#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Encode, Decode, Codec};
use tetcore_std::vec::Vec;
use tp_runtime::ConsensusEngineId;
pub mod inherents;
pub mod sr25519 {
mod app_sr25519 {
use tet_application_crypto::{app_crypto, key_types::AURA, sr25519};
app_crypto!(sr25519, AURA);
}
tet_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 tet_application_crypto::{app_crypto, key_types::AURA, ed25519};
app_crypto!(ed25519, AURA);
}
tet_application_crypto::with_pair! {
pub type AuthorityPair = app_ed25519::Pair;
}
pub type AuthoritySignature = app_ed25519::Signature;
pub type AuthorityId = app_ed25519::Public;
}
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),
}
tp_api::decl_runtime_apis! {
pub trait AuraApi<AuthorityId: Codec> {
fn slot_duration() -> u64;
fn authorities() -> Vec<AuthorityId>;
}
}