Skip to content

Commit

Permalink
eth/bridge_pool: env agnostic VP
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Sep 12, 2024
1 parent 5db5b2d commit c812120
Show file tree
Hide file tree
Showing 9 changed files with 228 additions and 272 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 @@ -1490,7 +1490,7 @@ fn eth_bridge_pool(c: &mut Criterion) {
let vp_address = Address::Internal(InternalAddress::EthBridgePool);
let gas_meter =
RefCell::new(VpGasMeter::new_from_tx_meter(&TxGasMeter::new(u64::MAX)));
let bridge_pool = EthBridgePoolVp::new(Ctx::new(
let ctx = Ctx::new(
&vp_address,
&shell.state,
&signed_tx.tx,
Expand All @@ -1500,18 +1500,18 @@ fn eth_bridge_pool(c: &mut Criterion) {
&keys_changed,
&verifiers,
shell.vp_wasm_cache.clone(),
));
);

c.bench_function("vp_eth_bridge_pool", |b| {
b.iter(|| {
assert!(
bridge_pool
.validate_tx(
&signed_tx.to_ref(),
bridge_pool.ctx.keys_changed,
bridge_pool.ctx.verifiers,
)
.is_ok()
EthBridgePoolVp::validate_tx(
&ctx,
&signed_tx.to_ref(),
ctx.keys_changed,
ctx.verifiers,
)
.is_ok()
)
})
});
Expand Down
1 change: 1 addition & 0 deletions crates/ethereum_bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namada_trans_token = {path = "../trans_token"}
namada_tx = {path = "../tx"}
namada_vote_ext = {path = "../vote_ext"}
namada_vp = {path = "../vp"}
namada_vp_env = {path = "../vp_env"}

borsh.workspace = true
ethers.workspace = true
Expand Down
Loading

0 comments on commit c812120

Please sign in to comment.