Rename genesis block to genesis config (#6816)

This commit is contained in:
Justin Starry
2019-11-08 23:56:57 -05:00
committed by GitHub
parent 63425bed10
commit 9807f47d4e
79 changed files with 1104 additions and 1094 deletions

View File

@ -620,31 +620,31 @@ impl RpcClient {
))
}
pub fn get_genesis_blockhash(&self) -> io::Result<Hash> {
pub fn get_genesis_hash(&self) -> io::Result<Hash> {
let response = self
.client
.send(&RpcRequest::GetGenesisBlockhash, None, 0, None)
.send(&RpcRequest::GetGenesisHash, None, 0, None)
.map_err(|err| {
io::Error::new(
io::ErrorKind::Other,
format!("GetGenesisBlockhash request failure: {:?}", err),
format!("GetGenesisHash request failure: {:?}", err),
)
})?;
let blockhash = serde_json::from_value::<String>(response).map_err(|err| {
let hash = serde_json::from_value::<String>(response).map_err(|err| {
io::Error::new(
io::ErrorKind::Other,
format!("GetGenesisBlockhash parse failure: {:?}", err),
format!("GetGenesisHash parse failure: {:?}", err),
)
})?;
let blockhash = blockhash.parse().map_err(|err| {
let hash = hash.parse().map_err(|err| {
io::Error::new(
io::ErrorKind::Other,
format!("GetGenesisBlockhash hash parse failure: {:?}", err),
format!("GetGenesisHash hash parse failure: {:?}", err),
)
})?;
Ok(blockhash)
Ok(hash)
}
pub fn poll_balance_with_timeout_and_commitment(

View File

@ -63,7 +63,7 @@ pub enum RpcRequest {
GetClusterNodes,
GetEpochInfo,
GetEpochSchedule,
GetGenesisBlockhash,
GetGenesisHash,
GetInflation,
GetNumBlocksSinceSignatureConfirmation,
GetProgramAccounts,
@ -102,7 +102,7 @@ impl RpcRequest {
RpcRequest::GetClusterNodes => "getClusterNodes",
RpcRequest::GetEpochInfo => "getEpochInfo",
RpcRequest::GetEpochSchedule => "getEpochSchedule",
RpcRequest::GetGenesisBlockhash => "getGenesisBlockhash",
RpcRequest::GetGenesisHash => "getGenesisHash",
RpcRequest::GetInflation => "getInflation",
RpcRequest::GetNumBlocksSinceSignatureConfirmation => {
"getNumBlocksSinceSignatureConfirmation"