aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-11-29 16:51:57 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-11-29 16:51:57 +0800
commit7c657fc78957d7ed302eba68bb6122b515364ac4 (patch)
tree61672d4974be958002d960b638a1e4f182d1f8b0
parent3d21d455dca6e75a635ab5742c66c80ee175c3e7 (diff)
downloadgo-tangerine-7c657fc78957d7ed302eba68bb6122b515364ac4.tar
go-tangerine-7c657fc78957d7ed302eba68bb6122b515364ac4.tar.gz
go-tangerine-7c657fc78957d7ed302eba68bb6122b515364ac4.tar.bz2
go-tangerine-7c657fc78957d7ed302eba68bb6122b515364ac4.tar.lz
go-tangerine-7c657fc78957d7ed302eba68bb6122b515364ac4.tar.xz
go-tangerine-7c657fc78957d7ed302eba68bb6122b515364ac4.tar.zst
go-tangerine-7c657fc78957d7ed302eba68bb6122b515364ac4.zip
tests, core: update tests and make STATICCALL cause touch-delete (#18187)
-rw-r--r--core/vm/evm.go6
-rw-r--r--tests/init.go9
m---------tests/testdata0
3 files changed, 15 insertions, 0 deletions
diff --git a/core/vm/evm.go b/core/vm/evm.go
index 968d2219e..ba4d1e9eb 100644
--- a/core/vm/evm.go
+++ b/core/vm/evm.go
@@ -339,6 +339,12 @@ func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte
contract := NewContract(caller, to, new(big.Int), gas)
contract.SetCallCode(&addr, evm.StateDB.GetCodeHash(addr), evm.StateDB.GetCode(addr))
+ // We do an AddBalance of zero here, just in order to trigger a touch.
+ // This doesn't matter on Mainnet, where all empties are gone at the time of Byzantium,
+ // but is the correct thing to do and matters on other networks, in tests, and potential
+ // future scenarios
+ evm.StateDB.AddBalance(addr, bigZero)
+
// When an error was returned by the EVM or when setting the creation code
// above we revert to the snapshot and consume any gas remaining. Additionally
// when we're in Homestead this also counts for code storage gas errors.
diff --git a/tests/init.go b/tests/init.go
index f0a4943c1..db0457b6d 100644
--- a/tests/init.go
+++ b/tests/init.go
@@ -86,6 +86,15 @@ var Forks = map[string]*params.ChainConfig{
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(5),
},
+ "ByzantiumToConstantinopleAt5": {
+ ChainID: big.NewInt(1),
+ HomesteadBlock: big.NewInt(0),
+ EIP150Block: big.NewInt(0),
+ EIP155Block: big.NewInt(0),
+ EIP158Block: big.NewInt(0),
+ ByzantiumBlock: big.NewInt(0),
+ ConstantinopleBlock: big.NewInt(5),
+ },
}
// UnsupportedForkError is returned when a test requests a fork that isn't implemented.
diff --git a/tests/testdata b/tests/testdata
-Subproject 95a309203890e6244c6d4353ca411671973c13b
+Subproject c02a2a17c0288a255572b37dc7ec1fcb838b9db