Skip to content

Commit

Permalink
chore: upgrade to polkadot 0.9.38
Browse files Browse the repository at this point in the history
  • Loading branch information
sander2 committed Mar 14, 2023
1 parent 3508b60 commit f6c9af5
Show file tree
Hide file tree
Showing 23 changed files with 1,719 additions and 1,406 deletions.
1,488 changes: 846 additions & 642 deletions Cargo.lock

Large diffs are not rendered by default.

441 changes: 221 additions & 220 deletions Cargo.toml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions crates/collator-selection/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ benchmarks! {
set_invulnerables {
let b in 1 .. T::MaxInvulnerables::get();
let new_invulnerables = register_validators::<T>(b);
let origin = T::UpdateOrigin::successful_origin();
let origin = T::UpdateOrigin::try_successful_origin().unwrap();
}: {
assert_ok!(
<CollatorSelection<T>>::set_invulnerables(origin, new_invulnerables.clone())
Expand All @@ -115,7 +115,7 @@ benchmarks! {

set_desired_candidates {
let max: u32 = 999;
let origin = T::UpdateOrigin::successful_origin();
let origin = T::UpdateOrigin::try_successful_origin().unwrap();
}: {
assert_ok!(
<CollatorSelection<T>>::set_desired_candidates(origin, max.clone())
Expand All @@ -127,7 +127,7 @@ benchmarks! {

set_candidacy_bond {
let bond_amount: BalanceOf<T> = T::StakingCurrency::minimum_balance() * 10u32.into();
let origin = T::UpdateOrigin::successful_origin();
let origin = T::UpdateOrigin::try_successful_origin().unwrap();
}: {
assert_ok!(
<CollatorSelection<T>>::set_candidacy_bond(origin, bond_amount.clone())
Expand Down
4 changes: 0 additions & 4 deletions crates/collator-selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,6 @@ pub mod pallet {
DispatchClass::Mandatory,
);
}

fn note_uncle(_author: T::AccountId, _age: T::BlockNumber) {
//TODO can we ignore this?
}
}

/// Play the role of the session manager.
Expand Down
4 changes: 1 addition & 3 deletions crates/collator-selection/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ frame_support::construct_runtime!(
Aura: pallet_aura::{Pallet, Storage, Config<T>},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
CollatorSelection: collator_selection::{Pallet, Call, Storage, Event<T>},
Authorship: pallet_authorship::{Pallet, Call, Storage, Inherent},
Authorship: pallet_authorship::{Pallet, Storage},
}
);

Expand Down Expand Up @@ -110,8 +110,6 @@ impl FindAuthor<u64> for Author4 {

impl pallet_authorship::Config for Test {
type FindAuthor = Author4;
type UncleGenerations = ();
type FilterUncle = ();
type EventHandler = CollatorSelection;
}

Expand Down
2 changes: 1 addition & 1 deletion crates/democracy/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ benchmarks! {
}

fast_track {
let origin_fast_track = T::FastTrackOrigin::successful_origin();
let origin_fast_track = T::FastTrackOrigin::try_successful_origin().unwrap();
let proposal_hash = add_proposal::<T>(0)?;
let prop_index = PublicProps::<T>::get()
.iter()
Expand Down
6 changes: 3 additions & 3 deletions crates/tx-pause/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ benchmarks! {
let full_name: FullNameOf<T> = (name::<T>(b"SomePalletName"), Some(name::<T>(b"SomePalletName")));
// let pallet_name: PalletNameOf<T> = name::<T>(b"SomePalletName");
// let maybe_call_name: Option<CallNameOf<T>> = Some(name::<T>(b"some_call_name"));
let origin = T::PauseOrigin::successful_origin();
let origin = T::PauseOrigin::try_successful_origin().unwrap();
// let call = Call::<T>::pause { full_name: full_name.clone() };
// let call = Call::<T>::pause { pallet_name: pallet_name.clone(), maybe_call_name: maybe_call_name.clone() };

Expand All @@ -37,14 +37,14 @@ benchmarks! {

unpause {
let full_name: FullNameOf<T> = (name::<T>(b"SomePalletName"), Some(name::<T>(b"SomePalletName")));
let pause_origin = T::PauseOrigin::successful_origin();
let pause_origin = T::PauseOrigin::try_successful_origin().unwrap();

TxPause::<T>::pause(
pause_origin,
full_name.clone(),
)?;

let unpause_origin = T::UnpauseOrigin::successful_origin();
let unpause_origin = T::UnpauseOrigin::try_successful_origin().unwrap();
// let call = Call::<T>::unpause { pallet_name: pallet_name.clone(), maybe_call_name: maybe_call_name.clone() };

}: _<T::RuntimeOrigin>(unpause_origin, full_name.clone())
Expand Down
31 changes: 17 additions & 14 deletions parachain/runtime/interlay/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// We allow for 0.5 seconds of compute with a 12 second average block time.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64,
cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64,
);

parameter_types! {
Expand Down Expand Up @@ -169,7 +169,6 @@ impl Contains<RuntimeCall> for BaseCallFilter {
if matches!(
call,
RuntimeCall::System(_)
| RuntimeCall::Authorship(_)
| RuntimeCall::Session(_)
| RuntimeCall::Timestamp(_)
| RuntimeCall::ParachainSystem(_)
Expand Down Expand Up @@ -232,14 +231,8 @@ impl frame_system::Config for Runtime {
type MaxConsumers = frame_support::traits::ConstU32<16>;
}

parameter_types! {
pub const UncleGenerations: u32 = 0;
}

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

Expand Down Expand Up @@ -413,8 +406,8 @@ impl EnsureOrigin<RuntimeOrigin> for EnsureKintsugiLabs {
}

#[cfg(feature = "runtime-benchmarks")]
fn successful_origin() -> RuntimeOrigin {
RuntimeOrigin::from(RawOrigin::None)
fn try_successful_origin() -> Result<RuntimeOrigin, ()> {
Ok(RuntimeOrigin::from(RawOrigin::None))
}
}

Expand Down Expand Up @@ -716,8 +709,8 @@ impl EnsureOriginWithArg<RuntimeOrigin, Option<u32>> for AssetAuthority {
}

#[cfg(feature = "runtime-benchmarks")]
fn successful_origin(_asset_id: &Option<u32>) -> RuntimeOrigin {
EnsureRoot::successful_origin()
fn try_successful_origin(_: &Option<u32>) -> Result<RuntimeOrigin, ()> {
EnsureRoot::try_successful_origin()
}
}

Expand Down Expand Up @@ -1206,7 +1199,7 @@ construct_runtime! {
TechnicalMembership: pallet_membership::{Pallet, Call, Storage, Event<T>, Config<T>} = 72,
Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 73,

Authorship: pallet_authorship::{Pallet, Call, Storage} = 80,
Authorship: pallet_authorship::{Pallet, Storage} = 80,
CollatorSelection: collator_selection::{Pallet, Call, Storage, Event<T>, Config<T>} = 81,
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 82,
Aura: pallet_aura::{Pallet, Storage, Config<T>} = 83,
Expand Down Expand Up @@ -1269,10 +1262,12 @@ pub type Executive = frame_executive::Executive<
>,
democracy::migrations::v1::Migration<Runtime>,
SudoMigrationCheck,
orml_asset_registry::Migration<Runtime>,
orml_unknown_tokens::Migration<Runtime>,
),
>;

struct SudoMigrationCheck;
pub struct SudoMigrationCheck;

impl OnRuntimeUpgrade for SudoMigrationCheck {
fn on_runtime_upgrade() -> Weight {
Expand Down Expand Up @@ -1398,6 +1393,14 @@ impl_runtime_apis! {
) -> pallet_transaction_payment_rpc_runtime_api::FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, len)
}

fn query_weight_to_fee(weight: Weight) -> Balance {
TransactionPayment::weight_to_fee(weight)
}

fn query_length_to_fee(length: u32) -> Balance {
TransactionPayment::length_to_fee(length)
}
}

impl loans_rpc_runtime_api::LoansApi<
Expand Down
Loading

0 comments on commit f6c9af5

Please sign in to comment.