From aa995ff9941c4f319985e23a14d0a87fc7b9ea1c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 4 Oct 2017 11:53:44 +0300 Subject: Use _.find instead of _.filter --- src/contract_wrappers/contract_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract_wrappers/contract_wrapper.ts b/src/contract_wrappers/contract_wrapper.ts index cffd2f6f3..6f074a976 100644 --- a/src/contract_wrappers/contract_wrapper.ts +++ b/src/contract_wrappers/contract_wrapper.ts @@ -24,7 +24,7 @@ export class ContractWrapper { indexFilterValues: IndexedFilterValues, abi: Web3.ContractAbi): Promise { // TODO include indexFilterValues in topics - const eventAbi = _.filter(abi, {name: eventName})[0] as Web3.EventAbi; + const eventAbi = _.find(abi, {name: eventName}) as Web3.EventAbi; const eventSignature = this._getEventSignatureFromAbiByName(eventAbi, eventName); const topicForEventSignature = this._web3Wrapper.keccak256(eventSignature); const topics = [topicForEventSignature]; -- cgit v1.2.3