Skip to content

Commit 9072bfd

Browse files
committed
Forces ibc shielding target argument to be a payment address
1 parent df1a2b2 commit 9072bfd

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

crates/apps_lib/src/cli.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7509,7 +7509,7 @@ pub mod args {
75097509
fn parse(matches: &ArgMatches) -> Self {
75107510
let query = Query::parse(matches);
75117511
let output_folder = OUTPUT_FOLDER_PATH.parse(matches);
7512-
let target = TRANSFER_TARGET.parse(matches);
7512+
let target = PAYMENT_ADDRESS_TARGET.parse(matches);
75137513
let token = TOKEN_STR.parse(matches);
75147514
let raw_amount = AMOUNT.parse(matches);
75157515
let amount = InputAmount::Unvalidated(raw_amount);
@@ -7560,7 +7560,11 @@ pub mod args {
75607560
.arg(OUTPUT_FOLDER_PATH.def().help(wrap!(
75617561
"The output folder path where the artifact will be stored."
75627562
)))
7563-
.arg(TRANSFER_TARGET.def().help(wrap!("The target address.")))
7563+
.arg(
7564+
PAYMENT_ADDRESS_TARGET
7565+
.def()
7566+
.help(wrap!("The shielded target account address.")),
7567+
)
75647568
.arg(TOKEN.def().help(wrap!("The transfer token.")))
75657569
.arg(
75667570
AMOUNT

crates/sdk/src/args.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -719,10 +719,7 @@ impl TxOsmosisSwap<SdkTypes> {
719719
ledger_address: transfer.tx.ledger_address.clone(),
720720
},
721721
output_folder: None,
722-
target:
723-
namada_core::masp::TransferTarget::PaymentAddress(
724-
payment_addr,
725-
),
722+
target: payment_addr,
726723
asset: IbcShieldingTransferAsset::Address(
727724
namada_output_addr,
728725
),
@@ -3250,8 +3247,7 @@ pub struct GenIbcShieldingTransfer<C: NamadaTypes = SdkTypes> {
32503247
/// The output directory path to where serialize the data
32513248
pub output_folder: Option<PathBuf>,
32523249
/// The target address
3253-
// FIXME: why isn't this a payment address?
3254-
pub target: C::TransferTarget,
3250+
pub target: C::PaymentAddress,
32553251
/// Transferred token amount
32563252
pub amount: InputAmount,
32573253
/// The optional expiration of the masp shielding transaction

crates/sdk/src/tx.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4376,7 +4376,11 @@ pub async fn gen_ibc_shielding_transfer<N: Namada>(
43764376
)],
43774377
targets: [
43784378
extra_target,
4379-
vec![(args.target, token.clone(), validated_amount)],
4379+
vec![(
4380+
TransferTarget::PaymentAddress(args.target),
4381+
token.clone(),
4382+
validated_amount,
4383+
)],
43804384
]
43814385
.concat(),
43824386
};

0 commit comments

Comments
 (0)