git.delta.rocks / unique-network / refs/commits / cfd4b613ae66

difftreelog

Revert "fix zero transfer"

Daniel Shiposha2022-12-06parent: #2f762b2.patch.diff
in: master
This reverts commit 2880b7f76c032798bcf34e0b1b79ca02a267e201.

13 files changed

modifiedCargo.lockdiffbeforeafterboth
59015901
5902[[package]]5902[[package]]
5903name = "pallet-common"5903name = "pallet-common"
5904version = "0.1.13"5904version = "0.1.12"
5905dependencies = [5905dependencies = [
5906 "ethereum",5906 "ethereum",
5907 "evm-coder",5907 "evm-coder",
61916191
6192[[package]]6192[[package]]
6193name = "pallet-fungible"6193name = "pallet-fungible"
6194version = "0.1.8"6194version = "0.1.7"
6195dependencies = [6195dependencies = [
6196 "ethereum",6196 "ethereum",
6197 "evm-coder",6197 "evm-coder",
64466446
6447[[package]]6447[[package]]
6448name = "pallet-nonfungible"6448name = "pallet-nonfungible"
6449version = "0.1.10"6449version = "0.1.9"
6450dependencies = [6450dependencies = [
6451 "ethereum",6451 "ethereum",
6452 "evm-coder",6452 "evm-coder",
65686568
6569[[package]]6569[[package]]
6570name = "pallet-refungible"6570name = "pallet-refungible"
6571version = "0.2.9"6571version = "0.2.8"
6572dependencies = [6572dependencies = [
6573 "derivative",6573 "derivative",
6574 "ethereum",6574 "ethereum",
modifiedpallets/common/CHANGELOG.mddiffbeforeafterboth
44
5<!-- bureaucrate goes here -->5<!-- bureaucrate goes here -->
66
7## [0.1.13] - 2022-12-05
8
9### Added
10
11- The error `ZeroTransferNotAllowed` to handling transactions with the transfer of a zero amount of tokens.
12
13## [0.1.12] - 2022-11-167## [0.1.12] - 2022-11-16
148
15### Changed9### Changed
modifiedpallets/common/Cargo.tomldiffbeforeafterboth
1[package]1[package]
2name = "pallet-common"2name = "pallet-common"
3version = "0.1.13"3version = "0.1.12"
4license = "GPLv3"4license = "GPLv3"
5edition = "2021"5edition = "2021"
66
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
602 /// Tried to access an internal collection with an external API602 /// Tried to access an internal collection with an external API
603 CollectionIsInternal,603 CollectionIsInternal,
604
605 /// Transfer operation with zero amount
606 ZeroTransferNotAllowed,
607 }604 }
608605
609 /// Storage of the count of created collections. Essentially contains the last collection ID.606 /// Storage of the count of created collections. Essentially contains the last collection ID.
modifiedpallets/fungible/CHANGELOG.mddiffbeforeafterboth
44
5<!-- bureaucrate goes here -->5<!-- bureaucrate goes here -->
66
7## [0.1.9] - 2022-12-05
8
9### Fixed
10
11- Transfer with zero tokens.
12
13## [0.1.8] - 2022-11-187## [0.1.8] - 2022-11-18
148
15### Added9### Added
modifiedpallets/fungible/Cargo.tomldiffbeforeafterboth
1[package]1[package]
2name = "pallet-fungible"2name = "pallet-fungible"
3version = "0.1.8"3version = "0.1.7"
4license = "GPLv3"4license = "GPLv3"
5edition = "2021"5edition = "2021"
66
modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
365 amount: u128,365 amount: u128,
366 nesting_budget: &dyn Budget,366 nesting_budget: &dyn Budget,
367 ) -> DispatchResult {367 ) -> DispatchResult {
368 ensure!(amount > 0, <CommonError<T>>::ZeroTransferNotAllowed);
369
370 ensure!(368 ensure!(
371 collection.limits.transfers_enabled(),369 collection.limits.transfers_enabled(),
modifiedpallets/nonfungible/CHANGELOG.mddiffbeforeafterboth
44
5<!-- bureaucrate goes here -->5<!-- bureaucrate goes here -->
66
7## [0.1.11] - 2022-12-05
8
9### Fixed
10
11- Transfer with zero tokens.
12
13## [0.1.10] - 2022-11-187## [0.1.10] - 2022-11-18
148
15### Added9### Added
modifiedpallets/nonfungible/Cargo.tomldiffbeforeafterboth
1[package]1[package]
2name = "pallet-nonfungible"2name = "pallet-nonfungible"
3version = "0.1.10"3version = "0.1.9"
4license = "GPLv3"4license = "GPLv3"
5edition = "2021"5edition = "2021"
66
modifiedpallets/nonfungible/src/common.rsdiffbeforeafterboth
23};23};
24use pallet_common::{24use pallet_common::{
25 CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight,25 CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight,
26 weights::WeightInfo as _, Error as CommonError,26 weights::WeightInfo as _,
27};27};
28use sp_runtime::DispatchError;28use sp_runtime::DispatchError;
29use sp_std::{vec::Vec, vec};29use sp_std::{vec::Vec, vec};
314 nesting_budget: &dyn Budget,314 nesting_budget: &dyn Budget,
315 ) -> DispatchResultWithPostInfo {315 ) -> DispatchResultWithPostInfo {
316 ensure!(amount <= 1, <Error<T>>::NonfungibleItemsHaveNoAmount);316 ensure!(amount <= 1, <Error<T>>::NonfungibleItemsHaveNoAmount);
317 ensure!(amount > 0, <CommonError<T>>::ZeroTransferNotAllowed);317 if amount == 1 {
318
319 with_weight(318 with_weight(
320 <Pallet<T>>::transfer(self, &from, &to, token, nesting_budget),319 <Pallet<T>>::transfer(self, &from, &to, token, nesting_budget),
321 <CommonWeights<T>>::transfer(),320 <CommonWeights<T>>::transfer(),
322 )321 )
322 } else {
323 Ok(().into())
324 }
323 }325 }
324326
325 fn approve(327 fn approve(
352 ) -> DispatchResultWithPostInfo {354 ) -> DispatchResultWithPostInfo {
353 ensure!(amount <= 1, <Error<T>>::NonfungibleItemsHaveNoAmount);355 ensure!(amount <= 1, <Error<T>>::NonfungibleItemsHaveNoAmount);
356
354 ensure!(amount > 0, <CommonError<T>>::ZeroTransferNotAllowed);357 if amount == 1 {
355
356 with_weight(358 with_weight(
357 <Pallet<T>>::transfer_from(self, &sender, &from, &to, token, nesting_budget),359 <Pallet<T>>::transfer_from(self, &sender, &from, &to, token, nesting_budget),
358 <CommonWeights<T>>::transfer_from(),360 <CommonWeights<T>>::transfer_from(),
359 )361 )
362 } else {
363 Ok(().into())
364 }
360 }365 }
361366
362 fn burn_from(367 fn burn_from(
modifiedpallets/refungible/CHANGELOG.mddiffbeforeafterboth
3All notable changes to this project will be documented in this file.3All notable changes to this project will be documented in this file.
44
5<!-- bureaucrate goes here -->5<!-- bureaucrate goes here -->
6## [0.2.10] - 2022-12-05
76
8### Fixed
9
10- Transfer with zero pieces.
11
12## [0.2.9] - 2022-11-187## [0.2.9] - 2022-11-18
138
14### Added9### Added
modifiedpallets/refungible/Cargo.tomldiffbeforeafterboth
1[package]1[package]
2name = "pallet-refungible"2name = "pallet-refungible"
3version = "0.2.9"3version = "0.2.8"
4license = "GPLv3"4license = "GPLv3"
5edition = "2021"5edition = "2021"
66
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
727 amount: u128,727 amount: u128,
728 nesting_budget: &dyn Budget,728 nesting_budget: &dyn Budget,
729 ) -> DispatchResult {729 ) -> DispatchResult {
730 ensure!(amount > 0, <CommonError<T>>::ZeroTransferNotAllowed);
731
732 ensure!(730 ensure!(
733 collection.limits.transfers_enabled(),731 collection.limits.transfers_enabled(),