rustfmt ghost rpc and fix typos

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2025-07-29 14:54:56 +03:00
parent 24a6f803c5
commit eb3b4f2651
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
2 changed files with 36 additions and 24 deletions

View File

@ -17,7 +17,7 @@ homepage.workspace = true
[workspace.package]
license = "GPL-3.0-only"
authors = ["571nky", "57r37ch", "f4750"]
version = "0.7.207"
version = "0.7.208"
edition = "2021"
homepage = "https://ghostchain.io"
repository = "https://git.ghostchain.io/ghostchain/ghost-node"

View File

@ -1,17 +1,15 @@
use std::sync::Arc;
use jsonrpsee::RpcModule;
use primitives::{
AccountId, Balance, Block, BlockNumber, Hash, Nonce,
};
use sc_client_api::AuxStore;
use babe_primitives::BabeApi;
use block_builder_api::BlockBuilder;
use consensus_common::SelectChain;
use grandpa::FinalityProofProvider;
use jsonrpsee::RpcModule;
use primitives::{AccountId, Balance, Block, BlockNumber, Hash, Nonce};
use sc_client_api::AuxStore;
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor};
use sp_api::ProvideRuntimeApi;
use block_builder_api::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
use consensus_common::SelectChain;
use babe_primitives::BabeApi;
use sp_keystore::KeystorePtr;
use tx_pool_api::TransactionPool;
@ -61,7 +59,16 @@ pub struct FullDeps<C, P, SC, B> {
}
pub fn create_full_rpc<C, P, SC, B>(
FullDeps { client, pool, select_chain, chain_spec, deny_unsafe, babe, grandpa, backend } : FullDeps<C, P, SC, B>,
FullDeps {
client,
pool,
select_chain,
chain_spec,
deny_unsafe,
babe,
grandpa,
backend,
}: FullDeps<C, P, SC, B>,
) -> Result<RpcExtension, Box<dyn std::error::Error + Send + Sync>>
where
C: ProvideRuntimeApi<Block>
@ -80,20 +87,19 @@ where
B: sc_client_api::Backend<Block> + Send + Sync + 'static,
B::State: sc_client_api::StateBackend<sp_runtime::traits::HashingFor<Block>>,
{
use frame_rpc_system::{System, SystemApiServer};
use pallet_transaction_payment_rpc::{
TransactionPayment, TransactionPaymentApiServer,
};
use babe_rpc::{Babe, BabeApiServer};
use frame_rpc_system::{System, SystemApiServer};
use grandpa_rpc::{Grandpa, GrandpaApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use sc_rpc_spec_v2::chain_spec::{ChainSpec, ChainSpecApiServer};
use sc_sync_state_rpc::{SyncState, SyncStateApiServer};
use substrate_state_trie_migration_rpc::{
StateMigration, StateMigrationApiServer,
};
use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer};
let mut io = RpcModule::new(());
let BabeDeps { babe_worker_handle, keystore } = babe;
let BabeDeps {
babe_worker_handle,
keystore,
} = babe;
let GrandpaDeps {
shared_voter_state,
shared_authority_set,
@ -103,10 +109,13 @@ where
} = grandpa;
let chain_name = chain_spec.name().to_string();
let genesis_hash = client.hash(0).ok().flatten().expect("Genesis block exists; qed;");
let genesis_hash = client
.hash(0)
.ok()
.flatten()
.expect("Genesis block exists; qed;");
let properties = chain_spec.properties();
io.merge(ChainSpec::new(chain_name, genesis_hash, properties).into_rpc())?;
io.merge(StateMigration::new(client.clone(), backend.clone(), deny_unsafe).into_rpc())?;
io.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
@ -119,7 +128,8 @@ where
keystore,
select_chain,
deny_unsafe,
).into_rpc()
)
.into_rpc(),
)?;
io.merge(
@ -129,7 +139,8 @@ where
shared_voter_state,
justification_stream,
finality_provider,
).into_rpc(),
)
.into_rpc(),
)?;
io.merge(
@ -137,8 +148,9 @@ where
chain_spec,
client.clone(),
shared_authority_set,
babe_worker_handle
)?.into_rpc(),
babe_worker_handle,
)?
.into_rpc(),
)?;
Ok(io)