aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-02 19:07:54 +0800
committerobscuren <geffobscura@gmail.com>2015-01-02 19:07:54 +0800
commit477a6d426cd798f036df85b15d73935060503a48 (patch)
treeaf1babc387a0ae6477c8fe2b5ed4339ed6161a8b
parent0972bdeda238cfb64de7e639ebf9849bc81bb2bb (diff)
downloaddexon-477a6d426cd798f036df85b15d73935060503a48.tar
dexon-477a6d426cd798f036df85b15d73935060503a48.tar.gz
dexon-477a6d426cd798f036df85b15d73935060503a48.tar.bz2
dexon-477a6d426cd798f036df85b15d73935060503a48.tar.lz
dexon-477a6d426cd798f036df85b15d73935060503a48.tar.xz
dexon-477a6d426cd798f036df85b15d73935060503a48.tar.zst
dexon-477a6d426cd798f036df85b15d73935060503a48.zip
Added a query interface for world state
-rw-r--r--core/chain_manager.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 780242f56..d623c170b 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -16,6 +16,10 @@ import (
var chainlogger = logger.NewLogger("CHAIN")
+type StateQuery interface {
+ GetAccount(addr []byte) *state.StateObject
+}
+
/*
func AddTestNetFunds(block *types.Block) {
for _, addr := range []string{
@@ -376,3 +380,8 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
return nil
}
+
+// Satisfy state query interface
+func (self *ChainManager) GetAccount(addr []byte) *state.StateObject {
+ return self.State().GetAccount(addr)
+}