Skip to content

Commit

Permalink
Add test for NewEVM constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed Apr 26, 2024
1 parent 91a9a53 commit eb83d29
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/vm/precompile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ func (c *mockStatefulPrecompiledContract) Run(
func TestEvmIsPrecompileMethod(t *testing.T) {
var address = common.HexToAddress("0x0300000000000000000000000000000000000000")

t.Run("test NewEVM constructor", func(t *testing.T) {
modules.ClearRegisteredModules()
evm := NewEVM(BlockContext{}, TxContext{}, nil, params.TestChainConfig, Config{})
require.Nil(t, evm.enabledPrecompiles)
})

t.Run("not registered and not enabled", func(t *testing.T) {
modules.ClearRegisteredModules()
evm := NewEVMWithEnabledPrecompiles(BlockContext{}, TxContext{}, nil, params.TestChainConfig, Config{}, nil)
Expand Down

0 comments on commit eb83d29

Please sign in to comment.