diff options
| author | MeshCollider <[email protected]> | 2019-09-10 11:27:50 +1200 |
|---|---|---|
| committer | MeshCollider <[email protected]> | 2020-08-14 08:44:42 +1200 |
| commit | b887060d06290abf4983a487f8da6b0986b058ab (patch) | |
| tree | 8c9f52099b69f64fe3264b5c3241d9c75068d559 /src/test/script_standard_tests.cpp | |
| parent | Merge #18654: rpc: separate bumpfee's psbt creation function into psbtbumpfee (diff) | |
| download | discoin-b887060d06290abf4983a487f8da6b0986b058ab.tar.xz discoin-b887060d06290abf4983a487f8da6b0986b058ab.zip | |
Replace usage of GetScriptForWitness with GetScriptForDestination
Diffstat (limited to 'src/test/script_standard_tests.cpp')
| -rw-r--r-- | src/test/script_standard_tests.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/test/script_standard_tests.cpp b/src/test/script_standard_tests.cpp index 87678af4d..1d6bcadf6 100644 --- a/src/test/script_standard_tests.cpp +++ b/src/test/script_standard_tests.cpp @@ -349,21 +349,16 @@ BOOST_AUTO_TEST_CASE(script_standard_GetScriptFor_) result = GetScriptForMultisig(2, std::vector<CPubKey>(pubkeys, pubkeys + 3)); BOOST_CHECK(result == expected); - // GetScriptForWitness - CScript witnessScript; - - witnessScript << ToByteVector(pubkeys[0]) << OP_CHECKSIG; + // WitnessV0KeyHash expected.clear(); expected << OP_0 << ToByteVector(pubkeys[0].GetID()); - result = GetScriptForWitness(witnessScript); + result = GetScriptForDestination(WitnessV0KeyHash(Hash160(ToByteVector(pubkeys[0])))); BOOST_CHECK(result == expected); - - witnessScript.clear(); - witnessScript << OP_DUP << OP_HASH160 << ToByteVector(pubkeys[0].GetID()) << OP_EQUALVERIFY << OP_CHECKSIG; - result = GetScriptForWitness(witnessScript); + result = GetScriptForDestination(WitnessV0KeyHash(pubkeys[0].GetID())); BOOST_CHECK(result == expected); - witnessScript.clear(); + // WitnessV0ScriptHash (multisig) + CScript witnessScript; witnessScript << OP_1 << ToByteVector(pubkeys[0]) << OP_1 << OP_CHECKMULTISIG; uint256 scriptHash; @@ -372,7 +367,7 @@ BOOST_AUTO_TEST_CASE(script_standard_GetScriptFor_) expected.clear(); expected << OP_0 << ToByteVector(scriptHash); - result = GetScriptForWitness(witnessScript); + result = GetScriptForDestination(WitnessV0ScriptHash(witnessScript)); BOOST_CHECK(result == expected); } |