aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/token_wrapper.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-03 21:37:09 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-10-04 16:14:19 +0800
commite6c138be5ab56856a454f7f04b6e1e54f1d41f18 (patch)
treecc8d06745192794fdacfc2430a4d940a560b38c2 /src/contract_wrappers/token_wrapper.ts
parent087645e59fb78a1ce20bbbcabe12317f11324e93 (diff)
downloaddexon-sol-tools-e6c138be5ab56856a454f7f04b6e1e54f1d41f18.tar
dexon-sol-tools-e6c138be5ab56856a454f7f04b6e1e54f1d41f18.tar.gz
dexon-sol-tools-e6c138be5ab56856a454f7f04b6e1e54f1d41f18.tar.bz2
dexon-sol-tools-e6c138be5ab56856a454f7f04b6e1e54f1d41f18.tar.lz
dexon-sol-tools-e6c138be5ab56856a454f7f04b6e1e54f1d41f18.tar.xz
dexon-sol-tools-e6c138be5ab56856a454f7f04b6e1e54f1d41f18.tar.zst
dexon-sol-tools-e6c138be5ab56856a454f7f04b6e1e54f1d41f18.zip
Add _getLogsAsync on contract_wrapper
Diffstat (limited to 'src/contract_wrappers/token_wrapper.ts')
-rw-r--r--src/contract_wrappers/token_wrapper.ts18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts
index 04c03edbd..b932686d4 100644
--- a/src/contract_wrappers/token_wrapper.ts
+++ b/src/contract_wrappers/token_wrapper.ts
@@ -280,20 +280,12 @@ export class TokenWrapper extends ContractWrapper {
this._tokenLogEventEmitters.push(eventEmitter);
return eventEmitter;
}
- public async getLogsAsync(tokenAddress: string, eventName: TokenEvents,
- subscriptionOpts: SubscriptionOpts,
+ public async getLogsAsync(tokenAddress: string, eventName: TokenEvents, subscriptionOpts: SubscriptionOpts,
indexFilterValues: IndexedFilterValues): Promise<Array<LogWithDecodedArgs|RawLog>> {
- // TODO include indexFilterValues in topics
- const eventSignature = this._getEventSignatureFromAbiByName(artifacts.TokenArtifact.abi, eventName);
- const filter = {
- fromBlock: subscriptionOpts.fromBlock,
- toBlock: subscriptionOpts.toBlock,
- address: tokenAddress,
- topics: [this._web3Wrapper.keccak256(eventSignature)],
- };
- const logs = await this._web3Wrapper.getLogsAsync(filter);
- const logsWithDecodedArguments = _.map(logs, this._tryToDecodeLogOrNoOp.bind(this));
- return logsWithDecodedArguments;
+ const logs = await this._getLogsAsync(
+ tokenAddress, eventName, subscriptionOpts, indexFilterValues, artifacts.TokenArtifact.abi,
+ );
+ return logs;
}
/**
* Stops watching for all token events