Added a query interface for world state

This commit is contained in:
obscuren 2015-01-02 12:07:54 +01:00
parent 0972bdeda2
commit 477a6d426c

View File

@ -16,6 +16,10 @@ import (
var chainlogger = logger.NewLogger("CHAIN") var chainlogger = logger.NewLogger("CHAIN")
type StateQuery interface {
GetAccount(addr []byte) *state.StateObject
}
/* /*
func AddTestNetFunds(block *types.Block) { func AddTestNetFunds(block *types.Block) {
for _, addr := range []string{ for _, addr := range []string{
@ -376,3 +380,8 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
return nil return nil
} }
// Satisfy state query interface
func (self *ChainManager) GetAccount(addr []byte) *state.StateObject {
return self.State().GetAccount(addr)
}