From 9f924e459c43c023e35ab7222cd9824cc0e67411 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 18 Oct 2018 21:51:56 +1100 Subject: chore: change package org from 0xproject to 0x --- packages/web3-wrapper/src/web3_wrapper.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/web3-wrapper/src/web3_wrapper.ts') diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index 726246f1a..3ba153680 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -1,6 +1,6 @@ -import { assert } from '@0xproject/assert'; -import { schemas } from '@0xproject/json-schemas'; -import { AbiDecoder, addressUtils, BigNumber, intervalUtils, promisify } from '@0xproject/utils'; +import { assert } from '@0x/assert'; +import { schemas } from '@0x/json-schemas'; +import { AbiDecoder, addressUtils, BigNumber, intervalUtils, promisify } from '@0x/utils'; import { BlockParam, BlockParamLiteral, @@ -145,7 +145,7 @@ export class Web3Wrapper { if (_.isUndefined((provider as any).sendAsync)) { // Web3@1.0 provider doesn't support synchronous http requests, // so it only has an async `send` method, instead of a `send` and `sendAsync` in web3@0.x.x` - // We re-assign the send method so that Web3@1.0 providers work with @0xproject/web3-wrapper + // We re-assign the send method so that Web3@1.0 providers work with @0x/web3-wrapper (provider as any).sendAsync = (provider as any).send; } this.abiDecoder = new AbiDecoder([]); -- cgit v1.2.3 From 6027e275b18ea65d2e23b3bce9be6edba18bf989 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 23 Oct 2018 15:56:20 -0700 Subject: fix(web3-wrapper): Make getTransactionByHashAsync return the correct type --- packages/web3-wrapper/src/web3_wrapper.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'packages/web3-wrapper/src/web3_wrapper.ts') 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 { assert.isHexString('txHash', txHash); - const transaction = await this.sendRawPayloadAsync({ + const transactionRpc = await this.sendRawPayloadAsync({ method: 'eth_getTransactionByHash', params: [txHash], }); + const transaction = marshaller.unmarshalTransaction(transactionRpc); return transaction; } /** -- cgit v1.2.3 From c2e8390d21adbd18f6c2b1a7d6255433582c325a Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 23 Oct 2018 16:12:48 -0700 Subject: chore: Fix linter --- packages/web3-wrapper/src/web3_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/web3-wrapper/src/web3_wrapper.ts') diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index 5dc252472..56877fef3 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -27,8 +27,8 @@ import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, NodeType, - Web3WrapperErrors, TransactionRPC, + Web3WrapperErrors, } from './types'; import { utils } from './utils'; -- cgit v1.2.3 From 801004be6635b2ffc04601181db850499e5ee18e Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 7 Nov 2018 16:06:20 -0800 Subject: start jsonRpcRequestId at 1, not 0 I'm trying to use the 0x-watcher against a parity websocket rpc and getting an error that I think is the same as https://github.com/ethereum/web3.js/issues/1967 --- packages/web3-wrapper/src/web3_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/web3-wrapper/src/web3_wrapper.ts') diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index 56877fef3..effcd78ab 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -157,7 +157,7 @@ export class Web3Wrapper { this.abiDecoder = new AbiDecoder([]); this._provider = provider; this._txDefaults = txDefaults || {}; - this._jsonRpcRequestId = 0; + this._jsonRpcRequestId = 1; } /** * Get the contract defaults set to the Web3Wrapper instance -- cgit v1.2.3 From e0c4f58970a6ea13d1c92b16c12609d11519092d Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Mon, 12 Nov 2018 13:55:46 +1100 Subject: bug(web3-wrapper): throws when contract returns null --- packages/web3-wrapper/src/web3_wrapper.ts | 3 --- 1 file changed, 3 deletions(-) (limited to 'packages/web3-wrapper/src/web3_wrapper.ts') diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index 56877fef3..23204e616 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -533,9 +533,6 @@ export class Web3Wrapper { method: 'eth_call', params: [callDataHex, marshalledDefaultBlock], }); - if (rawCallResult === '0x') { - throw new Error('Contract call failed (returned null)'); - } return rawCallResult; } /** -- cgit v1.2.3