From 62429dc44767795c27a6c5afc7d61825ad837b79 Mon Sep 17 00:00:00 2001 From: stanleyyuen <102275989+stanleyyconsensys@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:42:50 +0800 Subject: [PATCH] chore: resolve comment --- .../starknet-snap/src/utils/transaction.test.ts | 14 +++++++------- packages/starknet-snap/src/utils/transaction.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/starknet-snap/src/utils/transaction.test.ts b/packages/starknet-snap/src/utils/transaction.test.ts index daee887e..3186a376 100644 --- a/packages/starknet-snap/src/utils/transaction.test.ts +++ b/packages/starknet-snap/src/utils/transaction.test.ts @@ -21,7 +21,7 @@ import { transactionVersionToNumber, feeTokenToTransactionVersion, transactionVersionToFeeToken, - transactionSelectorHexToName, + transactionSelectorToName, isFundTransferEntrypoint, } from './transaction'; @@ -94,11 +94,11 @@ describe('transactionVersionToFeeToken', () => { ); }); -describe('transactionSelectorHexToName', () => { +describe('transactionSelectorToName', () => { it.each([TRANSFER_SELECTOR_HEX, 'transfer'])( 'converts selector name to `transfer` if it matchs the transfer selector - %s', (selector: string) => { - expect(transactionSelectorHexToName(selector)).toStrictEqual( + expect(transactionSelectorToName(selector)).toStrictEqual( ContractFuncName.Transfer, ); }, @@ -107,7 +107,7 @@ describe('transactionSelectorHexToName', () => { it.each([UPGRADE_SELECTOR_HEX, 'upgrade'])( 'converts selector name to `upgrade` if it matchs the upgrade selector - %s', (selector: string) => { - expect(transactionSelectorHexToName(selector)).toStrictEqual( + expect(transactionSelectorToName(selector)).toStrictEqual( ContractFuncName.Upgrade, ); }, @@ -116,7 +116,7 @@ describe('transactionSelectorHexToName', () => { it.each(['transfers', 'upgraded', '0x11234'])( 'returns the original selector string if it doesnt match the hex string for upgrade or transfer', (selector: string) => { - expect(transactionSelectorHexToName(selector)).toStrictEqual(selector); + expect(transactionSelectorToName(selector)).toStrictEqual(selector); }, ); }); @@ -137,7 +137,7 @@ describe('callsToTranscationAccountCalls', () => { { contract, contractCallData, - contractFuncName: transactionSelectorHexToName(entrypoint), + contractFuncName: transactionSelectorToName(entrypoint), }, ], }); @@ -183,7 +183,7 @@ describe('callsToTranscationAccountCalls', () => { acc[contract].push({ contract, contractCallData, - contractFuncName: transactionSelectorHexToName(entrypoint), + contractFuncName: transactionSelectorToName(entrypoint), recipient: contractCallData[0], amount: contractCallData[1], }); diff --git a/packages/starknet-snap/src/utils/transaction.ts b/packages/starknet-snap/src/utils/transaction.ts index 38e0d419..4430fc8f 100644 --- a/packages/starknet-snap/src/utils/transaction.ts +++ b/packages/starknet-snap/src/utils/transaction.ts @@ -91,7 +91,7 @@ export function callsToTranscationAccountCalls( entrypoint, } = call; - const contractFuncName = transactionSelectorHexToName(entrypoint); + const contractFuncName = transactionSelectorToName(entrypoint); if (!Object.prototype.hasOwnProperty.call(acc, contract)) { acc[contract] = [];