aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web3-wrapper/src/web3_wrapper.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-06-05 09:10:42 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-06-07 03:40:30 +0800
commitbca62c813d2e821c56968916615861366402435b (patch)
tree041ea056d813b0db32520f7ca9e25e9799530c47 /packages/web3-wrapper/src/web3_wrapper.ts
parentae1cf74dcd84b0a39a5781f63c1c3f2beb0e1857 (diff)
downloaddexon-sol-tools-bca62c813d2e821c56968916615861366402435b.tar
dexon-sol-tools-bca62c813d2e821c56968916615861366402435b.tar.gz
dexon-sol-tools-bca62c813d2e821c56968916615861366402435b.tar.bz2
dexon-sol-tools-bca62c813d2e821c56968916615861366402435b.tar.lz
dexon-sol-tools-bca62c813d2e821c56968916615861366402435b.tar.xz
dexon-sol-tools-bca62c813d2e821c56968916615861366402435b.tar.zst
dexon-sol-tools-bca62c813d2e821c56968916615861366402435b.zip
Throw in web3-wrapper when rawCallResult is '0x'
Diffstat (limited to 'packages/web3-wrapper/src/web3_wrapper.ts')
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts
index ace6a2d61..ed2d0a119 100644
--- a/packages/web3-wrapper/src/web3_wrapper.ts
+++ b/packages/web3-wrapper/src/web3_wrapper.ts
@@ -315,6 +315,9 @@ export class Web3Wrapper {
*/
public async callAsync(callData: CallData, defaultBlock?: BlockParam): Promise<string> {
const rawCallResult = await promisify<string>(this._web3.eth.call)(callData, defaultBlock);
+ if (rawCallResult === '0x') {
+ throw new Error('Contract call failed (returned null)');
+ }
return rawCallResult;
}
/**