Run prettier

This commit is contained in:
Bryce 2018-06-25 09:44:56 -07:00
parent 4b2d27b5e5
commit e59c57106c
2 changed files with 11 additions and 11 deletions

View File

@ -32,6 +32,6 @@ declare module 'ethers' {
constructor(address: string, abi: any, provider: any); constructor(address: string, abi: any, provider: any);
} }
const enum errors { const enum errors {
INVALID_ARGUMENT = 'INVALID_ARGUMENT', INVALID_ARGUMENT = 'INVALID_ARGUMENT',
} }
} }

View File

@ -34,17 +34,17 @@ export class AbiDecoder {
let decodedData: any[]; let decodedData: any[];
try { try {
decodedData = ethersInterface.events[event.name].parse(log.data); decodedData = ethersInterface.events[event.name].parse(log.data);
} catch (error) { } catch (error) {
if (error.code === ethers.errors.INVALID_ARGUMENT) { if (error.code === ethers.errors.INVALID_ARGUMENT) {
// Because we index events by Method ID, and Method IDs are derived from the method // Because we index events by Method ID, and Method IDs are derived from the method
// name and the input parameters, it's possible that the return value of the event // name and the input parameters, it's possible that the return value of the event
// does not match our ABI. If that's the case, then ethers will throw an error // does not match our ABI. If that's the case, then ethers will throw an error
// when we try to parse the event. We handle that case here by returning the log rather // when we try to parse the event. We handle that case here by returning the log rather
// than throwing an error. // than throwing an error.
return log; return log;
} }
throw error; throw error;
} }
let didFailToDecode = false; let didFailToDecode = false;