mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-15 16:05:43 +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:
@@ -16,14 +16,13 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::sync::Arc;
|
||||
use parking_lot::Mutex;
|
||||
use std::sync::Arc;
|
||||
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender};
|
||||
|
||||
use crate::justification::GrandpaJustification;
|
||||
use crate::Error;
|
||||
use crate::{justification::GrandpaJustification, Error};
|
||||
|
||||
// Stream of justifications returned when subscribing.
|
||||
type JustificationStream<Block> = TracingUnboundedReceiver<GrandpaJustification<Block>>;
|
||||
@@ -41,16 +40,14 @@ type SharedJustificationSenders<Block> = Arc<Mutex<Vec<JustificationSender<Block
|
||||
/// at the end of a Grandpa round.
|
||||
#[derive(Clone)]
|
||||
pub struct GrandpaJustificationSender<Block: BlockT> {
|
||||
subscribers: SharedJustificationSenders<Block>
|
||||
subscribers: SharedJustificationSenders<Block>,
|
||||
}
|
||||
|
||||
impl<Block: BlockT> GrandpaJustificationSender<Block> {
|
||||
/// The `subscribers` should be shared with a corresponding
|
||||
/// `GrandpaJustificationStream`.
|
||||
fn new(subscribers: SharedJustificationSenders<Block>) -> Self {
|
||||
Self {
|
||||
subscribers,
|
||||
}
|
||||
Self { subscribers }
|
||||
}
|
||||
|
||||
/// Send out a notification to all subscribers that a new justification
|
||||
@@ -83,7 +80,7 @@ impl<Block: BlockT> GrandpaJustificationSender<Block> {
|
||||
/// so it can be used to add more subscriptions.
|
||||
#[derive(Clone)]
|
||||
pub struct GrandpaJustificationStream<Block: BlockT> {
|
||||
subscribers: SharedJustificationSenders<Block>
|
||||
subscribers: SharedJustificationSenders<Block>,
|
||||
}
|
||||
|
||||
impl<Block: BlockT> GrandpaJustificationStream<Block> {
|
||||
@@ -100,9 +97,7 @@ impl<Block: BlockT> GrandpaJustificationStream<Block> {
|
||||
/// The `subscribers` should be shared with a corresponding
|
||||
/// `GrandpaJustificationSender`.
|
||||
fn new(subscribers: SharedJustificationSenders<Block>) -> Self {
|
||||
Self {
|
||||
subscribers,
|
||||
}
|
||||
Self { subscribers }
|
||||
}
|
||||
|
||||
/// Subscribe to a channel through which justifications are sent
|
||||
|
||||
Reference in New Issue
Block a user