Skip to content

Commit 42502d4

Browse files
committed
test: explicitly use SIGHASH_TYPEs ALL and ALL+ANYONECANPAY
1 parent 73ec1a6 commit 42502d4

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/memo.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,13 @@ Zora.test("can create memo tx", async function (t) {
103103
let changeOutput = { pubKeyHash: pkh };
104104
let txInfo = await DashTx.legacyCreateTx(coins, outputs, changeOutput);
105105

106-
let txInfoSigned = await dashTx.hashAndSignAll(txInfo);
106+
let txInfoSigned = await dashTx.hashAndSignAll(
107+
txInfo,
108+
DashTx.SIGHASH_ALL | DashTx.SIGHASH_ANYONECANPAY,
109+
);
107110

108111
let rawtx =
109-
"03000000017777777777777777777777777777777777777777777777777777777777777777000000006b483045022100888db2ea9388e2c29d2480fd3374250cb2242a7dfa0e4bc6d82ac01b58f99dfb02200fe878c74f58eebf234f31a43a17bc6ea1535de6f7f2329ac007107888a39199012103f808bdec4293bf12441ec9a9e61bc3b264c78fcc5ad499ce5f0799f2874e6856ffffffff0200000000000000000e6a0c48656c6c6f2c204461736821484d0000000000001976a91482754a9c935fbfcdda5995a32006a68a8156ee2b88ac00000000";
110-
112+
"03000000017777777777777777777777777777777777777777777777777777777777777777000000006a47304402200ece01fcaedeb53b0983e333b07859957a816a62663b6f20439b3ed5e94794910220713eb04bc7ce7a3861ce3f46a8cfa8b308769bc114ed419a0e9c0bf8dbc4c4b4812103f808bdec4293bf12441ec9a9e61bc3b264c78fcc5ad499ce5f0799f2874e6856ffffffff0200000000000000000e6a0c48656c6c6f2c204461736821484d0000000000001976a91482754a9c935fbfcdda5995a32006a68a8156ee2b88ac00000000";
111113
t.equal(txInfoSigned.transaction, rawtx, "created transaction with memo");
112114
});
113115

@@ -116,7 +118,13 @@ Zora.test("can create donation tx via memo", async function (t) {
116118

117119
let txId = "77".repeat(32);
118120
let inputs = [
119-
{ pubKeyHash: pkh, satoshis: 20000, txId: txId, outputIndex: 0 },
121+
{
122+
pubKeyHash: pkh,
123+
satoshis: 20000,
124+
txId: txId,
125+
outputIndex: 0,
126+
sigHashType: DashTx.SIGHASH_ALL,
127+
},
120128
];
121129

122130
//let donationOutput = Tx.createDonationOutput();

0 commit comments

Comments
 (0)