Skip to content

Commit

Permalink
disable the check on gasPrice >= priorityFee
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Oct 1, 2024
1 parent c05a91c commit a1a06f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions zetaclient/chains/evm/signer/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ func (g Gas) validate() error {
return errors.New("max fee per unit is nil")
case g.PriorityFee == nil:
return errors.New("priority fee per unit is nil")
case g.Price.Cmp(g.PriorityFee) == -1:
return fmt.Errorf(
"max fee per unit (%d) is less than priority fee per unit (%d)",
g.Price.Int64(),
g.PriorityFee.Int64(),
)
// case g.Price.Cmp(g.PriorityFee) == -1:
// return fmt.Errorf(
// "max fee per unit (%d) is less than priority fee per unit (%d)",
// g.Price.Int64(),
// g.PriorityFee.Int64(),
// )
default:
return nil
}
Expand Down Expand Up @@ -91,8 +91,8 @@ func gasFromCCTX(cctx *types.CrossChainTx, logger zerolog.Logger) (Gas, error) {
switch {
case err != nil:
return Gas{}, errors.Wrap(err, "unable to parse priorityFee")
case gasPrice.Cmp(priorityFee) == -1:
return Gas{}, fmt.Errorf("gasPrice (%d) is less than priorityFee (%d)", gasPrice.Int64(), priorityFee.Int64())
// case gasPrice.Cmp(priorityFee) == -1:
// return Gas{}, fmt.Errorf("gasPrice (%d) is less than priorityFee (%d)", gasPrice.Int64(), priorityFee.Int64())
}

return Gas{
Expand Down
10 changes: 5 additions & 5 deletions zetaclient/chains/evm/signer/gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ func TestGasFromCCTX(t *testing.T) {
cctx: makeCCTX(123_000, gwei(4).String(), "-1"),
errorContains: "unable to parse priorityFee: big.Int is negative",
},
{
name: "gasPrice is less than priorityFee",
cctx: makeCCTX(123_000, gwei(4).String(), gwei(5).String()),
errorContains: "gasPrice (4000000000) is less than priorityFee (5000000000)",
},
// {
// name: "gasPrice is less than priorityFee",
// cctx: makeCCTX(123_000, gwei(4).String(), gwei(5).String()),
// errorContains: "gasPrice (4000000000) is less than priorityFee (5000000000)",
// },
{
name: "gasPrice is invalid",
cctx: makeCCTX(123_000, "hello", gwei(5).String()),
Expand Down

0 comments on commit a1a06f0

Please sign in to comment.