diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-21 06:10:36 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-21 06:10:36 +0800 |
commit | 8f69c2ac45a1109985ad8cc3b98dcd2e315dc8e9 (patch) | |
tree | 04660f1b9068d72cd7eee5cd76c5438d1c9f8c30 /ethchain/contract.go | |
parent | 504d356232e11e98a19f9f2b6fd5ee61a5226b1d (diff) | |
download | go-tangerine-8f69c2ac45a1109985ad8cc3b98dcd2e315dc8e9.tar go-tangerine-8f69c2ac45a1109985ad8cc3b98dcd2e315dc8e9.tar.gz go-tangerine-8f69c2ac45a1109985ad8cc3b98dcd2e315dc8e9.tar.bz2 go-tangerine-8f69c2ac45a1109985ad8cc3b98dcd2e315dc8e9.tar.lz go-tangerine-8f69c2ac45a1109985ad8cc3b98dcd2e315dc8e9.tar.xz go-tangerine-8f69c2ac45a1109985ad8cc3b98dcd2e315dc8e9.tar.zst go-tangerine-8f69c2ac45a1109985ad8cc3b98dcd2e315dc8e9.zip |
Added contract addr acessors
Diffstat (limited to 'ethchain/contract.go')
-rw-r--r-- | ethchain/contract.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ethchain/contract.go b/ethchain/contract.go index 70189593b..5dccb8728 100644 --- a/ethchain/contract.go +++ b/ethchain/contract.go @@ -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 } |