From bca62c813d2e821c56968916615861366402435b Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Mon, 4 Jun 2018 18:10:42 -0700 Subject: Throw in web3-wrapper when rawCallResult is '0x' --- packages/web3-wrapper/src/web3_wrapper.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/web3-wrapper') 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 { const rawCallResult = await promisify(this._web3.eth.call)(callData, defaultBlock); + if (rawCallResult === '0x') { + throw new Error('Contract call failed (returned null)'); + } return rawCallResult; } /** -- cgit