From d65b4cd0dd49975410374801fae3ece7d7e087b3 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sun, 2 Mar 2014 20:42:05 +0100 Subject: Updated block to use state instead of trie directly --- ethchain/state.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ethchain/state.go') diff --git a/ethchain/state.go b/ethchain/state.go index 1a18ea1d7..cff192b54 100644 --- a/ethchain/state.go +++ b/ethchain/state.go @@ -13,6 +13,10 @@ func NewState(trie *ethutil.Trie) *State { return &State{trie: trie} } +func (s *State) Reset() { + s.trie.Undo() +} + func (s *State) GetContract(addr []byte) *Contract { data := s.trie.Get(string(addr)) if data == "" { @@ -54,3 +58,7 @@ func (s *State) GetAccount(addr []byte) (account *Address) { func (s *State) UpdateAccount(addr []byte, account *Address) { s.trie.Update(string(addr), string(account.RlpEncode())) } + +func (s *State) Cmp(other *State) bool { + return s.trie.Cmp(other.trie) +} -- cgit v1.2.3