--- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -307,7 +307,7 @@ /// Item balance not enough. TokenValueTooLow, /// Requested value more than approved. - TokenValueNotEnough, + ApprovedValueTooLow, /// Tried to approve more than owned CantApproveMoreThanOwned, --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -2,7 +2,7 @@ use core::ops::Deref; use frame_support::{ensure}; -use up_data_structs::{AccessMode, Collection, CollectionId, TokenId, CreateCollectionData}; +use up_data_structs::{AccessMode, CollectionId, TokenId, CreateCollectionData}; use pallet_common::{ Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, account::CrossAccountId, }; @@ -346,7 +346,7 @@ if allowance.is_none() { ensure!( collection.ignores_allowance(spender), - >::TokenValueNotEnough + >::ApprovedValueTooLow ); } @@ -377,7 +377,7 @@ if allowance.is_none() { ensure!( collection.ignores_allowance(spender), - >::TokenValueNotEnough + >::ApprovedValueTooLow ); } --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -2,9 +2,7 @@ use erc::ERC721Events; use frame_support::{BoundedVec, ensure}; -use up_data_structs::{ - AccessMode, Collection, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, -}; +use up_data_structs::{AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData}; use pallet_common::{ Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, account::CrossAccountId, }; @@ -497,7 +495,7 @@ if >::get((collection.id, token)).as_ref() != Some(spender) { ensure!( collection.ignores_allowance(spender), - >::TokenValueNotEnough + >::ApprovedValueTooLow ); } @@ -525,7 +523,7 @@ if >::get((collection.id, token)).as_ref() != Some(spender) { ensure!( collection.ignores_allowance(spender), - >::TokenValueNotEnough + >::ApprovedValueTooLow ); } --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -2,8 +2,7 @@ use frame_support::{ensure, BoundedVec}; use up_data_structs::{ - AccessMode, Collection, CollectionId, CustomDataLimit, MAX_REFUNGIBLE_PIECES, TokenId, - CreateCollectionData, + AccessMode, CollectionId, CustomDataLimit, MAX_REFUNGIBLE_PIECES, TokenId, CreateCollectionData, }; use pallet_common::{ Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, account::CrossAccountId, @@ -532,7 +531,7 @@ if allowance.is_none() { ensure!( collection.ignores_allowance(spender), - >::TokenValueNotEnough + >::ApprovedValueTooLow ); } @@ -565,7 +564,7 @@ if allowance.is_none() { ensure!( collection.ignores_allowance(spender), - >::TokenValueNotEnough + >::ApprovedValueTooLow ); } --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -38,8 +38,8 @@ use up_data_structs::{ MAX_DECIMAL_POINTS, VARIABLE_ON_CHAIN_SCHEMA_LIMIT, CONST_ON_CHAIN_SCHEMA_LIMIT, OFFCHAIN_SCHEMA_LIMIT, MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, - MAX_TOKEN_PREFIX_LENGTH, AccessMode, Collection, CreateItemData, CollectionLimits, - CollectionId, CollectionMode, TokenId, SchemaVersion, SponsorshipState, MetaUpdatePermission, + MAX_TOKEN_PREFIX_LENGTH, AccessMode, CreateItemData, CollectionLimits, CollectionId, + CollectionMode, TokenId, SchemaVersion, SponsorshipState, MetaUpdatePermission, CreateCollectionData, CustomDataLimit, }; use pallet_common::{ --- a/pallets/unique/src/tests.rs +++ b/pallets/unique/src/tests.rs @@ -601,7 +601,7 @@ 1 ) .map_err(|e| e.error), - CommonError::::TokenValueNotEnough + CommonError::::ApprovedValueTooLow ); // do approve @@ -916,7 +916,7 @@ 4 ) .map_err(|e| e.error), - CommonError::::TokenValueNotEnough + CommonError::::ApprovedValueTooLow ); }); } --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -115,7 +115,7 @@ /** * Requested value more than approved. **/ - TokenValueNotEnough: AugmentedError; + ApprovedValueTooLow: AugmentedError; /** * Item balance not enough. **/