Skip to content

Commit 85a8974

Browse files
committed
chore(polkadot): upgrade to v1.2.0 (#905)
1 parent 84b713d commit 85a8974

File tree

9 files changed

+296
-264
lines changed

9 files changed

+296
-264
lines changed

substrate-node/Cargo.lock

Lines changed: 147 additions & 151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

substrate-node/Cargo.toml

Lines changed: 73 additions & 71 deletions
Large diffs are not rendered by default.

substrate-node/node/src/command.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ pub fn run() -> sc_cli::Result<()> {
194194
}
195195
#[cfg(feature = "try-runtime")]
196196
Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()),
197-
198197
#[cfg(not(feature = "try-runtime"))]
199198
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
200199
You can enable it with `--features try-runtime`."

substrate-node/node/src/service.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
205205
import_queue,
206206
block_announce_validator_builder: None,
207207
warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)),
208+
block_relay: None,
208209
})?;
209210

210211
if config.offchain_worker.enabled {

substrate-node/pallets/pallet-smart-contract/src/mock.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub const EXISTENTIAL_DEPOSIT: u64 = 500;
150150
parameter_types! {
151151
pub const MaxLocks: u32 = 50;
152152
pub const MaxReserves: u32 = 50;
153-
pub const ExistentialDepositBalance: u64 = EXISTENTIAL_DEPOSIT;
153+
pub const ExistentialDeposit: u64 = EXISTENTIAL_DEPOSIT;
154154
}
155155

156156
impl pallet_balances::Config for TestRuntime {
@@ -162,7 +162,7 @@ impl pallet_balances::Config for TestRuntime {
162162
/// The ubiquitous event type.
163163
type RuntimeEvent = RuntimeEvent;
164164
type DustRemoval = ();
165-
type ExistentialDeposit = ExistentialDepositBalance;
165+
type ExistentialDeposit = ExistentialDeposit;
166166
type AccountStore = System;
167167
type WeightInfo = pallet_balances::weights::SubstrateWeight<TestRuntime>;
168168
type FreezeIdentifier = ();

substrate-node/pallets/pallet-smart-contract/src/tests.rs

Lines changed: 53 additions & 33 deletions
Large diffs are not rendered by default.

substrate-node/pallets/pallet-tft-bridge/src/migrations/v2.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ impl<T: Config> OnRuntimeUpgrade for MigrateBurnTransactionsV2<T> {
1717
#[cfg(feature = "try-runtime")]
1818
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::TryRuntimeError> {
1919
info!("current pallet version: {:?}", PalletVersion::<T>::get());
20-
if PalletVersion::<T>::get() != types::StorageVersion::V1 {
21-
return Ok(Vec::<u8>::new());
22-
}
20+
ensure!(
21+
PalletVersion::<T>::get() >= types::StorageVersion::V1,
22+
DispatchError::Other("Unexpected pallet version")
23+
);
2324

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

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

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

substrate-node/runtime/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ version.workspace = true
1414
targets = ["x86_64-unknown-linux-gnu"]
1515

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

1919
[dependencies]
2020
smallvec.workspace = true
@@ -59,6 +59,7 @@ sp-api.workspace = true
5959
sp-block-builder.workspace = true
6060
sp-consensus-aura.workspace = true
6161
sp-core.workspace = true
62+
sp-genesis-builder.workspace = true
6263
sp-inherents.workspace = true
6364
sp-offchain.workspace = true
6465
sp-runtime.workspace = true
@@ -99,6 +100,7 @@ std = [
99100
"sp-block-builder/std",
100101
"sp-consensus-aura/std",
101102
"sp-core/std",
103+
"sp-genesis-builder/std",
102104
"sp-inherents/std",
103105
"sp-offchain/std",
104106
"sp-runtime/std",

substrate-node/runtime/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ use tfchain_support::{
3535
types::PublicIP,
3636
};
3737

38+
use frame_support::genesis_builder_helper::{build_config, create_default_config};
3839
// A few exports that help ease life for downstream crates.
3940
pub use frame_support::{
4041
construct_runtime, parameter_types,
@@ -1054,4 +1055,14 @@ impl_runtime_apis! {
10541055
Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap()
10551056
}
10561057
}
1058+
1059+
impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
1060+
fn create_default_config() -> Vec<u8> {
1061+
create_default_config::<RuntimeGenesisConfig>()
1062+
}
1063+
1064+
fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
1065+
build_config::<RuntimeGenesisConfig>(config)
1066+
}
1067+
}
10571068
}

0 commit comments

Comments
 (0)