Skip to content

Commit

Permalink
refactor: update doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Fumuran committed Nov 26, 2024
1 parent 0486ab7 commit a7db7b5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions miden-lib/asm/note_scripts/P2ID.masm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ end
#! Requires that the account exposes:
#! - miden::contracts::wallets::basic::receive_asset procedure.
#!
#! Inputs: [SCRIPT_ROOT]
#! Inputs: []
#! Outputs: []
#!
#! Note inputs are assumed to be as follows:
Expand All @@ -95,12 +95,12 @@ begin
# => [target_account_id]

exec.account::get_id
# => [account_id, target_account_id, ...]
# => [account_id, target_account_id]

# ensure account_id = target_account_id, fails otherwise
assert_eq.err=ERR_P2ID_TARGET_ACCT_MISMATCH
# => [...]
# => []

exec.add_note_assets_to_account
# => [...]
# => []
end
14 changes: 7 additions & 7 deletions miden-lib/asm/note_scripts/P2IDR.masm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ end
#! Requires that the account exposes:
#! - miden::contracts::wallets::basic::receive_asset procedure.
#!
#! Inputs: [SCRIPT_ROOT]
#! Inputs: []
#! Outputs: []
#!
#! Note inputs are assumed to be as follows:
Expand Down Expand Up @@ -104,11 +104,11 @@ begin
# => [reclaim_block_height, target_account_id]

exec.account::get_id dup
# => [account_id, account_id, reclaim_block_height, target_account_id, ...]
# => [account_id, account_id, reclaim_block_height, target_account_id]

# determine if the current account is the target account
movup.3 eq
# => [is_target, account_id, reclaim_block_height, ...]
# => [is_target, account_id, reclaim_block_height]

if.true
# if current account is the target, we don't need to check anything else
Expand All @@ -118,18 +118,18 @@ begin
else
# if current account is not the target, we need to ensure it is the sender
exec.note::get_sender
# => [sender_account_id, account_id, reclaim_block_height, ...]
# => [sender_account_id, account_id, reclaim_block_height]

assert_eq.err=ERR_P2IDR_RECLAIM_ACCT_IS_NOT_SENDER
# => [reclaim_block_height, ...]
# => [reclaim_block_height]

# now check that sender is allowed to reclaim, current block >= reclaim block height
exec.tx::get_block_number
# => [current_block_height, reclaim_block_height, ...]
# => [current_block_height, reclaim_block_height]

u32assert2 u32lte assert.err=ERR_P2IDR_RECLAIM_HEIGHT_NOT_REACHED
end

exec.add_note_assets_to_account
# => [...]
# => []
end
2 changes: 1 addition & 1 deletion miden-lib/asm/note_scripts/SWAP.masm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const.ERR_SWAP_WRONG_NUMBER_OF_ASSETS=0x00020056
#! - miden::contracts::wallets::basic::create_note procedure.
#! - miden::contracts::wallets::basic::move_asset_to_note procedure.
#!
#! Inputs: [SCRIPT_ROOT]
#! Inputs: []
#! Outputs: []
#!
#! Note inputs are assumed to be as follows:
Expand Down

0 comments on commit a7db7b5

Please sign in to comment.