mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Move create_inherents into the block-builder (#6553)
* Move `create_inherents` into the block-builder This moves the `create_inherents` call into the block-builder. This has the advantage that `create_inherents` will be able to reuse the same context that will be used when applying the extrinsics and we also save one call to `on_initialize`. To make sure that `create_inherents` does not modify any state, we execute it in a transaction that is rolled-back after doing the runtime call. * Feedback and build fix * Update primitives/runtime/src/lib.rs Co-authored-by: Sergei Shulepov <sergei@parity.io> * Update client/block-builder/src/lib.rs Co-authored-by: Sergei Shulepov <sergei@parity.io>
This commit is contained in:
@@ -73,11 +73,11 @@ fn implement_common_api_traits(
|
||||
impl #crate_::ApiExt<#block_type> for #self_ty {
|
||||
type StateBackend = #crate_::InMemoryBackend<#crate_::HashFor<#block_type>>;
|
||||
|
||||
fn map_api_result<F: FnOnce(&Self) -> std::result::Result<R, E>, R, E>(
|
||||
fn execute_in_transaction<F: FnOnce(&Self) -> #crate_::TransactionOutcome<R>, R>(
|
||||
&self,
|
||||
map_call: F,
|
||||
) -> std::result::Result<R, E> where Self: Sized {
|
||||
map_call(self)
|
||||
call: F,
|
||||
) -> R where Self: Sized {
|
||||
call(self).into_inner()
|
||||
}
|
||||
|
||||
fn has_api<A: #crate_::RuntimeApiInfo + ?Sized>(
|
||||
|
||||
Reference in New Issue
Block a user