Skip to content

Commit

Permalink
Merge pull request #186 from 0xPolygonMiden/greenhat/bali-account-comp
Browse files Browse the repository at this point in the history
[2/2] Integration test for basic wallet account code compilation to MASM
  • Loading branch information
bitwalker authored May 24, 2024
2 parents 6acf836 + a700779 commit 3693ae1
Show file tree
Hide file tree
Showing 11 changed files with 1,589 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod miden_sdk_account_test


Original file line number Diff line number Diff line change
Expand Up @@ -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::<impl [T]>::copy_from_slice::len_mismatch_fail (;64;) (type 19) (param i32 i32 i32)
(func $core::slice::<impl [T]>::copy_from_slice::len_mismatch_fail (;66;) (type 19) (param i32 i32 i32)
unreachable
unreachable
)
(func $core::slice::<impl [T]>::copy_from_slice (;65;) (type 27) (param i32 i32 i32 i32 i32)
(func $core::slice::<impl [T]>::copy_from_slice (;67;) (type 27) (param i32 i32 i32 i32 i32)
block ;; label = @1
local.get 1
local.get 3
Expand All @@ -1885,20 +1890,82 @@
call $core::slice::<impl [T]>::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")
)
Loading

0 comments on commit 3693ae1

Please sign in to comment.