From d0b0c4a917601f6ca02dda6336f256850ab3941b Mon Sep 17 00:00:00 2001 From: Jeremy Schlatter Date: Mon, 4 Feb 2019 13:06:34 -0800 Subject: Fix default gas limit for fake txs in TraceCollectionSubprovider This hex string is required to be prefixed with '0x'. If it does not have that prefix, then the call to unmarshalTxData below will fail with: BigNumber Error: new BigNumber() not a number: 5b8d80 This default value is overridden if the incoming call already has a gas estimate, in which case the parse error above does not happen. This is probably why the error wasn't previously noticed. --- packages/sol-tracing-utils/src/trace_collection_subprovider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sol-tracing-utils/src/trace_collection_subprovider.ts b/packages/sol-tracing-utils/src/trace_collection_subprovider.ts index 8279bda54..6f833b0fc 100644 --- a/packages/sol-tracing-utils/src/trace_collection_subprovider.ts +++ b/packages/sol-tracing-utils/src/trace_collection_subprovider.ts @@ -186,7 +186,7 @@ export abstract class TraceCollectionSubprovider extends Subprovider { const blockchainLifecycle = new BlockchainLifecycle(this._web3Wrapper); await blockchainLifecycle.startAsync(); const fakeTxData = { - gas: BLOCK_GAS_LIMIT.toString(16), // tslint:disable-line:custom-no-magic-numbers + gas: `0x${BLOCK_GAS_LIMIT.toString(16)}`, // tslint:disable-line:custom-no-magic-numbers isFakeTransaction: true, // This transaction (and only it) is allowed to come through when the lock is locked ...callData, from: callData.from || this._defaultFromAddress, -- cgit v1.2.3