git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: 9224a38130d9646acdb70e89eadcd3de8b626082

Files: 9224a38130d9646acdb70e89eadcd3de8b626082 / tests / interface / basic_gas_ops.wast

515 bytesRaw
1;; starts with 1000 gas
2(module
3 (import "ethereum" "useGas" (func $useGas (param i64)))
4 (import "ethereum" "getGasLeft" (func $gas (result i64)))
5
6 (export "main" (func $main))
7 (func $main
8 ;; test adding gas
9 (block
10 (call $useGas (i64.const 1))
11 (if (i64.eq (call $gas) (i64.const 997))
12 (return)
13 )
14 (unreachable)
15 )
16 (block
17 (call $useGas (i64.const 1))
18 (if (i64.eq (call $gas) (i64.const 996))
19 (return)
20 )
21 (unreachable)
22 )
23 )
24)
25

Built with git-ssb-web