Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into kiz-fix-hooked
Browse files Browse the repository at this point in the history
  • Loading branch information
parity-processbot committed Feb 1, 2023
2 parents 53ee3bd + 8cfe326 commit b7059c5
Show file tree
Hide file tree
Showing 50 changed files with 609 additions and 1,226 deletions.
24 changes: 0 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ members = [
"client/consensus/manual-seal",
"client/consensus/pow",
"client/consensus/slots",
"client/consensus/uncles",
"client/db",
"client/executor",
"client/executor/common",
Expand Down Expand Up @@ -177,7 +176,6 @@ members = [
"primitives/arithmetic",
"primitives/arithmetic/fuzzer",
"primitives/authority-discovery",
"primitives/authorship",
"primitives/beefy",
"primitives/block-builder",
"primitives/blockchain",
Expand Down
6 changes: 3 additions & 3 deletions bin/node-template/pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ frame-support = { version = "4.0.0-dev", default-features = false, path = "../..
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../../../frame/system" }

[dev-dependencies]
sp-core = { version = "7.0.0", default-features = false, path = "../../../../primitives/core" }
sp-io = { version = "7.0.0", default-features = false, path = "../../../../primitives/io" }
sp-runtime = { version = "7.0.0", default-features = false, path = "../../../../primitives/runtime" }
sp-core = { version = "7.0.0", path = "../../../../primitives/core" }
sp-io = { version = "7.0.0", path = "../../../../primitives/io" }
sp-runtime = { version = "7.0.0", path = "../../../../primitives/runtime" }

[features]
default = ["std"]
Expand Down
5 changes: 2 additions & 3 deletions bin/node-template/pallets/template/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate as pallet_template;
use frame_support::traits::{ConstU16, ConstU64};
use frame_system as system;
use sp_core::H256;
use sp_runtime::{
testing::Header,
Expand All @@ -22,7 +21,7 @@ frame_support::construct_runtime!(
}
);

impl system::Config for Test {
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
Expand Down Expand Up @@ -55,5 +54,5 @@ impl pallet_template::Config for Test {

// Build genesis storage according to the mock runtime.
pub fn new_test_ext() -> sp_io::TestExternalities {
system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
frame_system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
}
1 change: 1 addition & 0 deletions bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ impl pallet_grandpa::Config for Runtime {

type WeightInfo = ();
type MaxAuthorities = ConstU32<32>;
type MaxSetIdSessionEntries = ConstU64<0>;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
2 changes: 0 additions & 2 deletions bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" }
sp-core = { version = "7.0.0", path = "../../../primitives/core" }
sp-runtime = { version = "7.0.0", path = "../../../primitives/runtime" }
sp-timestamp = { version = "4.0.0-dev", path = "../../../primitives/timestamp" }
sp-authorship = { version = "4.0.0-dev", path = "../../../primitives/authorship" }
sp-inherents = { version = "4.0.0-dev", path = "../../../primitives/inherents" }
sp-keyring = { version = "7.0.0", path = "../../../primitives/keyring" }
sp-keystore = { version = "0.13.0", path = "../../../primitives/keystore" }
Expand All @@ -71,7 +70,6 @@ sc-network = { version = "0.10.0-dev", path = "../../../client/network" }
sc-network-common = { version = "0.10.0-dev", path = "../../../client/network/common" }
sc-consensus-slots = { version = "0.10.0-dev", path = "../../../client/consensus/slots" }
sc-consensus-babe = { version = "0.10.0-dev", path = "../../../client/consensus/babe" }
sc-consensus-uncles = { version = "0.10.0-dev", path = "../../../client/consensus/uncles" }
grandpa = { version = "0.10.0-dev", package = "sc-finality-grandpa", path = "../../../client/finality-grandpa" }
sc-rpc = { version = "4.0.0-dev", path = "../../../client/rpc" }
sc-basic-authorship = { version = "0.10.0-dev", path = "../../../client/basic-authorship" }
Expand Down
12 changes: 2 additions & 10 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,7 @@ pub fn new_partial(
slot_duration,
);

let uncles =
sp_authorship::InherentDataProvider::<<Block as BlockT>::Header>::check_inherents();

Ok((slot, timestamp, uncles))
Ok((slot, timestamp))
},
&task_manager.spawn_essential_handle(),
config.prometheus_registry(),
Expand Down Expand Up @@ -440,11 +437,6 @@ pub fn new_full_base(
create_inherent_data_providers: move |parent, ()| {
let client_clone = client_clone.clone();
async move {
let uncles = sc_consensus_uncles::create_uncles_inherent_data_provider(
&*client_clone,
parent,
)?;

let timestamp = sp_timestamp::InherentDataProvider::from_system_time();

let slot =
Expand All @@ -459,7 +451,7 @@ pub fn new_full_base(
&parent,
)?;

Ok((slot, timestamp, uncles, storage_proof))
Ok((slot, timestamp, storage_proof))
}
},
force_authoring,
Expand Down
11 changes: 5 additions & 6 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,8 @@ impl pallet_timestamp::Config for Runtime {
type WeightInfo = pallet_timestamp::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const UncleGenerations: BlockNumber = 5;
}

impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
type UncleGenerations = UncleGenerations;
type FilterUncle = ();
type EventHandler = (Staking, ImOnline);
}

Expand Down Expand Up @@ -1316,6 +1310,10 @@ impl pallet_authority_discovery::Config for Runtime {
type MaxAuthorities = MaxAuthorities;
}

parameter_types! {
pub const MaxSetIdSessionEntries: u32 = BondingDuration::get() * SessionsPerEra::get();
}

impl pallet_grandpa::Config for Runtime {
type RuntimeEvent = RuntimeEvent;

Expand All @@ -1337,6 +1335,7 @@ impl pallet_grandpa::Config for Runtime {

type WeightInfo = ();
type MaxAuthorities = MaxAuthorities;
type MaxSetIdSessionEntries = MaxSetIdSessionEntries;
}

parameter_types! {
Expand Down
19 changes: 0 additions & 19 deletions client/consensus/uncles/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions client/consensus/uncles/README.md

This file was deleted.

45 changes: 0 additions & 45 deletions client/consensus/uncles/src/lib.rs

This file was deleted.

23 changes: 15 additions & 8 deletions frame/alliance/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use sp_std::{
prelude::*,
};

use frame_benchmarking::v1::{account, benchmarks_instance_pallet};
use frame_benchmarking::v1::{account, benchmarks_instance_pallet, BenchmarkError};
use frame_support::traits::{EnsureOrigin, Get, UnfilteredDispatchable};
use frame_system::{Pallet as System, RawOrigin as SystemOrigin};

Expand Down Expand Up @@ -581,7 +581,8 @@ benchmarks_instance_pallet! {
let rule = rule(b"hello world");

let call = Call::<T, I>::set_rule { rule: rule.clone() };
let origin = T::AdminOrigin::successful_origin();
let origin =
T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
}: { call.dispatch_bypass_filter(origin)? }
verify {
assert_eq!(Alliance::<T, I>::rule(), Some(rule.clone()));
Expand All @@ -594,7 +595,8 @@ benchmarks_instance_pallet! {
let announcement = announcement(b"hello world");

let call = Call::<T, I>::announce { announcement: announcement.clone() };
let origin = T::AnnouncementOrigin::successful_origin();
let origin =
T::AnnouncementOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
}: { call.dispatch_bypass_filter(origin)? }
verify {
assert!(Alliance::<T, I>::announcements().contains(&announcement));
Expand All @@ -609,7 +611,8 @@ benchmarks_instance_pallet! {
Announcements::<T, I>::put(announcements);

let call = Call::<T, I>::remove_announcement { announcement: announcement.clone() };
let origin = T::AnnouncementOrigin::successful_origin();
let origin =
T::AnnouncementOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
}: { call.dispatch_bypass_filter(origin)? }
verify {
assert!(Alliance::<T, I>::announcements().is_empty());
Expand Down Expand Up @@ -665,7 +668,8 @@ benchmarks_instance_pallet! {

let ally1_lookup = T::Lookup::unlookup(ally1.clone());
let call = Call::<T, I>::elevate_ally { ally: ally1_lookup };
let origin = T::MembershipManager::successful_origin();
let origin =
T::MembershipManager::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
}: { call.dispatch_bypass_filter(origin)? }
verify {
assert!(!Alliance::<T, I>::is_ally(&ally1));
Expand Down Expand Up @@ -725,7 +729,8 @@ benchmarks_instance_pallet! {

let fellow2_lookup = T::Lookup::unlookup(fellow2.clone());
let call = Call::<T, I>::kick_member { who: fellow2_lookup };
let origin = T::MembershipManager::successful_origin();
let origin =
T::MembershipManager::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
}: { call.dispatch_bypass_filter(origin)? }
verify {
assert!(!Alliance::<T, I>::is_member(&fellow2));
Expand Down Expand Up @@ -754,7 +759,8 @@ benchmarks_instance_pallet! {
unscrupulous_list.extend(websites.into_iter().map(UnscrupulousItem::Website));

let call = Call::<T, I>::add_unscrupulous_items { items: unscrupulous_list.clone() };
let origin = T::AnnouncementOrigin::successful_origin();
let origin =
T::AnnouncementOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
}: { call.dispatch_bypass_filter(origin)? }
verify {
assert_last_event::<T, I>(Event::UnscrupulousItemAdded { items: unscrupulous_list }.into());
Expand Down Expand Up @@ -784,7 +790,8 @@ benchmarks_instance_pallet! {
unscrupulous_list.extend(websites.into_iter().map(UnscrupulousItem::Website));

let call = Call::<T, I>::remove_unscrupulous_items { items: unscrupulous_list.clone() };
let origin = T::AnnouncementOrigin::successful_origin();
let origin =
T::AnnouncementOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
}: { call.dispatch_bypass_filter(origin)? }
verify {
assert_last_event::<T, I>(Event::UnscrupulousItemRemoved { items: unscrupulous_list }.into());
Expand Down
Loading

0 comments on commit b7059c5

Please sign in to comment.