#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;
use alloc::vec::Vec;
use codec::{Codec, Decode, Encode};
use sp_runtime::ConsensusEngineId;
pub mod digests;
pub mod inherents;
pub mod sr25519 {
mod app_sr25519 {
use sp_application_crypto::{app_crypto, key_types::AURA, sr25519};
app_crypto!(sr25519, AURA);
}
sp_application_crypto::with_pair! {
pub type AuthorityPair = app_sr25519::Pair;
}
pub type AuthoritySignature = app_sr25519::Signature;
pub type AuthorityId = app_sr25519::Public;
}
pub mod ed25519 {
mod app_ed25519 {
use sp_application_crypto::{app_crypto, ed25519, key_types::AURA};
app_crypto!(ed25519, AURA);
}
sp_application_crypto::with_pair! {
pub type AuthorityPair = app_ed25519::Pair;
}
pub type AuthoritySignature = app_ed25519::Signature;
pub type AuthorityId = app_ed25519::Public;
}
pub use sp_consensus_slots::{Slot, SlotDuration};
pub const AURA_ENGINE_ID: ConsensusEngineId = [b'a', b'u', b'r', b'a'];
pub type AuthorityIndex = u32;
#[derive(Decode, Encode)]
pub enum ConsensusLog<AuthorityId: Codec> {
#[codec(index = 1)]
AuthoritiesChange(Vec<AuthorityId>),
#[codec(index = 2)]
OnDisabled(AuthorityIndex),
}
sp_api::decl_runtime_apis! {
pub trait AuraApi<AuthorityId: Codec> {
fn slot_duration() -> SlotDuration;
fn authorities() -> Vec<AuthorityId>;
}
}