Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into thomas/fix-bug-reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
fedekunze authored Oct 8, 2021
2 parents 917674d + 5169721 commit a678cad
Show file tree
Hide file tree
Showing 12 changed files with 1,111 additions and 14 deletions.
38 changes: 38 additions & 0 deletions x/evm/types/access_list_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package types

import (
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
)

func (suite *TxDataTestSuite) TestTestNewAccessList() {
testCases := []struct {
name string
ethAccessList *ethtypes.AccessList
expAl AccessList
}{
{
"ethAccessList is nil",
nil,
nil,
},
{
"non-empty ethAccessList",
&ethtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}},
AccessList{{Address: suite.hexAddr, StorageKeys: []string{common.Hash{}.Hex()}}},
},
}
for _, tc := range testCases {
al := NewAccessList(tc.ethAccessList)

suite.Require().Equal(tc.expAl, al)
}
}

func (suite *TxDataTestSuite) TestAccessListToEthAccessList() {
ethAccessList := ethtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}}
al := NewAccessList(&ethAccessList)
actual := al.ToEthAccessList()

suite.Require().Equal(&ethAccessList, actual)
}
20 changes: 19 additions & 1 deletion x/evm/types/chain_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ func TestChainConfigValidate(t *testing.T) {
},
true,
},

{
"invalid CatalystBlock",
ChainConfig{
Expand All @@ -258,6 +257,25 @@ func TestChainConfigValidate(t *testing.T) {
},
true,
},
{
"invalid fork order - skip HomesteadBlock",
ChainConfig{
DAOForkBlock: newIntPtr(0),
EIP150Block: newIntPtr(0),
EIP150Hash: defaultEIP150Hash,
EIP155Block: newIntPtr(0),
EIP158Block: newIntPtr(0),
ByzantiumBlock: newIntPtr(0),
ConstantinopleBlock: newIntPtr(0),
PetersburgBlock: newIntPtr(0),
IstanbulBlock: newIntPtr(0),
MuirGlacierBlock: newIntPtr(0),
BerlinBlock: newIntPtr(0),
LondonBlock: newIntPtr(0),
CatalystBlock: newIntPtr(0),
},
true,
},
}

for _, tc := range testCases {
Expand Down
4 changes: 2 additions & 2 deletions x/evm/types/dynamic_fee_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ func (tx *DynamicFeeTx) GetGasPrice() *big.Int {
return tx.GetGasFeeCap()
}

// GetGasTipCap returns the gas price field.
// GetGasTipCap returns the gas tip cap field.
func (tx *DynamicFeeTx) GetGasTipCap() *big.Int {
if tx.GasTipCap == nil {
return nil
}
return tx.GasTipCap.BigInt()
}

// GetGasFeeCap returns the gas price field.
// GetGasFeeCap returns the gas fee cap field.
func (tx *DynamicFeeTx) GetGasFeeCap() *big.Int {
if tx.GasFeeCap == nil {
return nil
Expand Down
Loading

0 comments on commit a678cad

Please sign in to comment.