git.delta.rocks / unique-network / refs/commits / 73ad88465834

difftreelog

CORE-302 Clean code

Trubnikov Sergey2022-04-26parent: #3912bc1.patch.diff
in: master

7 files changed

modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -153,7 +153,7 @@
 	pub fn set_sponsor(&mut self, sponsor: T::AccountId) {
 		self.collection.sponsorship = SponsorshipState::Unconfirmed(sponsor);
 	}
-	
+
 	pub fn confirm_sponsorship(&mut self, sender: &T::AccountId) -> bool {
 		if self.collection.sponsorship.pending_sponsor() != Some(sender) {
 			return false;
modifiedpallets/evm-collection/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-collection/src/eth.rs
+++ b/pallets/evm-collection/src/eth.rs
@@ -18,6 +18,7 @@
 use evm_coder::{abi::AbiWriter, execution::*, generate_stubgen, solidity_interface, types::*, ToLog};
 use ethereum as _;
 use pallet_common::CollectionById;
+use pallet_common::CollectionHandle;
 use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
 use pallet_evm::{
 	ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure,
modifiedpallets/evm-collection/src/lib.rsdiffbeforeafterboth
1818
19extern crate alloc;19extern crate alloc;
2020
21use codec::{Decode, Encode, MaxEncodedLen};
22pub use pallet::*;21pub use pallet::*;
23pub use eth::*;22pub use eth::*;
24use scale_info::TypeInfo;
25pub mod eth;23pub mod eth;
2624
27#[frame_support::pallet]25#[frame_support::pallet]
28pub mod pallet {26pub mod pallet {
29 pub use super::*;27 pub use super::*;
30 use evm_coder::execution::Result;
31 use frame_support::pallet_prelude::*;28 use frame_support::pallet_prelude::*;
32 use sp_core::H160;29 use sp_core::H160;
3330
modifiedpallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/lib.rs
+++ b/pallets/evm-contract-helpers/src/lib.rs
@@ -31,7 +31,10 @@
 
 	#[pallet::config]
 	pub trait Config:
-		frame_system::Config + pallet_evm_coder_substrate::Config + pallet_evm::account::Config + pallet_nonfungible::Config
+		frame_system::Config
+		+ pallet_evm_coder_substrate::Config
+		+ pallet_evm::account::Config
+		+ pallet_nonfungible::Config
 	{
 		type ContractAddress: Get<H160>;
 		type DefaultSponsoringRateLimit: Get<Self::BlockNumber>;
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -368,30 +368,30 @@
 #[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
 #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
 pub struct CollectionLimits {
-	#[serde(alias="accountTokenOwnershipLimit")]
+	#[serde(alias = "accountTokenOwnershipLimit")]
 	pub account_token_ownership_limit: Option<u32>,
-	#[serde(alias="sponsoredDataSize")]
+	#[serde(alias = "sponsoredDataSize")]
 	pub sponsored_data_size: Option<u32>,
 
 	/// FIXME should we delete this or repurpose it?
 	/// None - setVariableMetadata is not sponsored
 	/// Some(v) - setVariableMetadata is sponsored
 	///           if there is v block between txs
-	#[serde(alias="sponsoredDataRateLimit")]
+	#[serde(alias = "sponsoredDataRateLimit")]
 	pub sponsored_data_rate_limit: Option<SponsoringRateLimit>,
-	#[serde(alias="tokenLimit")]
+	#[serde(alias = "tokenLimit")]
 	pub token_limit: Option<u32>,
-	
+
 	// Timeouts for item types in passed blocks
-	#[serde(alias="sponsorTransferTimeout")]
+	#[serde(alias = "sponsorTransferTimeout")]
 	pub sponsor_transfer_timeout: Option<u32>,
-	#[serde(alias="sponsorApproveTimeout")]
+	#[serde(alias = "sponsorApproveTimeout")]
 	pub sponsor_approve_timeout: Option<u32>,
-	#[serde(alias="ownerCanTransfer")]
+	#[serde(alias = "ownerCanTransfer")]
 	pub owner_can_transfer: Option<bool>,
-	#[serde(alias="ownerCanDestroy")]
+	#[serde(alias = "ownerCanDestroy")]
 	pub owner_can_destroy: Option<bool>,
-	#[serde(alias="transfersEnabled")]
+	#[serde(alias = "transfersEnabled")]
 	pub transfers_enabled: Option<bool>,
 }
 
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -975,7 +975,7 @@
 	pub const HelpersContractAddress: H160 = H160([
 		0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49,
 	]);
-	
+
 	// 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f
 	pub const EvmCollectionAddress: H160 = H160([
 		0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f,
modifiedtests/src/eth/createCollection.test.tsdiffbeforeafterboth
--- a/tests/src/eth/createCollection.test.ts
+++ b/tests/src/eth/createCollection.test.ts
@@ -101,7 +101,7 @@
     expect(collection.constOnChainSchema.toHuman()).to.be.eq(constShema);
   });
 
-  itWeb3.only('Set limits', async ({api, web3}) => {
+  itWeb3('Set limits', async ({api, web3}) => {
     const owner = await createEthAccountWithBalance(api, web3);
     const helper = collectionHelper(web3, owner);
     const result = await helper.methods.create721Collection('Const collection', '4', '4').send();