Skip to content

Commit

Permalink
core/blockchain,core/types: simplify eip-2718 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient committed Sep 27, 2020
1 parent 6e610ac commit aaea762
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3064,14 +3064,13 @@ func TestEIP2718Transition(t *testing.T) {
)

blocks, _ := GenerateChain(gspec.Config, genesis, engine, db, 1, func(i int, b *BlockGen) {
zero := common.HexToHash("0x00")
b.SetCoinbase(common.Address{1})

// One transaction to AAAA
accesses := types.AccessList{types.AccessTuple{
Address: &aa,
StorageKeys: []*common.Hash{
&zero,
{0},
},
}}

Expand Down
7 changes: 3 additions & 4 deletions core/types/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,11 @@ func Test2718BlockEncoding(t *testing.T) {

tx1 := NewTransaction(0, common.HexToAddress("095e7baea6a6c7c4c2dfeb977efac326af552d87"), big.NewInt(10), 50000, big.NewInt(10), nil)
tx1, _ = tx1.WithSignature(HomesteadSigner{}, common.Hex2Bytes("9bea4c4daac7c7c52e093e6a4c35dbbcf8856f1af7b059ba20253e70848d094f8a8fae537ce25ed8cb5af9adac3f141af69bd515bd2ba031522df09b97dd72b100"))
a := common.HexToAddress("0x0000000000000000000000000000000000000001")
zero := common.HexToHash("0x0")
addr := common.HexToAddress("0x0000000000000000000000000000000000000001")
accesses := AccessList{AccessTuple{
Address: &a,
Address: &addr,
StorageKeys: []*common.Hash{
&zero,
{0},
},
}}
tx2 := NewAccessListTransaction(big.NewInt(1), 0, common.HexToAddress("095e7baea6a6c7c4c2dfeb977efac326af552d87"), big.NewInt(0), 123457, big.NewInt(10), nil, &accesses)
Expand Down

0 comments on commit aaea762

Please sign in to comment.