1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Codec, Decode, Encode};
use sp_runtime::ConsensusEngineId;
use sp_std::vec::Vec;
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>;
}
}