difftreelog
Merge pull request #275 from UniqueNetwork/feature/CORE-262
in: master
7 files changed
pallets/common/src/lib.rsdiffbeforeafterboth--- 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,
pallets/fungible/src/lib.rsdiffbeforeafterboth--- 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),
- <CommonError<T>>::TokenValueNotEnough
+ <CommonError<T>>::ApprovedValueTooLow
);
}
@@ -377,7 +377,7 @@
if allowance.is_none() {
ensure!(
collection.ignores_allowance(spender),
- <CommonError<T>>::TokenValueNotEnough
+ <CommonError<T>>::ApprovedValueTooLow
);
}
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- 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 <Allowance<T>>::get((collection.id, token)).as_ref() != Some(spender) {
ensure!(
collection.ignores_allowance(spender),
- <CommonError<T>>::TokenValueNotEnough
+ <CommonError<T>>::ApprovedValueTooLow
);
}
@@ -525,7 +523,7 @@
if <Allowance<T>>::get((collection.id, token)).as_ref() != Some(spender) {
ensure!(
collection.ignores_allowance(spender),
- <CommonError<T>>::TokenValueNotEnough
+ <CommonError<T>>::ApprovedValueTooLow
);
}
pallets/refungible/src/lib.rsdiffbeforeafterboth223use frame_support::{ensure, BoundedVec};3use frame_support::{ensure, BoundedVec};4use up_data_structs::{4use up_data_structs::{5 AccessMode, Collection, CollectionId, CustomDataLimit, MAX_REFUNGIBLE_PIECES, TokenId,5 AccessMode, CollectionId, CustomDataLimit, MAX_REFUNGIBLE_PIECES, TokenId, CreateCollectionData,6 CreateCollectionData,7};6};8use pallet_common::{7use pallet_common::{532 if allowance.is_none() {531 if allowance.is_none() {533 ensure!(532 ensure!(534 collection.ignores_allowance(spender),533 collection.ignores_allowance(spender),535 <CommonError<T>>::TokenValueNotEnough534 <CommonError<T>>::ApprovedValueTooLow536 );535 );537 }536 }538537565 if allowance.is_none() {564 if allowance.is_none() {566 ensure!(565 ensure!(567 collection.ignores_allowance(spender),566 collection.ignores_allowance(spender),568 <CommonError<T>>::TokenValueNotEnough567 <CommonError<T>>::ApprovedValueTooLow569 );568 );570 }569 }571570pallets/unique/src/lib.rsdiffbeforeafterboth--- 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::{
pallets/unique/src/tests.rsdiffbeforeafterboth--- a/pallets/unique/src/tests.rs
+++ b/pallets/unique/src/tests.rs
@@ -601,7 +601,7 @@
1
)
.map_err(|e| e.error),
- CommonError::<Test>::TokenValueNotEnough
+ CommonError::<Test>::ApprovedValueTooLow
);
// do approve
@@ -916,7 +916,7 @@
4
)
.map_err(|e| e.error),
- CommonError::<Test>::TokenValueNotEnough
+ CommonError::<Test>::ApprovedValueTooLow
);
});
}
tests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth--- 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<ApiType>;
+ ApprovedValueTooLow: AugmentedError<ApiType>;
/**
* Item balance not enough.
**/