6
6
* These are the highest level integration tests for the Spectre protocol
7
7
* They treat the Spectre contract as an ethereum light-client and test against the spec
8
8
*/
9
- use std:: path:: PathBuf ;
10
- use std:: sync:: Arc ;
11
9
12
- use contract_tests:: make_client;
13
10
#[ cfg( feature = "contracts" ) ]
14
- use contracts:: { MockVerifier , Spectre } ;
15
- use eth_types:: { Minimal , LIMB_BITS } ;
16
- use ethers:: core:: types:: U256 ;
17
- use ethers:: providers:: Middleware ;
18
- use halo2_base:: halo2_proofs:: halo2curves:: bn256:: Fr ;
19
- use lightclient_circuits:: sync_step_circuit:: StepCircuit ;
20
- use rstest:: rstest;
21
- use test_utils:: { get_initial_sync_committee_poseidon, read_test_files_and_gen_witness} ;
22
-
23
- const SLOTS_PER_EPOCH : usize = 8 ;
24
- const EPOCHS_PER_SYNC_COMMITTEE_PERIOD : usize = 8 ;
25
- const SLOTS_PER_SYNC_COMMITTEE_PERIOD : usize = EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH ;
26
- const FINALITY_THRESHOLD : usize = 20 ; // ~ 2/3 of 32
11
+ mod contract_integration {
12
+ use std:: path:: PathBuf ;
13
+ use std:: sync:: Arc ;
14
+
15
+ use contract_tests:: make_client;
16
+ use contracts:: { MockVerifier , Spectre } ;
17
+ use eth_types:: { Minimal , LIMB_BITS } ;
18
+ use ethers:: core:: types:: U256 ;
19
+ use ethers:: providers:: Middleware ;
20
+ use halo2_base:: halo2_proofs:: halo2curves:: bn256:: Fr ;
21
+ use lightclient_circuits:: sync_step_circuit:: StepCircuit ;
22
+ use rstest:: rstest;
23
+ use test_utils:: { get_initial_sync_committee_poseidon, read_test_files_and_gen_witness} ;
24
+ const SLOTS_PER_EPOCH : usize = 8 ;
25
+ const EPOCHS_PER_SYNC_COMMITTEE_PERIOD : usize = 8 ;
26
+ const SLOTS_PER_SYNC_COMMITTEE_PERIOD : usize =
27
+ EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH ;
28
+ const FINALITY_THRESHOLD : usize = 20 ; // ~ 2/3 of 32
29
+ }
27
30
28
31
#[ tokio:: test]
29
32
#[ cfg( feature = "contracts" ) ]
30
-
31
33
async fn test_deploy_spectre ( ) -> anyhow:: Result < ( ) > {
32
34
let ( _anvil_instance, ethclient) = make_client ( ) ;
33
35
let _contract = deploy_spectre_mock_verifiers ( ethclient, 0 , U256 :: zero ( ) , 0 ) . await ?;
@@ -37,7 +39,6 @@ async fn test_deploy_spectre() -> anyhow::Result<()> {
37
39
#[ rstest]
38
40
#[ tokio:: test]
39
41
#[ cfg( feature = "contracts" ) ]
40
-
41
42
async fn test_contract_initialization_and_first_step (
42
43
#[ files( "../consensus-spec-tests/tests/minimal/capella/light_client/sync/pyspec_tests/**" ) ]
43
44
#[ exclude( "deneb*" ) ]
@@ -82,7 +83,6 @@ async fn test_contract_initialization_and_first_step(
82
83
contract. execution_payload_roots( head) . call( ) . await ?,
83
84
step_input. execution_payload_root
84
85
) ;
85
-
86
86
Ok ( ( ) )
87
87
}
88
88
0 commit comments