aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/gas_table_test.go
blob: cceb8928591618a29377a6556a9cdd6ec1c7296a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package vm

import (
    "math"
    "testing"
)

func TestMemoryGasCost(t *testing.T) {
    size := uint64(math.MaxUint64 - 64)
    _, 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)
    }

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