git.delta.rocks / unique-network / refs/commits / 1bc75e21b764

difftreelog

Revert "fix `transfer_nft_item_zero_value` test"

Daniel Shiposha2022-12-06parent: #cfd4b61.patch.diff
in: master
This reverts commit b81a4dfe8aee04b085ac0af6434645316c8d6337.

1 file changed

modifiedruntime/tests/src/tests.rsdiffbeforeafterboth
625 });625 });
626}626}
627
628#[test]
629fn transfer_nft_item_zero_value() {
630 new_test_ext().execute_with(|| {
631 let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1));
632
633 let data = default_nft_data();
634 create_test_item(collection_id, &data.into());
635 assert_eq!(
636 <pallet_nonfungible::AccountBalance<Test>>::get((collection_id, account(1))),
637 1
638 );
639 assert_eq!(
640 <pallet_nonfungible::Owned<Test>>::get((collection_id, account(1), TokenId(1))),
641 true
642 );
643
644 let origin1 = RuntimeOrigin::signed(1);
645
646 // Transferring 0 amount works on NFT...
647 assert_noop!(
648 Unique::transfer(origin1, account(2), CollectionId(1), TokenId(1), 0),
649 <CommonError<Test>>::ZeroTransferNotAllowed
650 );
651 // ... and results in no transfer
652 assert_eq!(
653 <pallet_nonfungible::AccountBalance<Test>>::get((collection_id, account(1))),
654 1
655 );
656 assert_eq!(
657 <pallet_nonfungible::Owned<Test>>::get((collection_id, account(1), TokenId(1))),
658 true
659 );
660 });
661}
662627
663#[test]628#[test]
664fn nft_approve_and_transfer_from() {629fn nft_approve_and_transfer_from() {