aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2017-06-28 16:47:07 +0800
committerMartin Holst Swende <martin@swende.se>2017-06-28 16:47:07 +0800
commite4301564c2af0b4f084a3bcf8ddcec5e84ac4ead (patch)
tree986e71c51b078f25b939c420300cbfd1039b55b4 /core
parentbae7565231376bbd23474e2e91c99a21542ef47a (diff)
downloadgo-tangerine-e4301564c2af0b4f084a3bcf8ddcec5e84ac4ead.tar.gz
go-tangerine-e4301564c2af0b4f084a3bcf8ddcec5e84ac4ead.tar.zst
go-tangerine-e4301564c2af0b4f084a3bcf8ddcec5e84ac4ead.zip
core/vm : fix testcase for gas calculation
Diffstat (limited to 'core')
-rw-r--r--core/vm/gas_table_test.go18
1 files changed, 7 insertions, 11 deletions
diff --git a/core/vm/gas_table_test.go b/core/vm/gas_table_test.go
index 1ee909e92..1b91aee56 100644
--- a/core/vm/gas_table_test.go
+++ b/core/vm/gas_table_test.go
@@ -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")
}