Skip to content

Commit

Permalink
wc: use methodRegistry on all networks (#5179)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylarbarrera authored Nov 7, 2023
1 parent faf3b34 commit 42fda7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/screens/TransactionConfirmationScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -375,7 +376,7 @@ export default function TransactionConfirmationScreen() {
clearTimeout(fallbackHandler);
}
},
[setMethodName]
[setMethodName, currentNetwork]
);

useEffect(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/utils/methodRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ import { CONTRACT_FUNCTION } from '@/apollo/queries';
const METHOD_REGISTRY_ADDRESS = '0x44691B39d1a75dC4E0A0346CBB15E310e6ED1E86';

export const methodRegistryLookupAndParse = async (
methodSignatureBytes: any
methodSignatureBytes: any,
chainId: number
) => {
let signature = '';

const response = await metadataClient.queryWithTimeout(
{
query: CONTRACT_FUNCTION,
variables: {
chainID: 1,
chainID: chainId,
hex: methodSignatureBytes,
},
},
Expand Down

0 comments on commit 42fda7d

Please sign in to comment.