Skip to content

Commit

Permalink
fix(ethers): avoid 0x0 prefix on non-zero eth_gasPrice values
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Apr 29, 2024
1 parent d4896c4 commit 239370f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/ethers/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ class WalletWrapper {
_params: TransactionParams
): Promise<any> {
if (this.ethGasPriceFactor) {
return (await this.getGasPrice()).toHexString()
return "0x" + (await this.getGasPrice()).toNumber().toString(16)
} else {
const gp: BigNumber = BigNumber.from(await this.provider.getGasPrice())
console.log(`0x${gp.toNumber().toString(16)}`)
Expand Down

0 comments on commit 239370f

Please sign in to comment.