Skip to content

Commit

Permalink
fixup! fix everything that was depending on rm'd namada crate
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jul 1, 2024
1 parent 769e297 commit 5513de2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
15 changes: 4 additions & 11 deletions crates/benches/native_vps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use namada_apps_lib::ibc::core::host::types::identifiers::{
ClientId, ConnectionId, PortId,
};
use namada_apps_lib::ibc::primitives::ToProto;
use namada_apps_lib::ibc::vp::context::PseudoExecutionContext;
use namada_apps_lib::ibc::{IbcActions, NftTransferModule, TransferModule};
use namada_apps_lib::masp::{
partial_deauthorize, preload_verifying_keys, PVKs, TransferSource,
Expand All @@ -48,8 +47,8 @@ use namada_apps_lib::state::{Epoch, StorageRead, StorageWrite, TxIndex};
use namada_apps_lib::token::{Amount, TransparentTransfer};
use namada_apps_lib::tx::{BatchedTx, Code, Section, Tx};
use namada_apps_lib::validation::{
EthBridgeNutVp, EthBridgePoolVp, EthBridgeVp, GovernanceVp, IbcVp, MaspVp,
MultitokenVp, ParametersVp, PgfVp, PosVp,
EthBridgeNutVp, EthBridgePoolVp, EthBridgeVp, GovernanceVp, IbcVp,
IbcVpContext, MaspVp, MultitokenVp, ParametersVp, PgfVp, PosVp,
};
use namada_apps_lib::wallet::defaults;
use namada_apps_lib::{governance, proof_of_stake, storage, token};
Expand Down Expand Up @@ -1671,10 +1670,7 @@ fn ibc_vp_validate_action(c: &mut Criterion) {
// needed in actual txs to addresses whose VPs should be triggered
let verifiers = Rc::new(RefCell::new(BTreeSet::<Address>::new()));

let exec_ctx =
PseudoExecutionContext::<'_, '_, _, _, _, token::Store<_>>::new(
ibc.ctx.pre(),
);
let exec_ctx = IbcVpContext::new(ibc.ctx.pre());
let ctx = Rc::new(RefCell::new(exec_ctx));
let mut actions = IbcActions::new(ctx.clone(), verifiers.clone());
actions.set_validation_params(ibc.validation_params().unwrap());
Expand Down Expand Up @@ -1730,10 +1726,7 @@ fn ibc_vp_execute_action(c: &mut Criterion) {
// needed in actual txs to addresses whose VPs should be triggered
let verifiers = Rc::new(RefCell::new(BTreeSet::<Address>::new()));

let exec_ctx =
PseudoExecutionContext::<'_, '_, _, _, _, token::Store<_>>::new(
ibc.ctx.pre(),
);
let exec_ctx = IbcVpContext::new(ibc.ctx.pre());
let ctx = Rc::new(RefCell::new(exec_ctx));

let mut actions = IbcActions::new(ctx.clone(), verifiers.clone());
Expand Down
32 changes: 23 additions & 9 deletions crates/sdk/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,21 @@ pub type IbcVp<'a, S, CA> = ibc::vp::Ibc<
Eval<S, CA>,
ParamsPreStore<'a, S, CA>,
GovPreStore<'a, S, CA>,
token::Store<
ibc::vp::context::PseudoExecutionStorage<
'a,
'a,
S,
VpCache<CA>,
Eval<S, CA>,
>,
>,
TokenStoreForIbcExec<'a, S, CA>,
PosPreStore<'a, S, CA>,
>;

/// IBC VP pseudo-execution context
pub type IbcVpContext<'view, 'a, S, CA, EVAL> =
ibc::vp::context::PseudoExecutionContext<
'view,
'a,
S,
VpCache<CA>,
EVAL,
TokenStoreForIbcExec<'a, S, CA>,
>;

/// Native parameters VP
pub type ParametersVp<'a, S, CA> = parameters::vp::ParametersVp<
'a,
Expand Down Expand Up @@ -112,6 +115,17 @@ pub type PosPreStore<'a, S, CA> = proof_of_stake::Store<
CtxPreStorageRead<'a, 'a, S, VpCache<CA>, Eval<S, CA>>,
>;

/// Token store impl over IBC pseudo-execution storage
pub type TokenStoreForIbcExec<'a, S, CA> = token::Store<
ibc::vp::context::PseudoExecutionStorage<
'a,
'a,
S,
VpCache<CA>,
Eval<S, CA>,
>,
>;

/// Token storage keys implementation
pub type TokenKeys = token::Store<()>;

Expand Down

0 comments on commit 5513de2

Please sign in to comment.