cargo +nightly fmt (#3540)

* cargo +nightly fmt

* add cargo-fmt check to ci

* update ci

* fmt

* fmt

* skip macro

* ignore bridges
This commit is contained in:
Shawn Tabrizi
2021-08-02 12:47:33 +02:00
committed by GitHub
parent 30e3012270
commit ff5d56fb76
350 changed files with 20617 additions and 21266 deletions
+11 -16
View File
@@ -16,16 +16,16 @@
//! Types relevant for approval.
pub use sp_consensus_vrf::schnorrkel::{VRFOutput, VRFProof, Randomness};
pub use sp_consensus_babe::Slot;
pub use sp_consensus_vrf::schnorrkel::{Randomness, VRFOutput, VRFProof};
use parity_scale_codec::{Decode, Encode};
use polkadot_primitives::v1::{
CandidateHash, Hash, ValidatorIndex, ValidatorSignature, CoreIndex,
Header, BlockNumber, CandidateIndex,
BlockNumber, CandidateHash, CandidateIndex, CoreIndex, Hash, Header, ValidatorIndex,
ValidatorSignature,
};
use parity_scale_codec::{Encode, Decode};
use sp_consensus_babe as babe_primitives;
use sp_application_crypto::Public;
use sp_consensus_babe as babe_primitives;
/// Validators assigning to check a particular candidate are split up into tranches.
/// Earlier tranches of validators check first, with later tranches serving as backup.
@@ -168,13 +168,12 @@ impl UnsafeVRFOutput {
let pubkey = schnorrkel::PublicKey::from_bytes(author.as_slice())
.map_err(ApprovalError::SchnorrkelSignature)?;
let transcript = babe_primitives::make_transcript(
randomness,
self.slot,
epoch_index,
);
let transcript = babe_primitives::make_transcript(randomness, self.slot, epoch_index);
let inout = self.vrf_output.0.attach_input_hash(&pubkey, transcript)
let inout = self
.vrf_output
.0
.attach_input_hash(&pubkey, transcript)
.map_err(ApprovalError::SchnorrkelSignature)?;
Ok(RelayVRFStory(inout.make_bytes(RELAY_VRF_STORY_CONTEXT)))
}
@@ -200,11 +199,7 @@ pub fn babe_unsafe_vrf_info(header: &Header) -> Option<UnsafeVRFOutput> {
PreDigest::SecondaryPlain(_) => return None,
};
return Some(UnsafeVRFOutput {
vrf_output,
slot,
authority_index,
});
return Some(UnsafeVRFOutput { vrf_output, slot, authority_index })
}
}