Skip to content

Commit

Permalink
last touches
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Oct 10, 2024
1 parent 7137fd9 commit 5521592
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ unconstrained fn transfer_to_private_to_self() {
utils::assert_owns_public_nft(env, nft_contract_address, AztecAddress::zero(), token_id);
}

/// External orchestration means that the calls to prepare and finalize are not done by the NFT contract. This flow
/// will typically be used by a DEX.
#[test]
unconstrained fn transfer_to_private_to_a_different_account() {
unconstrained fn transfer_to_private_external_orchestration() {
// Setup without account contracts. We are not using authwits here, so dummy accounts are enough
let (env, nft_contract_address, sender, recipient, token_id) = utils::setup_and_mint(/* with_account_contracts */ false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ unconstrained pub fn setup_mint_and_transfer_to_private(with_account_contracts:
// We mock the Oracle to return the note randomness such that later on we can manually add the note
let _ = OracleMock::mock("getRandomField").returns(note_randomness);

// We prepare the transfer with user being both the sender and the recipient (classical "shield" flow)
let slot_commitment: Field = env.call_private(NFT::at(nft_contract_address).prepare_transfer_to_private(owner, owner));

// Finalize the transfer of the NFT
let finalize_transfer_to_private_call_interface = NFT::at(nft_contract_address).finalize_transfer_to_private(minted_token_id, slot_commitment);
env.call_public(finalize_transfer_to_private_call_interface);
// We transfer the public NFT to private.
env.call_private_void(NFT::at(nft_contract_address).transfer_to_private(owner, minted_token_id));

// TODO(#8771): We need to manually add the note because in the partial notes flow `notify_created_note_oracle`
// is not called and we don't have a `NoteProcessor` in TXE.
Expand Down

0 comments on commit 5521592

Please sign in to comment.