Skip to content

Commit 6083e1e

Browse files
committed
chore: run cargo fmt
1 parent d936c9d commit 6083e1e

File tree

398 files changed

+1576
-1400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

398 files changed

+1576
-1400
lines changed

demo/protocol-demo/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use mithril_stm::{
33
StmVerificationKeyPoP,
44
};
55

6-
use blake2::{digest::consts::U32, Blake2b};
6+
use blake2::{Blake2b, digest::consts::U32};
77

88
// Protocol types alias
99
type D = Blake2b<U32>;

internal/cardano-node/mithril-cardano-node-chain/src/chain_observer/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use serde::{Deserialize, Serialize};
22
use std::{fmt::Display, path::PathBuf, sync::Arc};
33
use thiserror::Error;
44

5-
use mithril_common::entities::CardanoNetwork;
65
use mithril_common::StdResult;
6+
use mithril_common::entities::CardanoNetwork;
77

88
use crate::chain_observer::ChainObserver;
99
use crate::test::double::FakeChainObserver;

internal/cardano-node/mithril-cardano-node-chain/src/chain_observer/cli_observer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{anyhow, Context};
1+
use anyhow::{Context, anyhow};
22
use async_trait::async_trait;
33
use hex::FromHex;
44
use nom::IResult;
@@ -9,7 +9,7 @@ use std::fs;
99
use std::path::PathBuf;
1010
use tokio::process::Command;
1111

12-
use mithril_common::crypto_helper::{encode_bech32, KesPeriod, OpCert, SerDeShelleyFileFormat};
12+
use mithril_common::crypto_helper::{KesPeriod, OpCert, SerDeShelleyFileFormat, encode_bech32};
1313
use mithril_common::entities::{BlockNumber, ChainPoint, Epoch, SlotNumber, StakeDistribution};
1414
use mithril_common::{CardanoNetwork, StdResult};
1515

@@ -568,7 +568,7 @@ mod tests {
568568

569569
use mithril_common::crypto_helper::ColdKeyGenerator;
570570

571-
use crate::test::test_cli_runner::{test_expected, TestCliRunner};
571+
use crate::test::test_cli_runner::{TestCliRunner, test_expected};
572572

573573
use super::*;
574574

internal/cardano-node/mithril-cardano-node-chain/src/chain_observer/interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use async_trait::async_trait;
22
use thiserror::Error;
33

4+
use mithril_common::StdError;
45
use mithril_common::crypto_helper::{KesPeriod, OpCert};
56
use mithril_common::entities::{ChainPoint, Epoch, StakeDistribution};
6-
use mithril_common::StdError;
77

88
use crate::entities::{ChainAddress, TxDatum};
99

internal/cardano-node/mithril-cardano-node-chain/src/chain_observer/pallas_observer.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
use std::collections::BTreeSet;
22
use std::path::{Path, PathBuf};
33

4-
use anyhow::{anyhow, Context};
4+
use anyhow::{Context, anyhow};
55
use async_trait::async_trait;
66
use pallas_addresses::Address;
77
use pallas_codec::utils::{Bytes, CborWrap, TagWrap};
88
use pallas_network::{
99
facades::NodeClient,
1010
miniprotocols::{
11+
Point,
1112
localstate::{
13+
Client,
1214
queries_v16::{
1315
self, Addr, Addrs, ChainBlockNumber, GenesisConfig, PostAlonsoTransactionOutput,
1416
StakeSnapshot, Stakes, TransactionOutput, UTxOByAddress,
1517
},
16-
Client,
1718
},
18-
Point,
1919
},
2020
};
2121
use pallas_primitives::ToCanonicalJson;
2222
use pallas_traverse::Era;
2323

24-
use mithril_common::crypto_helper::{encode_bech32, KesPeriod, OpCert};
24+
use mithril_common::crypto_helper::{KesPeriod, OpCert, encode_bech32};
2525
use mithril_common::entities::{BlockNumber, ChainPoint, Epoch, SlotNumber, StakeDistribution};
2626
use mithril_common::{CardanoNetwork, StdResult};
2727

28-
use crate::entities::{try_inspect, ChainAddress, Datum, Datums, TxDatum};
28+
use crate::entities::{ChainAddress, Datum, Datums, TxDatum, try_inspect};
2929

3030
use super::{ChainObserver, ChainObserverError};
3131

@@ -517,14 +517,14 @@ mod tests {
517517
use pallas_crypto::hash::Hash;
518518
use pallas_network::facades::NodeServer;
519519
use pallas_network::miniprotocols::{
520+
Point,
520521
localstate::{
522+
ClientQueryRequest,
521523
queries_v16::{
522524
BlockQuery, ChainBlockNumber, Fraction, GenesisConfig, HardForkQuery, LedgerQuery,
523525
Request, Snapshots, StakeSnapshot, SystemStart, Value,
524526
},
525-
ClientQueryRequest,
526527
},
527-
Point,
528528
};
529529
use tokio::net::UnixListener;
530530

internal/cardano-node/mithril-cardano-node-chain/src/chain_reader/pallas_chain_reader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
use std::path::{Path, PathBuf};
22

3-
use anyhow::{anyhow, Context};
3+
use anyhow::{Context, anyhow};
44
use async_trait::async_trait;
55
use pallas_network::{
66
facades::NodeClient,
77
miniprotocols::chainsync::{BlockContent, NextResponse},
88
};
99
use pallas_traverse::MultiEraBlock;
10-
use slog::{debug, Logger};
10+
use slog::{Logger, debug};
1111

12+
use mithril_common::StdResult;
1213
use mithril_common::entities::CardanoNetwork;
1314
use mithril_common::logging::LoggerExtensions;
14-
use mithril_common::StdResult;
1515

1616
use crate::entities::{ChainBlockNextAction, RawCardanoPoint, ScannedBlock};
1717

@@ -153,8 +153,8 @@ mod tests {
153153
use pallas_network::{
154154
facades::NodeServer,
155155
miniprotocols::{
156-
chainsync::{BlockContent, Tip},
157156
Point,
157+
chainsync::{BlockContent, Tip},
158158
},
159159
};
160160
use std::fs;

internal/cardano-node/mithril-cardano-node-chain/src/chain_scanner/block_scanner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use async_trait::async_trait;
44
use slog::Logger;
55
use tokio::sync::Mutex;
66

7-
use mithril_common::entities::BlockNumber;
87
use mithril_common::StdResult;
8+
use mithril_common::entities::BlockNumber;
99

1010
use crate::chain_reader::ChainBlockReader;
1111
use crate::chain_scanner::{BlockScanner, BlockStreamer};

internal/cardano-node/mithril-cardano-node-chain/src/chain_scanner/chain_reader_block_streamer.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::sync::Arc;
22

33
use async_trait::async_trait;
4-
use slog::{debug, trace, Logger};
4+
use slog::{Logger, debug, trace};
55
use tokio::sync::Mutex;
66

7+
use mithril_common::StdResult;
78
use mithril_common::entities::BlockNumber;
89
use mithril_common::logging::LoggerExtensions;
9-
use mithril_common::StdResult;
1010

1111
use crate::chain_reader::ChainBlockReader;
1212
use crate::chain_scanner::{BlockStreamer, ChainScannedBlocks};
@@ -89,7 +89,7 @@ impl BlockStreamer for ChainReaderBlockStreamer {
8989
} else {
9090
chain_scanned_blocks = ChainScannedBlocks::RollForwards(roll_forwards);
9191
Ok(Some(chain_scanned_blocks))
92-
}
92+
};
9393
}
9494
}
9595
}
@@ -174,8 +174,8 @@ mod tests {
174174
use mithril_common::entities::SlotNumber;
175175

176176
use crate::entities::ScannedBlock;
177-
use crate::test::double::FakeChainReader;
178177
use crate::test::TestLogger;
178+
use crate::test::double::FakeChainReader;
179179

180180
use super::*;
181181

@@ -482,8 +482,8 @@ mod tests {
482482
}
483483

484484
#[tokio::test]
485-
async fn test_parse_expected_rollforward_when_rollbackward_on_different_point_and_have_previous_rollforwards(
486-
) {
485+
async fn test_parse_expected_rollforward_when_rollbackward_on_different_point_and_have_previous_rollforwards()
486+
{
487487
let chain_reader = Arc::new(Mutex::new(FakeChainReader::new(vec![
488488
ChainBlockNextAction::RollForward {
489489
parsed_block: ScannedBlock::new(
@@ -539,8 +539,8 @@ mod tests {
539539
}
540540

541541
#[tokio::test]
542-
async fn test_parse_expected_backward_when_rollbackward_on_different_point_and_does_not_have_previous_rollforwards(
543-
) {
542+
async fn test_parse_expected_backward_when_rollbackward_on_different_point_and_does_not_have_previous_rollforwards()
543+
{
544544
let chain_reader = Arc::new(Mutex::new(FakeChainReader::new(vec![
545545
ChainBlockNextAction::RollForward {
546546
parsed_block: ScannedBlock::new(

internal/cardano-node/mithril-cardano-node-chain/src/chain_scanner/interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use async_trait::async_trait;
22

3-
use mithril_common::entities::{BlockNumber, SlotNumber};
43
use mithril_common::StdResult;
4+
use mithril_common::entities::{BlockNumber, SlotNumber};
55

66
use crate::entities::{RawCardanoPoint, ScannedBlock};
77

internal/cardano-node/mithril-cardano-node-chain/src/entities/datum.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use anyhow::{anyhow, Context};
2-
use pallas_codec::minicbor::{decode, Decode, Decoder};
3-
use pallas_primitives::{alonzo::PlutusData, ToCanonicalJson};
1+
use anyhow::{Context, anyhow};
2+
use pallas_codec::minicbor::{Decode, Decoder, decode};
3+
use pallas_primitives::{ToCanonicalJson, alonzo::PlutusData};
44
use serde::{Deserialize, Serialize};
55
use serde_json::Value;
66
use std::collections::HashMap;

0 commit comments

Comments
 (0)