diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-24 06:56:20 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-24 06:56:20 +0800 |
commit | 6027e275b18ea65d2e23b3bce9be6edba18bf989 (patch) | |
tree | 1f8ae20a2b2c27cae3d6f2850f83a9d17569d513 /packages/web3-wrapper/src | |
parent | 37f87ab267c5eb10c70d7eb4d3eef01bf8ed7ac1 (diff) | |
download | dexon-sol-tools-6027e275b18ea65d2e23b3bce9be6edba18bf989.tar dexon-sol-tools-6027e275b18ea65d2e23b3bce9be6edba18bf989.tar.gz dexon-sol-tools-6027e275b18ea65d2e23b3bce9be6edba18bf989.tar.bz2 dexon-sol-tools-6027e275b18ea65d2e23b3bce9be6edba18bf989.tar.lz dexon-sol-tools-6027e275b18ea65d2e23b3bce9be6edba18bf989.tar.xz dexon-sol-tools-6027e275b18ea65d2e23b3bce9be6edba18bf989.tar.zst dexon-sol-tools-6027e275b18ea65d2e23b3bce9be6edba18bf989.zip |
fix(web3-wrapper): Make getTransactionByHashAsync return the correct type
Diffstat (limited to 'packages/web3-wrapper/src')
-rw-r--r-- | packages/web3-wrapper/src/web3_wrapper.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index 3ba153680..5dc252472 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -23,7 +23,13 @@ import { import * as _ from 'lodash'; import { marshaller } from './marshaller'; -import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, NodeType, Web3WrapperErrors } from './types'; +import { + BlockWithoutTransactionDataRPC, + BlockWithTransactionDataRPC, + NodeType, + Web3WrapperErrors, + TransactionRPC, +} from './types'; import { utils } from './utils'; const BASE_TEN = 10; @@ -228,10 +234,11 @@ export class Web3Wrapper { */ public async getTransactionByHashAsync(txHash: string): Promise<Transaction> { assert.isHexString('txHash', txHash); - const transaction = await this.sendRawPayloadAsync<Transaction>({ + const transactionRpc = await this.sendRawPayloadAsync<TransactionRPC>({ method: 'eth_getTransactionByHash', params: [txHash], }); + const transaction = marshaller.unmarshalTransaction(transactionRpc); return transaction; } /** |