difftreelog
change error type for `ensure_single_owner`
in: master
2 files changed
pallets/refungible/src/erc.rsdiffbeforeafterboth512512513 if owner_balance == 0 {513 if owner_balance == 0 {514 return Err(dispatch_to_evm::<T>(514 return Err(dispatch_to_evm::<T>(515 <CommonError<T>>::TokenValueTooLow.into(),515 <CommonError<T>>::MustBeTokenOwner.into(),516 ));516 ));517 }517 }518518runtime/tests/src/tests.rsdiffbeforeafterboth625 });625 });626}626}627628#[test]629fn transfer_nft_item_zero_value() {630 new_test_ext().execute_with(|| {631 let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1));632633 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 1638 );639 assert_eq!(640 <pallet_nonfungible::Owned<Test>>::get((collection_id, account(1), TokenId(1))),641 true642 );643644 let origin1 = RuntimeOrigin::signed(1);645646 // Transferring 0 amount works on NFT...647 assert_ok!(Unique::transfer(648 origin1,649 account(2),650 CollectionId(1),651 TokenId(1),652 0653 ));654 // ... and results in no transfer655 assert_eq!(656 <pallet_nonfungible::AccountBalance<Test>>::get((collection_id, account(1))),657 1658 );659 assert_eq!(660 <pallet_nonfungible::Owned<Test>>::get((collection_id, account(1), TokenId(1))),661 true662 );663 });664}665627666#[test]628#[test]667fn nft_approve_and_transfer_from() {629fn nft_approve_and_transfer_from() {