Do not return the Header from execute_block (#8256)

That was actually a bad idea by me, because it should essentially be the
same as block.header.

Ty @kianenigma
This commit is contained in:
Bastian Köcher
2021-03-03 21:59:28 +01:00
committed by GitHub
parent 0d8a849b84
commit 274e7f0652
3 changed files with 11 additions and 17 deletions
+5 -7
View File
@@ -174,8 +174,8 @@ where
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call=CallOf<Block::Extrinsic, Context>>,
{
fn execute_block(block: Block) -> Block::Header {
Executive::<System, Block, Context, UnsignedValidator, AllModules>::execute_block(block)
fn execute_block(block: Block) {
Executive::<System, Block, Context, UnsignedValidator, AllModules>::execute_block(block);
}
}
@@ -312,7 +312,7 @@ where
}
/// Actually execute all transitions for `block`.
pub fn execute_block(block: Block) -> Block::Header {
pub fn execute_block(block: Block) {
sp_io::init_tracing();
sp_tracing::within_span! {
sp_tracing::info_span!("execute_block", ?block);
@@ -333,7 +333,7 @@ where
}
// any final checks
Self::final_checks(&header)
Self::final_checks(&header);
}
}
@@ -406,7 +406,7 @@ where
Ok(r.map(|_| ()).map_err(|e| e.error))
}
fn final_checks(header: &System::Header) -> System::Header {
fn final_checks(header: &System::Header) {
sp_tracing::enter_span!(sp_tracing::Level::TRACE, "final_checks");
// remove temporaries
let new_header = <frame_system::Module<System>>::finalize();
@@ -432,8 +432,6 @@ where
header.extrinsics_root() == new_header.extrinsics_root(),
"Transaction trie root must be valid.",
);
new_header
}
/// Check a given signed transaction for validity. This doesn't execute any