Skip to content

Commit 3d6585e

Browse files
Merge pull request #7522 from BitGo/BTC-2732.utxolib-rpscript
feat(utxo-lib): refactor replay protection to use wallet keys
2 parents 73a2fb5 + eb57682 commit 3d6585e

File tree

1 file changed

+7
-1
lines changed
  • modules/utxo-lib/src/testutil

1 file changed

+7
-1
lines changed

modules/utxo-lib/src/testutil/psbt.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export function constructPsbt(
201201
if (isWalletUnspent(u) && cosignerName) {
202202
addWalletUnspentToPsbt(psbt, u, rootWalletKeys, signerName, cosignerName, { skipNonWitnessUtxo });
203203
} else {
204-
const { redeemScript } = createOutputScriptP2shP2pk(rootWalletKeys[signerName].publicKey);
204+
const { redeemScript } = createOutputScriptP2shP2pk(rootWalletKeys.user.publicKey);
205205
assert(redeemScript);
206206
addReplayProtectionUnspentToPsbt(psbt, u, redeemScript, { skipNonWitnessUtxo });
207207
}
@@ -328,6 +328,12 @@ export class AcidTest {
328328
return `${networkName} ${this.signStage} ${this.txFormat}`;
329329
}
330330

331+
getReplayProtectionOutputScript(): Buffer {
332+
const { scriptPubKey } = createOutputScriptP2shP2pk(this.rootWalletKeys.user.publicKey);
333+
assert(scriptPubKey);
334+
return scriptPubKey;
335+
}
336+
331337
createPsbt(): UtxoPsbt {
332338
const psbt = constructPsbt(this.inputs, this.outputs, this.network, this.rootWalletKeys, this.signStage, {
333339
deterministic: true,

0 commit comments

Comments
 (0)