mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Skip searching 4byte directory if we don't have a full 4 bytes of data (#15473)
* skip searching 4byte directory if we don't have a full 4bytes of data * address feedback * lint
This commit is contained in:
parent
7b04bf8b47
commit
0026966c9e
@ -3257,13 +3257,14 @@ export function getContractMethodData(data = '') {
|
||||
return (dispatch, getState) => {
|
||||
const prefixedData = addHexPrefix(data);
|
||||
const fourBytePrefix = prefixedData.slice(0, 10);
|
||||
if (fourBytePrefix.length < 10) {
|
||||
return Promise.resolve({});
|
||||
}
|
||||
const { knownMethodData } = getState().metamask;
|
||||
|
||||
if (
|
||||
(knownMethodData &&
|
||||
knownMethodData[fourBytePrefix] &&
|
||||
Object.keys(knownMethodData[fourBytePrefix]).length !== 0) ||
|
||||
fourBytePrefix === '0x'
|
||||
knownMethodData &&
|
||||
knownMethodData[fourBytePrefix] &&
|
||||
Object.keys(knownMethodData[fourBytePrefix]).length !== 0
|
||||
) {
|
||||
return Promise.resolve(knownMethodData[fourBytePrefix]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user