diff --git a/zk-token-sdk/src/instruction/close_account.rs b/zk-token-sdk/src/instruction/close_account.rs index 146d104c9..fa36165aa 100644 --- a/zk-token-sdk/src/instruction/close_account.rs +++ b/zk-token-sdk/src/instruction/close_account.rs @@ -146,9 +146,13 @@ impl CloseAccountProof { #[cfg(test)] mod test { - use super::*; - use crate::encryption::elgamal::ElGamalKeypair; - use crate::encryption::pedersen::{Pedersen, PedersenDecryptHandle, PedersenOpening}; + use { + super::*, + crate::encryption::{ + elgamal::ElGamalKeypair, + pedersen::{Pedersen, PedersenDecryptHandle, PedersenOpening}, + }, + }; #[test] fn test_close_account_correctness() { diff --git a/zk-token-sdk/src/instruction/transfer.rs b/zk-token-sdk/src/instruction/transfer.rs index e11125f7e..8e2df6292 100644 --- a/zk-token-sdk/src/instruction/transfer.rs +++ b/zk-token-sdk/src/instruction/transfer.rs @@ -480,8 +480,7 @@ pub fn combine_u32_ciphertexts(ct_lo: ElGamalCiphertext, ct_hi: ElGamalCiphertex #[cfg(test)] mod test { - use super::*; - use crate::encryption::elgamal::ElGamalKeypair; + use {super::*, crate::encryption::elgamal::ElGamalKeypair}; #[test] fn test_transfer_correctness() { diff --git a/zk-token-sdk/src/instruction/withdraw.rs b/zk-token-sdk/src/instruction/withdraw.rs index 17f708357..60cb328d7 100644 --- a/zk-token-sdk/src/instruction/withdraw.rs +++ b/zk-token-sdk/src/instruction/withdraw.rs @@ -172,8 +172,7 @@ impl WithdrawProof { #[cfg(test)] mod test { - use super::*; - use crate::encryption::elgamal::ElGamalKeypair; + use {super::*, crate::encryption::elgamal::ElGamalKeypair}; #[test] #[ignore] diff --git a/zk-token-sdk/src/range_proof/inner_product.rs b/zk-token-sdk/src/range_proof/inner_product.rs index f23633221..bf8e14086 100644 --- a/zk-token-sdk/src/range_proof/inner_product.rs +++ b/zk-token-sdk/src/range_proof/inner_product.rs @@ -1,15 +1,14 @@ -use core::iter; -use std::borrow::Borrow; - -use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint}; -use curve25519_dalek::scalar::Scalar; -use curve25519_dalek::traits::VartimeMultiscalarMul; - -use crate::errors::ProofError; -use crate::range_proof::util; -use crate::transcript::TranscriptProtocol; - -use merlin::Transcript; +use { + crate::{errors::ProofError, range_proof::util, transcript::TranscriptProtocol}, + core::iter, + curve25519_dalek::{ + ristretto::{CompressedRistretto, RistrettoPoint}, + scalar::Scalar, + traits::VartimeMultiscalarMul, + }, + merlin::Transcript, + std::borrow::Borrow, +}; #[allow(non_snake_case)] #[derive(Clone)] diff --git a/zk-token-sdk/src/range_proof/mod.rs b/zk-token-sdk/src/range_proof/mod.rs index e4519afcf..afdd79957 100644 --- a/zk-token-sdk/src/range_proof/mod.rs +++ b/zk-token-sdk/src/range_proof/mod.rs @@ -7,8 +7,9 @@ use { }; use { crate::{ - encryption::pedersen::PedersenBase, errors::ProofError, - range_proof::generators::BulletproofGens, range_proof::inner_product::InnerProductProof, + encryption::pedersen::PedersenBase, + errors::ProofError, + range_proof::{generators::BulletproofGens, inner_product::InnerProductProof}, transcript::TranscriptProtocol, }, core::iter, diff --git a/zk-token-sdk/src/transcript.rs b/zk-token-sdk/src/transcript.rs index a9a8a1b8c..680623ace 100644 --- a/zk-token-sdk/src/transcript.rs +++ b/zk-token-sdk/src/transcript.rs @@ -1,10 +1,8 @@ -use curve25519_dalek::ristretto::CompressedRistretto; -use curve25519_dalek::scalar::Scalar; -use curve25519_dalek::traits::IsIdentity; - -use merlin::Transcript; - -use crate::errors::ProofError; +use { + crate::errors::ProofError, + curve25519_dalek::{ristretto::CompressedRistretto, scalar::Scalar, traits::IsIdentity}, + merlin::Transcript, +}; pub trait TranscriptProtocol { /// Append a domain separator for an `n`-bit rangeproof for ElGamalKeypair diff --git a/zk-token-sdk/src/zk_token_elgamal/convert.rs b/zk-token-sdk/src/zk_token_elgamal/convert.rs index 0e64a7dde..d7a57d842 100644 --- a/zk-token-sdk/src/zk_token_elgamal/convert.rs +++ b/zk-token-sdk/src/zk_token_elgamal/convert.rs @@ -15,9 +15,11 @@ mod target_arch { use { super::pod, crate::{ - encryption::aes::AesCiphertext, - encryption::elgamal::{ElGamalCiphertext, ElGamalPubkey}, - encryption::pedersen::{PedersenCommitment, PedersenDecryptHandle}, + encryption::{ + aes::AesCiphertext, + elgamal::{ElGamalCiphertext, ElGamalPubkey}, + pedersen::{PedersenCommitment, PedersenDecryptHandle}, + }, errors::ProofError, range_proof::RangeProof, }, diff --git a/zk-token-sdk/src/zk_token_elgamal/pod.rs b/zk-token-sdk/src/zk_token_elgamal/pod.rs index e8b28e2b9..ccac5b5ef 100644 --- a/zk-token-sdk/src/zk_token_elgamal/pod.rs +++ b/zk-token-sdk/src/zk_token_elgamal/pod.rs @@ -1,6 +1,5 @@ -use std::fmt; - pub use bytemuck::{Pod, Zeroable}; +use std::fmt; #[derive(Clone, Copy, Pod, Zeroable, PartialEq)] #[repr(transparent)] diff --git a/zk-token-sdk/src/zk_token_proof_instruction.rs b/zk-token-sdk/src/zk_token_proof_instruction.rs index 30c314f69..576e2c559 100644 --- a/zk-token-sdk/src/zk_token_proof_instruction.rs +++ b/zk-token-sdk/src/zk_token_proof_instruction.rs @@ -1,6 +1,5 @@ ///! Instructions provided by the ZkToken Proof program pub use crate::instruction::*; - use { bytemuck::{bytes_of, Pod}, num_derive::{FromPrimitive, ToPrimitive},