Skip to content

Commit

Permalink
fix sync with eth after init test
Browse files Browse the repository at this point in the history
  • Loading branch information
olga24912 committed Jan 22, 2024
1 parent 6f8403e commit 2706d43
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions eth2near/eth2-contract-init/src/init_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ mod tests {
let mut init_config = get_init_config(&config_for_test, &eth_client_contract);
init_config.beacon_rpc_version = BeaconRPCVersion::V1_5;

init_contract(&init_config, &mut eth_client_contract).unwrap();

let last_finalized_slot_eth_client = eth_client_contract
.get_finalized_beacon_block_slot()
.expect("Error on getting last finalized beacon block slot(Eth client)");

let beacon_rpc_client = BeaconRPCClient::new(
&init_config.beacon_endpoint,
init_config.eth_requests_timeout_seconds.unwrap_or(10),
Expand All @@ -273,8 +267,14 @@ mod tests {
.get_last_finalized_slot_number()
.expect("Error on getting last finalized beacon block slot");

const MAX_GAP_IN_EPOCH_BETWEEN_FINALIZED_SLOTS: u64 = 3;
init_contract(&init_config, &mut eth_client_contract).unwrap();

let last_finalized_slot_eth_client = eth_client_contract
.get_finalized_beacon_block_slot()
.expect("Error on getting last finalized beacon block slot(Eth client)");

const MAX_GAP_IN_EPOCH_BETWEEN_FINALIZED_SLOTS: u64 = 3;

assert!(
last_finalized_slot_eth_client
+ ONE_EPOCH_IN_SLOTS * MAX_GAP_IN_EPOCH_BETWEEN_FINALIZED_SLOTS
Expand Down

0 comments on commit 2706d43

Please sign in to comment.