Adds support for returning a custom header from validate_block (#825)

* Adds support for returning a custom header from `validate_block`

This adds support for returning a custom header from `validate_block`. Before this, we always
returned the header of the block that was validated (and still do it by default). However, after
this pr it is possible to set a custom header or better custom head data that will be returned
instead from `validate_block`. This can be for example when a chain wants to fork.

* FMT
This commit is contained in:
Bastian Köcher
2021-12-03 12:49:13 +01:00
committed by GitHub
parent 70ea98995a
commit 32a86d8ef4
8 changed files with 156 additions and 17 deletions
@@ -18,7 +18,7 @@
use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
use cumulus_test_runtime::{AccountId, BalancesCall, SudoCall};
use futures::{future, join, StreamExt};
use futures::{future, StreamExt};
use polkadot_service::polkadot_runtime::constants::currency::DOLLARS;
use sc_transaction_pool_api::{TransactionPool as _, TransactionSource, TransactionStatus};
use sp_core::{crypto::Pair, sr25519};
+1
View File
@@ -128,5 +128,6 @@ fn testnet_genesis(
balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(),
},
sudo: cumulus_test_runtime::SudoConfig { key: root_key },
transaction_payment: Default::default(),
}
}