Add get-epoch-info command (#6161)

automerge
This commit is contained in:
Michael Vines
2019-09-27 22:00:30 -07:00
committed by Grimes
parent 5637f88aff
commit d50aef8404
5 changed files with 100 additions and 32 deletions

View File

@ -10,6 +10,7 @@ use crate::version::VERSION;
use bincode::{deserialize, serialize};
use jsonrpc_core::{Error, Metadata, Result};
use jsonrpc_derive::rpc;
use solana_client::rpc_request::RpcEpochInfo;
use solana_drone::drone::request_airdrop_transaction;
use solana_runtime::bank::Bank;
use solana_sdk::account::Account;
@ -271,22 +272,6 @@ pub struct RpcVoteAccountInfo {
pub last_vote: u64,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct RpcEpochInfo {
/// The current epoch
pub epoch: u64,
/// The current slot, relative to the start of the current epoch
pub slot_index: u64,
/// The number of slots in this epoch
pub slots_in_epoch: u64,
/// The absolute current slot
pub absolute_slot: u64,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "kebab-case")]
pub struct RpcVersionInfo {