diff options
author | Fabio Berger <me@fabioberger.com> | 2018-09-25 19:32:20 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-09-25 19:32:20 +0800 |
commit | fc3acec669f21b8c5bcb5e3d4f712c2adaf2cf64 (patch) | |
tree | 5dabb3c01e1f4a3bfeb1538bdefb174f4461ccd3 /packages/contract-wrappers | |
parent | a05530f821b2550ff14a0e359c27650d4ba03130 (diff) | |
download | dexon-sol-tools-fc3acec669f21b8c5bcb5e3d4f712c2adaf2cf64.tar dexon-sol-tools-fc3acec669f21b8c5bcb5e3d4f712c2adaf2cf64.tar.gz dexon-sol-tools-fc3acec669f21b8c5bcb5e3d4f712c2adaf2cf64.tar.bz2 dexon-sol-tools-fc3acec669f21b8c5bcb5e3d4f712c2adaf2cf64.tar.lz dexon-sol-tools-fc3acec669f21b8c5bcb5e3d4f712c2adaf2cf64.tar.xz dexon-sol-tools-fc3acec669f21b8c5bcb5e3d4f712c2adaf2cf64.tar.zst dexon-sol-tools-fc3acec669f21b8c5bcb5e3d4f712c2adaf2cf64.zip |
Fix lint issues
Diffstat (limited to 'packages/contract-wrappers')
-rw-r--r-- | packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts index 58c5bce6d..f7a89e3be 100644 --- a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts @@ -199,28 +199,28 @@ export abstract class ContractWrapper { // This method only exists in order to comply with the expected interface of Blockstream's constructor private async _blockstreamGetBlockOrNullAsync(hash: string): Promise<Block | null> { const shouldIncludeTransactionData = false; - const blockOrNull = await this._web3Wrapper.sendRawPayloadAsync({ + const blockOrNull = await this._web3Wrapper.sendRawPayloadAsync<Block | null>({ method: 'eth_getBlockByHash', params: [hash, shouldIncludeTransactionData], }); - return blockOrNull as Block; + return blockOrNull; } // This method only exists in order to comply with the expected interface of Blockstream's constructor private async _blockstreamGetLatestBlockOrNullAsync(): Promise<Block | null> { const shouldIncludeTransactionData = false; - const blockOrNull = await this._web3Wrapper.sendRawPayloadAsync({ + const blockOrNull = await this._web3Wrapper.sendRawPayloadAsync<Block | null>({ method: 'eth_getBlockByNumber', params: [BlockParamLiteral.Latest, shouldIncludeTransactionData], }); - return blockOrNull as Block; + return blockOrNull; } // This method only exists in order to comply with the expected interface of Blockstream's constructor - private async _blockstreamGetLogsAsync(filterOptions: FilterObject): Promise<Log[]> { - const logs = await this._web3Wrapper.sendRawPayloadAsync({ + private async _blockstreamGetLogsAsync(filterOptions: FilterObject): Promise<RawLogEntry[]> { + const logs = await this._web3Wrapper.sendRawPayloadAsync<RawLogEntry[]>({ method: 'eth_getLogs', params: [filterOptions], }); - return logs as Log[]; + return logs as RawLogEntry[]; } // HACK: This should be a package-scoped method (which doesn't exist in TS) // We don't want this method available in the public interface for all classes @@ -247,7 +247,7 @@ export abstract class ContractWrapper { // We need to coerce to Block type cause Web3.Block includes types for mempool blocks if (!_.isUndefined(this._blockAndLogStreamerIfExists)) { // If we clear the interval while fetching the block - this._blockAndLogStreamer will be undefined - await this._blockAndLogStreamerIfExists.reconcileNewBlock((latestBlockOrNull as any) as Block); + await this._blockAndLogStreamerIfExists.reconcileNewBlock(latestBlockOrNull); } } } |