Add first-available-block command
This commit is contained in:
@@ -709,6 +709,10 @@ impl RpcClient {
|
||||
.into())
|
||||
}
|
||||
|
||||
pub fn get_first_available_block(&self) -> ClientResult<Slot> {
|
||||
self.send(RpcRequest::GetFirstAvailableBlock, Value::Null)
|
||||
}
|
||||
|
||||
pub fn get_genesis_hash(&self) -> ClientResult<Hash> {
|
||||
let hash_str: String = self.send(RpcRequest::GetGenesisHash, Value::Null)?;
|
||||
let hash = hash_str.parse().map_err(|_| {
|
||||
|
@@ -21,6 +21,7 @@ pub enum RpcRequest {
|
||||
GetFeeCalculatorForBlockhash,
|
||||
GetFeeRateGovernor,
|
||||
GetFees,
|
||||
GetFirstAvailableBlock,
|
||||
GetGenesisHash,
|
||||
GetIdentity,
|
||||
GetInflationGovernor,
|
||||
@@ -74,6 +75,7 @@ impl fmt::Display for RpcRequest {
|
||||
RpcRequest::GetFeeCalculatorForBlockhash => "getFeeCalculatorForBlockhash",
|
||||
RpcRequest::GetFeeRateGovernor => "getFeeRateGovernor",
|
||||
RpcRequest::GetFees => "getFees",
|
||||
RpcRequest::GetFirstAvailableBlock => "getFirstAvailableBlock",
|
||||
RpcRequest::GetGenesisHash => "getGenesisHash",
|
||||
RpcRequest::GetIdentity => "getIdentity",
|
||||
RpcRequest::GetInflationGovernor => "getInflationGovernor",
|
||||
|
Reference in New Issue
Block a user