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

Add migration for substrate#14084 #2751

Merged
merged 12 commits into from
Jul 3, 2023
21 changes: 11 additions & 10 deletions client/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ impl BlockAnnounceData {
///
/// This will not check the signature, for this you should use [`BlockAnnounceData::check_signature`].
fn validate(&self, encoded_header: Vec<u8>) -> Result<(), Validation> {
let candidate_hash =
if let CompactStatement::Seconded(h) = self.statement.unchecked_payload() {
h
} else {
tracing::debug!(target: LOG_TARGET, "`CompactStatement` isn't the candidate variant!",);
return Err(Validation::Failure { disconnect: true })
};
let candidate_hash = if let CompactStatement::Seconded(h) =
agryaznov marked this conversation as resolved.
Show resolved Hide resolved
self.statement.unchecked_payload()
{
h
} else {
tracing::debug!(target: LOG_TARGET, "`CompactStatement` isn't the candidate variant!",);
return Err(Validation::Failure { disconnect: true })
};

if *candidate_hash != self.receipt.hash() {
tracing::debug!(
Expand Down Expand Up @@ -333,9 +334,9 @@ where
let relay_chain_is_syncing = relay_chain_interface
.is_major_syncing()
.await
.map_err(
|e| tracing::error!(target: LOG_TARGET, "Unable to determine sync status. {}", e),
)
.map_err(|e| {
tracing::error!(target: LOG_TARGET, "Unable to determine sync status. {}", e)
})
.unwrap_or(false);

if relay_chain_is_syncing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ use frame_support::{
traits::{ConstBool, ConstU32, Nothing},
};
use pallet_contracts::{
weights::SubstrateWeight, Config, DebugInfo, DefaultAddressGenerator, Frame, Schedule,
migration::v12, weights::SubstrateWeight, Config, DebugInfo, DefaultAddressGenerator, Frame,
Schedule,
};

pub use parachains_common::AVERAGE_ON_INITIALIZE_RATIO;

// Prints debug output of the `contracts` pallet to stdout if the node is
Expand Down Expand Up @@ -48,5 +50,5 @@ impl Config for Runtime {
type MaxStorageKeyLen = ConstU32<128>;
type UnsafeUnstableInterface = ConstBool<true>;
type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
type Migrations = ();
type Migrations = (v12::Migration<Runtime>,);
}
1 change: 1 addition & 0 deletions parachains/runtimes/contracts/contracts-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pub type Migrations = (
cumulus_pallet_dmp_queue::migration::Migration<Runtime>,
cumulus_pallet_parachain_system::migration::Migration<Runtime>,
cumulus_pallet_xcmp_queue::migration::Migration<Runtime>,
pallet_contracts::Migration<Runtime>,
);

type EventRecord = frame_system::EventRecord<
Expand Down