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.rsdiffbeforeafterboth3use erc::ERC721Events;3use erc::ERC721Events;4use frame_support::{BoundedVec, ensure};4use frame_support::{BoundedVec, ensure};5use up_data_structs::{5use up_data_structs::{AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData};6 AccessMode, Collection, CollectionId, CustomDataLimit, TokenId, CreateCollectionData,7};8use pallet_common::{6use pallet_common::{9 Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, account::CrossAccountId,7 Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, account::CrossAccountId,497 if <Allowance<T>>::get((collection.id, token)).as_ref() != Some(spender) {495 if <Allowance<T>>::get((collection.id, token)).as_ref() != Some(spender) {498 ensure!(496 ensure!(499 collection.ignores_allowance(spender),497 collection.ignores_allowance(spender),500 <CommonError<T>>::TokenValueNotEnough498 <CommonError<T>>::ApprovedValueTooLow501 );499 );502 }500 }503501525 if <Allowance<T>>::get((collection.id, token)).as_ref() != Some(spender) {523 if <Allowance<T>>::get((collection.id, token)).as_ref() != Some(spender) {526 ensure!(524 ensure!(527 collection.ignores_allowance(spender),525 collection.ignores_allowance(spender),528 <CommonError<T>>::TokenValueNotEnough526 <CommonError<T>>::ApprovedValueTooLow529 );527 );530 }528 }531529pallets/refungible/src/lib.rsdiffbeforeafterboth--- 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),
- <CommonError<T>>::TokenValueNotEnough
+ <CommonError<T>>::ApprovedValueTooLow
);
}
@@ -565,7 +564,7 @@
if allowance.is_none() {
ensure!(
collection.ignores_allowance(spender),
- <CommonError<T>>::TokenValueNotEnough
+ <CommonError<T>>::ApprovedValueTooLow
);
}
pallets/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.
**/