git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: b09ae9b9bed2be0a68c73659b7f9b4befa8a5c8b

Files: b09ae9b9bed2be0a68c73659b7f9b4befa8a5c8b / tests / interface / basic_gas_ops.wast

707 bytesRaw
1;; starts with 1000 gas
2(module
3 (import $useGas "ethereum" "useGas" (param i32))
4 (import $gas "ethereum" "gas" (result i32))
5
6 (export "test" 0)
7 (func
8 ;; test adding gas
9 (block
10 (call_import $useGas (i32.const 1))
11 (if (i32.eq (call_import $gas) (i32.const 999))
12 (return)
13 )
14 (unreachable)
15 )
16 (block
17 (call_import $useGas (i32.const 1))
18 (if (i32.eq (call_import $gas) (i32.const 998))
19 (return)
20 )
21 (unreachable)
22 )
23 ;; should disregard negative values
24 (block
25 (call_import $useGas (i32.const -1))
26 (if (i32.eq (call_import $gas) (i32.const 998))
27 (return)
28 )
29 (unreachable)
30 )
31 )
32)
33

Built with git-ssb-web