mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2025-01-11 13:10:04 +00:00
Added contract addr acessors
This commit is contained in:
parent
504d356232
commit
8f69c2ac45
@ -30,6 +30,14 @@ func (c *Contract) RlpDecode(data []byte) {
|
||||
c.state = ethutil.NewTrie(ethutil.Config.Db, decoder.Get(2).Interface())
|
||||
}
|
||||
|
||||
func (c *Contract) Addr(addr []byte) *ethutil.Value {
|
||||
return ethutil.NewValueFromBytes([]byte(c.state.Get(string(addr))))
|
||||
}
|
||||
|
||||
func (c *Contract) SetAddr(addr []byte, value interface{}) {
|
||||
c.state.Update(string(addr), string(ethutil.NewValue(value).Encode()))
|
||||
}
|
||||
|
||||
func (c *Contract) State() *ethutil.Trie {
|
||||
return c.state
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user