Skip to content

Commit

Permalink
fix: atomic swap
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Jan 7, 2025
1 parent b1719a6 commit 10713d1
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 153 deletions.
4 changes: 2 additions & 2 deletions pallets/nfts/src/features/atomic_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {

// This also removes the swap.
Self::do_transfer(
Some(&caller),
None,
send_collection_id,
send_item_id,
receive_item.owner.clone(),
|_, _| Ok(()),
)?;
Self::do_transfer(
Some(&caller),
None,
receive_collection_id,
receive_item_id,
send_item.owner.clone(),
Expand Down
4 changes: 2 additions & 2 deletions pallets/nfts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3778,11 +3778,11 @@ fn claim_swap_requires_deposit_works() {
));
assert_eq!(
AccountBalance::get(collection_id, &user_1),
Some((1, (user_1, balance_deposit)))
Some((1, (user_1.clone(), balance_deposit)))
);
assert_eq!(
AccountBalance::get(collection_id, &user_2),
Some((1, (user_2, balance_deposit)))
Some((1, (user_1, balance_deposit)))
);
});
}
Expand Down
Loading

0 comments on commit 10713d1

Please sign in to comment.