Skip to content

Commit

Permalink
Fixes masp tx generation and integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
grarco committed Jun 11, 2024
1 parent 9f390a7 commit fb0df69
Show file tree
Hide file tree
Showing 6 changed files with 1,072 additions and 192 deletions.
6 changes: 5 additions & 1 deletion crates/namada/src/ledger/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,11 @@ where
.expect("Missing masp fee payment gas limit in storage")
.min(tx_gas_meter.borrow().tx_gas_limit.into());

let mut gas_meter = TxGasMeter::new(min_gas_limit);
let mut gas_meter = TxGasMeter::new(
namada_gas::Gas::from_whole_units(min_gas_limit).ok_or_else(|| {
Error::GasError("Overflow in gas expansion".to_string())
})?,
);
gas_meter
.copy_consumed_gas_from(&tx_gas_meter.borrow())
.map_err(|e| Error::GasError(e.to_string()))?;
Expand Down
3 changes: 0 additions & 3 deletions crates/sdk/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2138,9 +2138,6 @@ pub struct Tx<C: NamadaTypes = SdkTypes> {
pub gas_limit: GasLimit,
/// The optional expiration of the transaction
pub expiration: TxExpiration,
// FIXME: maybe should move this out of here, it's only needed for txs that
// pay the fees via the masp, so it should go together with the optional
// gas spending keys
/// Generate an ephimeral signing key to be used only once to sign a
/// wrapper tx
pub disposable_signing_key: bool,
Expand Down
5 changes: 4 additions & 1 deletion crates/sdk/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ pub enum TxSubmitError {
#[error("Proposal end epoch is not in the storage.")]
EpochNotInStorage,
/// Couldn't understand who the fee payer is
#[error("Either --signing-keys or --gas-payer must be available.")]
#[error(
"Either --signing-keys, --gas-payer or --disposable-gas-payer must be \
available."
)]
InvalidFeePayer,
/// Account threshold is not set
#[error("Account threshold must be set.")]
Expand Down
Loading

0 comments on commit fb0df69

Please sign in to comment.