aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-02-05 20:04:49 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-02-05 20:04:49 +0800
commit1f4cbb747976560df0e67e703311db8f21f75604 (patch)
tree45113906f5149a52b408ac19e2b8b8cc440ee381 /packages/utils
parentb17bbdaa7ddc2c316f71dc5883f46aee88b913b9 (diff)
downloaddexon-0x-contracts-1f4cbb747976560df0e67e703311db8f21f75604.tar
dexon-0x-contracts-1f4cbb747976560df0e67e703311db8f21f75604.tar.gz
dexon-0x-contracts-1f4cbb747976560df0e67e703311db8f21f75604.tar.bz2
dexon-0x-contracts-1f4cbb747976560df0e67e703311db8f21f75604.tar.lz
dexon-0x-contracts-1f4cbb747976560df0e67e703311db8f21f75604.tar.xz
dexon-0x-contracts-1f4cbb747976560df0e67e703311db8f21f75604.tar.zst
dexon-0x-contracts-1f4cbb747976560df0e67e703311db8f21f75604.zip
Use forEach instead of map
Diffstat (limited to 'packages/utils')
-rw-r--r--packages/utils/CHANGELOG.md8
-rw-r--r--packages/utils/src/abi_decoder.ts4
2 files changed, 8 insertions, 4 deletions
diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md
index efee30dd1..0abe835b8 100644
--- a/packages/utils/CHANGELOG.md
+++ b/packages/utils/CHANGELOG.md
@@ -1,6 +1,10 @@
# CHANGELOG
+## v0.x.x - _TBD, 2018_
+
+ * Fix a bug causing abi_decoder to throw on unknown events with the same signature (#366)
+
## v0.2.0 - _January 17, 2018_
-* Add `onError` parameter to `intervalUtils.setAsyncExcludingInterval` (#312)
-* Add `intervalUtils.setInterval` (#312)
+ * Add `onError` parameter to `intervalUtils.setAsyncExcludingInterval` (#312)
+ * Add `intervalUtils.setInterval` (#312)
diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts
index 2dd7134a7..368973b1b 100644
--- a/packages/utils/src/abi_decoder.ts
+++ b/packages/utils/src/abi_decoder.ts
@@ -18,7 +18,7 @@ export class AbiDecoder {
return `0x${formatted}`;
}
constructor(abiArrays: Web3.AbiDefinition[][]) {
- _.map(abiArrays, this._addABI.bind(this));
+ _.forEach(abiArrays, this._addABI.bind(this));
}
// This method can only decode logs from the 0x & ERC20 smart contracts
public tryToDecodeLogOrNoop<ArgsType>(log: Web3.LogEntry): LogWithDecodedArgs<ArgsType> | RawLog {
@@ -37,7 +37,7 @@ export class AbiDecoder {
const decodedData = SolidityCoder.decodeParams(dataTypes, logData.slice('0x'.length));
let failedToDecode = false;
- _.map(event.inputs, (param: Web3.EventParameter) => {
+ _.forEach(event.inputs, (param: Web3.EventParameter) => {
// Indexed parameters are stored in topics. Non-indexed ones in decodedData
let value: BigNumber | string = param.indexed ? log.topics[topicsIndex++] : decodedData[dataIndex++];
if (_.isUndefined(value)) {