mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 06:57:58 +00:00
core/consensus,node/runtime: Declare and implement authorities endpoint (#3207)
The goal of the commit is to be able to retrieve the current set of authorities without needing to know the concrete consensus mechanism in place. In order to achieve the above this commit introduces the `core/consensus/common/primitives` crate, declaring the `ConsensusApi` runtime API. In addition it implements the above mentioned trait definition in `node/runtime` by returning the current authorities of the BABE consensus mechanism.
This commit is contained in:
committed by
DemiMarie-parity
parent
9388f48942
commit
cf80af9255
@@ -538,4 +538,10 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl consensus_primitives::ConsensusApi<Block, babe_primitives::AuthorityId> for Runtime {
|
||||
fn authorities() -> Vec<babe_primitives::AuthorityId> {
|
||||
Babe::authorities().into_iter().map(|(a, _)| a).collect()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user