mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-14 09:45:42 +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:
@@ -17,18 +17,16 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::error::Error;
|
||||
use log::info;
|
||||
use futures::{future, prelude::*};
|
||||
use sp_runtime::traits::{
|
||||
Block as BlockT, NumberFor, One, Zero, SaturatedConversion
|
||||
};
|
||||
use sp_runtime::generic::BlockId;
|
||||
use codec::Encode;
|
||||
use futures::{future, prelude::*};
|
||||
use log::info;
|
||||
use sp_runtime::{
|
||||
generic::BlockId,
|
||||
traits::{Block as BlockT, NumberFor, One, SaturatedConversion, Zero},
|
||||
};
|
||||
|
||||
use std::{io::Write, pin::Pin};
|
||||
use sc_client_api::{BlockBackend, UsageProvider};
|
||||
use std::sync::Arc;
|
||||
use std::task::Poll;
|
||||
use std::{io::Write, pin::Pin, sync::Arc, task::Poll};
|
||||
|
||||
/// Performs the blocks export.
|
||||
pub fn export_blocks<B, C>(
|
||||
@@ -36,7 +34,7 @@ pub fn export_blocks<B, C>(
|
||||
mut output: impl Write + 'static,
|
||||
from: NumberFor<B>,
|
||||
to: Option<NumberFor<B>>,
|
||||
binary: bool
|
||||
binary: bool,
|
||||
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>
|
||||
where
|
||||
C: BlockBackend<B> + UsageProvider<B> + 'static,
|
||||
@@ -63,7 +61,7 @@ where
|
||||
let client = &client;
|
||||
|
||||
if last < block {
|
||||
return Poll::Ready(Err("Invalid block range specified".into()));
|
||||
return Poll::Ready(Err("Invalid block range specified".into()))
|
||||
}
|
||||
|
||||
if !wrote_header {
|
||||
@@ -78,14 +76,13 @@ where
|
||||
}
|
||||
|
||||
match client.block(&BlockId::number(block))? {
|
||||
Some(block) => {
|
||||
Some(block) =>
|
||||
if binary {
|
||||
output.write_all(&block.encode())?;
|
||||
} else {
|
||||
serde_json::to_writer(&mut output, &block)
|
||||
.map_err(|e| format!("Error writing JSON: {}", e))?;
|
||||
}
|
||||
},
|
||||
},
|
||||
// Reached end of the chain.
|
||||
None => return Poll::Ready(Ok(())),
|
||||
}
|
||||
@@ -93,7 +90,7 @@ where
|
||||
info!("#{}", block);
|
||||
}
|
||||
if block == last {
|
||||
return Poll::Ready(Ok(()));
|
||||
return Poll::Ready(Ok(()))
|
||||
}
|
||||
block += One::one();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user