From a771be1de9d52a6665eb7000abfc1994cd056770 Mon Sep 17 00:00:00 2001 From: Mikhail Volkhov Date: Tue, 29 Oct 2024 20:01:51 +0800 Subject: [PATCH] Cargo fmt --- poly-commitment/tests/serialization.rs | 0 utils/src/foreign_field.rs | 4 ++-- utils/src/lib.rs | 2 +- utils/src/serialization.rs | 1 - utils/tests/serialization.rs | 29 +++++++++++++------------- 5 files changed, 17 insertions(+), 19 deletions(-) delete mode 100644 poly-commitment/tests/serialization.rs diff --git a/poly-commitment/tests/serialization.rs b/poly-commitment/tests/serialization.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/utils/src/foreign_field.rs b/utils/src/foreign_field.rs index 4c46f77da4..fb05f4eb0d 100644 --- a/utils/src/foreign_field.rs +++ b/utils/src/foreign_field.rs @@ -11,7 +11,6 @@ use std::{ ops::{Index, IndexMut}, }; - /// Represents a foreign field element #[derive(Clone, PartialEq, Eq)] /// Represents a foreign field element @@ -191,7 +190,8 @@ impl ForeignFieldHelpers F::from(2u64).pow([2 * B as u64]) } - fn two_to_3limb() -> F { // Self? + fn two_to_3limb() -> F { + // Self? F::from(2u64).pow([3 * B as u64]) } } diff --git a/utils/src/lib.rs b/utils/src/lib.rs index ea6999102d..aaba775072 100644 --- a/utils/src/lib.rs +++ b/utils/src/lib.rs @@ -21,7 +21,7 @@ pub use chunked_evaluations::ChunkedEvaluations; pub use dense_polynomial::ExtendedDensePolynomial; pub use evaluations::ExtendedEvaluations; pub use field_helpers::{BigUintFieldHelpers, FieldHelpers, RandomField, Two}; -pub use foreign_field::{ForeignElement}; +pub use foreign_field::ForeignElement; /// Utils only for testing pub mod tests { diff --git a/utils/src/serialization.rs b/utils/src/serialization.rs index a8f04d204f..49fb498736 100644 --- a/utils/src/serialization.rs +++ b/utils/src/serialization.rs @@ -129,7 +129,6 @@ where } } - /// A generic regression serialization test for serialization via /// `CanonicalSerialize` and `CanonicalDeserialize`. pub fn test_generic_serialization_regression_canonical< diff --git a/utils/tests/serialization.rs b/utils/tests/serialization.rs index 96c287ef23..15fded48c8 100644 --- a/utils/tests/serialization.rs +++ b/utils/tests/serialization.rs @@ -1,9 +1,8 @@ -use o1_utils::serialization::{ - test_generic_serialization_regression_canonical, - test_generic_serialization_regression_serde, -}; use ark_ec::short_weierstrass::SWCurveConfig; use mina_curves::pasta::{Pallas, PallasParameters, Vesta, VestaParameters}; +use o1_utils::serialization::{ + test_generic_serialization_regression_canonical, test_generic_serialization_regression_serde, +}; use serde::{Deserialize, Serialize}; use serde_with::serde_as; @@ -16,22 +15,22 @@ pub fn ser_regression_canonical_bigint() { ( Fp::from(5u64), vec![ - 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, ], ), ( Fp::from((1u64 << 62) + 7u64), vec![ - 7, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, ], ), ( Fp::from((1u64 << 30) * 13u64 * 7u64 * 5u64 * 3u64 + 7u64), vec![ - 7, 0, 0, 64, 85, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + 7, 0, 0, 64, 85, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, ], ), ( @@ -39,8 +38,8 @@ pub fn ser_regression_canonical_bigint() { * Fp::from((1u64 << 63) + 13u64) * Fp::from((1u64 << 63) + 17u64), vec![ - 11, 6, 0, 0, 0, 0, 0, 128, 215, 0, 0, 0, 0, 0, 0, 64, 9, 0, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 0, 0, 0, 0, + 11, 6, 0, 0, 0, 0, 0, 128, 215, 0, 0, 0, 0, 0, 0, 64, 9, 0, 0, 0, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, 0, ], ), ]; @@ -68,9 +67,9 @@ pub fn ser_regression_canonical_pasta() { // Generated with commit 1494cf973d40fb276465929eb7db1952c5de7bdc let buf_expected: Vec = vec![ - 146, 196, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 196, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 146, 196, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 196, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]; test_generic_serialization_regression_serde(data_expected, buf_expected);