diff options
author | Felix Lange <fjl@twurst.com> | 2016-10-04 18:36:02 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-10-06 21:32:16 +0800 |
commit | 1f1ea18b5414bea22332bb4fce53cc95b5c6a07d (patch) | |
tree | d1aa3051f9c4d9f33a24519c18b70f0dd2f00644 /internal | |
parent | ab7adb0027dbcf09cf75a533be356c1e24c46c90 (diff) | |
download | go-tangerine-1f1ea18b5414bea22332bb4fce53cc95b5c6a07d.tar go-tangerine-1f1ea18b5414bea22332bb4fce53cc95b5c6a07d.tar.gz go-tangerine-1f1ea18b5414bea22332bb4fce53cc95b5c6a07d.tar.bz2 go-tangerine-1f1ea18b5414bea22332bb4fce53cc95b5c6a07d.tar.lz go-tangerine-1f1ea18b5414bea22332bb4fce53cc95b5c6a07d.tar.xz go-tangerine-1f1ea18b5414bea22332bb4fce53cc95b5c6a07d.tar.zst go-tangerine-1f1ea18b5414bea22332bb4fce53cc95b5c6a07d.zip |
core/state: implement reverts by journaling all changes
This commit replaces the deep-copy based state revert mechanism with a
linear complexity journal. This commit also hides several internal
StateDB methods to limit the number of ways in which calling code can
use the journal incorrectly.
As usual consultation and bug fixes to the initial implementation were
provided by @karalabe, @obscuren and @Arachnid. Thank you!
Diffstat (limited to 'internal')
-rw-r--r-- | internal/ethapi/tracer_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/ethapi/tracer_test.go b/internal/ethapi/tracer_test.go index 7c831d299..127af32a8 100644 --- a/internal/ethapi/tracer_test.go +++ b/internal/ethapi/tracer_test.go @@ -50,14 +50,14 @@ func (self *Env) Origin() common.Address { return common.Address{} } func (self *Env) BlockNumber() *big.Int { return big.NewInt(0) } //func (self *Env) PrevHash() []byte { return self.parent } -func (self *Env) Coinbase() common.Address { return common.Address{} } -func (self *Env) MakeSnapshot() vm.Database { return nil } -func (self *Env) SetSnapshot(vm.Database) {} -func (self *Env) Time() *big.Int { return big.NewInt(time.Now().Unix()) } -func (self *Env) Difficulty() *big.Int { return big.NewInt(0) } -func (self *Env) Db() vm.Database { return nil } -func (self *Env) GasLimit() *big.Int { return self.gasLimit } -func (self *Env) VmType() vm.Type { return vm.StdVmTy } +func (self *Env) Coinbase() common.Address { return common.Address{} } +func (self *Env) SnapshotDatabase() int { return 0 } +func (self *Env) RevertToSnapshot(int) {} +func (self *Env) Time() *big.Int { return big.NewInt(time.Now().Unix()) } +func (self *Env) Difficulty() *big.Int { return big.NewInt(0) } +func (self *Env) Db() vm.Database { return nil } +func (self *Env) GasLimit() *big.Int { return self.gasLimit } +func (self *Env) VmType() vm.Type { return vm.StdVmTy } func (self *Env) GetHash(n uint64) common.Hash { return common.BytesToHash(crypto.Keccak256([]byte(big.NewInt(int64(n)).String()))) } |