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 MajorLift committed Oct 11, 2023
1 parent 0af5407 commit dbb0f2d
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 dbb0f2d

Please sign in to comment.