diff --git a/yarn-project/end-to-end/src/e2e_nft.test.ts b/yarn-project/end-to-end/src/e2e_nft.test.ts index afa41541f15..1f7c5eb3008 100644 --- a/yarn-project/end-to-end/src/e2e_nft.test.ts +++ b/yarn-project/end-to-end/src/e2e_nft.test.ts @@ -58,9 +58,9 @@ describe('NFT', () => { it('transfers to private', async () => { const nftContractAsUser1 = await NFTContract.at(nftContractAddress, user1Wallet); - // In a simple "shield" flow the sender and recipient are the same. In the "uniswap swap to private" flow - // the sender would be the uniswap contract. - const recipient = user1Wallet.getAddress(); + // In a simple "shield" flow the sender and recipient are the same. In the "AMM swap to private" flow + // the sender would be the AMM contract. + const recipient = user2Wallet.getAddress(); const { debugInfo } = await nftContractAsUser1.methods .transfer_to_private(recipient, TOKEN_ID) @@ -80,29 +80,29 @@ describe('NFT', () => { }); it('transfers in private', async () => { - const nftContractAsUser1 = await NFTContract.at(nftContractAddress, user1Wallet); + const nftContractAsUser2 = await NFTContract.at(nftContractAddress, user2Wallet); - await nftContractAsUser1.methods - .transfer_in_private(user1Wallet.getAddress(), user2Wallet.getAddress(), TOKEN_ID, 0) + await nftContractAsUser2.methods + .transfer_in_private(user2Wallet.getAddress(), user1Wallet.getAddress(), TOKEN_ID, 0) .send() .wait(); const user1Nfts = await getPrivateNfts(user1Wallet.getAddress()); - expect(user1Nfts).toEqual([]); + expect(user1Nfts).toEqual([TOKEN_ID]); const user2Nfts = await getPrivateNfts(user2Wallet.getAddress()); - expect(user2Nfts).toEqual([TOKEN_ID]); + expect(user2Nfts).toEqual([]); }); it('transfers to public', async () => { - const nftContractAsUser2 = await NFTContract.at(nftContractAddress, user2Wallet); + const nftContractAsUser1 = await NFTContract.at(nftContractAddress, user1Wallet); - await nftContractAsUser2.methods - .transfer_to_public(user2Wallet.getAddress(), user2Wallet.getAddress(), TOKEN_ID, 0) + await nftContractAsUser1.methods + .transfer_to_public(user1Wallet.getAddress(), user2Wallet.getAddress(), TOKEN_ID, 0) .send() .wait(); - const publicOwnerAfter = await nftContractAsUser2.methods.owner_of(TOKEN_ID).simulate(); + const publicOwnerAfter = await nftContractAsUser1.methods.owner_of(TOKEN_ID).simulate(); expect(publicOwnerAfter).toEqual(user2Wallet.getAddress()); });