Skip to content

Commit

Permalink
core/vm : fix testcase for gas calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Jun 28, 2017
1 parent bae7565 commit e430156
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions core/vm/gas_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,20 @@

package vm

import (
"math"
"testing"
)
import "testing"

func TestMemoryGasCost(t *testing.T) {
size := uint64(math.MaxUint64 - 64)
_, err := memoryGasCost(&Memory{}, size)
//size := uint64(math.MaxUint64 - 64)
size := uint64(0xffffffffe0)
v, err := memoryGasCost(&Memory{}, size)
if err != nil {
t.Error("didn't expect error:", err)
}

_, err = memoryGasCost(&Memory{}, size+32)
if err != nil {
t.Error("didn't expect error:", err)
if v != 36028899963961341 {
t.Errorf("Expected: 36028899963961341, got %d", v)
}

_, err = memoryGasCost(&Memory{}, size+33)
_, err = memoryGasCost(&Memory{}, size+1)
if err == nil {
t.Error("expected error")
}
Expand Down

0 comments on commit e430156

Please sign in to comment.