State snapshotting

This commit is contained in:
obscuren
2014-05-26 00:09:38 +02:00
parent 81ef40010f
commit 3ebd7f1166
5 changed files with 81 additions and 9 deletions

View File

@ -81,12 +81,17 @@ func (c *StateObject) SetStorage(num *big.Int, val *ethutil.Value) {
c.SetAddr(addr, val)
}
func (c *StateObject) GetMem(num *big.Int) *ethutil.Value {
func (c *StateObject) GetStorage(num *big.Int) *ethutil.Value {
nb := ethutil.BigToBytes(num, 256)
return c.Addr(nb)
}
/* DEPRECATED */
func (c *StateObject) GetMem(num *big.Int) *ethutil.Value {
return c.GetStorage(num)
}
func (c *StateObject) GetInstr(pc *big.Int) *ethutil.Value {
if int64(len(c.script)-1) < pc.Int64() {
return ethutil.NewValue(0)