mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 06:57:58 +00:00
[NFTs] Fix consumers issue (#2653)
When we call the `set_accept_ownership` method, we increase the number of account consumers, but then we don't decrease it on collection transfer, which leads to the wrong consumers number an account has.
This commit is contained in:
@@ -254,8 +254,11 @@ fn transfer_owner_should_work() {
|
||||
Uniques::transfer_ownership(RuntimeOrigin::signed(1), 0, 2),
|
||||
Error::<Test>::Unaccepted
|
||||
);
|
||||
assert_eq!(System::consumers(&2), 0);
|
||||
assert_ok!(Uniques::set_accept_ownership(RuntimeOrigin::signed(2), Some(0)));
|
||||
assert_eq!(System::consumers(&2), 1);
|
||||
assert_ok!(Uniques::transfer_ownership(RuntimeOrigin::signed(1), 0, 2));
|
||||
assert_eq!(System::consumers(&2), 1);
|
||||
|
||||
assert_eq!(collections(), vec![(2, 0)]);
|
||||
assert_eq!(Balances::total_balance(&1), 98);
|
||||
|
||||
Reference in New Issue
Block a user