diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir index 0aa319cf..fe088973 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir @@ -2565,6 +2565,24 @@ (ret)) ) + (func (export #dummy) + (block 0 + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #__wasm_call_dtors) + (block 0 + (call #dummy) + (call #dummy) + (br (block 1))) + + (block 1 + (ret)) + ) + (func (export #alloc::alloc::handle_alloc_error) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) @@ -2617,6 +2635,128 @@ (ret)) ) + (func (export #get_wallet_magic_number.command_export) (result felt) + (block 0 + (let (v1 felt) (call #get_wallet_magic_number)) + (call #__wasm_call_dtors) + (br (block 1 v1))) + + (block 1 (param v0 felt) + (ret v0)) + ) + + (func (export #test_add_asset.command_export) (result felt) + (block 0 + (let (v1 felt) (call #test_add_asset)) + (call #__wasm_call_dtors) + (br (block 1 v1))) + + (block 1 (param v0 felt) + (ret v0)) + ) + + (func (export #test_felt_ops_smoke.command_export) + (param felt) (param felt) (result felt) + (block 0 (param v0 felt) (param v1 felt) + (let (v3 felt) (call #test_felt_ops_smoke v0 v1)) + (call #__wasm_call_dtors) + (br (block 1 v3))) + + (block 1 (param v2 felt) + (ret v2)) + ) + + (func (export #note_script.command_export) (result felt) + (block 0 + (let (v1 felt) (call #note_script)) + (call #__wasm_call_dtors) + (br (block 1 v1))) + + (block 1 (param v0 felt) + (ret v0)) + ) + + (func (export #test_blake3_hash_1to1.command_export) + (param i32) (param i32) + (block 0 (param v0 i32) (param v1 i32) + (call #test_blake3_hash_1to1 v0 v1) + (call #__wasm_call_dtors) + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #test_blake3_hash_2to1.command_export) + (param i32) (param i32) (param i32) + (block 0 (param v0 i32) (param v1 i32) (param v2 i32) + (call #test_blake3_hash_2to1 v0 v1 v2) + (call #__wasm_call_dtors) + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #test_rpo_falcon512_verify.command_export) + (param i32) (param i32) + (block 0 (param v0 i32) (param v1 i32) + (call #test_rpo_falcon512_verify v0 v1) + (call #__wasm_call_dtors) + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #test_pipe_words_to_memory.command_export) + (param i32) (param felt) + (block 0 (param v0 i32) (param v1 felt) + (call #test_pipe_words_to_memory v0 v1) + (call #__wasm_call_dtors) + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #test_pipe_double_words_to_memory.command_export) + (param i32) (param felt) + (block 0 (param v0 i32) (param v1 felt) + (call #test_pipe_double_words_to_memory v0 v1) + (call #__wasm_call_dtors) + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #test_remove_asset.command_export) + (param i32) (result felt) + (block 0 (param v0 i32) + (let (v2 felt) (call #test_remove_asset v0)) + (call #__wasm_call_dtors) + (br (block 1 v2))) + + (block 1 (param v1 felt) + (ret v1)) + ) + + (func (export #test_create_note.command_export) + (param i32) (param felt) (param felt) (param i32) (result felt) + (block 0 + (param v0 i32) + (param v1 felt) + (param v2 felt) + (param v3 i32) + (let (v5 felt) (call #test_create_note v0 v1 v2 v3)) + (call #__wasm_call_dtors) + (br (block 1 v5))) + + (block 1 (param v4 felt) + (ret v4)) + ) + ;; Imports (func (import #miden:prelude/std_crypto_dsa #rpo_falcon512_verify) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt)) diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.masm b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.masm new file mode 100644 index 00000000..856d29c0 --- /dev/null +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.masm @@ -0,0 +1,3 @@ +mod miden_sdk_account_test + + diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat index 2495d059..5ca0d6b5 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat @@ -1855,19 +1855,24 @@ i32.add global.set $__stack_pointer ) - (func $alloc::alloc::handle_alloc_error (;62;) (type 20) (param i32 i32) + (func $dummy (;62;) (type 26)) + (func $__wasm_call_dtors (;63;) (type 26) + call $dummy + call $dummy + ) + (func $alloc::alloc::handle_alloc_error (;64;) (type 20) (param i32 i32) unreachable unreachable ) - (func $alloc::raw_vec::capacity_overflow (;63;) (type 26) + (func $alloc::raw_vec::capacity_overflow (;65;) (type 26) unreachable unreachable ) - (func $core::slice::::copy_from_slice::len_mismatch_fail (;64;) (type 19) (param i32 i32 i32) + (func $core::slice::::copy_from_slice::len_mismatch_fail (;66;) (type 19) (param i32 i32 i32) unreachable unreachable ) - (func $core::slice::::copy_from_slice (;65;) (type 27) (param i32 i32 i32 i32 i32) + (func $core::slice::::copy_from_slice (;67;) (type 27) (param i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 local.get 3 @@ -1885,20 +1890,82 @@ call $core::slice::::copy_from_slice::len_mismatch_fail unreachable ) + (func $get_wallet_magic_number.command_export (;68;) (type 11) (result f64) + call $get_wallet_magic_number + call $__wasm_call_dtors + ) + (func $test_add_asset.command_export (;69;) (type 11) (result f64) + call $test_add_asset + call $__wasm_call_dtors + ) + (func $test_felt_ops_smoke.command_export (;70;) (type 1) (param f64 f64) (result f64) + local.get 0 + local.get 1 + call $test_felt_ops_smoke + call $__wasm_call_dtors + ) + (func $note_script.command_export (;71;) (type 11) (result f64) + call $note_script + call $__wasm_call_dtors + ) + (func $test_blake3_hash_1to1.command_export (;72;) (type 20) (param i32 i32) + local.get 0 + local.get 1 + call $test_blake3_hash_1to1 + call $__wasm_call_dtors + ) + (func $test_blake3_hash_2to1.command_export (;73;) (type 19) (param i32 i32 i32) + local.get 0 + local.get 1 + local.get 2 + call $test_blake3_hash_2to1 + call $__wasm_call_dtors + ) + (func $test_rpo_falcon512_verify.command_export (;74;) (type 20) (param i32 i32) + local.get 0 + local.get 1 + call $test_rpo_falcon512_verify + call $__wasm_call_dtors + ) + (func $test_pipe_words_to_memory.command_export (;75;) (type 21) (param i32 f64) + local.get 0 + local.get 1 + call $test_pipe_words_to_memory + call $__wasm_call_dtors + ) + (func $test_pipe_double_words_to_memory.command_export (;76;) (type 21) (param i32 f64) + local.get 0 + local.get 1 + call $test_pipe_double_words_to_memory + call $__wasm_call_dtors + ) + (func $test_remove_asset.command_export (;77;) (type 22) (param i32) (result f64) + local.get 0 + call $test_remove_asset + call $__wasm_call_dtors + ) + (func $test_create_note.command_export (;78;) (type 23) (param i32 f64 f64 i32) (result f64) + local.get 0 + local.get 1 + local.get 2 + local.get 3 + call $test_create_note + call $__wasm_call_dtors + ) (table (;0;) 1 1 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) - (export "get_wallet_magic_number" (func $get_wallet_magic_number)) - (export "test_add_asset" (func $test_add_asset)) - (export "test_felt_ops_smoke" (func $test_felt_ops_smoke)) - (export "note_script" (func $note_script)) - (export "test_blake3_hash_1to1" (func $test_blake3_hash_1to1)) - (export "test_blake3_hash_2to1" (func $test_blake3_hash_2to1)) - (export "test_rpo_falcon512_verify" (func $test_rpo_falcon512_verify)) - (export "test_pipe_words_to_memory" (func $test_pipe_words_to_memory)) - (export "test_pipe_double_words_to_memory" (func $test_pipe_double_words_to_memory)) - (export "test_remove_asset" (func $test_remove_asset)) - (export "test_create_note" (func $test_create_note)) + (export "get_wallet_magic_number" (func $get_wallet_magic_number.command_export)) + (export "test_add_asset" (func $test_add_asset.command_export)) + (export "test_felt_ops_smoke" (func $test_felt_ops_smoke.command_export)) + (export "note_script" (func $note_script.command_export)) + (export "test_blake3_hash_1to1" (func $test_blake3_hash_1to1.command_export)) + (export "test_blake3_hash_2to1" (func $test_blake3_hash_2to1.command_export)) + (export "test_rpo_falcon512_verify" (func $test_rpo_falcon512_verify.command_export)) + (export "test_pipe_words_to_memory" (func $test_pipe_words_to_memory.command_export)) + (export "test_pipe_double_words_to_memory" (func $test_pipe_double_words_to_memory.command_export)) + (export "test_remove_asset" (func $test_remove_asset.command_export)) + (export "test_create_note" (func $test_create_note.command_export)) (data $.rodata (;0;) (i32.const 1048576) "~/sdk/prelude/src/stdlib/crypto/hashes.rs\00\00\00\00\00\10\00)\00\00\00\8b\00\00\00(\00\00\00\00\00\10\00)\00\00\00\d1\00\00\00(\00\00\00") ) \ No newline at end of file diff --git a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir new file mode 100644 index 00000000..0916626b --- /dev/null +++ b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir @@ -0,0 +1,279 @@ +(component + ;; Component Imports + (lower ((digest 0x0000000000000000000000000000000000000000000000000000000000000000) (type (func (abi canon) (param felt) (param felt) (param felt) (param felt) (result felt felt felt felt)))) (#miden:tx_kernel/account #add_asset) + (lower ((digest 0x0000000000000000000000000000000000000000000000000000000000000000) (type (func (abi canon) (param felt) (param felt) (param felt) (param felt) (result felt felt felt felt)))) (#miden:tx_kernel/account #remove_asset) + (lower ((digest 0x0000000000000000000000000000000000000000000000000000000000000000) (type (func (abi canon) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (result felt)))) (#miden:tx_kernel/tx #create_note) + + ;; Modules + (module #rust_sdk_basic_wallet + ;; Constants + (const (id 0) 0x00100000) + + ;; Global Variables + (global (export #__stack_pointer) (id 0) (type i32) (const 0)) + + ;; Functions + (func (export #receive_asset) (param i32) + (block 0 (param v0 i32) + (let (v1 i32) (const.i32 0)) + (let (v2 i32) (global.load i32 (global.symbol #__stack_pointer))) + (let (v3 i32) (const.i32 32)) + (let (v4 i32) (sub.wrapping v2 v3)) + (let (v5 (ptr i32)) (global.symbol #__stack_pointer)) + (store v5 v4) + (call #miden_sdk_tx_kernel::add_asset v4 v0) + (let (v6 i32) (const.i32 32)) + (let (v7 i32) (add.wrapping v4 v6)) + (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) + (store v8 v7) + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #send_asset) + (param i32) (param felt) (param felt) (param i32) + (block 0 + (param v0 i32) + (param v1 felt) + (param v2 felt) + (param v3 i32) + (let (v4 i32) (const.i32 0)) + (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) + (let (v6 i32) (const.i32 32)) + (let (v7 i32) (sub.wrapping v5 v6)) + (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) + (store v8 v7) + (call #miden_sdk_tx_kernel::remove_asset v7 v0) + (let (v9 felt) (call #miden_sdk_tx_kernel::create_note v7 v1 v2 v3)) + (let (v10 i32) (const.i32 32)) + (let (v11 i32) (add.wrapping v7 v10)) + (let (v12 (ptr i32)) (global.symbol #__stack_pointer)) + (store v12 v11) + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #miden_sdk_tx_kernel::add_asset) + (param i32) (param i32) + (block 0 (param v0 i32) (param v1 i32) + (let (v2 i32) (const.i32 0)) + (let (v3 i32) (global.load i32 (global.symbol #__stack_pointer))) + (let (v4 i32) (const.i32 32)) + (let (v5 i32) (sub.wrapping v3 v4)) + (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) + (store v6 v5) + (let (v7 u32) (cast v1)) + (let (v8 (ptr felt)) (inttoptr v7)) + (let (v9 felt) (load v8)) + (let (v10 u32) (cast v1)) + (let (v11 u32) (add.checked v10 8)) + (let (v12 (ptr felt)) (inttoptr v11)) + (let (v13 felt) (load v12)) + (let (v14 u32) (cast v1)) + (let (v15 u32) (add.checked v14 16)) + (let (v16 (ptr felt)) (inttoptr v15)) + (let (v17 felt) (load v16)) + (let (v18 u32) (cast v1)) + (let (v19 u32) (add.checked v18 24)) + (let (v20 (ptr felt)) (inttoptr v19)) + (let (v21 felt) (load v20)) + (let [(v22 felt) (v23 felt) (v24 felt) (v25 felt)] (call (#miden:tx_kernel/account #add_asset) v9 v13 v17 v21)) + (let (v26 u32) (cast v5)) + (let (v27 (ptr felt)) (inttoptr v26)) + (store v27 v22) + (let (v28 u32) (add.checked v26 8)) + (let (v29 (ptr felt)) (inttoptr v28)) + (store v29 v23) + (let (v30 u32) (add.checked v26 16)) + (let (v31 (ptr felt)) (inttoptr v30)) + (store v31 v24) + (let (v32 u32) (add.checked v26 24)) + (let (v33 (ptr felt)) (inttoptr v32)) + (store v33 v25) + (let (v34 i32) (const.i32 24)) + (let (v35 i32) (add.wrapping v0 v34)) + (let (v36 i32) (const.i32 24)) + (let (v37 i32) (add.wrapping v5 v36)) + (let (v38 u32) (cast v37)) + (let (v39 (ptr i64)) (inttoptr v38)) + (let (v40 i64) (load v39)) + (let (v41 u32) (cast v35)) + (let (v42 (ptr i64)) (inttoptr v41)) + (store v42 v40) + (let (v43 i32) (const.i32 16)) + (let (v44 i32) (add.wrapping v0 v43)) + (let (v45 i32) (const.i32 16)) + (let (v46 i32) (add.wrapping v5 v45)) + (let (v47 u32) (cast v46)) + (let (v48 (ptr i64)) (inttoptr v47)) + (let (v49 i64) (load v48)) + (let (v50 u32) (cast v44)) + (let (v51 (ptr i64)) (inttoptr v50)) + (store v51 v49) + (let (v52 i32) (const.i32 8)) + (let (v53 i32) (add.wrapping v0 v52)) + (let (v54 i32) (const.i32 8)) + (let (v55 i32) (add.wrapping v5 v54)) + (let (v56 u32) (cast v55)) + (let (v57 (ptr i64)) (inttoptr v56)) + (let (v58 i64) (load v57)) + (let (v59 u32) (cast v53)) + (let (v60 (ptr i64)) (inttoptr v59)) + (store v60 v58) + (let (v61 u32) (cast v5)) + (let (v62 (ptr i64)) (inttoptr v61)) + (let (v63 i64) (load v62)) + (let (v64 u32) (cast v0)) + (let (v65 (ptr i64)) (inttoptr v64)) + (store v65 v63) + (let (v66 i32) (const.i32 32)) + (let (v67 i32) (add.wrapping v5 v66)) + (let (v68 (ptr i32)) (global.symbol #__stack_pointer)) + (store v68 v67) + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #miden_sdk_tx_kernel::remove_asset) + (param i32) (param i32) + (block 0 (param v0 i32) (param v1 i32) + (let (v2 i32) (const.i32 0)) + (let (v3 i32) (global.load i32 (global.symbol #__stack_pointer))) + (let (v4 i32) (const.i32 32)) + (let (v5 i32) (sub.wrapping v3 v4)) + (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) + (store v6 v5) + (let (v7 u32) (cast v1)) + (let (v8 (ptr felt)) (inttoptr v7)) + (let (v9 felt) (load v8)) + (let (v10 u32) (cast v1)) + (let (v11 u32) (add.checked v10 8)) + (let (v12 (ptr felt)) (inttoptr v11)) + (let (v13 felt) (load v12)) + (let (v14 u32) (cast v1)) + (let (v15 u32) (add.checked v14 16)) + (let (v16 (ptr felt)) (inttoptr v15)) + (let (v17 felt) (load v16)) + (let (v18 u32) (cast v1)) + (let (v19 u32) (add.checked v18 24)) + (let (v20 (ptr felt)) (inttoptr v19)) + (let (v21 felt) (load v20)) + (let [(v22 felt) (v23 felt) (v24 felt) (v25 felt)] (call (#miden:tx_kernel/account #remove_asset) v9 v13 v17 v21)) + (let (v26 u32) (cast v5)) + (let (v27 (ptr felt)) (inttoptr v26)) + (store v27 v22) + (let (v28 u32) (add.checked v26 8)) + (let (v29 (ptr felt)) (inttoptr v28)) + (store v29 v23) + (let (v30 u32) (add.checked v26 16)) + (let (v31 (ptr felt)) (inttoptr v30)) + (store v31 v24) + (let (v32 u32) (add.checked v26 24)) + (let (v33 (ptr felt)) (inttoptr v32)) + (store v33 v25) + (let (v34 i32) (const.i32 24)) + (let (v35 i32) (add.wrapping v0 v34)) + (let (v36 i32) (const.i32 24)) + (let (v37 i32) (add.wrapping v5 v36)) + (let (v38 u32) (cast v37)) + (let (v39 (ptr i64)) (inttoptr v38)) + (let (v40 i64) (load v39)) + (let (v41 u32) (cast v35)) + (let (v42 (ptr i64)) (inttoptr v41)) + (store v42 v40) + (let (v43 i32) (const.i32 16)) + (let (v44 i32) (add.wrapping v0 v43)) + (let (v45 i32) (const.i32 16)) + (let (v46 i32) (add.wrapping v5 v45)) + (let (v47 u32) (cast v46)) + (let (v48 (ptr i64)) (inttoptr v47)) + (let (v49 i64) (load v48)) + (let (v50 u32) (cast v44)) + (let (v51 (ptr i64)) (inttoptr v50)) + (store v51 v49) + (let (v52 i32) (const.i32 8)) + (let (v53 i32) (add.wrapping v0 v52)) + (let (v54 i32) (const.i32 8)) + (let (v55 i32) (add.wrapping v5 v54)) + (let (v56 u32) (cast v55)) + (let (v57 (ptr i64)) (inttoptr v56)) + (let (v58 i64) (load v57)) + (let (v59 u32) (cast v53)) + (let (v60 (ptr i64)) (inttoptr v59)) + (store v60 v58) + (let (v61 u32) (cast v5)) + (let (v62 (ptr i64)) (inttoptr v61)) + (let (v63 i64) (load v62)) + (let (v64 u32) (cast v0)) + (let (v65 (ptr i64)) (inttoptr v64)) + (store v65 v63) + (let (v66 i32) (const.i32 32)) + (let (v67 i32) (add.wrapping v5 v66)) + (let (v68 (ptr i32)) (global.symbol #__stack_pointer)) + (store v68 v67) + (br (block 1))) + + (block 1 + (ret)) + ) + + (func (export #miden_sdk_tx_kernel::create_note) + (param i32) (param felt) (param felt) (param i32) (result felt) + (block 0 + (param v0 i32) + (param v1 felt) + (param v2 felt) + (param v3 i32) + (let (v5 u32) (cast v0)) + (let (v6 (ptr felt)) (inttoptr v5)) + (let (v7 felt) (load v6)) + (let (v8 u32) (cast v0)) + (let (v9 u32) (add.checked v8 8)) + (let (v10 (ptr felt)) (inttoptr v9)) + (let (v11 felt) (load v10)) + (let (v12 u32) (cast v0)) + (let (v13 u32) (add.checked v12 16)) + (let (v14 (ptr felt)) (inttoptr v13)) + (let (v15 felt) (load v14)) + (let (v16 u32) (cast v0)) + (let (v17 u32) (add.checked v16 24)) + (let (v18 (ptr felt)) (inttoptr v17)) + (let (v19 felt) (load v18)) + (let (v20 u32) (cast v3)) + (let (v21 (ptr felt)) (inttoptr v20)) + (let (v22 felt) (load v21)) + (let (v23 u32) (cast v3)) + (let (v24 u32) (add.checked v23 8)) + (let (v25 (ptr felt)) (inttoptr v24)) + (let (v26 felt) (load v25)) + (let (v27 u32) (cast v3)) + (let (v28 u32) (add.checked v27 16)) + (let (v29 (ptr felt)) (inttoptr v28)) + (let (v30 felt) (load v29)) + (let (v31 u32) (cast v3)) + (let (v32 u32) (add.checked v31 24)) + (let (v33 (ptr felt)) (inttoptr v32)) + (let (v34 felt) (load v33)) + (let (v35 felt) (call (#miden:tx_kernel/tx #create_note) v7 v11 v15 v19 v1 v2 v22 v26 v30 v34)) + (br (block 1 v35))) + + (block 1 (param v4 felt) + (ret v4)) + ) + + ;; Imports + (func (import #miden:tx_kernel/account #add_asset) + (param felt) (param felt) (param felt) (param felt) (result felt felt felt felt)) + (func (import #miden:tx_kernel/account #remove_asset) + (param felt) (param felt) (param felt) (param felt) (result felt felt felt felt)) + (func (import #miden:tx_kernel/tx #create_note) + (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (param felt) (result felt)) + ) + +) diff --git a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.masm b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.masm new file mode 100644 index 00000000..69e62dea --- /dev/null +++ b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.masm @@ -0,0 +1,802 @@ +mod rust_sdk_basic_wallet + +use.miden:tx_kernel/account +use.miden:tx_kernel/tx + +export.receive_asset + mem_load.0x00000000 + push.32 + u32wrapping_sub + push.32 + dup.1 + swap.1 + u32wrapping_add + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_sw + dup.0 + swap.1 + swap.2 + swap.1 + exec."_ZN19miden_sdk_tx_kernel9add_asset17h6f4cff304c095ffcE" + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_sw +end + + +export.send_asset + mem_load.0x00000000 + push.32 + u32wrapping_sub + dup.0 + movup.2 + swap.4 + movdn.2 + swap.1 + swap.5 + swap.3 + swap.1 + exec."_ZN19miden_sdk_tx_kernel11create_note17h99477639e0ff4f18E" + push.32 + dup.3 + swap.1 + u32wrapping_add + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_sw + dup.2 + swap.1 + swap.2 + swap.1 + exec."_ZN19miden_sdk_tx_kernel12remove_asset17hf5f373d8386f7b96E" + movup.2 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_sw + dropw +end + + +export."_ZN19miden_sdk_tx_kernel9add_asset17h6f4cff304c095ffcE" + mem_load.0x00000000 + push.32 + u32wrapping_sub + dup.0 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.3 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.24 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + dup.4 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.16 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + dup.5 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + movup.6 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + exec.miden:tx_kernel/account::add_asset + push.32 + dup.6 + swap.1 + u32wrapping_add + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_sw + dup.5 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_dw + dup.8 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_dw + push.8 + dup.6 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_dw + push.8 + dup.9 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_dw + push.16 + dup.6 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_dw + push.16 + dup.9 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_dw + push.24 + dup.6 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_dw + push.24 + movup.9 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_dw + dup.4 + add.24 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_felt + dup.3 + add.16 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_felt + dup.2 + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_felt + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_felt + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_sw +end + + +export."_ZN19miden_sdk_tx_kernel12remove_asset17hf5f373d8386f7b96E" + mem_load.0x00000000 + push.32 + u32wrapping_sub + dup.0 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.3 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.24 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + dup.4 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.16 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + dup.5 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + movup.6 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + exec.miden:tx_kernel/account::remove_asset + push.32 + dup.6 + swap.1 + u32wrapping_add + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_sw + dup.5 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_dw + dup.8 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_dw + push.8 + dup.6 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_dw + push.8 + dup.9 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_dw + push.16 + dup.6 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_dw + push.16 + dup.9 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_dw + push.24 + dup.6 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_dw + push.24 + movup.9 + swap.1 + u32wrapping_add + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_dw + dup.4 + add.24 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_felt + dup.3 + add.16 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_felt + dup.2 + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_felt + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_felt + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::store_sw +end + + +export."_ZN19miden_sdk_tx_kernel11create_note17h99477639e0ff4f18E" + dup.3 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.24 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + dup.4 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.16 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + dup.5 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + movup.6 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + dup.4 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.24 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + dup.5 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.16 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + dup.6 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + movup.7 + dup.0 + push.2147483648 + u32and + eq.2147483648 + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.intrinsics::mem::load_felt + movup.5 + swap.7 + swap.9 + movdn.5 + movup.4 + swap.6 + swap.8 + movdn.4 + exec.miden:tx_kernel/tx::create_note +end + + diff --git a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat new file mode 100644 index 00000000..45e3048a --- /dev/null +++ b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat @@ -0,0 +1,174 @@ +(module $rust_sdk_basic_wallet.wasm + (type (;0;) (func (param f64 f64 f64 f64 i32))) + (type (;1;) (func (param f64 f64 f64 f64 f64 f64 f64 f64 f64 f64) (result f64))) + (type (;2;) (func (param i32))) + (type (;3;) (func (param i32 f64 f64 i32))) + (type (;4;) (func (param i32 i32))) + (type (;5;) (func (param i32 f64 f64 i32) (result f64))) + (import "miden:tx_kernel/account" "add_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_sdk_tx_kernel::externs::extern_account_add_asset (;0;) (type 0))) + (import "miden:tx_kernel/account" "remove_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_sdk_tx_kernel::externs::extern_account_remove_asset (;1;) (type 0))) + (import "miden:tx_kernel/tx" "create_note<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_sdk_tx_kernel::externs::extern_tx_create_note (;2;) (type 1))) + (func $receive_asset (;3;) (type 2) (param i32) + (local i32) + global.get $__stack_pointer + i32.const 32 + i32.sub + local.tee 1 + global.set $__stack_pointer + local.get 1 + local.get 0 + call $miden_sdk_tx_kernel::add_asset + local.get 1 + i32.const 32 + i32.add + global.set $__stack_pointer + ) + (func $send_asset (;4;) (type 3) (param i32 f64 f64 i32) + (local i32) + global.get $__stack_pointer + i32.const 32 + i32.sub + local.tee 4 + global.set $__stack_pointer + local.get 4 + local.get 0 + call $miden_sdk_tx_kernel::remove_asset + local.get 4 + local.get 1 + local.get 2 + local.get 3 + call $miden_sdk_tx_kernel::create_note + drop + local.get 4 + i32.const 32 + i32.add + global.set $__stack_pointer + ) + (func $miden_sdk_tx_kernel::add_asset (;5;) (type 4) (param i32 i32) + (local i32) + global.get $__stack_pointer + i32.const 32 + i32.sub + local.tee 2 + global.set $__stack_pointer + local.get 1 + f64.load + local.get 1 + f64.load offset=8 + local.get 1 + f64.load offset=16 + local.get 1 + f64.load offset=24 + local.get 2 + call $miden_sdk_tx_kernel::externs::extern_account_add_asset + local.get 0 + i32.const 24 + i32.add + local.get 2 + i32.const 24 + i32.add + i64.load + i64.store + local.get 0 + i32.const 16 + i32.add + local.get 2 + i32.const 16 + i32.add + i64.load + i64.store + local.get 0 + i32.const 8 + i32.add + local.get 2 + i32.const 8 + i32.add + i64.load + i64.store + local.get 0 + local.get 2 + i64.load + i64.store + local.get 2 + i32.const 32 + i32.add + global.set $__stack_pointer + ) + (func $miden_sdk_tx_kernel::remove_asset (;6;) (type 4) (param i32 i32) + (local i32) + global.get $__stack_pointer + i32.const 32 + i32.sub + local.tee 2 + global.set $__stack_pointer + local.get 1 + f64.load + local.get 1 + f64.load offset=8 + local.get 1 + f64.load offset=16 + local.get 1 + f64.load offset=24 + local.get 2 + call $miden_sdk_tx_kernel::externs::extern_account_remove_asset + local.get 0 + i32.const 24 + i32.add + local.get 2 + i32.const 24 + i32.add + i64.load + i64.store + local.get 0 + i32.const 16 + i32.add + local.get 2 + i32.const 16 + i32.add + i64.load + i64.store + local.get 0 + i32.const 8 + i32.add + local.get 2 + i32.const 8 + i32.add + i64.load + i64.store + local.get 0 + local.get 2 + i64.load + i64.store + local.get 2 + i32.const 32 + i32.add + global.set $__stack_pointer + ) + (func $miden_sdk_tx_kernel::create_note (;7;) (type 5) (param i32 f64 f64 i32) (result f64) + local.get 0 + f64.load + local.get 0 + f64.load offset=8 + local.get 0 + f64.load offset=16 + local.get 0 + f64.load offset=24 + local.get 1 + local.get 2 + local.get 3 + f64.load + local.get 3 + f64.load offset=8 + local.get 3 + f64.load offset=16 + local.get 3 + f64.load offset=24 + call $miden_sdk_tx_kernel::externs::extern_tx_create_note + ) + (table (;0;) 1 1 funcref) + (memory (;0;) 16) + (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) + (export "memory" (memory 0)) + (export "receive_asset" (func $receive_asset)) + (export "send_asset" (func $send_asset)) +) \ No newline at end of file diff --git a/tests/integration/src/cargo_proj/mod.rs b/tests/integration/src/cargo_proj/mod.rs index 12853e47..ff46ec43 100644 --- a/tests/integration/src/cargo_proj/mod.rs +++ b/tests/integration/src/cargo_proj/mod.rs @@ -363,7 +363,7 @@ pub fn basic_manifest(name: &str, version: &str) -> String { name = "{}" version = "{}" authors = [] - edition = "2015" + edition = "2021" "#, name, version ) @@ -377,7 +377,7 @@ pub fn basic_bin_manifest(name: &str) -> String { name = "{}" version = "0.5.0" authors = ["wycats@example.com"] - edition = "2015" + edition = "2021" [[bin]] @@ -395,7 +395,7 @@ pub fn basic_lib_manifest(name: &str) -> String { name = "{}" version = "0.5.0" authors = ["wycats@example.com"] - edition = "2015" + edition = "2021" [lib] diff --git a/tests/integration/src/compiler_test.rs b/tests/integration/src/compiler_test.rs index a3664b58..519fad89 100644 --- a/tests/integration/src/compiler_test.rs +++ b/tests/integration/src/compiler_test.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use core::panic; use std::{ fs, @@ -356,10 +358,7 @@ impl CompilerTest { /// Set the Rust source code to compile with `miden-prelude` (stdlib + intrinsics) pub fn rust_fn_body_with_prelude(name: &str, rust_source: &str, is_build_std: bool) -> Self { - let cwd = std::env::current_dir().unwrap(); - let miden_prelude_path = - cwd.parent().unwrap().parent().unwrap().join("sdk").join("prelude"); - let miden_prelude_path_str = miden_prelude_path.to_str().unwrap(); + let miden_prelude_path_str = prelude_crate_path(); // dbg!(&miden_prelude_path); let proj = project(name) .file( @@ -369,7 +368,7 @@ impl CompilerTest { [package] name = "{name}" version = "0.0.1" - edition = "2015" + edition = "2021" authors = [] [dependencies] @@ -551,6 +550,31 @@ impl CompilerTest { } } +fn prelude_crate_path() -> String { + let cwd = std::env::current_dir().unwrap(); + cwd.parent() + .unwrap() + .parent() + .unwrap() + .join("sdk") + .join("prelude") + .to_str() + .unwrap() + .to_string() +} + +pub fn sdk_crate_path() -> String { + let cwd = std::env::current_dir().unwrap(); + cwd.parent() + .unwrap() + .parent() + .unwrap() + .join("sdk") + .join("sdk") + .to_str() + .unwrap() + .to_string() +} /// Get the directory for the top-level workspace fn get_workspace_dir() -> String { // Get the directory for the integration test suite project diff --git a/tests/integration/src/rust_masm_tests/components.rs b/tests/integration/src/rust_masm_tests/components.rs index c1f5d13c..8cb7d2f9 100644 --- a/tests/integration/src/rust_masm_tests/components.rs +++ b/tests/integration/src/rust_masm_tests/components.rs @@ -16,7 +16,7 @@ fn wcm_no_imports() { [package] name = "add-wasm-component" version = "0.0.1" - edition = "2015" + edition = "2021" authors = [] [dependencies] @@ -132,7 +132,7 @@ fn wcm_import() { [package] name = "inc-wasm-component" version = "0.0.1" - edition = "2015" + edition = "2021" authors = [] [dependencies] diff --git a/tests/integration/src/rust_masm_tests/rust_sdk.rs b/tests/integration/src/rust_masm_tests/rust_sdk.rs index 98fac4cf..599d5e4f 100644 --- a/tests/integration/src/rust_masm_tests/rust_sdk.rs +++ b/tests/integration/src/rust_masm_tests/rust_sdk.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use expect_test::expect_file; -use crate::CompilerTest; +use crate::{cargo_proj::project, compiler_test::sdk_crate_path, CompilerTest}; #[test] fn account() { @@ -18,4 +18,78 @@ fn account() { test.expect_ir(expect_file![format!( "../../expected/rust_sdk_account_test/{artifact_name}.hir" )]); + // test.expect_masm(expect_file![format!( + // "../../expected/rust_sdk_account_test/{artifact_name}.masm" + // )]); +} + +#[test] +fn basic_wallet() { + let sdk_crate_path = sdk_crate_path(); + let project_name = "rust_sdk_basic_wallet"; + let proj = project(project_name) + .file( + "Cargo.toml", + format!( + r#" + + [package] + name = "{project_name}" + version = "0.0.1" + edition = "2021" + authors = [] + + [dependencies] + wee_alloc = {{ version = "0.4.5", default-features = false}} + miden-sdk = {{ path = "{sdk_crate_path}" }} + + [lib] + crate-type = ["cdylib"] + + [profile.release] + panic = "abort" + # optimize for size + opt-level = "z" + "#).as_str() + ) + .file( + "src/lib.rs", + r#" + #![no_std] + + #[panic_handler] + fn my_panic(_info: &core::panic::PanicInfo) -> ! { + loop {} + } + + #[global_allocator] + static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; + + use miden_sdk::*; + + pub struct Account; + + impl Account { + #[no_mangle] + pub fn receive_asset(asset: CoreAsset) { + add_asset(asset); + } + + #[no_mangle] + pub fn send_asset(asset: CoreAsset, tag: Tag, note_type: NoteType, recipient: Recipient) { + let asset = remove_asset(asset); + create_note(asset, tag, note_type, recipient); + } + } + "#, + ) + .build(); + + let mut test = CompilerTest::rust_source_cargo_lib(proj.root(), true, None); + let artifact_name = test.source.artifact_name(); + test.expect_wasm(expect_file![format!("../../expected/{project_name}/{artifact_name}.wat")]); + test.expect_ir(expect_file![format!("../../expected/{project_name}/{artifact_name}.hir")]); + // TODO: fix flaky test, "exec."_ZN19miden_sdk_tx_kernel9add_asset17h6f4cff304c095ffc" is + // changing the suffix on every n-th run test.expect_masm(expect_file![format!("../../ + // expected/{project_name}/{artifact_name}.masm" )]); } diff --git a/tests/rust-apps-wasm/rust-sdk/account-test/src/lib.rs b/tests/rust-apps-wasm/rust-sdk/account-test/src/lib.rs index f54a6683..81e8b966 100644 --- a/tests/rust-apps-wasm/rust-sdk/account-test/src/lib.rs +++ b/tests/rust-apps-wasm/rust-sdk/account-test/src/lib.rs @@ -1,15 +1,7 @@ -#![no_std] - -#[panic_handler] -fn my_panic(_info: &core::panic::PanicInfo) -> ! { - loop {} -} - #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; extern crate alloc; -use alloc::vec::Vec; use miden_sdk::*;