Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport "Fix method registry initialization (#8200)" #8459

Merged
merged 1 commit into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [#8447](https://github.com/MetaMask/metamask-extension/pull/8447): Delete Dai/Sai migration notification
- [#8460](https://github.com/MetaMask/metamask-extension/pull/8460): Update deposit copy for Wyre
- [#8458](https://github.com/MetaMask/metamask-extension/pull/8458): Snapshot txMeta without cloning history
- [#8459](https://github.com/MetaMask/metamask-extension/pull/8459): Fix method registry initialization

## 7.7.8 Wed Mar 11 2020
- [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked
Expand Down
7 changes: 5 additions & 2 deletions ui/app/helpers/utils/transactions.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ async function getMethodFrom4Byte (fourBytePrefix) {
return null
}
}

const registry = new MethodRegistry({ provider: global.ethereumProvider })
let registry

/**
* Attempts to return the method data from the MethodRegistry library, the message registry library and the token abi, in that order of preference
Expand All @@ -62,6 +61,10 @@ export async function getMethodDataAsync (fourBytePrefix) {
return null
})

if (!registry) {
registry = new MethodRegistry({ provider: global.ethereumProvider })
}

let sig = await registry.lookup(fourBytePrefix)

if (!sig) {
Expand Down