Skip to content

Commit

Permalink
fix: add update input for tapInternalKey
Browse files Browse the repository at this point in the history
  • Loading branch information
fbwoolf committed Jul 31, 2023
1 parent 62b479c commit e085927
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/features/psbt-signer/hooks/use-psbt-signer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function usePsbtSigner() {
// If type taproot, and the tapInternalKey is missing, assume it should
// be the account publicKey
if (taprootSigner && witnessOutputScript?.type === 'tr' && !input.tapInternalKey) {
input.tapInternalKey = taprootSigner.payment.tapInternalKey;
tx.updateInput(idx, { ...input, tapInternalKey: taprootSigner.payment.tapInternalKey });
}

try {
Expand Down
1 change: 1 addition & 0 deletions test-app/src/components/bitcoin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function buildTestTaprootPsbtRequestWithIndex(pubKey: Uint8Array): PsbtRequestOp
tx.addInput({
index: 0,
txid: '4f4cc7cb40b04978bd7704798dc1adf55b58196cef616b0fac8181965abc4726',
// tapInternalKey: payment.tapInternalKey,
witnessUtxo: {
amount: BigInt(1000),
script: payment.script,
Expand Down

0 comments on commit e085927

Please sign in to comment.