Update Substrate & Polkadot (#387)

* Update Substrate & Polkadot

* Enforce `ParachainSetCode`
This commit is contained in:
Bastian Köcher
2021-04-02 16:17:04 +02:00
committed by GitHub
parent dc666c7e82
commit 1d4c02cc4e
14 changed files with 957 additions and 635 deletions
+10 -1
View File
@@ -321,6 +321,7 @@ fn relay_parent_not_imported_when_block_announce_is_processed() {
client
.import(BlockOrigin::Own, block)
.await
.expect("Imports the block");
assert!(matches!(
@@ -386,7 +387,11 @@ sp_api::mock_impl_runtime_apis! {
Vec::new()
}
fn persisted_validation_data(&self, _: ParaId, _: OccupiedCoreAssumption) -> Option<PersistedValidationData<BlockNumber>> {
fn persisted_validation_data(
&self,
_: ParaId,
_: OccupiedCoreAssumption,
) -> Option<PersistedValidationData<PHash, BlockNumber>> {
Some(PersistedValidationData {
parent_head: HeadData(default_header().encode()),
..Default::default()
@@ -430,5 +435,9 @@ sp_api::mock_impl_runtime_apis! {
) -> BTreeMap<ParaId, Vec<InboundHrmpMessage<BlockNumber>>> {
BTreeMap::new()
}
fn validation_code_by_hash(_: PHash) -> Option<ValidationCode> {
None
}
}
}
@@ -165,9 +165,7 @@ mod tests {
let (mut client, backend, block) = build_client_backend_and_block();
let hash = block.hash();
client
.import(BlockOrigin::Own, block)
.expect("Imports the block");
block_on(client.import(BlockOrigin::Own, block)).expect("Imports the block");
let wait = WaitOnRelayChainBlock::new(backend, client);
@@ -195,6 +193,7 @@ mod tests {
// Import the block that should fire the notification
client
.import(BlockOrigin::Own, block)
.await
.expect("Imports the block");
// Now it should have received the notification and report that the block was imported
@@ -246,6 +245,7 @@ mod tests {
// Import the block that should fire the notification
client
.import(BlockOrigin::Own, block2)
.await
.expect("Imports the second block");
// The import notification of the second block should not make this one finish
@@ -255,6 +255,7 @@ mod tests {
client
.import(BlockOrigin::Own, block)
.await
.expect("Imports the first block");
// Now it should be ready