mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 21:17:16 +00:00
25 lines
419 B
Go
25 lines
419 B
Go
|
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")
|
||
|
}
|
||
|
}
|