Skip to content

Commit

Permalink
add hedera checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Sep 15, 2024
1 parent 6bad89a commit e5ca74b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/handlers/gasPriceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,13 @@ export class GasPriceManager {
}

public async validateGasPrice(gasPrice: GasPriceParameters) {
const lowestMaxFeePerGas = await this.getMinMaxFeePerGas()
const lowestMaxPriorityFeePerGas =
await this.getMinMaxPriorityFeePerGas()
let lowestMaxFeePerGas = await this.getMinMaxFeePerGas()
let lowestMaxPriorityFeePerGas = await this.getMinMaxPriorityFeePerGas()

if (this.chainType === "hedera") {
lowestMaxFeePerGas /= 10n ** 9n
lowestMaxPriorityFeePerGas /= 10n ** 9n
}

if (gasPrice.maxFeePerGas < lowestMaxFeePerGas) {
throw new RpcError(
Expand Down

0 comments on commit e5ca74b

Please sign in to comment.