From 15f8de846039bc16383d2d6e336b781a46faafe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Gamenik?= Date: Tue, 24 Jun 2025 17:27:06 +0200 Subject: [PATCH] Revert "more tests" This reverts commit 356ad96d796513cc4290dcbe93dd35487b7cc11b. --- core/vm/eips_test.go | 99 -------------------------------------------- core/vm/gas_test.go | 37 ----------------- 2 files changed, 136 deletions(-) delete mode 100644 core/vm/eips_test.go delete mode 100644 core/vm/gas_test.go diff --git a/core/vm/eips_test.go b/core/vm/eips_test.go deleted file mode 100644 index cfd4427cd3..0000000000 --- a/core/vm/eips_test.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2017 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// The go-ethereum library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see . - -package vm - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/params" - "github.com/holiman/uint256" -) - -func TestOpChainID(t *testing.T) { - pc := uint64(1) - evm := EVM{} - chainID := big.NewInt(1) - chainConfig := params.ChainConfig{ChainID: chainID} - evm.chainConfig = &chainConfig - interpreter := EVMInterpreter{evm: &evm} - stack := Stack{} - scope := ScopeContext{Stack: &stack} - _, ret2 := opChainID(&pc, &interpreter, &scope) - if ret2 != nil || len(stack.data) != 1 || stack.data[0] != *uint256.NewInt(1) { - t.Errorf("opChainID not successful") - } -} - -func TestOpBaseFee(t *testing.T) { - pc := uint64(1) - baseFee := big.NewInt(1) - context := BlockContext{BaseFee: baseFee} - evm := EVM{Context: context} - interpreter := EVMInterpreter{evm: &evm} - stack := Stack{} - scope := ScopeContext{Stack: &stack} - _, ret2 := opBaseFee(&pc, &interpreter, &scope) - if ret2 != nil || len(stack.data) != 1 || stack.data[0] != *uint256.NewInt(1) { - t.Errorf("opBaseFee not successful") - } -} - -func TestOpBlobBaseFee(t *testing.T) { - pc := uint64(1) - blobBaseFee := big.NewInt(1) - context := BlockContext{BlobBaseFee: blobBaseFee} - evm := EVM{Context: context} - interpreter := EVMInterpreter{evm: &evm} - stack := Stack{} - scope := ScopeContext{Stack: &stack} - _, ret2 := opBlobBaseFee(&pc, &interpreter, &scope) - if ret2 != nil || len(stack.data) != 1 || stack.data[0] != *uint256.NewInt(1) { - t.Errorf("opBlobBaseFee not successful") - } -} - -func TestOpPush1EIP4762(t *testing.T) { - pc := uint64(1) - context := BlockContext{} - evm := EVM{Context: context} - interpreter := EVMInterpreter{evm: &evm} - contract := Contract{Code: []byte{0, 1, 2}} - stack := Stack{} - scope := ScopeContext{Contract: &contract, Stack: &stack} - _, ret2 := opPush1EIP4762(&pc, &interpreter, &scope) - if ret2 != nil || len(stack.data) != 1 || stack.data[0] != *uint256.NewInt(2) { - t.Errorf("opPush1EIP4762 not successful") - } -} - -func TestMakePushEIP4762(t *testing.T) { - ef := makePushEIP4762(4, 8) - - pc := uint64(1) - context := BlockContext{} - evm := EVM{Context: context} - interpreter := EVMInterpreter{evm: &evm} - contract := Contract{Code: []byte{0, 1, 2}, IsDeployment: true} - stack := Stack{} - scope := ScopeContext{Contract: &contract, Stack: &stack} - - _, ret2 := ef(&pc, &interpreter, &scope) - if ret2 != nil || len(stack.data) != 1 || pc != uint64(5) { - t.Errorf("makePushEIP4762 not successful") - } -} diff --git a/core/vm/gas_test.go b/core/vm/gas_test.go deleted file mode 100644 index 30caf072dc..0000000000 --- a/core/vm/gas_test.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// The go-ethereum library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see . - -package vm - -import ( - "testing" - - "github.com/holiman/uint256" -) - -func TestCallGas(t *testing.T) { - availableGas := uint64(100) - base := uint64(50) - callCost := uint256.NewInt(70) - ret1, ret2 := callGas(false, availableGas, base, callCost) - if ret2 != nil || ret1 != uint64(70) { - t.Errorf("callGas not successful") - } - ret1, ret2 = callGas(true, availableGas, base, callCost) - if ret2 != nil || ret1 != uint64(50) { - t.Errorf("callGas not successful") - } -}