Rename genesis block to genesis config (#6816)
This commit is contained in:
@ -72,7 +72,7 @@ pub enum CliCommand {
|
||||
ClusterVersion,
|
||||
Fees,
|
||||
GetEpochInfo,
|
||||
GetGenesisBlockhash,
|
||||
GetGenesisHash,
|
||||
GetSlot,
|
||||
GetTransactionCount,
|
||||
Ping {
|
||||
@ -247,8 +247,8 @@ pub fn parse_command(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, Box<dyn
|
||||
command: CliCommand::GetEpochInfo,
|
||||
require_keypair: false,
|
||||
}),
|
||||
("get-genesis-blockhash", Some(_matches)) => Ok(CliCommandInfo {
|
||||
command: CliCommand::GetGenesisBlockhash,
|
||||
("get-genesis-hash", Some(_matches)) => Ok(CliCommandInfo {
|
||||
command: CliCommand::GetGenesisHash,
|
||||
require_keypair: false,
|
||||
}),
|
||||
("get-slot", Some(_matches)) => Ok(CliCommandInfo {
|
||||
@ -849,7 +849,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
|
||||
// Return software version of solana-cli and cluster entrypoint node
|
||||
CliCommand::ClusterVersion => process_cluster_version(&rpc_client, config),
|
||||
CliCommand::Fees => process_fees(&rpc_client),
|
||||
CliCommand::GetGenesisBlockhash => process_get_genesis_blockhash(&rpc_client),
|
||||
CliCommand::GetGenesisHash => process_get_genesis_hash(&rpc_client),
|
||||
CliCommand::GetSlot => process_get_slot(&rpc_client),
|
||||
CliCommand::GetEpochInfo => process_get_epoch_info(&rpc_client),
|
||||
CliCommand::GetTransactionCount => process_get_transaction_count(&rpc_client),
|
||||
|
@ -41,7 +41,7 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
||||
.about("Get information about the current epoch"),
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("get-genesis-blockhash").about("Get the genesis blockhash"),
|
||||
SubCommand::with_name("get-genesis-hash").about("Get the genesis hash"),
|
||||
)
|
||||
.subcommand(SubCommand::with_name("get-slot").about("Get current slot"))
|
||||
.subcommand(
|
||||
@ -186,9 +186,9 @@ pub fn process_get_epoch_info(rpc_client: &RpcClient) -> ProcessResult {
|
||||
Ok("".to_string())
|
||||
}
|
||||
|
||||
pub fn process_get_genesis_blockhash(rpc_client: &RpcClient) -> ProcessResult {
|
||||
let genesis_blockhash = rpc_client.get_genesis_blockhash()?;
|
||||
Ok(genesis_blockhash.to_string())
|
||||
pub fn process_get_genesis_hash(rpc_client: &RpcClient) -> ProcessResult {
|
||||
let genesis_hash = rpc_client.get_genesis_hash()?;
|
||||
Ok(genesis_hash.to_string())
|
||||
}
|
||||
|
||||
pub fn process_get_slot(rpc_client: &RpcClient) -> ProcessResult {
|
||||
@ -463,13 +463,13 @@ mod tests {
|
||||
}
|
||||
);
|
||||
|
||||
let test_get_genesis_blockhash = test_commands
|
||||
let test_get_genesis_hash = test_commands
|
||||
.clone()
|
||||
.get_matches_from(vec!["test", "get-genesis-blockhash"]);
|
||||
.get_matches_from(vec!["test", "get-genesis-hash"]);
|
||||
assert_eq!(
|
||||
parse_command(&test_get_genesis_blockhash).unwrap(),
|
||||
parse_command(&test_get_genesis_hash).unwrap(),
|
||||
CliCommandInfo {
|
||||
command: CliCommand::GetGenesisBlockhash,
|
||||
command: CliCommand::GetGenesisHash,
|
||||
require_keypair: false
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user