diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-24 07:25:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-24 07:25:51 +0800 |
commit | 2110ac32b7fceb230467ae0e2bb2bcd5e582f25f (patch) | |
tree | aa36e959e0d927a800792c51da61da507af2c55c | |
parent | 37f87ab267c5eb10c70d7eb4d3eef01bf8ed7ac1 (diff) | |
parent | c2e8390d21adbd18f6c2b1a7d6255433582c325a (diff) | |
download | dexon-sol-tools-2110ac32b7fceb230467ae0e2bb2bcd5e582f25f.tar dexon-sol-tools-2110ac32b7fceb230467ae0e2bb2bcd5e582f25f.tar.gz dexon-sol-tools-2110ac32b7fceb230467ae0e2bb2bcd5e582f25f.tar.bz2 dexon-sol-tools-2110ac32b7fceb230467ae0e2bb2bcd5e582f25f.tar.lz dexon-sol-tools-2110ac32b7fceb230467ae0e2bb2bcd5e582f25f.tar.xz dexon-sol-tools-2110ac32b7fceb230467ae0e2bb2bcd5e582f25f.tar.zst dexon-sol-tools-2110ac32b7fceb230467ae0e2bb2bcd5e582f25f.zip |
Merge pull request #1177 from 0xProject/fix/web3-wrapper-transaction-type
Make getTransactionByHashAsync return the correct type
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.json | 10 | ||||
-rw-r--r-- | packages/web3-wrapper/src/web3_wrapper.ts | 11 |
2 files changed, 19 insertions, 2 deletions
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index b8d06eac1..6b554110f 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "version": "3.1.1", + "changes": [ + { + "note": + "Fix bug in `getTransactionByHashAsync` which was causing the return value to have the wrong type (raw fields instead of unmarshalled fields).", + "pr": 1177 + } + ] + }, + { "version": "3.1.0", "changes": [ { diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index 3ba153680..56877fef3 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, + TransactionRPC, + Web3WrapperErrors, +} 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; } /** |