Skip to content

Commit 7212f7e

Browse files
committed
remove --refund
1 parent ca79554 commit 7212f7e

File tree

5 files changed

+15
-37
lines changed

5 files changed

+15
-37
lines changed

crates/apps_lib/src/cli.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3349,7 +3349,6 @@ pub mod args {
33493349
pub const RAW_PUBLIC_KEY_HASH_OPT: ArgOpt<String> =
33503350
RAW_PUBLIC_KEY_HASH.opt();
33513351
pub const RECEIVER: Arg<String> = arg("receiver");
3352-
pub const REFUND: ArgFlag = flag("refund");
33533352
pub const REFUND_TARGET: ArgOpt<WalletTransferTarget> =
33543353
arg_opt("refund-target");
33553354
pub const RELAYER: Arg<Address> = arg("relayer");
@@ -6480,7 +6479,6 @@ pub mod args {
64806479
amount: self.amount,
64816480
port_id: self.port_id,
64826481
channel_id: self.channel_id,
6483-
refund: self.refund,
64846482
})
64856483
}
64866484
}
@@ -6494,7 +6492,6 @@ pub mod args {
64946492
let amount = InputAmount::Unvalidated(AMOUNT.parse(matches));
64956493
let port_id = PORT_ID.parse(matches);
64966494
let channel_id = CHANNEL_ID.parse(matches);
6497-
let refund = REFUND.parse(matches);
64986495
Self {
64996496
query,
65006497
output_folder,
@@ -6503,7 +6500,6 @@ pub mod args {
65036500
amount,
65046501
port_id,
65056502
channel_id,
6506-
refund,
65076503
}
65086504
}
65096505

@@ -6525,9 +6521,6 @@ pub mod args {
65256521
.arg(CHANNEL_ID.def().help(wrap!(
65266522
"The channel ID via which the token is received."
65276523
)))
6528-
.arg(REFUND.def().help(wrap!(
6529-
"Generate the shielding transfer for refunding."
6530-
)))
65316524
}
65326525
}
65336526

crates/sdk/src/args.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,6 +2662,4 @@ pub struct GenIbcShieldingTransfer<C: NamadaTypes = SdkTypes> {
26622662
pub port_id: PortId,
26632663
/// Channel ID via which the token is received
26642664
pub channel_id: ChannelId,
2665-
/// Generate the shielding transfer for refunding
2666-
pub refund: bool,
26672665
}

crates/sdk/src/masp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ impl<U: ShieldedUtils + MaybeSend + MaybeSync> ShieldedContext<U> {
876876
let mut masp_txs = Vec::new();
877877
for cmt in &tx.header.batch {
878878
let tx_data = tx.data(cmt).ok_or_else(|| {
879-
Error::Other("Missing expected masp transaction".to_string())
879+
Error::Other("Missing transaction data".to_string())
880880
})?;
881881
let ibc_msg = decode_message(&tx_data)
882882
.map_err(|_| Error::Other("Invalid IBC message".to_string()))?;
@@ -890,7 +890,7 @@ impl<U: ShieldedUtils + MaybeSend + MaybeSync> ShieldedContext<U> {
890890
Ok(masp_txs)
891891
} else {
892892
Err(Error::Other(
893-
"IBC meesage doesn't have masp transaction".to_string(),
893+
"IBC message doesn't have masp transaction".to_string(),
894894
))
895895
}
896896
}

crates/sdk/src/tx.rs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use namada_governance::storage::proposal::{
5151
};
5252
use namada_governance::storage::vote::ProposalVote;
5353
use namada_ibc::storage::channel_key;
54-
use namada_ibc::trace::{convert_to_address, is_nft_trace};
54+
use namada_ibc::trace::is_nft_trace;
5555
use namada_ibc::{
5656
decode_masp_tx_from_memo, IbcShieldingData, MsgNftTransfer, MsgTransfer,
5757
};
@@ -3526,22 +3526,17 @@ pub async fn gen_ibc_shielding_transfer<N: Namada>(
35263526
.await?;
35273527
let ibc_denom =
35283528
rpc::query_ibc_denom(context, &args.token, Some(&source)).await;
3529-
let token = if args.refund {
3530-
convert_to_address(ibc_denom)
3531-
.map_err(|e| Error::Other(format!("Invalid token: {e}")))?
3532-
} else {
3533-
// Need to check the prefix
3534-
namada_ibc::received_ibc_token(
3535-
&ibc_denom,
3536-
&src_port_id,
3537-
&src_channel_id,
3538-
&args.port_id,
3539-
&args.channel_id,
3540-
)
3541-
.map_err(|e| {
3542-
Error::Other(format!("Getting IBC Token failed: error {e}"))
3543-
})?
3544-
};
3529+
// Need to check the prefix
3530+
let token = namada_ibc::received_ibc_token(
3531+
&ibc_denom,
3532+
&src_port_id,
3533+
&src_channel_id,
3534+
&args.port_id,
3535+
&args.channel_id,
3536+
)
3537+
.map_err(|e| {
3538+
Error::Other(format!("Getting IBC Token failed: error {e}"))
3539+
})?;
35453540
let validated_amount =
35463541
validate_amount(context, args.amount, &token, false).await?;
35473542

crates/tests/src/e2e/ibc_tests.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ fn run_ledger_ibc_with_hermes() -> Result<()> {
299299
1_000_000_000,
300300
&port_id_b,
301301
&channel_id_b,
302-
false,
303302
)?;
304303
transfer(
305304
&test_a,
@@ -492,7 +491,6 @@ fn ibc_namada_gaia() -> Result<()> {
492491
100,
493492
&port_id_namada,
494493
&channel_id_namada,
495-
false,
496494
)?;
497495
transfer_from_gaia(
498496
&test_gaia,
@@ -695,7 +693,6 @@ fn proposal_ibc_token_inflation() -> Result<()> {
695693
1_000_000,
696694
&port_id_b,
697695
&channel_id_b,
698-
false,
699696
)?;
700697
transfer(
701698
&test_a,
@@ -2685,14 +2682,13 @@ fn gen_masp_tx(
26852682
amount: u64,
26862683
port_id: &PortId,
26872684
channel_id: &ChannelId,
2688-
is_refund: bool,
26892685
) -> Result<PathBuf> {
26902686
std::env::set_var(ENV_VAR_CHAIN_ID, dst_test.net.chain_id.to_string());
26912687
let rpc = get_actor_rpc(dst_test, Who::Validator(0));
26922688
let output_folder = dst_test.test_dir.path().to_string_lossy();
26932689

26942690
let amount = amount.to_string();
2695-
let mut args = vec![
2691+
let args = vec![
26962692
"ibc-gen-shielding",
26972693
"--output-folder-path",
26982694
&output_folder,
@@ -2710,10 +2706,6 @@ fn gen_masp_tx(
27102706
&rpc,
27112707
];
27122708

2713-
if is_refund {
2714-
args.push("--refund");
2715-
}
2716-
27172709
let mut client = run!(dst_test, Bin::Client, args, Some(120))?;
27182710
let (_unread, matched) =
27192711
client.exp_regex("Output IBC shielding transfer .*")?;

0 commit comments

Comments
 (0)