substrate_api_client/api/runtime_api/
authority_discovery.rs1use super::{RuntimeApi, RuntimeApiClient};
15use crate::{api::Result, rpc::Request};
16use ac_primitives::config::Config;
17#[cfg(all(not(feature = "sync-api"), not(feature = "std")))]
18use alloc::boxed::Box;
19use alloc::{vec, vec::Vec};
20use codec::Decode;
21
22#[maybe_async::maybe_async(?Send)]
23pub trait AuthorityDiscoveryApi: RuntimeApi {
24 async fn authorities<AuthorityId: Decode>(
26 &self,
27 at_block: Option<Self::Hash>,
28 ) -> Result<Vec<AuthorityId>>;
29}
30
31#[maybe_async::maybe_async(?Send)]
32impl<T, Client> AuthorityDiscoveryApi for RuntimeApiClient<T, Client>
33where
34 T: Config,
35 Client: Request,
36{
37 async fn authorities<AuthorityId: Decode>(
38 &self,
39 at_block: Option<Self::Hash>,
40 ) -> Result<Vec<AuthorityId>> {
41 self.runtime_call("AuthorityDiscoveryApi_authorities", vec![], at_block).await
42 }
43}