From eb83d297f3693eebf8d7c5bc1277b9cf13154b88 Mon Sep 17 00:00:00 2001 From: evgeniy-scherbina Date: Fri, 26 Apr 2024 19:35:03 -0400 Subject: [PATCH] Add test for NewEVM constructor --- core/vm/precompile_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/vm/precompile_test.go b/core/vm/precompile_test.go index 7b2dc8442a67..cb359ed45d85 100644 --- a/core/vm/precompile_test.go +++ b/core/vm/precompile_test.go @@ -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)