Skip to content

Commit

Permalink
fix: fix sign p2tr error
Browse files Browse the repository at this point in the history
  • Loading branch information
slient-coder committed Mar 14, 2023
1 parent 0df07ee commit cfadae4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/fix-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ const fixWindowError2 = () => {
};

const fixWindowError3 = () => {
const file = './node_modules/bitcoinjs-lib/src/psbt.js';
const file = './node_modules/bitcoinjs-lib/src/payments/p2tr.js';
let fileData = fs.readFileSync(file).toString();
fileData = fileData.replace('__UNSAFE_SIGN_NONSEGWIT: false', '__UNSAFE_SIGN_NONSEGWIT: true');
fileData = fileData.replace(
'signature: types_1.typeforce.maybe(types_1.typeforce.BufferN(64))',
'signature: types_1.typeforce.maybe(types_1.typeforce.Buffer)'
);
fs.writeFileSync(file, fileData);
};

Expand Down Expand Up @@ -89,7 +92,7 @@ const run = async () => {
try {
fixWindowError();
fixWindowError2();
// fixWindowError3();
fixWindowError3();
fixBufferError();
} catch (e) {
console.error('error:', e.message);
Expand Down

0 comments on commit cfadae4

Please sign in to comment.