Skip to content

Commit

Permalink
impl fix from review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone committed Apr 24, 2024
1 parent 5f29c71 commit 1b80cff
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 46 deletions.
1 change: 0 additions & 1 deletion crates/apps/src/lib/bench_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ impl BenchShell {
token: self.state.in_mem().native_token.clone(),
},
defaults::albert_keypair().ref_to(),
self.state.in_mem().last_epoch,
0.into(),
None,
);
Expand Down
2 changes: 0 additions & 2 deletions crates/apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2592,7 +2592,6 @@ mod test_finalize_block {
token: shell.state.in_mem().native_token.clone(),
},
keypair.ref_to(),
Epoch(0),
0.into(),
None,
))));
Expand Down Expand Up @@ -2847,7 +2846,6 @@ mod test_finalize_block {
token: shell.state.in_mem().native_token.clone(),
},
keypair.ref_to(),
Epoch(0),
WRAPPER_GAS_LIMIT.into(),
None,
))));
Expand Down
10 changes: 3 additions & 7 deletions crates/light_sdk/src/transaction/account.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use namada_sdk::address::Address;
use namada_sdk::hash::Hash;
use namada_sdk::key::common;
use namada_sdk::storage::Epoch;
use namada_sdk::token::DenominatedAmount;
use namada_sdk::tx::data::GasLimit;
use namada_sdk::tx::{Authorization, Tx, TxError};
Expand Down Expand Up @@ -59,10 +58,9 @@ impl InitAccount {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -131,10 +129,9 @@ impl RevealPk {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -215,10 +212,9 @@ impl UpdateAccount {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down
4 changes: 1 addition & 3 deletions crates/light_sdk/src/transaction/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use namada_sdk::address::Address;
pub use namada_sdk::eth_bridge_pool::{GasFee, TransferToEthereum};
use namada_sdk::hash::Hash;
use namada_sdk::key::common;
use namada_sdk::storage::Epoch;
use namada_sdk::token::DenominatedAmount;
use namada_sdk::tx::data::GasLimit;
use namada_sdk::tx::{Authorization, Tx, TxError};
Expand Down Expand Up @@ -54,10 +53,9 @@ impl BridgeTransfer {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down
6 changes: 2 additions & 4 deletions crates/light_sdk/src/transaction/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ impl InitProposal {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -145,10 +144,9 @@ impl VoteProposal {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down
4 changes: 1 addition & 3 deletions crates/light_sdk/src/transaction/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use namada_sdk::hash::Hash;
pub use namada_sdk::ibc::apps::transfer::types::msgs::transfer::MsgTransfer;
use namada_sdk::ibc::primitives::ToProto;
use namada_sdk::key::common;
use namada_sdk::storage::Epoch;
use namada_sdk::time::DateTimeUtc;
use namada_sdk::token::DenominatedAmount;
use namada_sdk::tx::data::GasLimit;
Expand Down Expand Up @@ -63,10 +62,9 @@ impl IbcTransfer {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down
2 changes: 0 additions & 2 deletions crates/light_sdk/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use namada_sdk::address::Address;
use namada_sdk::chain::ChainId;
use namada_sdk::hash::Hash;
use namada_sdk::key::common;
use namada_sdk::storage::Epoch;
use namada_sdk::time::DateTimeUtc;
use namada_sdk::token::DenominatedAmount;
use namada_sdk::tx::data::{Fee, GasLimit};
Expand Down Expand Up @@ -80,7 +79,6 @@ pub(in crate::transaction) fn attach_fee(
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
_epoch: Epoch,
gas_limit: GasLimit,
) -> Tx {
tx.add_wrapper(
Expand Down
7 changes: 2 additions & 5 deletions crates/light_sdk/src/transaction/pgf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use namada_sdk::collections::HashMap;
use namada_sdk::dec::Dec;
use namada_sdk::hash::Hash;
use namada_sdk::key::common;
use namada_sdk::storage::Epoch;
use namada_sdk::token::DenominatedAmount;
use namada_sdk::tx::data::GasLimit;
use namada_sdk::tx::{Authorization, Tx, TxError};
Expand Down Expand Up @@ -49,10 +48,9 @@ impl ResignSteward {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -131,10 +129,9 @@ impl UpdateStewardCommission {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down
22 changes: 7 additions & 15 deletions crates/light_sdk/src/transaction/pos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use namada_sdk::address::Address;
use namada_sdk::dec::Dec;
use namada_sdk::hash::Hash;
use namada_sdk::key::{common, secp256k1};
use namada_sdk::storage::Epoch;
use namada_sdk::token;
use namada_sdk::token::{Amount, DenominatedAmount};
use namada_sdk::tx::data::pos::Redelegation;
Expand Down Expand Up @@ -337,10 +336,9 @@ impl ReactivateValidator {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -415,10 +413,9 @@ impl ClaimRewards {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -506,10 +503,9 @@ impl ChangeMetaData {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -586,10 +582,9 @@ impl ChangeConsensusKey {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -662,10 +657,9 @@ impl ChangeCommission {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -740,10 +734,9 @@ impl Withdraw {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down Expand Up @@ -824,10 +817,9 @@ impl Redelegate {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down
4 changes: 1 addition & 3 deletions crates/light_sdk/src/transaction/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use borsh_ext::BorshSerializeExt;
use namada_sdk::address::Address;
use namada_sdk::hash::Hash;
use namada_sdk::key::common;
use namada_sdk::storage::Epoch;
use namada_sdk::token::DenominatedAmount;
use namada_sdk::tx::data::GasLimit;
use namada_sdk::tx::{Authorization, Tx, TxError};
Expand Down Expand Up @@ -65,10 +64,9 @@ impl Transfer {
fee: DenominatedAmount,
token: Address,
fee_payer: common::PublicKey,
epoch: Epoch,
gas_limit: GasLimit,
) -> Self {
Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit))
Self(attach_fee(self.0, fee, token, fee_payer, gas_limit))
}

/// Get the bytes of the fee data to sign
Expand Down
1 change: 0 additions & 1 deletion crates/namada/src/vm/wasm/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,6 @@ mod tests {
},
namada_core::key::testing::common_sk_from_simple_seed(0)
.to_public(),
namada_state::Epoch(0),
0.into(),
None,
),
Expand Down

0 comments on commit 1b80cff

Please sign in to comment.