Skip to content

Commit

Permalink
gov: env agnostic VP
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Sep 12, 2024
1 parent 15ffacc commit 95c58a6
Show file tree
Hide file tree
Showing 8 changed files with 303 additions and 229 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions crates/benches/native_vps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ fn governance(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX),
));
let governance = GovernanceVp::new(Ctx::new(
let ctx = Ctx::new(
&Address::Internal(InternalAddress::Governance),
&shell.state,
&signed_tx.tx,
Expand All @@ -230,18 +230,18 @@ fn governance(c: &mut Criterion) {
&keys_changed,
&verifiers,
shell.vp_wasm_cache.clone(),
));
);

group.bench_function(bench_name, |b| {
b.iter(|| {
assert!(
governance
.validate_tx(
&signed_tx.to_ref(),
governance.ctx.keys_changed,
governance.ctx.verifiers,
)
.is_ok()
GovernanceVp::validate_tx(
&ctx,
&signed_tx.to_ref(),
ctx.keys_changed,
ctx.verifiers,
)
.is_ok()
)
})
});
Expand Down
1 change: 1 addition & 0 deletions crates/governance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namada_state = { path = "../state" }
namada_systems = { path = "../systems" }
namada_tx = { path = "../tx" }
namada_vp = { path = "../vp" }
namada_vp_env = { path = "../vp_env" }

arbitrary = { workspace = true, optional = true }
borsh.workspace = true
Expand Down
Loading

0 comments on commit 95c58a6

Please sign in to comment.