Add block command

This commit is contained in:
Michael Vines
2020-09-06 11:10:19 -07:00
parent 6677996369
commit 27752c4e4d
3 changed files with 65 additions and 3 deletions

View File

@@ -178,6 +178,9 @@ pub enum CliCommand {
},
Fees,
FirstAvailableBlock,
GetBlock {
slot: Slot,
},
GetBlockTime {
slot: Option<Slot>,
},
@@ -624,6 +627,7 @@ pub fn parse_command(
command: CliCommand::FirstAvailableBlock,
signers: vec![],
}),
("block", Some(matches)) => parse_get_block(matches),
("block-time", Some(matches)) => parse_get_block_time(matches),
("epoch-info", Some(matches)) => parse_get_epoch_info(matches),
("genesis-hash", Some(_matches)) => Ok(CliCommandInfo {
@@ -1493,6 +1497,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_create_address_with_seed(config, from_pubkey.as_ref(), &seed, &program_id),
CliCommand::Fees => process_fees(&rpc_client, config),
CliCommand::FirstAvailableBlock => process_first_available_block(&rpc_client),
CliCommand::GetBlock { slot } => process_get_block(&rpc_client, config, *slot),
CliCommand::GetBlockTime { slot } => process_get_block_time(&rpc_client, config, *slot),
CliCommand::GetEpoch => process_get_epoch(&rpc_client, config),
CliCommand::GetEpochInfo => process_get_epoch_info(&rpc_client, config),