git.delta.rocks / unique-network / refs/commits / 58de5ce0e935

difftreelog

CArgo fmt

Trubnikov Sergey2022-05-27parent: #dbc2fd5.patch.diff
in: master

6 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -14,7 +14,11 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-use evm_coder::{solidity_interface, types::*, execution::{Result, Error}};
+use evm_coder::{
+	solidity_interface,
+	types::*,
+	execution::{Result, Error},
+};
 pub use pallet_evm::{PrecompileOutput, PrecompileResult, account::CrossAccountId};
 use pallet_evm_coder_substrate::dispatch_to_evm;
 use sp_core::{H160, U256};
@@ -66,11 +70,7 @@
 		Ok(prop.to_vec())
 	}
 
-	fn eth_set_sponsor(
-		&mut self,
-		caller: caller,
-		sponsor: address,
-	) -> Result<void> {
+	fn eth_set_sponsor(&mut self, caller: caller, sponsor: address) -> Result<void> {
 		check_is_owner(caller, self)?;
 
 		let sponsor = T::CrossAccountId::from_eth(sponsor);
@@ -88,44 +88,40 @@
 		Ok(())
 	}
 
-	fn set_limit(
-		&mut self,
-		caller: caller,
-		limit: string,
-		value: string,
-	) -> Result<void> {
+	fn set_limit(&mut self, caller: caller, limit: string, value: string) -> Result<void> {
 		check_is_owner(caller, self)?;
 		let mut limits = self.limits.clone();
 
 		match limit.as_str() {
 			"accountTokenOwnershipLimit" => {
 				limits.account_token_ownership_limit = parse_int(value)?;
-			},
+			}
 			"sponsoredDataSize" => {
 				limits.sponsored_data_size = parse_int(value)?;
-			},
+			}
 			"sponsoredDataRateLimit" => {
-				limits.sponsored_data_rate_limit = Some(SponsoringRateLimit::Blocks(parse_int(value)?.unwrap()));
-			},
+				limits.sponsored_data_rate_limit =
+					Some(SponsoringRateLimit::Blocks(parse_int(value)?.unwrap()));
+			}
 			"tokenLimit" => {
 				limits.token_limit = parse_int(value)?;
-			},
+			}
 			"sponsorTransferTimeout" => {
 				limits.sponsor_transfer_timeout = parse_int(value)?;
-			},
+			}
 			"sponsorApproveTimeout" => {
 				limits.sponsor_approve_timeout = parse_int(value)?;
-			},
+			}
 			"ownerCanTransfer" => {
 				limits.owner_can_transfer = parse_bool(value)?;
-			},
+			}
 			"ownerCanDestroy" => {
 				limits.owner_can_destroy = parse_bool(value)?;
-			},
+			}
 			"transfersEnabled" => {
 				limits.transfers_enabled = parse_bool(value)?;
-			},
-			_ => return Err(Error::Revert(format!("Unknown limit \"{}\"", limit)))
+			}
+			_ => return Err(Error::Revert(format!("Unknown limit \"{}\"", limit))),
 		}
 		self.limits = limits;
 		save(self);
@@ -150,13 +146,15 @@
 }
 
 fn parse_int(value: string) -> Result<Option<u32>> {
-	value.parse::<u32>()
+	value
+		.parse::<u32>()
 		.map_err(|e| Error::Revert(format!("Int value \"{}\" parse error: {}", value, e)))
 		.map(|value| Some(value))
 }
 
 fn parse_bool(value: string) -> Result<Option<bool>> {
-	value.parse::<bool>()
+	value
+		.parse::<bool>()
 		.map_err(|e| Error::Revert(format!("Bool value \"{}\" parse error: {}", value, e)))
 		.map(|value| Some(value))
-}
\ No newline at end of file
+}
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -20,7 +20,7 @@
 use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
 use pallet_evm::{
 	ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure,
-	account::CrossAccountId
+	account::CrossAccountId,
 };
 use sp_core::H160;
 use crate::{
modifiedpallets/nonfungible/src/common.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/common.rs
+++ b/pallets/nonfungible/src/common.rs
@@ -23,6 +23,7 @@
 };
 use pallet_common::{
 	CommonCollectionOperations, CommonWeightInfo, with_weight, weights::WeightInfo as _,
+	PropertyKeyPermission,
 };
 use sp_runtime::DispatchError;
 use sp_std::vec::Vec;
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
23use frame_support::BoundedVec;23use frame_support::BoundedVec;
24use up_data_structs::{TokenId, SchemaVersion, PropertyPermission, PropertyKeyPermission, Property, CollectionId, PropertyKey, CollectionPropertiesVec};24use up_data_structs::{
25 TokenId, SchemaVersion, PropertyPermission, PropertyKeyPermission, Property, CollectionId,
26 PropertyKey, CollectionPropertiesVec,
27};
25use pallet_evm_coder_substrate::dispatch_to_evm;28use pallet_evm_coder_substrate::dispatch_to_evm;
26use sp_core::{H160, U256};29use sp_core::{H160, U256};
387 value: token_uri.into_bytes().try_into()391 value: token_uri
392 .into_bytes()
393 .try_into()
388 .map_err(|_| "token uri is too long")?394 .map_err(|_| "token uri is too long")?,
389 }).map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?;395 })
396 .map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?;
390397
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -83,11 +83,11 @@
 			collection_admin: true,
 			token_owner: false,
 		};
-		let mut token_property_permissions = up_data_structs::CollectionPropertiesPermissionsVec::default();
-		token_property_permissions.try_push(up_data_structs::PropertyKeyPermission{
-			key,
-			permission,
-		}).map_err(|e| Error::Revert(format!("{:?}", e)))?;
+		let mut token_property_permissions =
+			up_data_structs::CollectionPropertiesPermissionsVec::default();
+		token_property_permissions
+			.try_push(up_data_structs::PropertyKeyPermission { key, permission })
+			.map_err(|e| Error::Revert(format!("{:?}", e)))?;
 
 		let data = CreateCollectionData {
 			name,
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -49,8 +49,8 @@
 // A few exports that help ease life for downstream crates.
 pub use pallet_balances::Call as BalancesCall;
 pub use pallet_evm::{
-	EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _, OnMethodCall,
-	Account as EVMAccount, FeeCalculator, GasWeightMapping,
+	EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _,
+	OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,
 };
 pub use frame_support::{
 	construct_runtime, match_types,