diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 093cf1647..771534aab 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -290,7 +290,11 @@ fn testnet_genesis( }, sudo: egg_runtime::SudoConfig { key: Some(root_key) }, balances: egg_runtime::BalancesConfig { - balances: endowed_accounts.iter().cloned().map(|k| (k, MILLIUNIT * 4096_000)).collect(), + balances: endowed_accounts + .iter() + .cloned() + .map(|k| (k, MILLIUNIT * 4_096_000)) + .collect(), }, indices: Default::default(), parachain_info: egg_runtime::ParachainInfoConfig { parachain_id: id }, @@ -306,7 +310,7 @@ fn testnet_genesis( .map(|(acc, aura, dkg)| { ( acc.clone(), // account id - acc.clone(), // validator id + acc, // validator id dkg_session_keys(aura, dkg), // session keys ) }) diff --git a/node/src/command.rs b/node/src/command.rs index abaed40d9..e4e4c96a2 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -1,3 +1,4 @@ +#![allow(clippy::all)] // Copyright 2022 Webb Technologies Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 8b646a5f3..62d67c5c1 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -52,7 +52,7 @@ where let mut module = RpcExtension::new(()); let FullDeps { client, pool, deny_unsafe } = deps; - module.merge(SystemRpc::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?; - module.merge(TransactionPaymentRpc::new(client.clone()).into_rpc())?; + module.merge(SystemRpc::new(client.clone(), pool, deny_unsafe).into_rpc())?; + module.merge(TransactionPaymentRpc::new(client).into_rpc())?; Ok(module) } diff --git a/node/src/service.rs b/node/src/service.rs index b64f8c19a..6450c82b7 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -206,6 +206,7 @@ async fn build_relay_chain_interface( /// Start a node with the given parachain `Configuration` and relay chain `Configuration`. /// /// This is the actual implementation that is abstract over the executor and the runtime api. +#[allow(clippy::too_many_arguments)] #[sc_tracing::logging::prefix_logs_with("Parachain")] async fn start_node_impl( parachain_config: Configuration, diff --git a/runtime/src/impls.rs b/runtime/src/impls.rs index 97664c693..760345cf3 100644 --- a/runtime/src/impls.rs +++ b/runtime/src/impls.rs @@ -17,12 +17,8 @@ //! Some configurable implementations as associated type for the substrate runtime. -use crate::{AccountId, Authorship, Balances, NegativeImbalance, Runtime}; -use frame_support::traits::{ - fungibles::{Balanced, CreditOf}, - Currency, OnUnbalanced, -}; -use pallet_asset_tx_payment::HandleCredit; +use crate::{Authorship, Balances, NegativeImbalance}; +use frame_support::traits::{Currency, OnUnbalanced}; pub struct Author; impl OnUnbalanced for Author { diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 0085c0ae9..ba9037d42 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -26,20 +26,15 @@ pub mod xcm_config; use codec::Encode; use dkg_runtime_primitives::{TypedChainId, UnsignedProposal}; -use impls::*; use pallet_dkg_proposals::DKGEcdsaToEthereum; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{ - self, AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, IdentifyAccount, - StaticLookup, Verify, - }, + traits::{self, BlakeTwo256, Block as BlockT, IdentifyAccount, StaticLookup, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, MultiSignature, SaturatedConversion, }; -use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; use sp_std::prelude::*; #[cfg(feature = "std")] @@ -49,18 +44,14 @@ use sp_version::RuntimeVersion; use frame_support::weights::{ ConstantMultiplier, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; -use pallet_linkable_tree::types::EdgeMetadata; -use pallet_transaction_payment::{ - CurrencyAdapter, FeeDetails, Multiplier, RuntimeDispatchInfo, TargetedFeeAdjustment, -}; -use polkadot_runtime_common::impls::DealWithFees; +use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; use sp_runtime::{FixedPointNumber, Perquintill}; -use webb_primitives::{AccountIndex, ChainId, LeafIndex}; +use webb_primitives::AccountIndex; // A few exports that help ease life for downstream crates. pub use dkg_runtime_primitives::crypto::AuthorityId as DKGId; pub use frame_support::{ - construct_runtime, match_type, parameter_types, + construct_runtime, match_types, parameter_types, traits::{Currency, EnsureOneOf, Everything, IsInVec, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, @@ -85,7 +76,6 @@ pub use sp_runtime::{MultiAddress, Perbill, Percent, Permill}; // XCM Imports use smallvec::smallvec; use xcm::latest::prelude::*; -use xcm_executor::XcmExecutor; /// Reputation type pub type Reputation = u128; @@ -324,11 +314,11 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = (); } -pub const EXISTENTIAL_DEPOSIT: u128 = 1 * MILLIUNIT; +pub const EXISTENTIAL_DEPOSIT: u128 = MILLIUNIT; parameter_types! { pub const ExistentialDeposit: u128 = EXISTENTIAL_DEPOSIT; - pub const TransferFee: u128 = 1 * MILLIUNIT; - pub const CreationFee: u128 = 1 * MILLIUNIT; + pub const TransferFee: u128 = MILLIUNIT; + pub const CreationFee: u128 = MILLIUNIT; pub const MaxLocks: u32 = 50; pub const MaxReserves: u32 = 50; } diff --git a/runtime/src/protocol_substrate_config.rs b/runtime/src/protocol_substrate_config.rs index 81dda6d84..3e3629a23 100644 --- a/runtime/src/protocol_substrate_config.rs +++ b/runtime/src/protocol_substrate_config.rs @@ -29,13 +29,13 @@ parameter_types! { pub const Two: u64 = 2; pub const MaxTreeDepth: u8 = 30; pub const RootHistorySize: u32 = 1096; - // 21663839004416932945382355908790599225266501822907911457504978515578255421292 - pub const DefaultZeroElement: Element = Element([ - 108, 175, 153, 072, 237, 133, 150, 036, - 226, 065, 231, 118, 015, 052, 027, 130, - 180, 093, 161, 235, 182, 053, 058, 052, - 243, 171, 172, 211, 096, 076, 229, 047, - ]); + // // 2166383900441693294538235590879059922526650182290791145750497851557825542129 + // pub const DefaultZeroElement: Element = Element([ + // 108, 175, 153, 072, 237, 133, 150, 036, + // 226, 065, 231, 118, 015, 052, 027, 130, + // 180, 093, 161, 235, 182, 053, 058, 052, + // 243, 171, 172, 211, 096, 076, 229, 047, + // ]); pub const NewDefaultZeroElement: Element = Element([0u8; 32]); } diff --git a/runtime/src/xcm_config.rs b/runtime/src/xcm_config.rs index 23a0eba5c..2f029a155 100644 --- a/runtime/src/xcm_config.rs +++ b/runtime/src/xcm_config.rs @@ -18,7 +18,7 @@ use super::{ }; use crate::{DmpQueue, MAXIMUM_BLOCK_WEIGHT}; use frame_support::{ - match_type, parameter_types, + match_types, parameter_types, traits::{Everything, Nothing}, weights::Weight, }; @@ -96,7 +96,7 @@ parameter_types! { pub const MaxInstructions: u32 = 100; } -match_type! { +match_types! { pub type ParentOrParentsExecutivePlurality: impl Contains = { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } diff --git a/standalone/node/src/command_helper.rs b/standalone/node/src/command_helper.rs index 33c6761f4..65147d960 100644 --- a/standalone/node/src/command_helper.rs +++ b/standalone/node/src/command_helper.rs @@ -1,3 +1,4 @@ +#![allow(clippy::all)] // This file is part of Substrate. // Copyright (C) 2022 Parity Technologies (UK) Ltd. diff --git a/standalone/node/src/rpc.rs b/standalone/node/src/rpc.rs index 50e41dbfc..d980df7e7 100644 --- a/standalone/node/src/rpc.rs +++ b/standalone/node/src/rpc.rs @@ -45,7 +45,7 @@ where let mut module = RpcModule::new(()); let FullDeps { client, pool, deny_unsafe } = deps; - module.merge(SystemRpc::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?; + module.merge(SystemRpc::new(client.clone(), pool, deny_unsafe).into_rpc())?; module.merge(TransactionPaymentRpc::new(client).into_rpc())?; // Extend this RPC with a custom API by using the following syntax. diff --git a/standalone/node/src/service.rs b/standalone/node/src/service.rs index ce8eae6ea..15ecdad59 100644 --- a/standalone/node/src/service.rs +++ b/standalone/node/src/service.rs @@ -1,3 +1,4 @@ +#![allow(clippy::all)] // Copyright 2022 Webb Technologies Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/standalone/runtime/src/lib.rs b/standalone/runtime/src/lib.rs index 370c64868..87ed2e7a9 100644 --- a/standalone/runtime/src/lib.rs +++ b/standalone/runtime/src/lib.rs @@ -338,11 +338,11 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = (); } -pub const EXISTENTIAL_DEPOSIT: u128 = 1 * MILLIUNIT; +pub const EXISTENTIAL_DEPOSIT: u128 = MILLIUNIT; parameter_types! { pub const ExistentialDeposit: u128 = EXISTENTIAL_DEPOSIT; - pub const TransferFee: u128 = 1 * MILLIUNIT; - pub const CreationFee: u128 = 1 * MILLIUNIT; + pub const TransferFee: u128 = MILLIUNIT; + pub const CreationFee: u128 = MILLIUNIT; pub const MaxLocks: u32 = 50; pub const MaxReserves: u32 = 50; } @@ -401,7 +401,7 @@ impl pallet_scheduler::Config for Runtime { parameter_types! { pub const PreimageMaxSize: u32 = 4096 * 1024; - pub const PreimageBaseDeposit: Balance = 1 * UNIT; + pub const PreimageBaseDeposit: Balance = UNIT; } impl pallet_preimage::Config for Runtime { @@ -642,9 +642,9 @@ parameter_types! { pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS as u32 / 4; // signed config - pub const SignedRewardBase: Balance = 1 * UNIT; - pub const SignedDepositBase: Balance = 1 * UNIT; - pub const SignedDepositByte: Balance = 1 * CENTS; + pub const SignedRewardBase: Balance = UNIT; + pub const SignedDepositBase: Balance = UNIT; + pub const SignedDepositByte: Balance = CENTS; pub BetterUnsignedThreshold: Perbill = Perbill::from_rational(1u32, 10_000); @@ -971,8 +971,8 @@ parameter_types! { pub const Burn: Permill = Permill::from_percent(50); pub const TipCountdown: BlockNumber = DAYS; pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 1 * UNIT; - pub const DataDepositPerByte: Balance = 1 * CENTS; + pub const TipReportDepositBase: Balance = UNIT; + pub const DataDepositPerByte: Balance = CENTS; pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); pub const MaximumReasonLength: u32 = 300; pub const MaxApprovals: u32 = 100; @@ -1005,11 +1005,11 @@ impl pallet_treasury::Config for Runtime { parameter_types! { pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); pub const BountyValueMinimum: Balance = 5 * UNIT; - pub const BountyDepositBase: Balance = 1 * UNIT; + pub const BountyDepositBase: Balance = UNIT; pub const CuratorDepositMultiplier: Permill = Permill::from_percent(50); - pub const CuratorDepositMin: Balance = 1 * UNIT; + pub const CuratorDepositMin: Balance = UNIT; pub const CuratorDepositMax: Balance = 100 * UNIT; - pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS; + pub const BountyDepositPayoutDelay: BlockNumber = DAYS; pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS; } @@ -1029,7 +1029,7 @@ impl pallet_bounties::Config for Runtime { } parameter_types! { - pub const ChildBountyValueMinimum: Balance = 1 * UNIT; + pub const ChildBountyValueMinimum: Balance = UNIT; } impl pallet_child_bounties::Config for Runtime { diff --git a/standalone/runtime/src/protocol_substrate_config.rs b/standalone/runtime/src/protocol_substrate_config.rs index 8c68bc23f..f282f4ecc 100644 --- a/standalone/runtime/src/protocol_substrate_config.rs +++ b/standalone/runtime/src/protocol_substrate_config.rs @@ -30,12 +30,12 @@ parameter_types! { pub const MaxTreeDepth: u8 = 30; pub const RootHistorySize: u32 = 1096; // 21663839004416932945382355908790599225266501822907911457504978515578255421292 - pub const DefaultZeroElement: Element = Element([ - 108, 175, 153, 072, 237, 133, 150, 036, - 226, 065, 231, 118, 015, 052, 027, 130, - 180, 093, 161, 235, 182, 053, 058, 052, - 243, 171, 172, 211, 096, 076, 229, 047, - ]); + // pub const DefaultZeroElement: Element = Element([ + // 108, 175, 153, 072, 237, 133, 150, 036, + // 226, 065, 231, 118, 015, 052, 027, 130, + // 180, 093, 161, 235, 182, 053, 058, 052, + // 243, 171, 172, 211, 096, 076, 229, 047, + // ]); pub const NewDefaultZeroElement: Element = Element([0u8; 32]); }