From 34a85561da6c1a0bed76d74ecd486e4da3fff24b Mon Sep 17 00:00:00 2001 From: Skydev0h Date: Fri, 9 Feb 2024 13:22:37 +0200 Subject: [PATCH] Adjusted all tests to match new signature place (in end) --- tests/wallet-v5-external.spec.ts | 15 ++++++++++----- tests/wallet-v5-internal.spec.ts | 13 ++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/tests/wallet-v5-external.spec.ts b/tests/wallet-v5-external.spec.ts index cab6c7ec..518e8e2a 100644 --- a/tests/wallet-v5-external.spec.ts +++ b/tests/wallet-v5-external.spec.ts @@ -619,6 +619,7 @@ describe('Wallet V5 sign auth external', () => { .endCell(); const fakePayload = beginCell() + .storeUint(Opcodes.auth_signed, 32) .storeUint(WALLET_ID.serialized, 80) .storeUint(vu, 32) .storeUint(seqno + 1, 32) // seqno @@ -627,8 +628,8 @@ describe('Wallet V5 sign auth external', () => { const signature = sign(fakePayload.hash(), keypair.secretKey); const body = beginCell() - .storeUint(bufferToBigInt(signature), 512) .storeSlice(payload.beginParse()) + .storeUint(bufferToBigInt(signature), 512) .endCell(); await disableConsoleError(() => @@ -649,6 +650,7 @@ describe('Wallet V5 sign auth external', () => { const actionsList = packActionsList([new ActionSendMsg(SendMode.PAY_GAS_SEPARATELY, msg)]); const payload = beginCell() + .storeUint(Opcodes.auth_signed, 32) .storeUint(WALLET_ID.serialized, 80) .storeUint(validUntil(), 32) .storeUint(seqno, 32) // seqno @@ -659,8 +661,8 @@ describe('Wallet V5 sign auth external', () => { const signature = sign(payload.hash(), fakeKeypair.secretKey); const body = beginCell() - .storeUint(bufferToBigInt(signature), 512) .storeSlice(payload.beginParse()) + .storeUint(bufferToBigInt(signature), 512) .endCell(); await disableConsoleError(() => @@ -681,6 +683,7 @@ describe('Wallet V5 sign auth external', () => { const actionsList = packActionsList([new ActionSendMsg(SendMode.PAY_GAS_SEPARATELY, msg)]); const payload = beginCell() + .storeUint(Opcodes.auth_signed, 32) .storeUint(WALLET_ID.serialized, 80) .storeUint(validUntil(), 32) .storeUint(seqno + 1, 32) // seqno @@ -689,8 +692,8 @@ describe('Wallet V5 sign auth external', () => { const signature = sign(payload.hash(), keypair.secretKey); const body = beginCell() - .storeUint(bufferToBigInt(signature), 512) .storeSlice(payload.beginParse()) + .storeUint(bufferToBigInt(signature), 512) .endCell(); await disableConsoleError(() => @@ -711,6 +714,7 @@ describe('Wallet V5 sign auth external', () => { const actionsList = packActionsList([new ActionSendMsg(SendMode.PAY_GAS_SEPARATELY, msg)]); const payload = beginCell() + .storeUint(Opcodes.auth_signed, 32) .storeUint(WALLET_ID.serialized, 80) .storeUint(Math.round(Date.now() / 1000) - 600, 32) .storeUint(seqno, 32) @@ -719,8 +723,8 @@ describe('Wallet V5 sign auth external', () => { const signature = sign(payload.hash(), keypair.secretKey); const body = beginCell() - .storeUint(bufferToBigInt(signature), 512) .storeSlice(payload.beginParse()) + .storeUint(bufferToBigInt(signature), 512) .endCell(); await disableConsoleError(() => @@ -741,6 +745,7 @@ describe('Wallet V5 sign auth external', () => { const actionsList = packActionsList([new ActionSendMsg(SendMode.PAY_GAS_SEPARATELY, msg)]); const payload = beginCell() + .storeUint(Opcodes.auth_signed, 32) .storeUint(new WalletId({ ...WALLET_ID, subwalletNumber: 1 }).serialized, 80) .storeUint(validUntil(), 32) .storeUint(seqno, 32) @@ -749,8 +754,8 @@ describe('Wallet V5 sign auth external', () => { const signature = sign(payload.hash(), keypair.secretKey); const body = beginCell() - .storeUint(bufferToBigInt(signature), 512) .storeSlice(payload.beginParse()) + .storeUint(bufferToBigInt(signature), 512) .endCell(); await disableConsoleError(() => diff --git a/tests/wallet-v5-internal.spec.ts b/tests/wallet-v5-internal.spec.ts index 03dc6185..cd94f66b 100644 --- a/tests/wallet-v5-internal.spec.ts +++ b/tests/wallet-v5-internal.spec.ts @@ -608,6 +608,7 @@ describe('Wallet V5 sign auth internal', () => { const vu = validUntil(); const payload = beginCell() + .storeUint(Opcodes.auth_signed_internal, 32) .storeUint(WALLET_ID.serialized, 80) .storeUint(vu, 32) .storeUint(seqno, 32) // seqno @@ -623,8 +624,8 @@ describe('Wallet V5 sign auth internal', () => { const signature = sign(fakePayload.hash(), keypair.secretKey); const body = beginCell() - .storeUint(bufferToBigInt(signature), 512) .storeSlice(payload.beginParse()) + .storeUint(bufferToBigInt(signature), 512) .endCell(); const receipt = await walletV5.sendInternalSignedMessage(sender, { @@ -713,7 +714,7 @@ describe('Wallet V5 sign auth internal', () => { const actionsList = packActionsList([new ActionSendMsg(SendMode.PAY_GAS_SEPARATELY, msg)]); const payload = beginCell() - + .storeUint(Opcodes.auth_signed_internal, 32) .storeUint(WALLET_ID.serialized, 80) .storeUint(validUntil(), 32) .storeUint(seqno + 1, 32) // seqno @@ -722,8 +723,8 @@ describe('Wallet V5 sign auth internal', () => { const signature = sign(payload.hash(), keypair.secretKey); const body = beginCell() - .storeUint(bufferToBigInt(signature), 512) .storeSlice(payload.beginParse()) + .storeUint(bufferToBigInt(signature), 512) .endCell(); const receipt = await walletV5.sendInternalSignedMessage(sender, { @@ -758,6 +759,7 @@ describe('Wallet V5 sign auth internal', () => { const actionsList = packActionsList([new ActionSendMsg(SendMode.PAY_GAS_SEPARATELY, msg)]); const payload = beginCell() + .storeUint(Opcodes.auth_signed_internal, 32) .storeUint(WALLET_ID.serialized, 80) .storeUint(Math.round(Date.now() / 1000) - 600, 32) .storeUint(seqno, 32) @@ -766,8 +768,8 @@ describe('Wallet V5 sign auth internal', () => { const signature = sign(payload.hash(), keypair.secretKey); const body = beginCell() - .storeUint(bufferToBigInt(signature), 512) .storeSlice(payload.beginParse()) + .storeUint(bufferToBigInt(signature), 512) .endCell(); const receipt = await walletV5.sendInternalSignedMessage(sender, { @@ -802,6 +804,7 @@ describe('Wallet V5 sign auth internal', () => { const actionsList = packActionsList([new ActionSendMsg(SendMode.PAY_GAS_SEPARATELY, msg)]); const payload = beginCell() + .storeUint(Opcodes.auth_signed_internal, 32) .storeUint(new WalletId({ ...WALLET_ID, subwalletNumber: 1 }).serialized, 80) .storeUint(validUntil(), 32) .storeUint(seqno, 32) @@ -810,8 +813,8 @@ describe('Wallet V5 sign auth internal', () => { const signature = sign(payload.hash(), keypair.secretKey); const body = beginCell() - .storeUint(bufferToBigInt(signature), 512) .storeSlice(payload.beginParse()) + .storeUint(bufferToBigInt(signature), 512) .endCell(); const receipt = await walletV5.sendInternalSignedMessage(sender, {