Skip to content

Commit

Permalink
fix breaking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saadahmsiddiqui committed Aug 28, 2024
1 parent 1de7bc4 commit 9a32d5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('createGenericCallDepositData', () => {
const genericCallParams = {
abi: CONTRACT_ABI,
functionName: 'store',
functionParams: [depositor, depositor, BigInt(3052070251)],
functionParams: [depositor, depositor, BigInt(42069)],
contractAddress: '0x4bE595ab5A070663B314970Fc10C049BBA0ad489',
destination: {
name: 'EVM',
Expand All @@ -66,8 +66,10 @@ describe('createGenericCallDepositData', () => {
depositor: depositor as `0x${string}`,
};

const expectedDepositData =
'0x00000000000000000000000000000000000000000000000000000000002dc6c00004ba154fea144be595ab5a070663b314970fc10c049bba0ad4891498729c03c4d5e820f5e8c45558ae07ae63f9746100000000000000000000000098729c03c4d5e820f5e8c45558ae07ae63f97461000000000000000000000000000000000000000000000000000000000000a455';

const depositData = createGenericCallDepositData(genericCallParams);
console.log(depositData);
expect(true).toBe(true);
expect(depositData.toLowerCase()).toEqual(expectedDepositData.toLowerCase());
});
});
3 changes: 2 additions & 1 deletion packages/evm/src/utils/genericTransferHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export function createGenericCallDepositData(genericTransferParams: GenericDepos
const paddedMaxFee = hexZeroPad(BigNumber.from(maxFee).toHexString(), 32);
const funcData = contractInterface.encodeFunctionData(functionName, functionParams);
const funcSig = funcData.substring(0, 10);
const funcParamEncoded = funcData.substring(10);
/** 0x (2) + function signature (8) + first param which is always set to depositer by relayer (64) */
const funcParamEncoded = funcData.substring(74);

const funcSigLen = getZeroPaddedLength(funcSig, 2);
const contractAddrLen = getZeroPaddedLength(contractAddress, 1);
Expand Down

0 comments on commit 9a32d5f

Please sign in to comment.