Skip to content

Commit

Permalink
Merge branch 'development' into fix_upgrade_polkadot_1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
renauter authored Sep 4, 2024
2 parents 984627a + ea6fdf3 commit 84b713d
Show file tree
Hide file tree
Showing 9 changed files with 264 additions and 296 deletions.
298 changes: 151 additions & 147 deletions substrate-node/Cargo.lock

Large diffs are not rendered by default.

144 changes: 71 additions & 73 deletions substrate-node/Cargo.toml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions substrate-node/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ pub fn run() -> sc_cli::Result<()> {
}
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()),

#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
You can enable it with `--features try-runtime`."
Expand Down
1 change: 0 additions & 1 deletion substrate-node/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
import_queue,
block_announce_validator_builder: None,
warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)),
block_relay: None,
})?;

if config.offchain_worker.enabled {
Expand Down
4 changes: 2 additions & 2 deletions substrate-node/pallets/pallet-smart-contract/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub const EXISTENTIAL_DEPOSIT: u64 = 500;
parameter_types! {
pub const MaxLocks: u32 = 50;
pub const MaxReserves: u32 = 50;
pub const ExistentialDeposit: u64 = EXISTENTIAL_DEPOSIT;
pub const ExistentialDepositBalance: u64 = EXISTENTIAL_DEPOSIT;
}

impl pallet_balances::Config for TestRuntime {
Expand All @@ -162,7 +162,7 @@ impl pallet_balances::Config for TestRuntime {
/// The ubiquitous event type.
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type ExistentialDeposit = ExistentialDepositBalance;
type AccountStore = System;
type WeightInfo = pallet_balances::weights::SubstrateWeight<TestRuntime>;
type FreezeIdentifier = ();
Expand Down
86 changes: 33 additions & 53 deletions substrate-node/pallets/pallet-smart-contract/src/tests.rs

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions substrate-node/pallets/pallet-tft-bridge/src/migrations/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ impl<T: Config> OnRuntimeUpgrade for MigrateBurnTransactionsV2<T> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::TryRuntimeError> {
info!("current pallet version: {:?}", PalletVersion::<T>::get());
ensure!(
PalletVersion::<T>::get() >= types::StorageVersion::V1,
DispatchError::Other("Unexpected pallet version")
);
if PalletVersion::<T>::get() != types::StorageVersion::V1 {
return Ok(Vec::<u8>::new());
}

let burn_transactions_count: u64 =
migrations::types::v1::BurnTransactions::<T>::iter().count() as u64;
Expand All @@ -36,7 +35,7 @@ impl<T: Config> OnRuntimeUpgrade for MigrateBurnTransactionsV2<T> {
executed_burn_transactions_count
);

info!("👥 TFT-BRIDGE pallet to V2 passes PRE migrate checks ✅",);
info!("👥 TFT-BRIDGE pallet to V1 passes PRE migrate checks ✅",);
Ok(Vec::<u8>::new())
}

Expand All @@ -55,7 +54,7 @@ impl<T: Config> OnRuntimeUpgrade for MigrateBurnTransactionsV2<T> {
) -> Result<(), sp_runtime::TryRuntimeError> {
info!("current pallet version: {:?}", PalletVersion::<T>::get());
ensure!(
PalletVersion::<T>::get() >= types::StorageVersion::V2,
PalletVersion::<T>::get() == types::StorageVersion::V2,
DispatchError::Other("Unexpected pallet version")
);

Expand Down
4 changes: 1 addition & 3 deletions substrate-node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ version.workspace = true
targets = ["x86_64-unknown-linux-gnu"]

[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-v1.2.0" }
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-v1.1.0" }

[dependencies]
smallvec.workspace = true
Expand Down Expand Up @@ -59,7 +59,6 @@ sp-api.workspace = true
sp-block-builder.workspace = true
sp-consensus-aura.workspace = true
sp-core.workspace = true
sp-genesis-builder.workspace = true
sp-inherents.workspace = true
sp-offchain.workspace = true
sp-runtime.workspace = true
Expand Down Expand Up @@ -100,7 +99,6 @@ std = [
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-inherents/std",
"sp-offchain/std",
"sp-runtime/std",
Expand Down
11 changes: 0 additions & 11 deletions substrate-node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use tfchain_support::{
types::PublicIP,
};

use frame_support::genesis_builder_helper::{build_config, create_default_config};
// A few exports that help ease life for downstream crates.
pub use frame_support::{
construct_runtime, parameter_types,
Expand Down Expand Up @@ -1055,14 +1054,4 @@ impl_runtime_apis! {
Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap()
}
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
}
}
}

0 comments on commit 84b713d

Please sign in to comment.