updated tests

This commit is contained in:
obscuren
2015-01-12 13:49:47 +01:00
parent 35fe4313d5
commit 00348756bc
8 changed files with 186 additions and 26 deletions

View File

@ -61,6 +61,13 @@ func (c *Context) GetRangeValue(x, size uint64) []byte {
return ethutil.LeftPadBytes(c.Code[x:y], int(size))
}
func (c *Context) GetCode(x, size uint64) []byte {
x = uint64(math.Min(float64(x), float64(len(c.Code))))
y := uint64(math.Min(float64(x+size), float64(len(c.Code))))
return ethutil.RightPadBytes(c.Code[x:y], int(size))
}
func (c *Context) Return(ret []byte) []byte {
// Return the remaining gas to the caller
c.caller.ReturnGas(c.Gas, c.Price)