From 42fda7dade5b193edf549ade4d5c1f8fcc5ee5fd Mon Sep 17 00:00:00 2001 From: Skylar Barrera Date: Tue, 7 Nov 2023 11:42:18 -0500 Subject: [PATCH] wc: use methodRegistry on all networks (#5179) --- src/screens/TransactionConfirmationScreen.js | 5 +++-- src/utils/methodRegistry.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/screens/TransactionConfirmationScreen.js b/src/screens/TransactionConfirmationScreen.js index 96346c18b86..9f1a789bebb 100644 --- a/src/screens/TransactionConfirmationScreen.js +++ b/src/screens/TransactionConfirmationScreen.js @@ -364,7 +364,8 @@ export default function TransactionConfirmationScreen() { setMethodName(lang.t('wallet.transaction.request')); }, 5000); const { name } = await methodRegistryLookupAndParse( - methodSignaturePrefix + methodSignaturePrefix, + getNetworkObj(currentNetwork).id ); if (name) { setMethodName(name); @@ -375,7 +376,7 @@ export default function TransactionConfirmationScreen() { clearTimeout(fallbackHandler); } }, - [setMethodName] + [setMethodName, currentNetwork] ); useEffect(() => { diff --git a/src/utils/methodRegistry.ts b/src/utils/methodRegistry.ts index 0d4b4fffb27..36074dbd26d 100644 --- a/src/utils/methodRegistry.ts +++ b/src/utils/methodRegistry.ts @@ -8,7 +8,8 @@ import { CONTRACT_FUNCTION } from '@/apollo/queries'; const METHOD_REGISTRY_ADDRESS = '0x44691B39d1a75dC4E0A0346CBB15E310e6ED1E86'; export const methodRegistryLookupAndParse = async ( - methodSignatureBytes: any + methodSignatureBytes: any, + chainId: number ) => { let signature = ''; @@ -16,7 +17,7 @@ export const methodRegistryLookupAndParse = async ( { query: CONTRACT_FUNCTION, variables: { - chainID: 1, + chainID: chainId, hex: methodSignatureBytes, }, },