@@ -37,12 +37,10 @@ use jsonrpsee::RpcModule;
3737use node_primitives:: { AccountId , Balance , Block , BlockNumber , Hash , Index } ;
3838use sc_client_api:: AuxStore ;
3939use sc_consensus_babe:: { Config , Epoch } ;
40- use sc_consensus_babe_rpc:: BabeRpc ;
4140use sc_consensus_epochs:: SharedEpochChanges ;
4241use sc_finality_grandpa:: {
4342 FinalityProofProvider , GrandpaJustificationStream , SharedAuthoritySet , SharedVoterState ,
4443} ;
45- use sc_finality_grandpa_rpc:: GrandpaRpc ;
4644use sc_rpc:: SubscriptionTaskExecutor ;
4745pub use sc_rpc_api:: DenyUnsafe ;
4846use sc_transaction_pool_api:: TransactionPool ;
@@ -120,15 +118,15 @@ where
120118 B : sc_client_api:: Backend < Block > + Send + Sync + ' static ,
121119 B :: State : sc_client_api:: backend:: StateBackend < sp_runtime:: traits:: HashFor < Block > > ,
122120{
123- use pallet_contracts_rpc:: { ContractsApiServer , ContractsRpc } ;
124- use pallet_mmr_rpc:: { MmrApiServer , MmrRpc } ;
125- use pallet_transaction_payment_rpc:: { TransactionPaymentApiServer , TransactionPaymentRpc } ;
126- use sc_consensus_babe_rpc:: BabeApiServer ;
127- use sc_finality_grandpa_rpc:: GrandpaApiServer ;
121+ use pallet_contracts_rpc:: { Contracts , ContractsApiServer } ;
122+ use pallet_mmr_rpc:: { Mmr , MmrApiServer } ;
123+ use pallet_transaction_payment_rpc:: { TransactionPayment , TransactionPaymentApiServer } ;
124+ use sc_consensus_babe_rpc:: { Babe , BabeApiServer } ;
125+ use sc_finality_grandpa_rpc:: { Grandpa , GrandpaApiServer } ;
128126 use sc_rpc:: dev:: { Dev , DevApiServer } ;
129- use sc_sync_state_rpc:: { SyncStateRpc , SyncStateRpcApiServer } ;
130- use substrate_frame_rpc_system:: { SystemApiServer , SystemRpc } ;
131- use substrate_state_trie_migration_rpc:: StateMigrationApiServer ;
127+ use sc_sync_state_rpc:: { SyncState , SyncStateApiServer } ;
128+ use substrate_frame_rpc_system:: { System , SystemApiServer } ;
129+ use substrate_state_trie_migration_rpc:: { StateMigration , StateMigrationApiServer } ;
132130
133131 let mut io = RpcModule :: new ( ( ) ) ;
134132 let FullDeps { client, pool, select_chain, chain_spec, deny_unsafe, babe, grandpa } = deps;
@@ -142,15 +140,15 @@ where
142140 finality_provider,
143141 } = grandpa;
144142
145- io. merge ( SystemRpc :: new ( client. clone ( ) , pool, deny_unsafe) . into_rpc ( ) ) ?;
143+ io. merge ( System :: new ( client. clone ( ) , pool, deny_unsafe) . into_rpc ( ) ) ?;
146144 // Making synchronous calls in light client freezes the browser currently,
147145 // more context: https://github.com/paritytech/substrate/pull/3480
148146 // These RPCs should use an asynchronous caller instead.
149- io. merge ( ContractsRpc :: new ( client. clone ( ) ) . into_rpc ( ) ) ?;
150- io. merge ( MmrRpc :: new ( client. clone ( ) ) . into_rpc ( ) ) ?;
151- io. merge ( TransactionPaymentRpc :: new ( client. clone ( ) ) . into_rpc ( ) ) ?;
147+ io. merge ( Contracts :: new ( client. clone ( ) ) . into_rpc ( ) ) ?;
148+ io. merge ( Mmr :: new ( client. clone ( ) ) . into_rpc ( ) ) ?;
149+ io. merge ( TransactionPayment :: new ( client. clone ( ) ) . into_rpc ( ) ) ?;
152150 io. merge (
153- BabeRpc :: new (
151+ Babe :: new (
154152 client. clone ( ) ,
155153 shared_epoch_changes. clone ( ) ,
156154 keystore,
@@ -161,7 +159,7 @@ where
161159 . into_rpc ( ) ,
162160 ) ?;
163161 io. merge (
164- GrandpaRpc :: new (
162+ Grandpa :: new (
165163 subscription_executor,
166164 shared_authority_set. clone ( ) ,
167165 shared_voter_state,
@@ -172,14 +170,11 @@ where
172170 ) ?;
173171
174172 io. merge (
175- SyncStateRpc :: new ( chain_spec, client. clone ( ) , shared_authority_set, shared_epoch_changes) ?
173+ SyncState :: new ( chain_spec, client. clone ( ) , shared_authority_set, shared_epoch_changes) ?
176174 . into_rpc ( ) ,
177175 ) ?;
178176
179- io. merge (
180- substrate_state_trie_migration_rpc:: MigrationRpc :: new ( client. clone ( ) , backend, deny_unsafe)
181- . into_rpc ( ) ,
182- ) ?;
177+ io. merge ( StateMigration :: new ( client. clone ( ) , backend, deny_unsafe) . into_rpc ( ) ) ?;
183178 io. merge ( Dev :: new ( client, deny_unsafe) . into_rpc ( ) ) ?;
184179
185180 Ok ( io)
0 commit comments