Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move initialise_block into Core trait as it is crucial calling th…
…e API functions
  • Loading branch information
bkchr committed Nov 13, 2018
commit 68a962f1a9e93b123064f4f4d503833c6cef8462
8 changes: 4 additions & 4 deletions core/sr-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ macro_rules! decl_apis {
/// The ApiIds for the various standard runtime APIs.
pub mod id {
use super::ApiId;

/// ApiId for the BlockBuilder trait.
pub const BLOCK_BUILDER: ApiId = *b"blkbuild";

Expand All @@ -443,10 +443,12 @@ pub mod id {

decl_apis! {
/// The `Core` api trait that is mandantory for each runtime.
pub trait Core<Block: BlockT, AuthorityId> {
pub trait Core<Block: BlockT, AuthorityId> ExtraClientSide <OverlayedChanges> {
fn version() -> RuntimeVersion;
fn authorities() -> Vec<AuthorityId>;
fn execute_block(block: Block);
/// Initialise a block with the given header.
fn initialise_block(header: <Block as BlockT>::Header) ExtraClientSide(changes: &mut Self::OverlayedChanges);
}

/// The `Metadata` api trait that returns metadata for the runtime.
Expand All @@ -461,8 +463,6 @@ decl_apis! {

/// The `BlockBuilder` api trait that provides required functions for building a block for a runtime.
pub trait BlockBuilder<Block: BlockT> ExtraClientSide <OverlayedChanges> {
/// Initialise a block with the given header.
fn initialise_block(header: <Block as BlockT>::Header) ExtraClientSide(changes: &mut Self::OverlayedChanges);
/// Apply the given extrinsics.
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) ExtraClientSide(changes: &mut Self::OverlayedChanges) -> ApplyResult;
/// Finish the current block.
Expand Down