Commit e4301564 authored by Martin Holst Swende's avatar Martin Holst Swende

core/vm : fix testcase for gas calculation

parent bae75652
...@@ -16,24 +16,20 @@ ...@@ -16,24 +16,20 @@
package vm package vm
import ( import "testing"
"math"
"testing"
)
func TestMemoryGasCost(t *testing.T) { func TestMemoryGasCost(t *testing.T) {
size := uint64(math.MaxUint64 - 64) //size := uint64(math.MaxUint64 - 64)
_, err := memoryGasCost(&Memory{}, size) size := uint64(0xffffffffe0)
v, err := memoryGasCost(&Memory{}, size)
if err != nil { if err != nil {
t.Error("didn't expect error:", err) t.Error("didn't expect error:", err)
} }
if v != 36028899963961341 {
_, err = memoryGasCost(&Memory{}, size+32) t.Errorf("Expected: 36028899963961341, got %d", v)
if err != nil {
t.Error("didn't expect error:", err)
} }
_, err = memoryGasCost(&Memory{}, size+33) _, err = memoryGasCost(&Memory{}, size+1)
if err == nil { if err == nil {
t.Error("expected error") t.Error("expected error")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment