Skip to content

Commit 5777d77

Browse files
committed
Formatting
1 parent cb9ec83 commit 5777d77

File tree

19 files changed

+80
-134
lines changed

19 files changed

+80
-134
lines changed

core/src/block/genesis.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
use crate::constants::{constraint_constants, slots_per_window};
12
use mina_p2p_messages::{
23
bigint::InvalidBigInt,
34
v2::{self, StateHash},
45
};
56

6-
use crate::constants::{constraint_constants, slots_per_window};
7-
87
#[allow(clippy::too_many_arguments)]
98
pub fn genesis_and_negative_one_protocol_states(
109
constants: v2::MinaBaseProtocolConstantsCheckedValueStableV1,

core/src/block/mod.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
mod block_with_hash;
2-
pub use block_with_hash::{BlockHeaderWithHash, BlockWithHash};
3-
41
mod applied_block;
5-
pub use applied_block::AppliedBlock;
6-
7-
pub mod prevalidate;
8-
2+
mod block_with_hash;
93
pub mod genesis;
4+
pub mod prevalidate;
105

11-
use std::sync::Arc;
12-
6+
pub use applied_block::AppliedBlock;
7+
pub use block_with_hash::{BlockHeaderWithHash, BlockWithHash};
138
pub use mina_p2p_messages::v2::{
149
MinaBlockBlockStableV2 as Block, MinaBlockHeaderStableV2 as BlockHeader, StateHash as BlockHash,
1510
};
1611

12+
use std::sync::Arc;
1713
pub type ArcBlock = Arc<Block>;
1814
pub type ArcBlockWithHash = BlockWithHash<Arc<Block>>;

core/src/block/prevalidate.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use serde::{Deserialize, Serialize};
2-
31
use super::ArcBlockWithHash;
42
use crate::constants::PROTOCOL_VERSION;
3+
use serde::{Deserialize, Serialize};
54

65
#[derive(Serialize, Deserialize, Debug, Clone)]
76
pub enum BlockPrevalidationError {

ledger/src/account/account.rs

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
use std::{io::Cursor, str::FromStr, sync::Arc};
2-
3-
use ark_ff::{BigInteger256, One, UniformRand, Zero};
4-
use mina_core::constants::PROTOCOL_VERSION;
5-
use mina_curves::pasta::Fp;
6-
use mina_p2p_messages::{
7-
binprot::{BinProtRead, BinProtWrite},
8-
v2,
9-
};
10-
use mina_signer::CompressedPubKey;
11-
use once_cell::sync::{Lazy, OnceCell};
12-
use rand::{prelude::ThreadRng, seq::SliceRandom, Rng};
13-
use serde::{Deserialize, Serialize};
14-
151
use crate::{
162
gen_compressed,
173
proofs::{
@@ -31,6 +17,15 @@ use crate::{
3117
zkapps::snark::FlaggedOption,
3218
AppendToInputs as _, MerklePath, MyCow, ToInputs,
3319
};
20+
use ark_ff::{BigInteger256, One, UniformRand, Zero};
21+
use mina_core::constants::PROTOCOL_VERSION;
22+
use mina_curves::pasta::Fp;
23+
use mina_p2p_messages::{
24+
binprot::{BinProtRead, BinProtWrite},
25+
v2,
26+
};
27+
use mina_signer::CompressedPubKey;
28+
use once_cell::sync::{Lazy, OnceCell};
3429
use poseidon::hash::{
3530
hash_noinputs, hash_with_kimchi,
3631
params::{
@@ -39,6 +34,9 @@ use poseidon::hash::{
3934
},
4035
Inputs,
4136
};
37+
use rand::{prelude::ThreadRng, seq::SliceRandom, Rng};
38+
use serde::{Deserialize, Serialize};
39+
use std::{io::Cursor, str::FromStr, sync::Arc};
4240

4341
use super::common::*;
4442

@@ -424,12 +422,6 @@ pub struct VerificationKey {
424422
pub wrap_vk: Option<()>,
425423
}
426424

427-
// impl From<VerificationKey> for MinaBaseVerificationKeyWireStableV1Base64 {
428-
// fn from(value: VerificationKey) -> Self {
429-
// MinaBaseVerificationKeyWireStableV1Base64((&value).into())
430-
// }
431-
// }
432-
433425
impl Check<Fp> for VerificationKey {
434426
fn check(&self, w: &mut Witness<Fp>) {
435427
let Self {

ledger/src/account/common.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
use std::str::FromStr;
2-
3-
use ark_ff::{UniformRand, Zero};
4-
use mina_curves::pasta::Fp;
5-
use o1_utils::{field_helpers::FieldHelpersError, FieldHelpers};
6-
use serde::{Deserialize, Serialize};
7-
81
use crate::{
92
proofs::{
103
field::{Boolean, FieldWitness, ToBoolean},
@@ -17,6 +10,11 @@ use crate::{
1710
scan_state::currency::{Amount, Balance, Magnitude, Slot, SlotSpan},
1811
ControlTag, ToInputs,
1912
};
13+
use ark_ff::{UniformRand, Zero};
14+
use mina_curves::pasta::Fp;
15+
use o1_utils::{field_helpers::FieldHelpersError, FieldHelpers};
16+
use serde::{Deserialize, Serialize};
17+
use std::str::FromStr;
2018

2119
#[derive(Clone, Debug, Default, PartialEq, Eq)]
2220
pub struct VotingFor(pub Fp);

ledger/src/account/conv.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#![allow(clippy::type_complexity)]
22

3+
use super::{Account, AccountId, AuthRequired, TokenId, VerificationKeyWire};
4+
use crate::{
5+
proofs::{
6+
field::FieldWitness,
7+
transaction::{make_group, InnerCurve, PlonkVerificationKeyEvals},
8+
},
9+
scan_state::currency::{Amount, Balance, Nonce, Slot, SlotSpan, TxnVersion},
10+
AccountIndex, Permissions, ProofVerified, ReceiptChainHash, SetVerificationKey, Timing,
11+
TokenSymbol, VerificationKey, VotingFor, ZkAppAccount,
12+
};
313
use ark_ec::short_weierstrass::Affine;
414
use ark_ff::{Field, PrimeField};
515
use mina_curves::pasta::Fp;
@@ -17,18 +27,6 @@ use mina_p2p_messages::{
1727
},
1828
};
1929

20-
use crate::{
21-
proofs::{
22-
field::FieldWitness,
23-
transaction::{make_group, InnerCurve, PlonkVerificationKeyEvals},
24-
},
25-
scan_state::currency::{Amount, Balance, Nonce, Slot, SlotSpan, TxnVersion},
26-
AccountIndex, Permissions, ProofVerified, ReceiptChainHash, SetVerificationKey, Timing,
27-
TokenSymbol, VerificationKey, VotingFor, ZkAppAccount,
28-
};
29-
30-
use super::{Account, AccountId, AuthRequired, TokenId, VerificationKeyWire};
31-
3230
impl binprot::BinProtRead for TokenId {
3331
fn binprot_read<R: std::io::Read + ?Sized>(r: &mut R) -> Result<Self, binprot::Error>
3432
where

ledger/src/account/legacy.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
use std::borrow::Cow;
2-
1+
use super::common::*;
2+
use crate::scan_state::currency::{Balance, Magnitude, Nonce};
33
use ark_ff::Zero;
44
use mina_hasher::{create_legacy, Fp, Hashable, Hasher, ROInput};
55
use mina_signer::CompressedPubKey;
66
use o1_utils::FieldHelpers;
7-
8-
use crate::scan_state::currency::{Balance, Magnitude, Nonce};
9-
10-
use super::common::*;
7+
use std::borrow::Cow;
118

129
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
1310
pub struct TokenIdLegacy(pub u64);

ledger/src/address/raw.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,6 @@ impl<const NBYTES: usize> Address<NBYTES> {
261261

262262
pub fn nused_bytes(&self) -> usize {
263263
self.length.saturating_sub(1) / 8 + 1
264-
265-
// let length_div = self.length / 8;
266-
// let length_mod = self.length % 8;
267-
268-
// if length_mod == 0 {
269-
// length_div
270-
// } else {
271-
// length_div + 1
272-
// }
273264
}
274265

275266
pub fn used_bytes(&self) -> &[u8] {

ledger/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ mod wasm {
129129
#[macro_use]
130130
mod cache;
131131

132-
#[cfg(all(not(target_family = "wasm"), feature = "ocaml-interop"))]
133-
mod ffi;
134-
135132
#[cfg(any(test, feature = "fuzzing"))]
136133
pub mod generators;
137134

mina-p2p-messages/src/array.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
use std::ops::Deref;
2-
31
use binprot::{BinProtRead, BinProtWrite, Nat0};
42
use malloc_size_of_derive::MallocSizeOf;
53
use rsexp::OfSexp;
64
use serde::{Deserialize, Serialize};
5+
use std::ops::Deref;
76

87
/// Mina array bounded to specific length. Note that the length is only checked
98
/// when performing binprot operations.

0 commit comments

Comments
 (0)