mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +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:
@@ -21,6 +21,7 @@ use sp_std::{prelude::*, marker::PhantomData};
|
||||
use codec::{FullCodec, FullEncode, Encode, EncodeLike, Decode};
|
||||
use crate::hash::{Twox128, StorageHasher};
|
||||
use sp_runtime::generic::{Digest, DigestItem};
|
||||
pub use sp_runtime::TransactionOutcome;
|
||||
|
||||
pub mod unhashed;
|
||||
pub mod hashed;
|
||||
@@ -29,14 +30,6 @@ pub mod child;
|
||||
pub mod generator;
|
||||
pub mod migration;
|
||||
|
||||
/// Describes whether a storage transaction should be committed or rolled back.
|
||||
pub enum TransactionOutcome<T> {
|
||||
/// Transaction should be committed.
|
||||
Commit(T),
|
||||
/// Transaction should be rolled back.
|
||||
Rollback(T),
|
||||
}
|
||||
|
||||
/// Execute the supplied function in a new storage transaction.
|
||||
///
|
||||
/// All changes to storage performed by the supplied function are discarded if the returned
|
||||
|
||||
Reference in New Issue
Block a user