diff options
author | Esteban MiƱo <efmino@uc.cl> | 2019-01-23 02:22:56 +0800 |
---|---|---|
committer | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2019-01-23 02:22:56 +0800 |
commit | e21dfd18622dd7f70dac51855a0052a56fb74e57 (patch) | |
tree | 03fe6571c87474c15af266fa0e3bc9c1a755c450 /ui/app/helpers | |
parent | fe780fb3d457dd22be84cf7ef386327ba9a2ec93 (diff) | |
download | tangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.tar.gz tangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.tar.zst tangerine-wallet-browser-e21dfd18622dd7f70dac51855a0052a56fb74e57.zip |
Use Parity on-chain registry only when is needed (#6052)
* add and use knownMethodData to avoid infura requests
* dataMethod to methodData and check empty response
Diffstat (limited to 'ui/app/helpers')
-rw-r--r-- | ui/app/helpers/transactions.util.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/app/helpers/transactions.util.js b/ui/app/helpers/transactions.util.js index 0f1ed70a3..d5b7f4958 100644 --- a/ui/app/helpers/transactions.util.js +++ b/ui/app/helpers/transactions.util.js @@ -60,6 +60,18 @@ export function isConfirmDeployContract (txData = {}) { } /** + * Returns four-byte method signature from data + * + * @param {string} data - The hex data (@code txParams.data) of a transaction + * @returns {string} - The four-byte method signature + */ +export function getFourBytePrefix (data = '') { + const prefixedData = ethUtil.addHexPrefix(data) + const fourBytePrefix = prefixedData.slice(0, 10) + return fourBytePrefix +} + +/** * Returns the action of a transaction as a key to be passed into the translator. * @param {Object} transaction - txData object * @param {Object} methodData - Data returned from eth-method-registry |