aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils/log_decoder.ts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-05-16 03:52:49 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-05-16 03:52:49 +0800
commit9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a (patch)
treef72aae5170b6f1f6d3d70ebf6c03ed171680ff50 /packages/contracts/src/utils/log_decoder.ts
parent9744b1906a111aa0c65c8fafb4db66aef32a5a23 (diff)
parent6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b (diff)
downloaddexon-0x-contracts-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar.gz
dexon-0x-contracts-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar.zst
dexon-0x-contracts-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.zip
Merge branch 'development' into v2-prototype
Diffstat (limited to 'packages/contracts/src/utils/log_decoder.ts')
-rw-r--r--packages/contracts/src/utils/log_decoder.ts11
1 files changed, 4 insertions, 7 deletions
diff --git a/packages/contracts/src/utils/log_decoder.ts b/packages/contracts/src/utils/log_decoder.ts
index 291b85dd2..747c7644d 100644
--- a/packages/contracts/src/utils/log_decoder.ts
+++ b/packages/contracts/src/utils/log_decoder.ts
@@ -1,9 +1,9 @@
+import { ContractArtifact } from '@0xproject/sol-compiler';
import { AbiDefinition, LogEntry, LogWithDecodedArgs, RawLog } from '@0xproject/types';
import { AbiDecoder, BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { artifacts } from './artifacts';
-import { Artifact } from './types';
export class LogDecoder {
private _abiDecoder: AbiDecoder;
@@ -12,12 +12,9 @@ export class LogDecoder {
throw new Error('networkId not specified');
}
const abiArrays: AbiDefinition[][] = [];
- _.forEach(artifacts, (artifact: Artifact) => {
- const networkIfExists = artifact.networks[networkIdIfExists];
- if (_.isUndefined(networkIfExists)) {
- throw new Error(`Artifact does not exist on network ${networkIdIfExists}`);
- }
- abiArrays.push(networkIfExists.abi);
+ _.forEach(artifacts, (artifact: ContractArtifact) => {
+ const compilerOutput = artifact.compilerOutput;
+ abiArrays.push(compilerOutput.abi);
});
this._abiDecoder = new AbiDecoder(abiArrays);
}