|
|
|
@ -17,8 +17,6 @@ |
|
|
|
|
package vm |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"fmt" |
|
|
|
|
|
|
|
|
|
"github.com/holiman/uint256" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -68,7 +66,7 @@ func (m *Memory) Resize(size uint64) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Get returns offset + size as a new slice
|
|
|
|
|
// GetCopy returns offset + size as a new slice
|
|
|
|
|
func (m *Memory) GetCopy(offset, size int64) (cpy []byte) { |
|
|
|
|
if size == 0 { |
|
|
|
|
return nil |
|
|
|
@ -106,18 +104,3 @@ func (m *Memory) Len() int { |
|
|
|
|
func (m *Memory) Data() []byte { |
|
|
|
|
return m.store |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Print dumps the content of the memory.
|
|
|
|
|
func (m *Memory) Print() { |
|
|
|
|
fmt.Printf("### mem %d bytes ###\n", len(m.store)) |
|
|
|
|
if len(m.store) > 0 { |
|
|
|
|
addr := 0 |
|
|
|
|
for i := 0; i+32 <= len(m.store); i += 32 { |
|
|
|
|
fmt.Printf("%03d: % x\n", addr, m.store[i:i+32]) |
|
|
|
|
addr++ |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
fmt.Println("-- empty --") |
|
|
|
|
} |
|
|
|
|
fmt.Println("####################") |
|
|
|
|
} |
|
|
|
|