git.delta.rocks / unique-network / refs/commits / 6c1065a66823

difftreelog

Code style and format

Greg Zaitsev2021-07-27parent: #793a35d.patch.diff
in: master

10 files changed

modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -946,7 +946,7 @@
 			let mut target_collection = Self::get_collection(collection_id)?;
 
 			Self::check_owner_permissions(&target_collection, &sender)?;
-			
+
 			target_collection.transfers_enabled = value;
 			Self::save_collection(target_collection);
 
@@ -1607,10 +1607,7 @@
 		);
 
 		// preliminary transfer check
-		ensure!(
-			collection.transfers_enabled,
-			Error::<T>::TransferNotAllowed
-		);
+		ensure!(collection.transfers_enabled, Error::<T>::TransferNotAllowed);
 
 		Ok(())
 	}
modifiedpallets/nft/src/tests.rsdiffbeforeafterboth
--- a/pallets/nft/src/tests.rs
+++ b/pallets/nft/src/tests.rs
@@ -2387,7 +2387,9 @@
 		let origin1 = Origin::signed(1);
 
 		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-		assert_ok!(TemplateModule::set_transfers_enabled_flag(origin1, 1, false));
+		assert_ok!(TemplateModule::set_transfers_enabled_flag(
+			origin1, 1, false
+		));
 
 		let data = default_nft_data();
 		create_test_item(collection_id, &data.into());
modifiedruntime/src/lib.rsdiffbeforeafterboth
--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -154,7 +154,7 @@
 	transaction_version: 1,
 };
 
-pub const MILLISECS_PER_BLOCK: u64 = 12000;
+pub const MILLISECS_PER_BLOCK: u64 = 1200;
 
 pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
 
modifiedtests/src/change-collection-owner.test.tsdiffbeforeafterboth
--- a/tests/src/change-collection-owner.test.ts
+++ b/tests/src/change-collection-owner.test.ts
@@ -7,7 +7,7 @@
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from './substrate/privateKey';
 import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
-import { createCollectionExpectSuccess, normalizeAccountId } from './util/helpers';
+import { createCollectionExpectSuccess } from './util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
modifiedtests/src/enableDisableTransfer.test.tsdiffbeforeafterboth
--- a/tests/src/enableDisableTransfer.test.ts
+++ b/tests/src/enableDisableTransfer.test.ts
@@ -12,7 +12,7 @@
   createCollectionExpectSuccess,
   transferExpectSuccess,
   transferExpectFailure,
-  setTransferFlagExpectSuccess
+  setTransferFlagExpectSuccess,
 } from './util/helpers';
 
 chai.use(chaiAsPromised);
modifiedtests/src/pallet-presence.test.tsdiffbeforeafterboth
before · tests/src/pallet-presence.test.ts
1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56import { ApiPromise } from '@polkadot/api';7import { expect } from 'chai';8import usingApi from './substrate/substrate-api';910function getModuleNames(api: ApiPromise): string[] {11  return api.runtimeMetadata.asLatest.modules.map(m => m.name.toString().toLowerCase());12}1314// Pallets that must always be present15const requiredPallets = [16  'balances',17  'randomnesscollectiveflip',18  'timestamp',19  'transactionpayment',20  'treasury',21  'system',22  'vesting',23  'parachainsystem',24  'parachaininfo',25  'evm',26  'ethereum',27  'xcmpqueue',28  'polkadotxcm',29  'cumulusxcm',30  'dmpqueue',31  'inflation',32  'nft',33  'scheduler',34  'nftpayment',35  'charging'36];3738// Pallets that depend on consensus and governance configuration39const consensusPallets = [40  'sudo',41  'aura',42  'auraext'43];4445describe('Pallet presence', () => {46  it('Required pallets are present', async () => {47    await usingApi(async api => {48      for (let i=0; i<requiredPallets.length; i++) {49        expect(getModuleNames(api)).to.include(requiredPallets[i]);50      }51    });52  });53  it('Governance and consensus pallets are present', async () => {54    await usingApi(async api => {55      for (let i=0; i<consensusPallets.length; i++) {56        expect(getModuleNames(api)).to.include(consensusPallets[i]);57      }58    });59  });60  it('No extra pallets are included', async () => {61    await usingApi(async api => {62      expect(getModuleNames(api).length).to.be.equal(requiredPallets.length + consensusPallets.length);63    });64  });65});
modifiedtests/src/setConstOnChainSchema.test.tsdiffbeforeafterboth
--- a/tests/src/setConstOnChainSchema.test.ts
+++ b/tests/src/setConstOnChainSchema.test.ts
@@ -11,7 +11,6 @@
 import {
   createCollectionExpectSuccess,
   destroyCollectionExpectSuccess,
-  normalizeAccountId,
 } from './util/helpers';
 
 chai.use(chaiAsPromised);
modifiedtests/src/setVariableOnChainSchema.test.tsdiffbeforeafterboth
--- a/tests/src/setVariableOnChainSchema.test.ts
+++ b/tests/src/setVariableOnChainSchema.test.ts
@@ -11,7 +11,6 @@
 import {
   createCollectionExpectSuccess,
   destroyCollectionExpectSuccess,
-  normalizeAccountId,
 } from './util/helpers';
 
 chai.use(chaiAsPromised);
modifiedtests/src/substrate/substrate-api.tsdiffbeforeafterboth
--- a/tests/src/substrate/substrate-api.ts
+++ b/tests/src/substrate/substrate-api.ts
@@ -48,12 +48,12 @@
   console.warn = outFn;
 
   try {
-   await promisifySubstrate(api, async () => {
+    await promisifySubstrate(api, async () => {
       if (api) {
         await api.isReadyOrError;
         result = await action(api);
       }
-   })();
+    })();
   } finally {
     await api.disconnect();
     console.error = consoleErr;
modifiedtests/src/util/helpers.tsdiffbeforeafterboth
--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -555,7 +555,7 @@
   });
 }
 
-export async function toggleContractWhitelistExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, value: boolean = true) {
+export async function toggleContractWhitelistExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, value = true) {
   await usingApi(async (api) => {
     const tx = api.tx.nft.toggleContractWhiteList(contractAddress, value);
     const events = await submitTransactionAsync(sender, tx);
@@ -761,7 +761,7 @@
   recipient: IKeyringPair,
   value: number | bigint = 1,
   blockTimeMs: number,
-  blockSchedule: number
+  blockSchedule: number,
 ) {
   await usingApi(async (api: ApiPromise) => {
     const blockNumber: number | undefined = await getBlockNumber(api);