Skip to content

Commit

Permalink
Adding flag for recipient is ata owner and printing it as default wit…
Browse files Browse the repository at this point in the history
…hout touching commandresult
  • Loading branch information
SUMEETRM authored and joncinque committed Aug 18, 2023
1 parent 7e26f92 commit 579e9e0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions token/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,6 @@ 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 @@ -1232,9 +1231,6 @@ 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 {
Expand Down Expand Up @@ -3150,6 +3146,7 @@ fn app<'a, 'b>(
.long("recipient-is-ata-owner")
.takes_value(false)
.hidden(true)
.conflicts_with("no_recipient_is_ata_owner")
.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."),
)
Expand Down Expand Up @@ -4256,8 +4253,11 @@ async fn process_command<'a>(
let allow_unfunded_recipient = arg_matches.is_present("allow_empty_recipient")
|| 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 no_recipient_is_ata_owner = arg_matches.is_present("no_recipient_is_ata_owner") || !arg_matches.is_present("recipient_is_ata_owner");
if arg_matches.is_present("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."));
}
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 @@ -4278,7 +4278,6 @@ 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 579e9e0

Please sign in to comment.