1919//! API trait of the archive methods.
2020
2121use crate :: {
22+ archive:: error:: { Error , Infallible } ,
2223 common:: events:: {
2324 ArchiveStorageDiffEvent , ArchiveStorageDiffItem , ArchiveStorageEvent , StorageQuery ,
2425 } ,
2526 MethodResult ,
2627} ;
27- use jsonrpsee:: { core :: RpcResult , proc_macros:: rpc} ;
28+ use jsonrpsee:: proc_macros:: rpc;
2829
2930#[ rpc( client, server) ]
3031pub trait ArchiveApi < Hash > {
@@ -37,7 +38,7 @@ pub trait ArchiveApi<Hash> {
3738 ///
3839 /// This method is unstable and subject to change in the future.
3940 #[ method( name = "archive_v1_body" ) ]
40- fn archive_v1_body ( & self , hash : Hash ) -> RpcResult < Option < Vec < String > > > ;
41+ fn archive_v1_body ( & self , hash : Hash ) -> Result < Option < Vec < String > > , Infallible > ;
4142
4243 /// Get the chain's genesis hash.
4344 ///
@@ -47,7 +48,7 @@ pub trait ArchiveApi<Hash> {
4748 ///
4849 /// This method is unstable and subject to change in the future.
4950 #[ method( name = "archive_v1_genesisHash" ) ]
50- fn archive_v1_genesis_hash ( & self ) -> RpcResult < String > ;
51+ fn archive_v1_genesis_hash ( & self ) -> Result < String , Infallible > ;
5152
5253 /// Get the block's header.
5354 ///
@@ -58,7 +59,7 @@ pub trait ArchiveApi<Hash> {
5859 ///
5960 /// This method is unstable and subject to change in the future.
6061 #[ method( name = "archive_v1_header" ) ]
61- fn archive_v1_header ( & self , hash : Hash ) -> RpcResult < Option < String > > ;
62+ fn archive_v1_header ( & self , hash : Hash ) -> Result < Option < String > , Infallible > ;
6263
6364 /// Get the height of the current finalized block.
6465 ///
@@ -68,7 +69,7 @@ pub trait ArchiveApi<Hash> {
6869 ///
6970 /// This method is unstable and subject to change in the future.
7071 #[ method( name = "archive_v1_finalizedHeight" ) ]
71- fn archive_v1_finalized_height ( & self ) -> RpcResult < u64 > ;
72+ fn archive_v1_finalized_height ( & self ) -> Result < u64 , Infallible > ;
7273
7374 /// Get the hashes of blocks from the given height.
7475 ///
@@ -79,7 +80,7 @@ pub trait ArchiveApi<Hash> {
7980 ///
8081 /// This method is unstable and subject to change in the future.
8182 #[ method( name = "archive_v1_hashByHeight" ) ]
82- fn archive_v1_hash_by_height ( & self , height : u64 ) -> RpcResult < Vec < String > > ;
83+ fn archive_v1_hash_by_height ( & self , height : u64 ) -> Result < Vec < String > , Error > ;
8384
8485 /// Call into the Runtime API at a specified block's state.
8586 ///
@@ -92,7 +93,7 @@ pub trait ArchiveApi<Hash> {
9293 hash : Hash ,
9394 function : String ,
9495 call_parameters : String ,
95- ) -> RpcResult < MethodResult > ;
96+ ) -> Result < MethodResult , Error > ;
9697
9798 /// Returns storage entries at a specific block's state.
9899 ///
0 commit comments