From cc3871aca54a9c4dc0906e2b726c2c079787f142 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 4 Oct 2017 14:22:47 +0300 Subject: Use find --- src/contract_wrappers/contract_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/contract_wrappers/contract_wrapper.ts b/src/contract_wrappers/contract_wrapper.ts index 7732f2f50..4d08f04e6 100644 --- a/src/contract_wrappers/contract_wrapper.ts +++ b/src/contract_wrappers/contract_wrapper.ts @@ -26,7 +26,7 @@ export class ContractWrapper { protected async _getLogsAsync(address: string, eventName: ContractEvents, subscriptionOpts: SubscriptionOpts, indexFilterValues: IndexedFilterValues, abi: Web3.ContractAbi): Promise { - 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 topicsForIndexedArgs = this._getTopicsForIndexedArgs(eventAbi, indexFilterValues); -- cgit