mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-25 20:09:55 +00:00
Run cargo fmt on the whole code base (#9394)
* Run cargo fmt on the whole code base * Second run * Add CI check * Fix compilation * More unnecessary braces * Handle weights * Use --all * Use correct attributes... * Fix UI tests * AHHHHHHHHH * 🤦 * Docs * Fix compilation * 🤷 * Please stop * 🤦 x 2 * More * make rustfmt.toml consistent with polkadot Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
1 parent
d451c38c1c
commit
7b56ab15b4
1010 files changed
+53334
-51203
No files matched your search
@@ -18,16 +18,19 @@
|
||||
|
||||
//! Blockchain API backend for full nodes.
|
||||
|
||||
use std::sync::Arc;
|
||||
use rpc::futures::future::result;
|
||||
use jsonrpc_pubsub::manager::SubscriptionManager;
|
||||
use rpc::futures::future::result;
|
||||
use std::sync::Arc;
|
||||
|
||||
use sc_client_api::{BlockchainEvents, BlockBackend};
|
||||
use sp_runtime::{generic::{BlockId, SignedBlock}, traits::{Block as BlockT}};
|
||||
use sc_client_api::{BlockBackend, BlockchainEvents};
|
||||
use sp_runtime::{
|
||||
generic::{BlockId, SignedBlock},
|
||||
traits::Block as BlockT,
|
||||
};
|
||||
|
||||
use super::{ChainBackend, client_err, error::FutureResult};
|
||||
use std::marker::PhantomData;
|
||||
use super::{client_err, error::FutureResult, ChainBackend};
|
||||
use sp_blockchain::HeaderBackend;
|
||||
use std::marker::PhantomData;
|
||||
|
||||
/// Blockchain API backend for full nodes. Reads all the data from local database.
|
||||
pub struct FullChain<Block: BlockT, Client> {
|
||||
@@ -42,15 +45,12 @@ pub struct FullChain<Block: BlockT, Client> {
|
||||
impl<Block: BlockT, Client> FullChain<Block, Client> {
|
||||
/// Create new Chain API RPC handler.
|
||||
pub fn new(client: Arc<Client>, subscriptions: SubscriptionManager) -> Self {
|
||||
Self {
|
||||
client,
|
||||
subscriptions,
|
||||
_phantom: PhantomData,
|
||||
}
|
||||
Self { client, subscriptions, _phantom: PhantomData }
|
||||
}
|
||||
}
|
||||
|
||||
impl<Block, Client> ChainBackend<Client, Block> for FullChain<Block, Client> where
|
||||
impl<Block, Client> ChainBackend<Client, Block> for FullChain<Block, Client>
|
||||
where
|
||||
Block: BlockT + 'static,
|
||||
Client: BlockBackend<Block> + HeaderBackend<Block> + BlockchainEvents<Block> + 'static,
|
||||
{
|
||||
@@ -63,18 +63,14 @@ impl<Block, Client> ChainBackend<Client, Block> for FullChain<Block, Client> whe
|
||||
}
|
||||
|
||||
fn header(&self, hash: Option<Block::Hash>) -> FutureResult<Option<Block::Header>> {
|
||||
Box::new(result(self.client
|
||||
.header(BlockId::Hash(self.unwrap_or_best(hash)))
|
||||
.map_err(client_err)
|
||||
Box::new(result(
|
||||
self.client.header(BlockId::Hash(self.unwrap_or_best(hash))).map_err(client_err),
|
||||
))
|
||||
}
|
||||
|
||||
fn block(&self, hash: Option<Block::Hash>)
|
||||
-> FutureResult<Option<SignedBlock<Block>>>
|
||||
{
|
||||
Box::new(result(self.client
|
||||
.block(&BlockId::Hash(self.unwrap_or_best(hash)))
|
||||
.map_err(client_err)
|
||||
fn block(&self, hash: Option<Block::Hash>) -> FutureResult<Option<SignedBlock<Block>>> {
|
||||
Box::new(result(
|
||||
self.client.block(&BlockId::Hash(self.unwrap_or_best(hash))).map_err(client_err),
|
||||
))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user