aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web3-wrapper/src
diff options
context:
space:
mode:
authorAugust Skare <post@augustskare.no>2018-11-13 16:52:41 +0800
committerAugust Skare <post@augustskare.no>2018-11-13 16:52:41 +0800
commite43988aa44225ef66c95d0b26764de57b3d26c3a (patch)
tree5f2bdff05e3e6a336b600bcb7a766da4793afc76 /packages/web3-wrapper/src
parentee91f56bbe69534885da47f58a81302bf3c37f28 (diff)
parentc41622c20aea8ba89dc9899ff8b3ab6f22f53503 (diff)
downloaddexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.gz
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.bz2
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.lz
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.xz
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.tar.zst
dexon-sol-tools-e43988aa44225ef66c95d0b26764de57b3d26c3a.zip
Merge branch 'development' into dev-tools-pages
Diffstat (limited to 'packages/web3-wrapper/src')
-rw-r--r--packages/web3-wrapper/src/index.ts2
-rw-r--r--packages/web3-wrapper/src/marshaller.ts2
-rw-r--r--packages/web3-wrapper/src/utils.ts2
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts22
4 files changed, 16 insertions, 12 deletions
diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts
index 9bef06fd4..679563a2b 100644
--- a/packages/web3-wrapper/src/index.ts
+++ b/packages/web3-wrapper/src/index.ts
@@ -1,7 +1,7 @@
export { Web3Wrapper } from './web3_wrapper';
export { marshaller } from './marshaller';
-export { AbiDecoder } from '@0xproject/utils';
+export { AbiDecoder } from '@0x/utils';
export {
BlockParam,
diff --git a/packages/web3-wrapper/src/marshaller.ts b/packages/web3-wrapper/src/marshaller.ts
index 572a322d6..299c6a64c 100644
--- a/packages/web3-wrapper/src/marshaller.ts
+++ b/packages/web3-wrapper/src/marshaller.ts
@@ -1,4 +1,4 @@
-import { addressUtils } from '@0xproject/utils';
+import { addressUtils } from '@0x/utils';
import {
BlockParam,
BlockParamLiteral,
diff --git a/packages/web3-wrapper/src/utils.ts b/packages/web3-wrapper/src/utils.ts
index 0b568aac5..c68587632 100644
--- a/packages/web3-wrapper/src/utils.ts
+++ b/packages/web3-wrapper/src/utils.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
export const utils = {
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts
index 726246f1a..23204e616 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,
@@ -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;
@@ -145,7 +151,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([]);
@@ -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;
}
/**
@@ -526,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;
}
/**