Skip to content

Commit

Permalink
return basic usage gas when transaction to is undefined (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanmino authored and bitpshr committed Nov 27, 2018
1 parent dac95f6 commit 4c0e08e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TransactionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ export class TransactionController extends BaseController<TransactionConfig, Tra
return { gas, gasPrice };
}

// 2. If this is not a contract address, use 0x5208 / 21000
// 2. If to is not defined or this is not a contract address, use 0x5208 / 21000
/* istanbul ignore next */
const code = to ? await this.query('getCode', [to]) : undefined;
/* istanbul ignore next */
if (to && (!code || code === '0x')) {
if (!to || (to && (!code || code === '0x'))) {
return { gas: '0x5208', gasPrice };
}

Expand Down

0 comments on commit 4c0e08e

Please sign in to comment.