diff --git a/tests/bsv20LockBtcToMint.test.ts b/tests/bsv20LockBtcToMint.test.ts index c91decf5..8345fe31 100644 --- a/tests/bsv20LockBtcToMint.test.ts +++ b/tests/bsv20LockBtcToMint.test.ts @@ -214,10 +214,7 @@ function prepProofFromElectrum(proof: any): MerkleProof { ), pos: MerklePath.INVALID_NODE, } - return [ - ...res, - ...Array(Number(MerklePath.DEPTH) - res.length).fill(invalidNode), - ] as MerkleProof + return [...res, ...Array(32 - res.length).fill(invalidNode)] as MerkleProof } function numToBoolList(num) { diff --git a/tests/btcSwap.test.ts b/tests/btcSwap.test.ts index 43169405..2555c806 100644 --- a/tests/btcSwap.test.ts +++ b/tests/btcSwap.test.ts @@ -141,7 +141,7 @@ describe('Test SmartContract `BTCSwap`', () => { await btcSwap.connect(getDefaultSigner(alicePrivKey)) await btcSwap.deploy(1) - const callContract = async () =>{ + const callContract = async () => { btcSwap.methods.swap( btcTx, merkleProof, @@ -152,15 +152,15 @@ describe('Test SmartContract `BTCSwap`', () => { pubKeyOrAddrToSign: alicePubKey, } as MethodCallOptions ) - } - return expect(callContract()).not.rejected - }) + } + return expect(callContract()).not.rejected + }) it('should pass cancel', async () => { await btcSwap.connect(getDefaultSigner(bobPrivKey)) await btcSwap.deploy(1) - const callContract = async () =>{ + const callContract = async () => { btcSwap.methods.cancel( PubKey(bobPubKey.toByteString()), (sigResps) => findSig(sigResps, bobPubKey), @@ -169,9 +169,9 @@ describe('Test SmartContract `BTCSwap`', () => { pubKeyOrAddrToSign: bobPubKey, } as MethodCallOptions ) - } - return expect(callContract()).not.rejected - }) + } + return expect(callContract()).not.rejected + }) }) /** @@ -226,7 +226,7 @@ function prepProofFromElectrum(proof: any): MerkleProof { } return [ ...res, - ...Array(Number(MerklePath.DEPTH) - res.length).fill(invalidNode), + ...Array(Number(32) - res.length).fill(invalidNode), ] as MerkleProof }