Skip to content

Commit

Permalink
Retaining the original recipient_is_ata_owner as a hidden flag and pr…
Browse files Browse the repository at this point in the history
…inting that it is now default behaviour
  • Loading branch information
SUMEETRM authored and joncinque committed Aug 18, 2023
1 parent 246867c commit 144bcde
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions token/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,7 @@ async fn command_transfer(
fund_recipient: bool,
mint_decimals: Option<u8>,
no_recipient_is_ata_owner: bool,
recipient_is_ata_owner: bool,
use_unchecked_instruction: bool,
ui_fee: Option<f64>,
memo: Option<String>,
Expand Down Expand Up @@ -1231,6 +1232,10 @@ async fn command_transfer(
let maybe_fee =
ui_fee.map(|ui_amount| spl_token::ui_amount_to_amount(ui_amount, mint_info.decimals));

if recipient_is_ata_owner {
println_display(config, format!("recipient-is-ata-owner is now the default behavior. The option has been deprecated and will be removed in a future release."));
}

// determine whether recipient is a token account or an expected owner of one
let recipient_is_token_account = if !config.sign_only {
// in online mode we can fetch it and see
Expand Down Expand Up @@ -3140,6 +3145,14 @@ fn app<'a, 'b>(
.requires("sign_only")
.help("In sign-only mode, specifies that the recipient is the owner of the associated token account rather than an actual token account"),
)
.arg(
Arg::with_name("recipient_is_ata_owner")
.long("recipient-is-ata-owner")
.takes_value(false)
.hidden(true)
.requires("sign_only")
.help("recipient-is-ata-owner is now the default behavior. The option has been deprecated and will be removed in a future release."),
)
.arg(
Arg::with_name("expected_fee")
.long("expected-fee")
Expand Down Expand Up @@ -4244,6 +4257,7 @@ async fn process_command<'a>(
|| arg_matches.is_present("allow_unfunded_recipient");

let no_recipient_is_ata_owner = arg_matches.is_present("no_recipient_is_ata_owner");
let recipient_is_ata_owner = arg_matches.is_present("recipient_is_ata_owner");
let use_unchecked_instruction = arg_matches.is_present("use_unchecked_instruction");
let expected_fee = value_of::<f64>(arg_matches, "expected_fee");
let memo = value_t!(arg_matches, "memo", String).ok();
Expand All @@ -4264,6 +4278,7 @@ async fn process_command<'a>(
fund_recipient,
mint_decimals,
no_recipient_is_ata_owner,
recipient_is_ata_owner,
use_unchecked_instruction,
expected_fee,
memo,
Expand Down

0 comments on commit 144bcde

Please sign in to comment.