Skip to content

Commit

Permalink
Fix txpool unit tests (0xPolygon#1429)
Browse files Browse the repository at this point in the history
* Enable all forks at genesis and add unit test which checks that dynamic fee tx gets rejected if london hardfork is not enabled

* Minor change

* Fix
  • Loading branch information
Stefan-Ethernal authored Apr 25, 2023
1 parent 024d011 commit dca3824
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions txpool/txpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var (
forks = &chain.Forks{
Homestead: chain.NewFork(0),
Istanbul: chain.NewFork(0),
London: chain.NewFork(0),
}
)

Expand Down Expand Up @@ -1835,6 +1836,22 @@ func TestPermissionSmartContractDeployment(t *testing.T) {
ErrTipAboveFeeCap,
)
})

t.Run("dynamic fee tx placed without eip-1559 fork enabled", func(t *testing.T) {
t.Parallel()
pool := setupPool()
pool.forks.London = false

tx := newTx(defaultAddr, 0, 1)
tx.Type = types.DynamicFeeTx
tx.GasFeeCap = big.NewInt(10000)
tx.GasTipCap = big.NewInt(100000)

assert.ErrorIs(t,
pool.addTx(local, signTx(tx)),
ErrInvalidTxType,
)
})
}

/* "Integrated" tests */
Expand Down

0 comments on commit dca3824

Please sign in to comment.