@@ -3,20 +3,20 @@ mod sepolia_integration_tests {
33 use super :: * ;
44 use crate :: tests:: utils:: get_sepolia_test_data;
55 use crate :: tests:: utils:: InitOptions ;
6+ use borsh:: { BorshDeserialize , BorshSerialize } ;
67 use eth2_utility:: types:: InitInput ;
78 use eth_types:: eth2:: { ExtendedBeaconBlockHeader , SyncCommittee } ;
89 use eth_types:: { Address , Bloom , H256 , H64 , U256 } ;
9- use borsh:: { BorshDeserialize , BorshSerialize } ;
1010 use near_sdk:: { Gas , NearToken } ;
11- use near_workspaces:: { Account , Contract } ;
1211 use near_workspaces:: operations:: Function ;
12+ use near_workspaces:: { Account , Contract } ;
1313 use serde:: { Deserialize , Serialize } ;
1414
1515 const WASM_FILEPATH : & str = "../target/near/eth2_client/eth2_client.wasm" ;
1616 const WASM_V_0_1_0_FILEPATH : & str = "src/data/eth2_client_v0.1.0_testnet.wasm" ;
1717
1818 #[ derive( Debug , Clone , BorshSerialize , BorshDeserialize , Serialize , Deserialize ) ]
19- struct BlockHeaderV1 {
19+ struct BlockHeaderV1 {
2020 pub parent_hash : H256 ,
2121 pub uncles_hash : H256 ,
2222 pub author : Address ,
@@ -43,14 +43,14 @@ mod sepolia_integration_tests {
4343 pub partial_hash : Option < H256 > ,
4444 }
4545
46- impl From < eth_types:: BlockHeader > for BlockHeaderV1 {
46+ impl From < eth_types:: BlockHeader > for BlockHeaderV1 {
4747 fn from ( item : eth_types:: BlockHeader ) -> Self {
4848 serde_json:: from_str ( & serde_json:: to_string ( & item) . unwrap ( ) ) . unwrap ( )
4949 }
5050 }
5151
5252 #[ derive( Clone , BorshDeserialize , BorshSerialize ) ]
53- struct InitInputV1 {
53+ struct InitInputV1 {
5454 pub network : String ,
5555 pub finalized_execution_header : BlockHeaderV1 ,
5656 pub finalized_beacon_header : ExtendedBeaconBlockHeader ,
@@ -63,7 +63,7 @@ mod sepolia_integration_tests {
6363 pub trusted_signer : Option < near_sdk:: AccountId > ,
6464 }
6565
66- impl From < InitInput > for InitInputV1 {
66+ impl From < InitInput > for InitInputV1 {
6767 fn from ( message : InitInput ) -> Self {
6868 Self {
6969 network : message. network ,
@@ -91,9 +91,14 @@ mod sepolia_integration_tests {
9191 let alice = owner
9292 . create_subaccount ( "alice" )
9393 . initial_balance ( NearToken :: from_near ( 30 ) )
94- . transact ( ) . await ?
94+ . transact ( )
95+ . await ?
9596 . into_result ( ) ?;
96- let _ = contract. call ( "init" ) . args_borsh ( init_input) . transact ( ) . await ?;
97+ let _ = contract
98+ . call ( "init" )
99+ . args_borsh ( init_input)
100+ . transact ( )
101+ . await ?;
97102 Ok ( ( alice, contract) )
98103 }
99104
@@ -117,10 +122,12 @@ mod sepolia_integration_tests {
117122 update. finality_update . header_update . execution_block_hash = last;
118123
119124 // Submit the light‐client update
120- let outcome = alice. call ( contract. id ( ) , "submit_beacon_chain_light_client_update" )
125+ let outcome = alice
126+ . call ( contract. id ( ) , "submit_beacon_chain_light_client_update" )
121127 . args_borsh ( update)
122128 . gas ( Gas :: from_tgas ( 300 ) )
123- . transact ( ) . await ?;
129+ . transact ( )
130+ . await ?;
124131 assert ! ( outcome. is_success( ) , "update failed" ) ;
125132
126133 // Submit execution headers in reverse order
@@ -130,7 +137,7 @@ mod sepolia_integration_tests {
130137 tx = tx. call (
131138 Function :: new ( "submit_execution_header" )
132139 . args ( borsh:: to_vec ( h) ?)
133- . gas ( Gas :: from_tgas ( 6 ) )
140+ . gas ( Gas :: from_tgas ( 6 ) ) ,
134141 ) ;
135142 }
136143 let result = tx. transact ( ) . await ?;
@@ -139,14 +146,14 @@ mod sepolia_integration_tests {
139146
140147 // Verify that each block’s hash is stored
141148 for h in slice {
142- let result: Option < H256 > = contract. view ( "block_hash_safe" )
143- . args_borsh ( h. number ) . await ?
149+ let result: Option < H256 > = contract
150+ . view ( "block_hash_safe" )
151+ . args_borsh ( h. number )
152+ . await ?
144153 . borsh ( ) ?;
145154 assert ! ( result. is_some( ) , "block {} missing" , h. number) ;
146155 }
147156
148157 Ok ( ( ) )
149158 }
150-
151-
152159}
0 commit comments