Handle invalid ABI retrieved from address_book gracefully (#4606)
* Handle invalid ABI gracefully * Also include failed abi in log
This commit is contained in:
parent
e86837b878
commit
3fc29b9ae4
@ -54,9 +54,19 @@ export default class MethodDecodingStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loadFromAbi (_abi, contractAddress) {
|
loadFromAbi (_abi, contractAddress) {
|
||||||
const abi = new Abi(_abi);
|
let abi;
|
||||||
|
|
||||||
if (contractAddress && abi) {
|
try {
|
||||||
|
abi = new Abi(_abi);
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('loadFromAbi', error, _abi);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!abi) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (contractAddress) {
|
||||||
this._contractsAbi[contractAddress] = abi;
|
this._contractsAbi[contractAddress] = abi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user