From 6e80c992556fafbbe16bb62e11021b30bbf611ab Mon Sep 17 00:00:00 2001 From: Matthew Campbell Date: Sat, 8 Dec 2018 23:10:54 +0700 Subject: [PATCH 1/3] Add some helper methods for verifiers --- core/state/statedb.go | 5 +++++ core/vm/interface.go | 2 ++ 2 files changed, 7 insertions(+) diff --git a/core/state/statedb.go b/core/state/statedb.go index 216667ce983f..760fe0592851 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -100,6 +100,11 @@ func New(root common.Hash, db Database) (*StateDB, error) { }, nil } +// helper method to ensure consistency on the evm +func (self *StateDB) GetAccounts() []common.Address { + return []common.Address{} +} + // setError remembers the first non-nil error it is called with. func (self *StateDB) setError(err error) { if self.dbErr == nil { diff --git a/core/vm/interface.go b/core/vm/interface.go index fc15082f18ed..7d41a1fc51e9 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -27,6 +27,8 @@ import ( type StateDB interface { CreateAccount(common.Address) + GetAccounts() []common.Address + SubBalance(common.Address, *big.Int) AddBalance(common.Address, *big.Int) GetBalance(common.Address) *big.Int From d89fffca9b87b144f2002bc589ef39d850a15bd7 Mon Sep 17 00:00:00 2001 From: Matthew Campbell Date: Sun, 9 Dec 2018 00:53:29 +0700 Subject: [PATCH 2/3] Allow rawdump to be exposed --- core/state/statedb.go | 5 ----- core/vm/interface.go | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index 760fe0592851..216667ce983f 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -100,11 +100,6 @@ func New(root common.Hash, db Database) (*StateDB, error) { }, nil } -// helper method to ensure consistency on the evm -func (self *StateDB) GetAccounts() []common.Address { - return []common.Address{} -} - // setError remembers the first non-nil error it is called with. func (self *StateDB) setError(err error) { if self.dbErr == nil { diff --git a/core/vm/interface.go b/core/vm/interface.go index 7d41a1fc51e9..d37a04ad02b8 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -20,6 +20,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" ) @@ -28,6 +29,7 @@ type StateDB interface { CreateAccount(common.Address) GetAccounts() []common.Address + RawDump() state.Dump SubBalance(common.Address, *big.Int) AddBalance(common.Address, *big.Int) From b8c77375adcc90058d410b67347c6d33f18c2c3b Mon Sep 17 00:00:00 2001 From: Matthew Campbell Date: Sun, 9 Dec 2018 00:54:08 +0700 Subject: [PATCH 3/3] Allow rawdump to be exposed --- core/vm/interface.go | 1 - 1 file changed, 1 deletion(-) diff --git a/core/vm/interface.go b/core/vm/interface.go index d37a04ad02b8..d6d4e917d647 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -28,7 +28,6 @@ import ( type StateDB interface { CreateAccount(common.Address) - GetAccounts() []common.Address RawDump() state.Dump SubBalance(common.Address, *big.Int)