Add rustfmt.toml and cargo fmt (#23238)

* fmt

* formatted

Co-authored-by: Lucas B <buffalu@jito.network>
This commit is contained in:
buffalu
2022-02-18 23:32:29 -06:00
committed by GitHub
parent 1add82aa9e
commit 70ebab2c82
33 changed files with 127 additions and 108 deletions

View File

@@ -1,6 +1,8 @@
//! Errors related to proving and verifying proofs.
use crate::{range_proof::errors::RangeProofError, sigma_proofs::errors::*};
use thiserror::Error;
use {
crate::{range_proof::errors::RangeProofError, sigma_proofs::errors::*},
thiserror::Error,
};
// TODO: clean up errors for encryption
#[derive(Error, Clone, Debug, Eq, PartialEq)]

View File

@@ -1,6 +1,5 @@
//! Errors related to proving and verifying range proofs.
use crate::errors::TranscriptError;
use thiserror::Error;
use {crate::errors::TranscriptError, thiserror::Error};
#[derive(Error, Clone, Debug, Eq, PartialEq)]
pub enum RangeProofError {

View File

@@ -448,8 +448,10 @@ impl CtxtCtxtEqualityProof {
#[cfg(test)]
mod test {
use super::*;
use crate::encryption::{elgamal::ElGamalSecretKey, pedersen::Pedersen};
use {
super::*,
crate::encryption::{elgamal::ElGamalSecretKey, pedersen::Pedersen},
};
#[test]
fn test_ciphertext_commitment_equality_proof_correctness() {

View File

@@ -1,6 +1,5 @@
//! Errors related to proving and verifying sigma proofs.
use crate::errors::TranscriptError;
use thiserror::Error;
use {crate::errors::TranscriptError, thiserror::Error};
#[derive(Error, Clone, Debug, Eq, PartialEq)]
pub enum EqualityProofError {

View File

@@ -448,8 +448,7 @@ fn conditional_select_ristretto(
#[cfg(test)]
mod test {
use super::*;
use crate::encryption::pedersen::Pedersen;
use {super::*, crate::encryption::pedersen::Pedersen};
#[test]
fn test_fee_above_max_proof() {

View File

@@ -298,8 +298,10 @@ impl AggregatedValidityProof {
#[cfg(test)]
mod test {
use super::*;
use crate::encryption::{elgamal::ElGamalKeypair, pedersen::Pedersen};
use {
super::*,
crate::encryption::{elgamal::ElGamalKeypair, pedersen::Pedersen},
};
#[test]
fn test_validity_proof_correctness() {

View File

@@ -166,10 +166,12 @@ impl ZeroBalanceProof {
#[cfg(test)]
mod test {
use super::*;
use crate::encryption::{
elgamal::{DecryptHandle, ElGamalKeypair, ElGamalSecretKey},
pedersen::{Pedersen, PedersenCommitment, PedersenOpening},
use {
super::*,
crate::encryption::{
elgamal::{DecryptHandle, ElGamalKeypair, ElGamalSecretKey},
pedersen::{Pedersen, PedersenCommitment, PedersenOpening},
},
};
#[test]