|
|
@ -42,29 +42,29 @@ describe('bitcoinjs-lib (transactions w/ CSV)', function () { |
|
|
|
// But after sequence2 time, aQ can sign for the output all by themself.
|
|
|
|
function complexCsvOutput (aQ, bQ, cQ, dQ, sequence1, sequence2) { |
|
|
|
return bitcoin.script.compile([ |
|
|
|
bitcoin.opcodes.OP_IF, |
|
|
|
bitcoin.opcodes.OP_IF, |
|
|
|
bitcoin.opcodes.OP_2, |
|
|
|
bitcoin.opcodes.OP_ELSE, |
|
|
|
bitcoin.script.number.encode(sequence1), |
|
|
|
bitcoin.opcodes.OP_CHECKSEQUENCEVERIFY, |
|
|
|
bitcoin.opcodes.OP_DROP, |
|
|
|
aQ.publicKey, |
|
|
|
bitcoin.opcodes.OP_CHECKSIGVERIFY, |
|
|
|
bitcoin.opcodes.OP_1, |
|
|
|
bitcoin.opcodes.OP_ENDIF, |
|
|
|
bQ.publicKey, |
|
|
|
cQ.publicKey, |
|
|
|
dQ.publicKey, |
|
|
|
bitcoin.opcodes.OP_3, |
|
|
|
bitcoin.opcodes.OP_CHECKMULTISIG, |
|
|
|
bitcoin.opcodes.OP_ELSE, |
|
|
|
bitcoin.script.number.encode(sequence2), |
|
|
|
bitcoin.opcodes.OP_CHECKSEQUENCEVERIFY, |
|
|
|
bitcoin.opcodes.OP_DROP, |
|
|
|
aQ.publicKey, |
|
|
|
bitcoin.opcodes.OP_CHECKSIG, |
|
|
|
bitcoin.opcodes.OP_ENDIF, |
|
|
|
bitcoin.opcodes.OP_IF, |
|
|
|
bitcoin.opcodes.OP_IF, |
|
|
|
bitcoin.opcodes.OP_2, |
|
|
|
bitcoin.opcodes.OP_ELSE, |
|
|
|
bitcoin.script.number.encode(sequence1), |
|
|
|
bitcoin.opcodes.OP_CHECKSEQUENCEVERIFY, |
|
|
|
bitcoin.opcodes.OP_DROP, |
|
|
|
aQ.publicKey, |
|
|
|
bitcoin.opcodes.OP_CHECKSIGVERIFY, |
|
|
|
bitcoin.opcodes.OP_1, |
|
|
|
bitcoin.opcodes.OP_ENDIF, |
|
|
|
bQ.publicKey, |
|
|
|
cQ.publicKey, |
|
|
|
dQ.publicKey, |
|
|
|
bitcoin.opcodes.OP_3, |
|
|
|
bitcoin.opcodes.OP_CHECKMULTISIG, |
|
|
|
bitcoin.opcodes.OP_ELSE, |
|
|
|
bitcoin.script.number.encode(sequence2), |
|
|
|
bitcoin.opcodes.OP_CHECKSEQUENCEVERIFY, |
|
|
|
bitcoin.opcodes.OP_DROP, |
|
|
|
aQ.publicKey, |
|
|
|
bitcoin.opcodes.OP_CHECKSIG, |
|
|
|
bitcoin.opcodes.OP_ENDIF |
|
|
|
]) |
|
|
|
} |
|
|
|
|
|
|
|