mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 05:09:22 +00:00
TendermintApi, compilation fixes
This commit is contained in:
@@ -10,3 +10,12 @@ edition = "2021"
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[dependencies]
|
||||
sp-core = { git = "https://github.com/serai-dex/substrate", default-features = false }
|
||||
sp-std = { git = "https://github.com/serai-dex/substrate", default-features = false }
|
||||
sp-api = { git = "https://github.com/serai-dex/substrate", default-features = false }
|
||||
|
||||
[features]
|
||||
std = ["sp-core/std", "sp-std/std", "sp-api/std"]
|
||||
default = ["std"]
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use sp_core::sr25519::Public;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
trait TendermintApi {
|
||||
fn validators() -> Vec<Public>;
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait TendermintApi {
|
||||
/// Current session number. A session is NOT a fixed length of blocks, yet rather a continuous
|
||||
/// set of validators.
|
||||
fn current_session() -> u32;
|
||||
|
||||
/// Current validators.
|
||||
fn validators() -> Vec<Public>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user