Skip to content

Commit

Permalink
fix typo of getTapKeySigFromWithness
Browse files Browse the repository at this point in the history
  • Loading branch information
lnky79 committed Dec 20, 2024
1 parent 19d8f72 commit 7b8f8d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cjs/psbt/bip371.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function extractTaprootSigs(input) {
if (input.tapScriptSig)
sigs.push(...input.tapScriptSig.map(s => s.signature));
if (!sigs.length) {
const finalTapKeySig = getTapKeySigFromWithness(input.finalScriptWitness);
const finalTapKeySig = getTapKeySigFromWitness(input.finalScriptWitness);
if (finalTapKeySig) sigs.push(finalTapKeySig);
}
return sigs;
Expand All @@ -293,7 +293,7 @@ function extractTaprootSigs(input) {
* @param finalScriptWitness The final script witness.
* @returns The taproot signature, or undefined if not found.
*/
function getTapKeySigFromWithness(finalScriptWitness) {
function getTapKeySigFromWitness(finalScriptWitness) {
if (!finalScriptWitness) return;
const witness = finalScriptWitness.slice(2);
// todo: add schnorr signature validation
Expand Down
4 changes: 2 additions & 2 deletions src/esm/psbt/bip371.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function extractTaprootSigs(input) {
if (input.tapScriptSig)
sigs.push(...input.tapScriptSig.map(s => s.signature));
if (!sigs.length) {
const finalTapKeySig = getTapKeySigFromWithness(input.finalScriptWitness);
const finalTapKeySig = getTapKeySigFromWitness(input.finalScriptWitness);
if (finalTapKeySig) sigs.push(finalTapKeySig);
}
return sigs;
Expand All @@ -235,7 +235,7 @@ function extractTaprootSigs(input) {
* @param finalScriptWitness The final script witness.
* @returns The taproot signature, or undefined if not found.
*/
function getTapKeySigFromWithness(finalScriptWitness) {
function getTapKeySigFromWitness(finalScriptWitness) {
if (!finalScriptWitness) return;
const witness = finalScriptWitness.slice(2);
// todo: add schnorr signature validation
Expand Down
4 changes: 2 additions & 2 deletions ts_src/psbt/bip371.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function extractTaprootSigs(input: PsbtInput): Uint8Array[] {
if (input.tapScriptSig)
sigs.push(...input.tapScriptSig.map(s => s.signature));
if (!sigs.length) {
const finalTapKeySig = getTapKeySigFromWithness(input.finalScriptWitness);
const finalTapKeySig = getTapKeySigFromWitness(input.finalScriptWitness);
if (finalTapKeySig) sigs.push(finalTapKeySig);
}

Expand All @@ -304,7 +304,7 @@ function extractTaprootSigs(input: PsbtInput): Uint8Array[] {
* @param finalScriptWitness The final script witness.
* @returns The taproot signature, or undefined if not found.
*/
function getTapKeySigFromWithness(
function getTapKeySigFromWitness(
finalScriptWitness?: Uint8Array,
): Uint8Array | undefined {
if (!finalScriptWitness) return;
Expand Down

0 comments on commit 7b8f8d6

Please sign in to comment.