git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit fad5165be334ea1479fd4d88bd0fa7779765140f

Tests: test CALL via the identity precompile

Alex Beregszaszi committed on 8/28/2016, 11:54:30 AM
Parent: 3e76d33a7cef629ec34b59cf2d48fb0561fe2bc7

Files changed

tests/interface/call.jsonadded
tests/interface/call.wastadded
tests/interface/call.jsonView
@@ -1,0 +1,3 @@
1+{
2+ "address": "0x5d48c1018904a172886829bbbd9c6f4a2d06c47b"
3+}
tests/interface/call.wastView
@@ -1,0 +1,25 @@
1+;; starts with an address of 5d48c1018904a172886829bbbd9c6f4a2d06c47b
2+(module
3+ (memory 1)
4+
5+ (import $call "ethereum" "call" (param i32 i32 i32 i32 i32 i32 i32) (result i32))
6+ (export "test" 0)
7+ (export "a" memory)
8+ (func
9+ (block
10+ ;; Memory layout:
11+ ;; 0 - 20 bytes: address (4)
12+ ;; 20 - 52 bytes: value (0)
13+ ;; 52 - 56 bytes: data (0x42004200)
14+ ;; 56 - 60 bytes: result
15+ (i32.store (i32.const 0) (i32.const 0x4))
16+ (i32.store (i32.const 52) (i32.const 0x42004200))
17+ (if (i32.eq (call_import $call (i32.const 2000) (i32.const 0) (i32.const 20) (i32.const 52) (i32.const 4) (i32.const 56) (i32.const 4)) (i32.const 0))
18+ (if (i32.eq (i32.load (i32.const 56)) (i32.const 0x42004200))
19+ (return)
20+ )
21+ )
22+ (unreachable)
23+ )
24+ )
25+)

Built with git-ssb-web