mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 17:28:00 +00:00
Move inherent implementation into the modules (#924)
* Adds new `ProvideInherent` trait Also implements the new trait for `srml/consensus` and `srml/timestamp`. * Adds `impl_outer_inherent!` macro * Reexport macros from `alloc` * Introduce `RuntimeString` and fix `ProvideInherent` on `no_std` * Replace `VersionString` with `RuntimeString` * Improvements for `impl_outer_inherent!` * Make `construct_runtime!` support `impl_outer_inherent!` * Fixes after rebase * Whitespace
This commit is contained in:
@@ -22,8 +22,6 @@ extern crate sr_std as rstd;
|
||||
extern crate sr_primitives as primitives;
|
||||
#[doc(hidden)]
|
||||
pub extern crate parity_codec as codec;
|
||||
#[macro_use]
|
||||
extern crate parity_codec_derive;
|
||||
extern crate sr_version as runtime_version;
|
||||
|
||||
#[doc(hidden)]
|
||||
@@ -429,17 +427,6 @@ macro_rules! decl_apis {
|
||||
};
|
||||
}
|
||||
|
||||
//TODO: Move into runtime!
|
||||
#[derive(Encode)]
|
||||
#[cfg_attr(feature = "std", derive(Debug, Decode))]
|
||||
pub enum BlockBuilderError {
|
||||
#[cfg(not(feature = "std"))]
|
||||
Generic(&'static str),
|
||||
#[cfg(feature = "std")]
|
||||
Generic(String),
|
||||
TimestampInFuture(u64),
|
||||
}
|
||||
|
||||
decl_apis! {
|
||||
/// The `Core` api trait that is mandantory for each runtime.
|
||||
pub trait Core<Block: BlockT, AuthorityId> {
|
||||
@@ -482,7 +469,7 @@ decl_apis! {
|
||||
/// Generate inherent extrinsics.
|
||||
fn inherent_extrinsics<InherentExtrinsic, UncheckedExtrinsic>(inherent: InherentExtrinsic) -> Vec<UncheckedExtrinsic>;
|
||||
/// Check that the inherents are valid.
|
||||
fn check_inherents<InherentData>(block: Block, data: InherentData) -> Result<(), BlockBuilderError>;
|
||||
fn check_inherents<InherentData, Error>(block: Block, data: InherentData) -> Result<(), Error>;
|
||||
/// Generate a random seed.
|
||||
fn random_seed() -> <Block as BlockT>::Hash;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user