-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checking of the next preconfer when we're in last slot of the epoch (#…
…109) * Checking of the next preconfer when we're in last slot of the epoch * unit tests for the operator module
- Loading branch information
1 parent
22a555f
commit 7c437b3
Showing
7 changed files
with
288 additions
and
48 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,6 @@ tree_hash = "0.8" | |
blst = "0.3" | ||
|
||
[dev-dependencies] | ||
mockall_double = "0.3" | ||
mockall = "0.13" | ||
mockito = "1.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use super::super::{ | ||
consensus_layer::tests::setup_server, consensus_layer::ConsensusLayer, | ||
execution_layer::ExecutionLayer, execution_layer::PreconfTaskManager, | ||
}; | ||
use alloy::node_bindings::Anvil; | ||
|
||
#[tokio::test] | ||
async fn test_propose_new_block_with_lookahead() { | ||
let server = setup_server().await; | ||
let cl = ConsensusLayer::new(server.url().as_str()).unwrap(); | ||
let _duties = cl.get_lookahead(1).await.unwrap(); | ||
|
||
let anvil = Anvil::new().try_spawn().unwrap(); | ||
let rpc_url: reqwest::Url = anvil.endpoint().parse().unwrap(); | ||
let private_key = anvil.keys()[0].clone(); | ||
let el = ExecutionLayer::new_from_pk(rpc_url, private_key) | ||
.await | ||
.unwrap(); | ||
|
||
// TODO: | ||
// There is a bug in the Anvil (anvil 0.2.0) library: | ||
// `Result::unwrap()` on an `Err` value: buffer overrun while deserializing | ||
// check if it's fixed in next version | ||
// let lookahead_params = el | ||
// .get_lookahead_params_for_epoch_using_cl_lookahead(1, &duties) | ||
// .await | ||
// .unwrap(); | ||
let lookahead_params = Vec::<PreconfTaskManager::LookaheadSetParam>::new(); | ||
|
||
el.propose_new_block(0, vec![0; 32], [0; 32], 0, lookahead_params, true) | ||
.await | ||
.unwrap(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.