This repository was archived by the owner on Nov 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +16
-1
lines changed
relay-chain-inprocess-interface/src
relay-chain-rpc-interface/src Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,6 @@ impl RelayChainInterface for Relaychain {
186186 }
187187
188188 async fn wait_for_block ( & self , _: PHash ) -> RelayChainResult < ( ) > {
189- unimplemented ! ( "Not needed for test" )
190189 }
191190
192191 async fn new_best_notification_stream (
@@ -207,6 +206,10 @@ impl RelayChainInterface for Relaychain {
207206 } )
208207 . boxed ( ) )
209208 }
209+
210+ async fn header ( & self , block_id : PHash ) -> RelayChainResult < Option < PHeader > > {
211+ unimplemented ! ( "Not needed for test" )
212+ }
210213}
211214
212215fn build_block < B : InitBlockBuilder > (
Original file line number Diff line number Diff line change @@ -237,6 +237,10 @@ impl RelayChainInterface for DummyRelayChainInterface {
237237 } ) ;
238238 Ok ( Box :: pin ( notifications_stream) )
239239 }
240+
241+ async fn header ( & self , block_id : PHash ) -> RelayChainResult < Option < PHeader > > {
242+ unimplemented ! ( "Not needed for test" )
243+ }
240244}
241245
242246fn make_validator_and_api (
Original file line number Diff line number Diff line change @@ -171,6 +171,10 @@ where
171171 Ok ( self . sync_oracle . is_major_syncing ( ) )
172172 }
173173
174+ async fn header ( & self , block_id : PHash ) -> RelayChainResult < Option < PHeader > > {
175+ Ok ( self . backend . header ( block_hash) ?)
176+ }
177+
174178 fn overseer_handle ( & self ) -> RelayChainResult < Handle > {
175179 Ok ( self . overseer_handle . clone ( ) )
176180 }
Original file line number Diff line number Diff line change @@ -132,6 +132,10 @@ impl RelayChainInterface for RelayChainRpcInterface {
132132 self . rpc_client . system_health ( ) . await . map ( |h| h. is_syncing )
133133 }
134134
135+ async fn header ( & self , block_id : RelayHash ) -> RelayChainResult < Option < RelayHeader > > {
136+ self . rpc_client . chain_get_header ( Some ( block_id) ) . await
137+ }
138+
135139 fn overseer_handle ( & self ) -> RelayChainResult < Handle > {
136140 Ok ( self . overseer_handle . clone ( ) )
137141 }
You can’t perform that action at this time.
0 commit comments