Skip to content

Commit

Permalink
Minor error formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
talkol committed Jul 26, 2020
1 parent def22bc commit bb5991a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/write/ethereum-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ export async function signAndSendTransaction(
};

let gasLimit = toNumber(await state.web3.eth.estimateGas(txObject));
if (gasLimit <= 0) throw new Error(`Cannot estimate gas for tx with data ${encodedAbi}`);
if (gasLimit <= 0) {
throw new Error(`Cannot estimate gas for tx with data ${encodedAbi}.`);
}
gasLimit += GAS_LIMIT_ESTIMATE_EXTRA;
if (gasLimit > GAS_LIMIT_HARD_LIMIT) {
throw new Error(`Gas limit estimate ${gasLimit} over hard limit ${GAS_LIMIT_HARD_LIMIT}`);
throw new Error(`Gas limit estimate ${gasLimit} over hard limit ${GAS_LIMIT_HARD_LIMIT}.`);
}
txObject.gas = gasLimit;

Expand Down

0 comments on commit bb5991a

Please sign in to comment.