internal/ethapi: add testcase of pre-london

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2023-08-03 14:35:50 +08:00
parent 1ae784545e
commit afd421766c

View file

@ -67,6 +67,13 @@ func TestSetFeeDefaults(t *testing.T) {
&TransactionArgs{GasPrice: fortytwo}, &TransactionArgs{GasPrice: fortytwo},
nil, nil,
}, },
{
"legacy tx pre-London with zero price",
false,
&TransactionArgs{GasPrice: zero},
&TransactionArgs{GasPrice: fortytwo},
nil,
},
{ {
"legacy tx post-London, explicit gas price", "legacy tx post-London, explicit gas price",
true, true,
@ -74,6 +81,13 @@ func TestSetFeeDefaults(t *testing.T) {
&TransactionArgs{GasPrice: fortytwo}, &TransactionArgs{GasPrice: fortytwo},
nil, nil,
}, },
{
"legacy tx post-London with zero price",
true,
&TransactionArgs{GasPrice: zero},
nil,
errors.New("gasPrice must be positive"),
},
// Access list txs // Access list txs
{ {
@ -185,13 +199,6 @@ func TestSetFeeDefaults(t *testing.T) {
nil, nil,
errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified"), errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified"),
}, },
{
"set gas price to zero",
true,
&TransactionArgs{GasPrice: zero},
nil,
errors.New("gasPrice must be positive"),
},
} }
ctx := context.Background() ctx := context.Background()