Skip to content

Commit 6549b07

Browse files
authored
Merge pull request #1269 from o1-labs/copilot/fix-1267
Unify the usage of Fp, Fq and curves by replacing mina_hasher::Fp with mina_curves::pasta::Fp
2 parents 7c6cb6d + 0e4d0c5 commit 6549b07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+109
-128
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4949
Ubuntu 22.04 for test binary artifacts to ensure compatibility with Debian
5050
Bullseye container environment ([#1249](https://github.com/o1-labs/openmina/pull/1249))
5151
- **Build System**: Enhanced Makefile with documentation-related targets and comprehensive formatting commands ([#1234](https://github.com/o1-labs/openmina/pull/1234))
52+
- Use consistent `use` statements for fields. Replace `mina_hasher::Fp` with
53+
`mina_curves::pasta::Fp`.
54+
([#1269](https://github.com/o1-labs/openmina/pull/1269/)).
55+
5256
### Fixed
5357

5458
- **Documentation**: Resolved broken links and bare URL warnings in Rust

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ graphannis-malloc_size_of_derive = { workspace = true }
3535
ark-ff = { workspace = true }
3636
hex = "0.4.3"
3737
libp2p-identity = { version = "=0.2.7", features = ["serde", "peerid"] }
38+
mina-curves = { workspace = true }
3839
mina-hasher = { workspace = true }
3940
mina-p2p-messages = { workspace = true }
4041
poseidon = { workspace = true }

core/src/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use binprot_derive::BinProtWrite;
2-
use mina_hasher::Fp;
2+
use mina_curves::pasta::Fp;
33
use mina_p2p_messages::{bigint, number, v2};
44

55
pub const GENESIS_PRODUCER_SK: &str = "EKFKgDtU3rcuFTVSEpmpXSkukjmX4cKefYREi6Sdsk7E7wsT7KRw";

core/src/network.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl NetworkConfig {
111111
pub mod devnet {
112112
use super::{CircuitsConfig, NetworkId};
113113
use crate::constants::{ConstraintConstants, ForkConstants};
114-
use mina_hasher::Fp;
114+
use mina_curves::pasta::Fp;
115115

116116
pub const NETWORK_ID: NetworkId = NetworkId::TESTNET;
117117
pub const NAME: &str = "devnet";
@@ -194,7 +194,7 @@ pub mod devnet {
194194
pub mod mainnet {
195195
use super::{CircuitsConfig, NetworkId};
196196
use crate::constants::{ConstraintConstants, ForkConstants};
197-
use mina_hasher::Fp;
197+
use mina_curves::pasta::Fp;
198198

199199
pub const NETWORK_ID: NetworkId = NetworkId::MAINNET;
200200
pub const NAME: &str = "mainnet";

ledger/src/account/account.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{io::Cursor, str::FromStr, sync::Arc};
22

33
use ark_ff::{BigInteger256, One, UniformRand, Zero};
4-
use mina_hasher::Fp;
4+
use mina_curves::pasta::Fp;
55
use mina_p2p_messages::{
66
binprot::{BinProtRead, BinProtWrite},
77
v2,

ledger/src/account/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::str::FromStr;
22

33
use ark_ff::{UniformRand, Zero};
4-
use mina_hasher::Fp;
4+
use mina_curves::pasta::Fp;
55
use o1_utils::{field_helpers::FieldHelpersError, FieldHelpers};
66
use serde::{Deserialize, Serialize};
77

ledger/src/account/conv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use ark_ec::short_weierstrass_jacobian::GroupAffine;
44
use ark_ff::{fields::arithmetic::InvalidBigInt, Field, PrimeField};
5-
use mina_hasher::Fp;
5+
use mina_curves::pasta::Fp;
66
use mina_p2p_messages::{
77
bigint::BigInt,
88
binprot,

ledger/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
sync::atomic::AtomicU64,
66
};
77

8-
use mina_hasher::Fp;
8+
use mina_curves::pasta::Fp;
99
use mina_signer::CompressedPubKey;
1010
use serde::{Deserialize, Serialize};
1111

ledger/src/cache.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ mod tests {
7878

7979
#[test]
8080
fn test_cache() {
81-
use mina_curves::pasta::Fq;
82-
use mina_hasher::Fp;
81+
use mina_curves::pasta::{Fp, Fq};
8382

8483
static COUNTER: AtomicUsize = AtomicUsize::new(0);
8584

0 commit comments

Comments
 (0)