mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
check base fee in test block results
This commit is contained in:
parent
399812ad37
commit
1c154e996e
1 changed files with 164 additions and 109 deletions
|
|
@ -1108,11 +1108,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
Number string
|
||||
//Hash string
|
||||
// Ignore timestamp
|
||||
GasLimit string
|
||||
GasUsed string
|
||||
Miner string
|
||||
BaseFee string
|
||||
Calls []callRes
|
||||
GasLimit string
|
||||
GasUsed string
|
||||
Miner string
|
||||
BaseFeePerGas string
|
||||
Calls []callRes
|
||||
}
|
||||
var testSuite = []struct {
|
||||
name string
|
||||
|
|
@ -1146,10 +1146,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xf618",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xf618",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0x5208",
|
||||
|
|
@ -1199,10 +1200,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa410",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa410",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0x5208",
|
||||
|
|
@ -1215,10 +1217,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
Status: "0x1",
|
||||
}},
|
||||
}, {
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x5208",
|
||||
Miner: coinbase,
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x5208",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0x5208",
|
||||
|
|
@ -1253,10 +1256,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x47e7c4",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x47e7c4",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
Error: callErr{Message: "stack underflow (0 <=> 2)", Code: errCodeVMError},
|
||||
|
|
@ -1298,10 +1302,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xe891",
|
||||
Miner: strings.ToLower(cac.String()),
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xe891",
|
||||
Miner: strings.ToLower(cac.String()),
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x000000000000000000000000000000000000000000000000000000000000000b",
|
||||
GasUsed: "0xe891",
|
||||
|
|
@ -1309,10 +1314,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
Status: "0x1",
|
||||
}},
|
||||
}, {
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xe891",
|
||||
Miner: strings.ToLower(cac.String()),
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xe891",
|
||||
Miner: strings.ToLower(cac.String()),
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x000000000000000000000000000000000000000000000000000000000000000c",
|
||||
GasUsed: "0xe891",
|
||||
|
|
@ -1377,10 +1383,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x10683",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x10683",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0xaacc",
|
||||
|
|
@ -1418,10 +1425,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x5508",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x5508",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
Logs: []log{{
|
||||
|
|
@ -1486,10 +1494,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x52f6",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x52f6",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
// Caller is in this case the contract that invokes ecrecover.
|
||||
ReturnValue: strings.ToLower(randomAccounts[2].addr.String()),
|
||||
|
|
@ -1536,10 +1545,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa58c",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa58c",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0xec4916dd28fc4c10d78e287ca5d9cc51ee1ae73cbfde08c6b37324cbfaac8bc5",
|
||||
GasUsed: "0x52dc",
|
||||
|
|
@ -1584,10 +1594,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
includeTransfers: &includeTransfers,
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xd984",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xd984",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0xd984",
|
||||
|
|
@ -1650,10 +1661,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x1b83f",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x1b83f",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0xd166",
|
||||
|
|
@ -1666,10 +1678,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
Status: "0x1",
|
||||
}},
|
||||
}, {
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xe6d9",
|
||||
Miner: coinbase,
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xe6d9",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0xe6d9",
|
||||
|
|
@ -1713,10 +1726,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
validation: &validation,
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x5208",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x5208",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x1",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0x5208",
|
||||
|
|
@ -1765,10 +1779,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xc542",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xc542",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x0000000000000000000000000000000200000000000000000000000000000003",
|
||||
GasUsed: "0x62a1",
|
||||
|
|
@ -1781,10 +1796,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
Status: "0x1",
|
||||
}},
|
||||
}, {
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x62a1",
|
||||
Miner: coinbase,
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x62a1",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x0000000000000000000000000000000500000000000000000000000000000000",
|
||||
GasUsed: "0x62a1",
|
||||
|
|
@ -1838,16 +1854,18 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x0",
|
||||
Miner: coinbase,
|
||||
Calls: []callRes{},
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x0",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{},
|
||||
}, {
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xf864",
|
||||
Miner: coinbase,
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xf864",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0x52cc",
|
||||
|
|
@ -1866,28 +1884,32 @@ func TestSimulateV1(t *testing.T) {
|
|||
Status: "0x1",
|
||||
}},
|
||||
}, {
|
||||
Number: "0xd",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x0",
|
||||
Miner: coinbase,
|
||||
Calls: []callRes{},
|
||||
Number: "0xd",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x0",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{},
|
||||
}, {
|
||||
Number: "0xe",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x0",
|
||||
Miner: coinbase,
|
||||
Calls: []callRes{},
|
||||
Number: "0xe",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x0",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{},
|
||||
}, {
|
||||
Number: "0xf",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x0",
|
||||
Miner: coinbase,
|
||||
Calls: []callRes{},
|
||||
Number: "0xf",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x0",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{},
|
||||
}, {
|
||||
Number: "0x10",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa598",
|
||||
Miner: coinbase,
|
||||
Number: "0x10",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa598",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x",
|
||||
GasUsed: "0x52cc",
|
||||
|
|
@ -1947,10 +1969,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
}},
|
||||
}},
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa44e",
|
||||
Miner: coinbase,
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa44e",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
GasUsed: "0x5227",
|
||||
|
|
@ -1963,10 +1986,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
Status: "0x1",
|
||||
}},
|
||||
}, {
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa44e",
|
||||
Miner: coinbase,
|
||||
Number: "0xc",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0xa44e",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x1",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
|
||||
GasUsed: "0x5227",
|
||||
|
|
@ -1979,10 +2003,11 @@ func TestSimulateV1(t *testing.T) {
|
|||
Status: "0x1",
|
||||
}},
|
||||
}, {
|
||||
Number: "0xd",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x5227",
|
||||
Miner: coinbase,
|
||||
Number: "0xd",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x5227",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0x0",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
GasUsed: "0x5227",
|
||||
|
|
@ -1990,6 +2015,36 @@ func TestSimulateV1(t *testing.T) {
|
|||
Status: "0x1",
|
||||
}},
|
||||
}},
|
||||
}, {
|
||||
name: "basefee-validation-mode",
|
||||
tag: latest,
|
||||
blocks: []simBlock{{
|
||||
StateOverrides: &StateOverride{
|
||||
randomAccounts[2].addr: {
|
||||
Code: hex2Bytes("3a489060005260205260406000f3"),
|
||||
},
|
||||
},
|
||||
Calls: []TransactionArgs{{
|
||||
From: &accounts[0].addr,
|
||||
To: &randomAccounts[2].addr,
|
||||
MaxFeePerGas: newInt(233138868),
|
||||
MaxPriorityFeePerGas: newInt(1),
|
||||
}},
|
||||
}},
|
||||
validation: &validation,
|
||||
want: []blockRes{{
|
||||
Number: "0xb",
|
||||
GasLimit: "0x47e7c4",
|
||||
GasUsed: "0x5227",
|
||||
Miner: coinbase,
|
||||
BaseFeePerGas: "0xde56ab3",
|
||||
Calls: []callRes{{
|
||||
ReturnValue: "0x000000000000000000000000000000000000000000000000000000000de56ab4000000000000000000000000000000000000000000000000000000000de56ab3",
|
||||
GasUsed: "0x5227",
|
||||
Logs: []log{},
|
||||
Status: "0x1",
|
||||
}},
|
||||
}},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue