Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: tomg10 <[email protected]>
  • Loading branch information
tomg10 committed Sep 25, 2024
1 parent e1b5f1b commit be64bd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
12 changes: 2 additions & 10 deletions core/lib/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,13 @@ const DIAMOND_INIT_CONTRACT_FILE: (&str, &str) = (
const GOVERNANCE_CONTRACT_FILE: (&str, &str) = ("governance", "IGovernance.sol/IGovernance.json");
const CHAIN_ADMIN_CONTRACT_FILE: (&str, &str) = ("governance", "IChainAdmin.sol/IChainAdmin.json");
const GETTERS_FACET_CONTRACT_FILE: (&str, &str) = (
"state-transition/chain-deps/facets",
"Getters.sol/GettersFacet.json",
"state-transition/chain-interfaces",
"IGetters.sol/IGetters.json",
);

const MULTICALL3_CONTRACT_FILE: (&str, &str) = ("dev-contracts", "Multicall3.sol/Multicall3.json");
const VERIFIER_CONTRACT_FILE: (&str, &str) = ("state-transition", "Verifier.sol/Verifier.json");

const GETTERS_CONTRACT_FILE: (&str, &str) = (
"state-transition/chain-interfaces",
"IGetters.sol/IGetters.json",
);
const _IERC20_CONTRACT_FILE: &str =
"contracts/l1-contracts/artifacts/contracts/common/interfaces/IERC20.sol/IERC20.json";
const _FAIL_ON_RECEIVE_CONTRACT_FILE: &str =
Expand Down Expand Up @@ -167,10 +163,6 @@ pub fn verifier_contract() -> Contract {
load_contract_for_both_compilers(VERIFIER_CONTRACT_FILE)
}

pub fn getters_contract() -> Contract {
load_contract_for_both_compilers(GETTERS_CONTRACT_FILE)
}

#[derive(Debug, Clone)]
pub struct TestContract {
/// Contract bytecode to be used for sending deploy transaction.
Expand Down
10 changes: 6 additions & 4 deletions core/node/eth_watch/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use std::fmt;

use anyhow::Context;
use zksync_contracts::{getters_contract, state_transition_manager_contract, verifier_contract};
use zksync_contracts::{
getters_facet_contract, state_transition_manager_contract, verifier_contract,
};
use zksync_eth_client::{
clients::{DynClient, L1},
CallFunctionArgs, ClientError, ContractCallError, EnrichedClientError, EnrichedClientResult,
Expand Down Expand Up @@ -57,7 +59,7 @@ pub struct EthHttpQueryClient {
state_transition_manager_address: Option<Address>,
chain_admin_address: Option<Address>,
verifier_contract_abi: Contract,
getters_contract_abi: Contract,
getters_facet_contract_abi: Contract,
confirmations_for_eth_event: Option<u64>,
}

Expand Down Expand Up @@ -87,7 +89,7 @@ impl EthHttpQueryClient {
.unwrap()
.signature(),
verifier_contract_abi: verifier_contract(),
getters_contract_abi: getters_contract(),
getters_facet_contract_abi: getters_facet_contract(),
confirmations_for_eth_event,
}
}
Expand Down Expand Up @@ -291,7 +293,7 @@ impl EthClient for EthHttpQueryClient {

async fn get_total_priority_txs(&self) -> Result<u64, ContractCallError> {
CallFunctionArgs::new("getTotalPriorityTxs", ())
.for_contract(self.diamond_proxy_addr, &self.getters_contract_abi)
.for_contract(self.diamond_proxy_addr, &self.getters_facet_contract_abi)
.call(&self.client)
.await
.map(|x: U256| x.try_into().unwrap())
Expand Down

0 comments on commit be64bd4

Please sign in to comment.