From 8c7b764d47ce55ba6abe437ae8232cc537c4e0d9 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 9 Jan 2015 21:18:34 +0100 Subject: updated tests --- vm/stack.go | 17 +---------------- vm/vm_debug.go | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) (limited to 'vm') diff --git a/vm/stack.go b/vm/stack.go index e31f3eb57..a9aafdb9d 100644 --- a/vm/stack.go +++ b/vm/stack.go @@ -2,7 +2,6 @@ package vm import ( "fmt" - "math" "math/big" ) @@ -141,21 +140,7 @@ func (m *Memory) Resize(size uint64) { } } -func (m *Memory) Get(offset, size int64) []byte { - if size == 0 { - return nil - } - - if len(m.store) > int(offset) { - end := int(math.Min(float64(len(m.store)), float64(offset+size))) - - return m.store[offset:end] - } - - return nil -} - -func (self *Memory) Geti(offset, size int64) (cpy []byte) { +func (self *Memory) Get(offset, size int64) (cpy []byte) { if size == 0 { return nil } diff --git a/vm/vm_debug.go b/vm/vm_debug.go index 92e4154e4..04ba8190d 100644 --- a/vm/vm_debug.go +++ b/vm/vm_debug.go @@ -583,7 +583,7 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price * topics[i] = ethutil.LeftPadBytes(stack.Pop().Bytes(), 32) } - data := mem.Geti(mStart.Int64(), mSize.Int64()) + data := mem.Get(mStart.Int64(), mSize.Int64()) log := &Log{context.Address(), topics, data} self.env.AddLog(log) -- cgit v1.2.3