Skip to content
Prev Previous commit
Next Next commit
fix compile issue
  • Loading branch information
Aideepakchaudhary committed Oct 7, 2024
commit a5a27f43b102c9a5cac26c755cba5ca5d0cd34da
2 changes: 1 addition & 1 deletion node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub fn cere_dev_genesis(
sudo: cere_dev::SudoConfig { key: Some(root_key) },
babe: cere_dev::BabeConfig {
authorities: Default::default(),
epoch_config: Some(cere_dev::BABE_GENESIS_EPOCH_CONFIG),
epoch_config: cere_dev::BABE_GENESIS_EPOCH_CONFIG,
..Default::default()
},
im_online: cere_dev::ImOnlineConfig { keys: vec![] },
Expand Down
12 changes: 6 additions & 6 deletions pallets/ddc-clusters/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub mod v1 {

pub fn migrate_to_v1<T: Config>() -> Weight {
let on_chain_version = Pallet::<T>::on_chain_storage_version();
let current_version = Pallet::<T>::current_storage_version();
let current_version = Pallet::<T>::in_code_storage_version();

info!(
target: LOG_TARGET,
Expand Down Expand Up @@ -119,7 +119,7 @@ pub mod v1 {
"the cluster count before and after the migration should be the same"
);

let current_version = Pallet::<T>::current_storage_version();
let current_version = Pallet::<T>::in_code_storage_version();
let on_chain_version = Pallet::<T>::on_chain_storage_version();

frame_support::ensure!(current_version == 1, "must_upgrade");
Expand Down Expand Up @@ -249,7 +249,7 @@ pub mod v2 {
pub struct MigrateToV2<T>(sp_std::marker::PhantomData<T>);
impl<T: Config> OnRuntimeUpgrade for MigrateToV2<T> {
fn on_runtime_upgrade() -> Weight {
let current_version = Pallet::<T>::current_storage_version();
let current_version = Pallet::<T>::in_code_storage_version();
let onchain_version = Pallet::<T>::on_chain_storage_version();
let mut weight = T::DbWeight::get().reads(1);

Expand Down Expand Up @@ -372,18 +372,18 @@ pub mod v2 {
let post_clusters_nodes_count = ClustersNodes::<T>::iter().count() as u32;
assert_eq!(
pre_clusters_nodes_count, post_clusters_nodes_count,
"the clusters nodes count before (pre: {}) and after (post: {}) the migration should be the same",
"the clusters nodes count before (pre: {}) and after (post: {}) the migration should be the same",
pre_clusters_nodes_count, post_clusters_nodes_count
);

let post_clusters_nodes_stats_count = ClustersNodesStats::<T>::iter().count() as u32;
assert_eq!(
post_clusters_nodes_stats_count, post_clusters_count,
"the clusters statistics ({}) should be equal to clusters count ({}) after the migration",
"the clusters statistics ({}) should be equal to clusters count ({}) after the migration",
post_clusters_nodes_stats_count, post_clusters_count
);

let current_version = Pallet::<T>::current_storage_version();
let current_version = Pallet::<T>::in_code_storage_version();
let onchain_version = Pallet::<T>::on_chain_storage_version();

frame_support::ensure!(current_version == 2, "must_upgrade");
Expand Down
2 changes: 1 addition & 1 deletion pallets/ddc-staking/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub mod v1 {
pub struct MigrateToV1<T>(sp_std::marker::PhantomData<T>);
impl<T: Config> OnRuntimeUpgrade for MigrateToV1<T> {
fn on_runtime_upgrade() -> Weight {
let current_version = Pallet::<T>::current_storage_version();
let current_version = Pallet::<T>::in_code_storage_version();
let onchain_version = Pallet::<T>::on_chain_storage_version();
let mut weight = T::DbWeight::get().reads(1);

Expand Down
12 changes: 6 additions & 6 deletions runtime/cere-dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use frame_election_provider_support::{
bounds::ElectionBoundsBuilder, onchain, BalancingConfig, SequentialPhragmen, VoteWeight,
};
use frame_support::{
construct_runtime,
construct_runtime, derive_impl,
dispatch::DispatchClass,
pallet_prelude::Get,
parameter_types,
Expand All @@ -51,7 +51,7 @@ use frame_support::{
pub use frame_system::Call as SystemCall;
use frame_system::{
limits::{BlockLength, BlockWeights},
EnsureRoot,
EnsureRoot, EnsureSigned,
};
pub use node_primitives::{AccountId, Signature};
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce};
Expand Down Expand Up @@ -222,6 +222,7 @@ parameter_types! {

const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct());

#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = Everything;
type BlockWeights = RuntimeBlockWeights;
Expand All @@ -241,11 +242,8 @@ impl frame_system::Config for Runtime {
type Version = Version;
type PalletInfo = PalletInfo;
type AccountData = pallet_balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = frame_system::weights::SubstrateWeight<Runtime>;
type SS58Prefix = ConstU16<54>;
type OnSetCode = ();
type MaxConsumers = ConstU32<16>;
}

Expand Down Expand Up @@ -900,6 +898,8 @@ impl pallet_contracts::Config for Runtime {
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type MaxDelegateDependencies = MaxDelegateDependencies;
type RuntimeHoldReason = RuntimeHoldReason;
type UploadOrigin = EnsureSigned<Self::AccountId>;
type InstantiateOrigin = EnsureSigned<Self::AccountId>;
type Debug = ();
type Environment = ();
type Migrations = ();
Expand Down Expand Up @@ -1469,7 +1469,7 @@ impl_runtime_apis! {
Executive::execute_block(block);
}

fn initialize_block(header: &<Block as BlockT>::Header) {
fn initialize_block(header: &<Block as BlockT>::Header) -> sp_runtime::ExtrinsicInclusionMode {
Executive::initialize_block(header)
}
}
Expand Down
12 changes: 6 additions & 6 deletions runtime/cere/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use frame_election_provider_support::{
bounds::ElectionBoundsBuilder, onchain, BalancingConfig, SequentialPhragmen, VoteWeight,
};
use frame_support::{
construct_runtime,
construct_runtime, derive_impl,
dispatch::DispatchClass,
pallet_prelude::Get,
parameter_types,
Expand All @@ -50,7 +50,7 @@ use frame_support::{
pub use frame_system::Call as SystemCall;
use frame_system::{
limits::{BlockLength, BlockWeights},
EnsureRoot,
EnsureRoot,EnsureSigned,
};
pub use node_primitives::{AccountId, Signature};
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce};
Expand Down Expand Up @@ -217,6 +217,7 @@ parameter_types! {

const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct());

#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = Everything;
type BlockWeights = RuntimeBlockWeights;
Expand All @@ -236,11 +237,8 @@ impl frame_system::Config for Runtime {
type Version = Version;
type PalletInfo = PalletInfo;
type AccountData = pallet_balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = frame_system::weights::SubstrateWeight<Runtime>;
type SS58Prefix = ConstU16<54>;
type OnSetCode = ();
type MaxConsumers = ConstU32<16>;
}

Expand Down Expand Up @@ -903,6 +901,8 @@ impl pallet_contracts::Config for Runtime {
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type MaxDelegateDependencies = MaxDelegateDependencies;
type RuntimeHoldReason = RuntimeHoldReason;
type UploadOrigin = EnsureSigned<Self::AccountId>;
type InstantiateOrigin = EnsureSigned<Self::AccountId>;
type Debug = ();
type Environment = ();
type Migrations = ();
Expand Down Expand Up @@ -1472,7 +1472,7 @@ impl_runtime_apis! {
Executive::execute_block(block);
}

fn initialize_block(header: &<Block as BlockT>::Header) {
fn initialize_block(header: &<Block as BlockT>::Header) -> sp_runtime::ExtrinsicInclusionMode {
Executive::initialize_block(header)
}
}
Expand Down