Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -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
)
})
Expand Down
1 change: 1 addition & 0 deletions node/src/command.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::all)]
// Copyright 2022 Webb Technologies Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
4 changes: 2 additions & 2 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
1 change: 1 addition & 0 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RuntimeApi, Executor, RB, BIQ, BIC>(
parachain_config: Configuration,
Expand Down
8 changes: 2 additions & 6 deletions runtime/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NegativeImbalance> for Author {
Expand Down
24 changes: 7 additions & 17 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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},
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
14 changes: 7 additions & 7 deletions runtime/src/protocol_substrate_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down
4 changes: 2 additions & 2 deletions runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -96,7 +96,7 @@ parameter_types! {
pub const MaxInstructions: u32 = 100;
}

match_type! {
match_types! {
pub type ParentOrParentsExecutivePlurality: impl Contains<MultiLocation> = {
MultiLocation { parents: 1, interior: Here } |
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
Expand Down
1 change: 1 addition & 0 deletions standalone/node/src/command_helper.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::all)]
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
Expand Down
2 changes: 1 addition & 1 deletion standalone/node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions standalone/node/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::all)]
// Copyright 2022 Webb Technologies Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
26 changes: 13 additions & 13 deletions standalone/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions standalone/runtime/src/protocol_substrate_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down