automerge
This commit is contained in:
@ -322,13 +322,16 @@ FLAGS:
|
|||||||
-v, --verbose Show extra information header
|
-v, --verbose Show extra information header
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--ask-seed-phrase <KEYPAIR NAME> Securely recover a keypair using a seed phrase and optional passphrase
|
--ask-seed-phrase <KEYPAIR NAME>
|
||||||
[possible values: keypair]
|
Recover a keypair using a seed phrase and optional passphrase [possible values: keypair]
|
||||||
-C, --config <PATH> Configuration file to use [default:
|
|
||||||
~/.config/solana/cli/config.yml]
|
-C, --config <PATH>
|
||||||
-u, --url <URL> JSON RPC URL for the solana cluster
|
Configuration file to use [default: ~/.config/solana/cli/config.yml]
|
||||||
-k, --keypair <PATH> /path/to/id.json
|
|
||||||
--nonce-authority <KEYPAIR> Specify nonce authority if different from account
|
-u, --url <URL> JSON RPC URL for the solana cluster
|
||||||
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
|
--nonce-authority <KEYPAIR or PUBKEY>
|
||||||
|
Provide the nonce authority keypair to use when signing a nonced transaction
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<NONCE_ACCOUNT> Address of the nonce account
|
<NONCE_ACCOUNT> Address of the nonce account
|
||||||
@ -694,20 +697,25 @@ FLAGS:
|
|||||||
-v, --verbose Show extra information header
|
-v, --verbose Show extra information header
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--ask-seed-phrase <KEYPAIR NAME> Securely recover a keypair using a seed phrase and optional passphrase
|
--ask-seed-phrase <KEYPAIR NAME>
|
||||||
[possible values: keypair]
|
Recover a keypair using a seed phrase and optional passphrase [possible values: keypair]
|
||||||
--blockhash <BLOCKHASH> Use the supplied blockhash
|
|
||||||
-C, --config <PATH> Configuration file to use [default:
|
--blockhash <BLOCKHASH> Use the supplied blockhash
|
||||||
~/.config/solana/cli/config.yml]
|
-C, --config <PATH>
|
||||||
-u, --url <URL> JSON RPC URL for the solana cluster
|
Configuration file to use [default: ~/.config/solana/cli/config.yml]
|
||||||
-k, --keypair <PATH> /path/to/id.json
|
|
||||||
--nonce <PUBKEY> Provide the nonce account to use when creating a nonced
|
-u, --url <URL> JSON RPC URL for the solana cluster
|
||||||
transaction. Nonced transactions are useful when a transaction
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
requires a lengthy signing process. Learn more about nonced
|
--nonce <PUBKEY>
|
||||||
transactions at https://docs.solana.com/offline-signing/durable-nonce
|
Provide the nonce account to use when creating a nonced
|
||||||
--nonce-authority <nonce_authority> Provide the nonce authority keypair to use when signing a nonced
|
transaction. Nonced transactions are useful when a transaction
|
||||||
transaction
|
requires a lengthy signing process. Learn more about nonced
|
||||||
--signer <PUBKEY=BASE58_SIG>... Provide a public-key/signature pair for the transaction
|
transactions at https://docs.solana.com/offline-signing/durable-nonce
|
||||||
|
--nonce-authority <KEYPAIR or PUBKEY>
|
||||||
|
Provide the nonce authority keypair to use when signing a nonced transaction
|
||||||
|
|
||||||
|
--signer <PUBKEY=BASE58_SIG>... Provide a public-key/signature pair for the transaction
|
||||||
|
--stake-authority <KEYPAIR of PUBKEY> Public key of authorized staker (defaults to cli config pubkey)
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<STAKE ACCOUNT> Stake account to be deactivated.
|
<STAKE ACCOUNT> Stake account to be deactivated.
|
||||||
@ -730,20 +738,25 @@ FLAGS:
|
|||||||
-v, --verbose Show extra information header
|
-v, --verbose Show extra information header
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--ask-seed-phrase <KEYPAIR NAME> Securely recover a keypair using a seed phrase and optional passphrase
|
--ask-seed-phrase <KEYPAIR NAME>
|
||||||
[possible values: keypair]
|
Recover a keypair using a seed phrase and optional passphrase [possible values: keypair]
|
||||||
--blockhash <BLOCKHASH> Use the supplied blockhash
|
|
||||||
-C, --config <PATH> Configuration file to use [default:
|
--blockhash <BLOCKHASH> Use the supplied blockhash
|
||||||
~/.config/solana/cli/config.yml]
|
-C, --config <PATH>
|
||||||
-u, --url <URL> JSON RPC URL for the solana cluster
|
Configuration file to use [default: ~/.config/solana/cli/config.yml]
|
||||||
-k, --keypair <PATH> /path/to/id.json
|
|
||||||
--nonce <PUBKEY> Provide the nonce account to use when creating a nonced
|
-u, --url <URL> JSON RPC URL for the solana cluster
|
||||||
transaction. Nonced transactions are useful when a transaction
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
requires a lengthy signing process. Learn more about nonced
|
--nonce <PUBKEY>
|
||||||
transactions at https://docs.solana.com/offline-signing/durable-nonce
|
Provide the nonce account to use when creating a nonced
|
||||||
--nonce-authority <nonce_authority> Provide the nonce authority keypair to use when signing a nonced
|
transaction. Nonced transactions are useful when a transaction
|
||||||
transaction
|
requires a lengthy signing process. Learn more about nonced
|
||||||
--signer <PUBKEY=BASE58_SIG>... Provide a public-key/signature pair for the transaction
|
transactions at https://docs.solana.com/offline-signing/durable-nonce
|
||||||
|
--nonce-authority <KEYPAIR or PUBKEY>
|
||||||
|
Provide the nonce authority keypair to use when signing a nonced transaction
|
||||||
|
|
||||||
|
--signer <PUBKEY=BASE58_SIG>... Provide a public-key/signature pair for the transaction
|
||||||
|
--stake-authority <KEYPAIR of PUBKEY> Public key of authorized staker (defaults to cli config pubkey)
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<STAKE ACCOUNT> Stake account to delegate
|
<STAKE ACCOUNT> Stake account to delegate
|
||||||
@ -1009,13 +1022,17 @@ FLAGS:
|
|||||||
-v, --verbose Show extra information header
|
-v, --verbose Show extra information header
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--ask-seed-phrase <KEYPAIR NAME> Securely recover a keypair using a seed phrase and optional passphrase
|
--ask-seed-phrase <KEYPAIR NAME>
|
||||||
[possible values: keypair]
|
Recover a keypair using a seed phrase and optional passphrase [possible values: keypair]
|
||||||
-C, --config <PATH> Configuration file to use [default:
|
|
||||||
~/.config/solana/cli/config.yml]
|
-C, --config <PATH>
|
||||||
-u, --url <URL> JSON RPC URL for the solana cluster
|
Configuration file to use [default: ~/.config/solana/cli/config.yml]
|
||||||
-k, --keypair <PATH> /path/to/id.json
|
|
||||||
--nonce-authority <KEYPAIR> Specify nonce authority if different from account
|
-u, --url <URL> JSON RPC URL for the solana cluster
|
||||||
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
|
--nonce-authority <KEYPAIR or PUBKEY>
|
||||||
|
Provide the nonce authority keypair to use when signing a nonced transaction
|
||||||
|
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<NONCE ACCOUNT> Address of the nonce account
|
<NONCE ACCOUNT> Address of the nonce account
|
||||||
@ -1039,23 +1056,27 @@ FLAGS:
|
|||||||
-v, --verbose Show extra information header
|
-v, --verbose Show extra information header
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--ask-seed-phrase <KEYPAIR NAME> Securely recover a keypair using a seed phrase and optional passphrase
|
--ask-seed-phrase <KEYPAIR NAME>
|
||||||
[possible values: keypair]
|
Recover a keypair using a seed phrase and optional passphrase [possible values: keypair]
|
||||||
--blockhash <BLOCKHASH> Use the supplied blockhash
|
|
||||||
-C, --config <PATH> Configuration file to use [default:
|
--blockhash <BLOCKHASH> Use the supplied blockhash
|
||||||
~/.config/solana/cli/config.yml]
|
-C, --config <PATH>
|
||||||
-u, --url <URL> JSON RPC URL for the solana cluster
|
Configuration file to use [default: ~/.config/solana/cli/config.yml]
|
||||||
-k, --keypair <PATH> /path/to/id.json
|
|
||||||
--nonce <PUBKEY> Provide the nonce account to use when creating a nonced
|
-u, --url <URL> JSON RPC URL for the solana cluster
|
||||||
transaction. Nonced transactions are useful when a transaction
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
requires a lengthy signing process. Learn more about nonced
|
--nonce <PUBKEY>
|
||||||
transactions at https://docs.solana.com/offline-signing/durable-nonce
|
Provide the nonce account to use when creating a nonced
|
||||||
--nonce-authority <nonce_authority> Provide the nonce authority keypair to use when signing a nonced
|
transaction. Nonced transactions are useful when a transaction
|
||||||
transaction
|
requires a lengthy signing process. Learn more about nonced
|
||||||
--signer <PUBKEY=BASE58_SIG>... Provide a public-key/signature pair for the transaction
|
transactions at https://docs.solana.com/offline-signing/durable-nonce
|
||||||
--after <DATETIME> A timestamp after which transaction will execute
|
--nonce-authority <KEYPAIR or PUBKEY>
|
||||||
--require-timestamp-from <PUBKEY> Require timestamp from this third party
|
Provide the nonce authority keypair to use when signing a nonced transaction
|
||||||
--require-signature-from <PUBKEY>... Any third party signatures required to unlock the lamports
|
|
||||||
|
--signer <PUBKEY=BASE58_SIG>... Provide a public-key/signature pair for the transaction
|
||||||
|
--after <DATETIME> A timestamp after which transaction will execute
|
||||||
|
--require-timestamp-from <PUBKEY> Require timestamp from this third party
|
||||||
|
--require-signature-from <PUBKEY>... Any third party signatures required to unlock the lamports
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<TO PUBKEY> The pubkey of recipient
|
<TO PUBKEY> The pubkey of recipient
|
||||||
@ -1431,12 +1452,25 @@ FLAGS:
|
|||||||
-v, --verbose Show extra information header
|
-v, --verbose Show extra information header
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--ask-seed-phrase <KEYPAIR NAME> Securely recover a keypair using a seed phrase and optional passphrase
|
--ask-seed-phrase <KEYPAIR NAME>
|
||||||
[possible values: keypair]
|
Recover a keypair using a seed phrase and optional passphrase [possible values: keypair]
|
||||||
-C, --config <PATH> Configuration file to use [default:
|
|
||||||
~/.config/solana/cli/config.yml]
|
--blockhash <BLOCKHASH> Use the supplied blockhash
|
||||||
-u, --url <URL> JSON RPC URL for the solana cluster
|
-C, --config <PATH>
|
||||||
-k, --keypair <PATH> /path/to/id.json
|
Configuration file to use [default: ~/.config/solana/cli/config.yml]
|
||||||
|
|
||||||
|
-u, --url <URL> JSON RPC URL for the solana cluster
|
||||||
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
|
--nonce <PUBKEY>
|
||||||
|
Provide the nonce account to use when creating a nonced
|
||||||
|
transaction. Nonced transactions are useful when a transaction
|
||||||
|
requires a lengthy signing process. Learn more about nonced
|
||||||
|
transactions at https://docs.solana.com/offline-signing/durable-nonce
|
||||||
|
--nonce-authority <KEYPAIR or PUBKEY>
|
||||||
|
Provide the nonce authority keypair to use when signing a nonced transaction
|
||||||
|
|
||||||
|
--signer <PUBKEY=BASE58_SIG>... Provide a public-key/signature pair for the transaction
|
||||||
|
--stake-authority <KEYPAIR of PUBKEY> Public key of authorized staker (defaults to cli config pubkey)
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<STAKE ACCOUNT> Stake account in which to set the authorized staker
|
<STAKE ACCOUNT> Stake account in which to set the authorized staker
|
||||||
@ -1459,12 +1493,25 @@ FLAGS:
|
|||||||
-v, --verbose Show extra information header
|
-v, --verbose Show extra information header
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--ask-seed-phrase <KEYPAIR NAME> Securely recover a keypair using a seed phrase and optional passphrase
|
--ask-seed-phrase <KEYPAIR NAME>
|
||||||
[possible values: keypair]
|
Recover a keypair using a seed phrase and optional passphrase [possible values: keypair]
|
||||||
-C, --config <PATH> Configuration file to use [default:
|
|
||||||
~/.config/solana/cli/config.yml]
|
--blockhash <BLOCKHASH> Use the supplied blockhash
|
||||||
-u, --url <URL> JSON RPC URL for the solana cluster
|
-C, --config <PATH>
|
||||||
-k, --keypair <PATH> /path/to/id.json
|
Configuration file to use [default: ~/.config/solana/cli/config.yml]
|
||||||
|
|
||||||
|
-u, --url <URL> JSON RPC URL for the solana cluster
|
||||||
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
|
--nonce <PUBKEY>
|
||||||
|
Provide the nonce account to use when creating a nonced
|
||||||
|
transaction. Nonced transactions are useful when a transaction
|
||||||
|
requires a lengthy signing process. Learn more about nonced
|
||||||
|
transactions at https://docs.solana.com/offline-signing/durable-nonce
|
||||||
|
--nonce-authority <KEYPAIR or PUBKEY>
|
||||||
|
Provide the nonce authority keypair to use when signing a nonced transaction
|
||||||
|
|
||||||
|
--signer <PUBKEY=BASE58_SIG>... Provide a public-key/signature pair for the transaction
|
||||||
|
--withdraw-authority <KEYPAIR or PUBKEY> Public key of authorized withdrawer (defaults to cli config pubkey)
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<STAKE ACCOUNT> Stake account in which to set the authorized withdrawer
|
<STAKE ACCOUNT> Stake account in which to set the authorized withdrawer
|
||||||
@ -1630,13 +1677,17 @@ FLAGS:
|
|||||||
-v, --verbose Show extra information header
|
-v, --verbose Show extra information header
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--ask-seed-phrase <KEYPAIR NAME> Securely recover a keypair using a seed phrase and optional passphrase
|
--ask-seed-phrase <KEYPAIR NAME>
|
||||||
[possible values: keypair]
|
Recover a keypair using a seed phrase and optional passphrase [possible values: keypair]
|
||||||
-C, --config <PATH> Configuration file to use [default:
|
|
||||||
~/.config/solana/cli/config.yml]
|
-C, --config <PATH>
|
||||||
-u, --url <URL> JSON RPC URL for the solana cluster
|
Configuration file to use [default: ~/.config/solana/cli/config.yml]
|
||||||
-k, --keypair <PATH> /path/to/id.json
|
|
||||||
--nonce-authority <KEYPAIR> Specify nonce authority if different from account
|
-u, --url <URL> JSON RPC URL for the solana cluster
|
||||||
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
|
--nonce-authority <KEYPAIR or PUBKEY>
|
||||||
|
Provide the nonce authority keypair to use when signing a nonced transaction
|
||||||
|
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<NONCE ACCOUNT> Nonce account from to withdraw from
|
<NONCE ACCOUNT> Nonce account from to withdraw from
|
||||||
@ -1661,12 +1712,15 @@ FLAGS:
|
|||||||
-v, --verbose Show extra information header
|
-v, --verbose Show extra information header
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--ask-seed-phrase <KEYPAIR NAME> Securely recover a keypair using a seed phrase and optional passphrase
|
--ask-seed-phrase <KEYPAIR NAME>
|
||||||
[possible values: keypair]
|
Recover a keypair using a seed phrase and optional passphrase [possible values: keypair]
|
||||||
-C, --config <PATH> Configuration file to use [default:
|
|
||||||
~/.config/solana/cli/config.yml]
|
-C, --config <PATH>
|
||||||
-u, --url <URL> JSON RPC URL for the solana cluster
|
Configuration file to use [default: ~/.config/solana/cli/config.yml]
|
||||||
-k, --keypair <PATH> /path/to/id.json
|
|
||||||
|
-u, --url <URL> JSON RPC URL for the solana cluster
|
||||||
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
|
--withdraw-authority <KEYPAIR or PUBKEY> Public key of authorized withdrawer (defaults to cli config pubkey)
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<STAKE ACCOUNT> Stake account from which to withdraw
|
<STAKE ACCOUNT> Stake account from which to withdraw
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
cluster_query::*,
|
cluster_query::*,
|
||||||
display::{println_name_value, println_signers},
|
display::{println_name_value, println_signers},
|
||||||
nonce::*,
|
nonce::{self, *},
|
||||||
stake::*,
|
stake::*,
|
||||||
storage::*,
|
storage::*,
|
||||||
validator_info::*,
|
validator_info::*,
|
||||||
@ -146,6 +146,10 @@ impl PartialEq for SigningAuthority {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn nonce_authority_arg<'a, 'b>() -> Arg<'a, 'b> {
|
||||||
|
nonce::nonce_authority_arg().requires(NONCE_ARG.name)
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, PartialEq)]
|
#[derive(Default, Debug, PartialEq)]
|
||||||
pub struct PayCommand {
|
pub struct PayCommand {
|
||||||
pub lamports: u64,
|
pub lamports: u64,
|
||||||
@ -1969,23 +1973,8 @@ pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, '
|
|||||||
.takes_value(false)
|
.takes_value(false)
|
||||||
.help("Sign the transaction offline"),
|
.help("Sign the transaction offline"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(nonce_arg())
|
||||||
Arg::with_name(NONCE_ARG.name)
|
.arg(nonce_authority_arg())
|
||||||
.long(NONCE_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.value_name("PUBKEY")
|
|
||||||
.requires("blockhash")
|
|
||||||
.validator(is_pubkey_or_keypair)
|
|
||||||
.help(NONCE_ARG.help),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name(NONCE_AUTHORITY_ARG.name)
|
|
||||||
.long(NONCE_AUTHORITY_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.requires(NONCE_ARG.name)
|
|
||||||
.validator(is_pubkey_or_keypair_or_ask_keyword)
|
|
||||||
.help(NONCE_AUTHORITY_ARG.help),
|
|
||||||
)
|
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("signer")
|
Arg::with_name("signer")
|
||||||
.long("signer")
|
.long("signer")
|
||||||
|
@ -49,13 +49,23 @@ pub trait NonceSubCommands {
|
|||||||
fn nonce_subcommands(self) -> Self;
|
fn nonce_subcommands(self) -> Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn nonce_authority_arg<'a, 'b>() -> Arg<'a, 'b> {
|
pub fn nonce_arg<'a, 'b>() -> Arg<'a, 'b> {
|
||||||
Arg::with_name("nonce_authority")
|
Arg::with_name(NONCE_ARG.name)
|
||||||
.long("nonce-authority")
|
.long(NONCE_ARG.long)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("KEYPAIR")
|
.value_name("PUBKEY")
|
||||||
|
.requires("blockhash")
|
||||||
|
.validator(is_pubkey)
|
||||||
|
.help(NONCE_ARG.help)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn nonce_authority_arg<'a, 'b>() -> Arg<'a, 'b> {
|
||||||
|
Arg::with_name(NONCE_AUTHORITY_ARG.name)
|
||||||
|
.long(NONCE_AUTHORITY_ARG.long)
|
||||||
|
.takes_value(true)
|
||||||
|
.value_name("KEYPAIR or PUBKEY")
|
||||||
.validator(is_pubkey_or_keypair_or_ask_keyword)
|
.validator(is_pubkey_or_keypair_or_ask_keyword)
|
||||||
.help("Specify nonce authority if different from account")
|
.help(NONCE_AUTHORITY_ARG.help)
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NonceSubCommands for App<'_, '_> {
|
impl NonceSubCommands for App<'_, '_> {
|
||||||
@ -113,8 +123,8 @@ impl NonceSubCommands for App<'_, '_> {
|
|||||||
.help("Specify unit to use for request"),
|
.help("Specify unit to use for request"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("nonce_authority")
|
Arg::with_name(NONCE_AUTHORITY_ARG.name)
|
||||||
.long("nonce-authority")
|
.long(NONCE_AUTHORITY_ARG.long)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("BASE58_PUBKEY")
|
.value_name("BASE58_PUBKEY")
|
||||||
.validator(is_pubkey_or_keypair)
|
.validator(is_pubkey_or_keypair)
|
||||||
@ -236,7 +246,7 @@ pub fn parse_authorize_nonce_account(matches: &ArgMatches<'_>) -> Result<CliComm
|
|||||||
pub fn parse_nonce_create_account(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
pub fn parse_nonce_create_account(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
|
||||||
let nonce_account = keypair_of(matches, "nonce_account_keypair").unwrap();
|
let nonce_account = keypair_of(matches, "nonce_account_keypair").unwrap();
|
||||||
let lamports = required_lamports_from(matches, "amount", "unit")?;
|
let lamports = required_lamports_from(matches, "amount", "unit")?;
|
||||||
let nonce_authority = pubkey_of(matches, "nonce_authority");
|
let nonce_authority = pubkey_of(matches, NONCE_AUTHORITY_ARG.name);
|
||||||
|
|
||||||
Ok(CliCommandInfo {
|
Ok(CliCommandInfo {
|
||||||
command: CliCommand::CreateNonceAccount {
|
command: CliCommand::CreateNonceAccount {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
cli::{
|
cli::{
|
||||||
build_balance_message, check_account_for_fee, check_unique_pubkeys,
|
build_balance_message, check_account_for_fee, check_unique_pubkeys,
|
||||||
get_blockhash_fee_calculator, log_instruction_custom_error, replace_signatures,
|
get_blockhash_fee_calculator, log_instruction_custom_error, nonce_authority_arg,
|
||||||
required_lamports_from, return_signers, CliCommand, CliCommandInfo, CliConfig, CliError,
|
replace_signatures, required_lamports_from, return_signers, CliCommand, CliCommandInfo,
|
||||||
ProcessResult, SigningAuthority,
|
CliConfig, CliError, ProcessResult, SigningAuthority,
|
||||||
},
|
},
|
||||||
nonce::{check_nonce_account, NONCE_ARG, NONCE_AUTHORITY_ARG},
|
nonce::{check_nonce_account, nonce_arg, NONCE_ARG, NONCE_AUTHORITY_ARG},
|
||||||
};
|
};
|
||||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||||
use console::style;
|
use console::style;
|
||||||
@ -48,7 +48,7 @@ fn stake_authority_arg<'a, 'b>() -> Arg<'a, 'b> {
|
|||||||
Arg::with_name(STAKE_AUTHORITY_ARG.name)
|
Arg::with_name(STAKE_AUTHORITY_ARG.name)
|
||||||
.long(STAKE_AUTHORITY_ARG.long)
|
.long(STAKE_AUTHORITY_ARG.long)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("KEYPAIR")
|
.value_name("KEYPAIR of PUBKEY")
|
||||||
.validator(is_pubkey_or_keypair_or_ask_keyword)
|
.validator(is_pubkey_or_keypair_or_ask_keyword)
|
||||||
.help(STAKE_AUTHORITY_ARG.help)
|
.help(STAKE_AUTHORITY_ARG.help)
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ fn withdraw_authority_arg<'a, 'b>() -> Arg<'a, 'b> {
|
|||||||
Arg::with_name(WITHDRAW_AUTHORITY_ARG.name)
|
Arg::with_name(WITHDRAW_AUTHORITY_ARG.name)
|
||||||
.long(WITHDRAW_AUTHORITY_ARG.long)
|
.long(WITHDRAW_AUTHORITY_ARG.long)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("KEYPAIR")
|
.value_name("KEYPAIR or PUBKEY")
|
||||||
.validator(is_pubkey_or_keypair_or_ask_keyword)
|
.validator(is_pubkey_or_keypair_or_ask_keyword)
|
||||||
.help(WITHDRAW_AUTHORITY_ARG.help)
|
.help(WITHDRAW_AUTHORITY_ARG.help)
|
||||||
}
|
}
|
||||||
@ -189,23 +189,8 @@ impl StakeSubCommands for App<'_, '_> {
|
|||||||
.validator(is_hash)
|
.validator(is_hash)
|
||||||
.help("Use the supplied blockhash"),
|
.help("Use the supplied blockhash"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(nonce_arg())
|
||||||
Arg::with_name(NONCE_ARG.name)
|
.arg(nonce_authority_arg())
|
||||||
.long(NONCE_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.value_name("PUBKEY")
|
|
||||||
.requires("blockhash")
|
|
||||||
.validator(is_pubkey)
|
|
||||||
.help(NONCE_ARG.help)
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name(NONCE_AUTHORITY_ARG.name)
|
|
||||||
.long(NONCE_AUTHORITY_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.requires(NONCE_ARG.name)
|
|
||||||
.validator(is_keypair_or_ask_keyword)
|
|
||||||
.help(NONCE_AUTHORITY_ARG.help)
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("stake-authorize-staker")
|
SubCommand::with_name("stake-authorize-staker")
|
||||||
@ -252,23 +237,8 @@ impl StakeSubCommands for App<'_, '_> {
|
|||||||
.validator(is_hash)
|
.validator(is_hash)
|
||||||
.help("Use the supplied blockhash"),
|
.help("Use the supplied blockhash"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(nonce_arg())
|
||||||
Arg::with_name(NONCE_ARG.name)
|
.arg(nonce_authority_arg())
|
||||||
.long(NONCE_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.value_name("PUBKEY")
|
|
||||||
.requires("blockhash")
|
|
||||||
.validator(is_pubkey)
|
|
||||||
.help(NONCE_ARG.help)
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name(NONCE_AUTHORITY_ARG.name)
|
|
||||||
.long(NONCE_AUTHORITY_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.requires(NONCE_ARG.name)
|
|
||||||
.validator(is_keypair_or_ask_keyword)
|
|
||||||
.help(NONCE_AUTHORITY_ARG.help)
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("stake-authorize-withdrawer")
|
SubCommand::with_name("stake-authorize-withdrawer")
|
||||||
@ -315,23 +285,8 @@ impl StakeSubCommands for App<'_, '_> {
|
|||||||
.validator(is_hash)
|
.validator(is_hash)
|
||||||
.help("Use the supplied blockhash"),
|
.help("Use the supplied blockhash"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(nonce_arg())
|
||||||
Arg::with_name(NONCE_ARG.name)
|
.arg(nonce_authority_arg())
|
||||||
.long(NONCE_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.value_name("PUBKEY")
|
|
||||||
.requires("blockhash")
|
|
||||||
.validator(is_pubkey)
|
|
||||||
.help(NONCE_ARG.help)
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name(NONCE_AUTHORITY_ARG.name)
|
|
||||||
.long(NONCE_AUTHORITY_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.requires(NONCE_ARG.name)
|
|
||||||
.validator(is_keypair_or_ask_keyword)
|
|
||||||
.help(NONCE_AUTHORITY_ARG.help)
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("deactivate-stake")
|
SubCommand::with_name("deactivate-stake")
|
||||||
@ -368,23 +323,8 @@ impl StakeSubCommands for App<'_, '_> {
|
|||||||
.validator(is_hash)
|
.validator(is_hash)
|
||||||
.help("Use the supplied blockhash"),
|
.help("Use the supplied blockhash"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(nonce_arg())
|
||||||
Arg::with_name(NONCE_ARG.name)
|
.arg(nonce_authority_arg())
|
||||||
.long(NONCE_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.value_name("PUBKEY")
|
|
||||||
.requires("blockhash")
|
|
||||||
.validator(is_pubkey)
|
|
||||||
.help(NONCE_ARG.help)
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name(NONCE_AUTHORITY_ARG.name)
|
|
||||||
.long(NONCE_AUTHORITY_ARG.long)
|
|
||||||
.takes_value(true)
|
|
||||||
.requires(NONCE_ARG.name)
|
|
||||||
.validator(is_keypair_or_ask_keyword)
|
|
||||||
.help(NONCE_AUTHORITY_ARG.help)
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("withdraw-stake")
|
SubCommand::with_name("withdraw-stake")
|
||||||
|
Reference in New Issue
Block a user