diff options
Diffstat (limited to 'packages/utils/src')
-rw-r--r-- | packages/utils/src/abi_decoder.ts | 3 | ||||
-rw-r--r-- | packages/utils/src/abi_utils.ts | 2 | ||||
-rw-r--r-- | packages/utils/src/error_utils.ts | 5 | ||||
-rw-r--r-- | packages/utils/src/index.ts | 1 | ||||
-rw-r--r-- | packages/utils/src/interval_utils.ts | 2 |
5 files changed, 7 insertions, 6 deletions
diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index ed3297ee1..931cb94b2 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -29,12 +29,9 @@ export class AbiDecoder { return log; } const ethersInterface = new ethers.Interface([event]); - const logData = log.data; const decodedParams: DecodedLogArgs = {}; let topicsIndex = 1; - const nonIndexedInputs = _.filter(event.inputs, input => !input.indexed); - const dataTypes = _.map(nonIndexedInputs, input => input.type); const decodedData = ethersInterface.events[event.name].parse(log.data); let didFailToDecode = false; diff --git a/packages/utils/src/abi_utils.ts b/packages/utils/src/abi_utils.ts index b5822425c..413c2f481 100644 --- a/packages/utils/src/abi_utils.ts +++ b/packages/utils/src/abi_utils.ts @@ -1,4 +1,4 @@ -import { AbiDefinition, AbiType, ConstructorAbi, ContractAbi, DataItem, MethodAbi } from 'ethereum-types'; +import { AbiDefinition, AbiType, ContractAbi, DataItem, MethodAbi } from 'ethereum-types'; import * as _ from 'lodash'; export const abiUtils = { diff --git a/packages/utils/src/error_utils.ts b/packages/utils/src/error_utils.ts new file mode 100644 index 000000000..735d3940b --- /dev/null +++ b/packages/utils/src/error_utils.ts @@ -0,0 +1,5 @@ +export const errorUtils = { + spawnSwitchErr(name: string, value: any): Error { + return new Error(`Unexpected switch value: ${value} encountered for ${name}`); + }, +}; diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 709ec93b2..fd102cecb 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -7,3 +7,4 @@ export { AbiDecoder } from './abi_decoder'; export { logUtils } from './log_utils'; export { abiUtils } from './abi_utils'; export { NULL_BYTES } from './constants'; +export { errorUtils } from './error_utils'; diff --git a/packages/utils/src/interval_utils.ts b/packages/utils/src/interval_utils.ts index 6784d5b35..3d0561cd2 100644 --- a/packages/utils/src/interval_utils.ts +++ b/packages/utils/src/interval_utils.ts @@ -1,5 +1,3 @@ -import * as _ from 'lodash'; - export const intervalUtils = { setAsyncExcludingInterval( fn: () => Promise<void>, |