Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Enforce gas spending key usage with disposable gas payers.
([\#3979](https://github.com/anoma/namada/pull/3979))
16 changes: 9 additions & 7 deletions crates/apps_lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4759,8 +4759,8 @@ pub mod args {
.help(wrap!("The amount to transfer in decimal.")),
)
.arg(GAS_SPENDING_KEY.def().help(wrap!(
"The optional spending key that will be used in addition \
to the source for gas payment."
"The optional spending key that will be used for gas \
payment."
)))
.arg(
DISPOSABLE_SIGNING_KEY
Expand All @@ -4769,6 +4769,7 @@ pub mod args {
"Generates an ephemeral, disposable keypair to \
sign the wrapper transaction."
))
.requires(GAS_SPENDING_KEY.name)
.conflicts_with(FEE_PAYER_OPT.name),
)
}
Expand Down Expand Up @@ -4923,8 +4924,8 @@ pub mod args {
.help(wrap!("The amount to transfer in decimal.")),
)
.arg(GAS_SPENDING_KEY.def().help(wrap!(
"The optional spending key that will be used in addition \
to the source for gas payment."
"The optional spending key that will be used for gas \
payment."
)))
.arg(
DISPOSABLE_SIGNING_KEY
Expand All @@ -4933,6 +4934,7 @@ pub mod args {
"Generates an ephemeral, disposable keypair to \
sign the wrapper transaction."
))
.requires(GAS_SPENDING_KEY.name)
.conflicts_with(FEE_PAYER_OPT.name),
)
}
Expand Down Expand Up @@ -5054,9 +5056,8 @@ pub mod args {
.help(wrap!("The memo for IBC transfer packet.")),
)
.arg(GAS_SPENDING_KEY.def().help(wrap!(
"The optional spending key that will be used in addition \
to the source for gas payment (if this is a shielded \
action)."
"The optional spending key that will be used for gas \
payment (if this is a shielded action)."
)))
.arg(
DISPOSABLE_SIGNING_KEY
Expand All @@ -5065,6 +5066,7 @@ pub mod args {
"Generates an ephemeral, disposable keypair to \
sign the wrapper transaction."
))
.requires(GAS_SPENDING_KEY.name)
.conflicts_with(FEE_PAYER_OPT.name),
)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/shielded_token/src/masp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub struct MaspTargetTransferData {
pub struct MaspDataLog {
pub source: Option<TransferSource>,
pub token: Address,
pub amount: token::Amount,
pub amount: token::DenominatedAmount,
}

#[allow(missing_docs)]
Expand Down
4 changes: 3 additions & 1 deletion crates/shielded_token/src/masp/shielded_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,9 @@ pub trait ShieldedApi<U: ShieldedUtils + MaybeSend + MaybeSync>:
data: Some(MaspDataLog {
source,
token,
amount,
amount: namada_core::token::DenominatedAmount::new(
amount, denom,
),
}),
});
}
Expand Down
6 changes: 5 additions & 1 deletion crates/tests/src/integration/masp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3810,6 +3810,8 @@ fn masp_fee_payment() -> Result<()> {
"20000",
"--gas-price",
"1",
"--gas-spending-key",
A_SPENDING_KEY,
"--disposable-gas-payer",
"--ledger-address",
validator_one_rpc,
Expand Down Expand Up @@ -4116,6 +4118,8 @@ fn masp_fee_payment_gas_limit() -> Result<()> {
"1",
"--gas-price",
"1",
"--gas-spending-key",
A_SPENDING_KEY,
"--disposable-gas-payer",
"--ledger-address",
validator_one_rpc,
Expand Down Expand Up @@ -4155,7 +4159,7 @@ fn masp_fee_payment_gas_limit() -> Result<()> {
Ok(())
}

// Test masp fee payement with an unshield to a non-disposable address with
// Test masp fee payment with an unshield to a non-disposable address with
// already some funds on it.
#[test]
fn masp_fee_payment_with_non_disposable() -> Result<()> {
Expand Down