From 378c4ed0512aa13136309ee3430fb5779da97b13 Mon Sep 17 00:00:00 2001 From: NikVolf Date: Thu, 4 May 2017 10:38:04 +0300 Subject: [PATCH] add wast text --- samples/empty_contract.rs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/samples/empty_contract.rs b/samples/empty_contract.rs index a8ab78b..ed0cbeb 100644 --- a/samples/empty_contract.rs +++ b/samples/empty_contract.rs @@ -9,4 +9,28 @@ extern {} #[no_mangle] pub fn call() { -} \ No newline at end of file +} + +/* This produces the following code (after injecting gas counter & optimizing) + +(module + (type (;0;) (func (result i32))) + (type (;1;) (func)) + (type (;2;) (func (param i32))) + (type (;3;) (func (param i32 i32 i64 i32 i32) (result i32))) + (type (;4;) (func (param i32 i32 i32 i32 i32 i32) (result i32))) + (type (;5;) (func (param i32) (result i32))) + (type (;6;) (func (param i32 i32))) + (type (;7;) (func (param i32 i32 i32 i32 i32 i32) (result i32))) + (type (;8;) (func (param i32))) + (import "env" "memory" (memory (;0;) 256 256)) + (import "env" "table" (table (;0;) 0 0 anyfunc)) + (import "env" "gas" (func (;0;) (type 8))) + (func (;1;) (type 1) + i32.const 2 + call 0 + nop) + (export "_call" (func 1)) + (data (i32.const 1212) "\1c\05")) + +*/ \ No newline at end of file