Skip to content

Commit 2298bc7

Browse files
sebastiencsakoptelov
authored andcommitted
Convert proof types + fmt
1 parent b682082 commit 2298bc7

File tree

3 files changed

+51
-5
lines changed

3 files changed

+51
-5
lines changed

mina-p2p-messages/src/v2/generated.rs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,9 @@ pub struct PicklesProofProofsVerifiedMaxStableV2 {
676676
/// Gid: `544`
677677
/// Location: [src/lib/non_zero_curve_point/compressed_poly.ml:13:6](https://github.com/MinaProtocol/mina/blob/bfd1009/src/lib/non_zero_curve_point/compressed_poly.ml#L13)
678678
/// Args: crate :: bigint :: BigInt , bool
679-
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, BinProtRead, BinProtWrite)]
679+
#[derive(
680+
Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, BinProtRead, BinProtWrite,
681+
)]
680682
pub struct NonZeroCurvePointUncompressedStableV1 {
681683
pub x: crate::bigint::BigInt,
682684
pub is_odd: bool,
@@ -788,7 +790,19 @@ pub struct CurrencyBalanceStableV1(pub CurrencyAmountStableV1);
788790
///
789791
/// Gid: `637`
790792
/// Location: [src/lib/data_hash_lib/state_hash.ml:44:4](https://github.com/MinaProtocol/mina/blob/bfd1009/src/lib/data_hash_lib/state_hash.ml#L44)
791-
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, BinProtRead, BinProtWrite, Deref)]
793+
#[derive(
794+
Clone,
795+
Debug,
796+
PartialEq,
797+
Eq,
798+
PartialOrd,
799+
Ord,
800+
Serialize,
801+
Deserialize,
802+
BinProtRead,
803+
BinProtWrite,
804+
Deref,
805+
)]
792806
pub struct DataHashLibStateHashStableV1(pub crate::bigint::BigInt);
793807

794808
/// Derived name: `Mina_base__Sparse_ledger_base.Stable.V2.tree`
@@ -914,7 +928,19 @@ pub struct MinaBasePaymentPayloadStableV2 {
914928
///
915929
/// Gid: `689`
916930
/// Location: [src/lib/mina_base/ledger_hash0.ml:17:4](https://github.com/MinaProtocol/mina/blob/bfd1009/src/lib/mina_base/ledger_hash0.ml#L17)
917-
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, BinProtRead, BinProtWrite, Deref)]
931+
#[derive(
932+
Clone,
933+
Debug,
934+
PartialEq,
935+
Eq,
936+
PartialOrd,
937+
Ord,
938+
Serialize,
939+
Deserialize,
940+
BinProtRead,
941+
BinProtWrite,
942+
Deref,
943+
)]
918944
pub struct MinaBaseLedgerHash0StableV1(pub crate::bigint::BigInt);
919945

920946
/// **OCaml name**: `Mina_base__Permissions.Auth_required.Stable.V2`

mina-p2p-messages/src/v2/hashing.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,10 @@ impl MinaHash for MinaStateProtocolStateBodyValueStableV2 {
336336

337337
impl MinaHash for MinaStateProtocolStateValueStableV2 {
338338
fn hash(&self) -> mina_hasher::Fp {
339-
fp_state_hash_from_fp_hashes(self.previous_state_hash.to_field(), MinaHash::hash(&self.body))
339+
fp_state_hash_from_fp_hashes(
340+
self.previous_state_hash.to_field(),
341+
MinaHash::hash(&self.body),
342+
)
340343
}
341344
}
342345

mina-p2p-messages/src/v2/manual.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ use super::{
1515
MinaBasePendingCoinbaseCoinbaseStackStableV1, MinaBasePendingCoinbaseHashVersionedStableV1,
1616
MinaBasePendingCoinbaseStackHashStableV1, MinaBaseSignatureStableV1,
1717
MinaBaseStateBodyHashStableV1, NonZeroCurvePointUncompressedStableV1,
18-
ParallelScanWeightStableV1, PicklesProofProofsVerified2ReprStableV2StatementFp,
18+
ParallelScanWeightStableV1, PicklesProofProofsVerified2ReprStableV2,
19+
PicklesProofProofsVerified2ReprStableV2StatementFp, PicklesProofProofsVerifiedMaxStableV2,
1920
ProtocolVersionStableV1, SgnStableV1, TransactionSnarkScanStateStableV2ScanStateTreesABaseT1,
2021
TransactionSnarkScanStateStableV2ScanStateTreesAMergeT1,
2122
};
@@ -763,3 +764,19 @@ impl From<u32> for super::UnsignedExtendedUInt32StableV1 {
763764
Self(value.into())
764765
}
765766
}
767+
768+
impl From<&PicklesProofProofsVerifiedMaxStableV2> for PicklesProofProofsVerified2ReprStableV2 {
769+
fn from(value: &PicklesProofProofsVerifiedMaxStableV2) -> Self {
770+
let PicklesProofProofsVerifiedMaxStableV2 {
771+
statement,
772+
prev_evals,
773+
proof,
774+
} = value;
775+
776+
Self {
777+
statement: statement.clone(),
778+
prev_evals: prev_evals.clone(),
779+
proof: proof.clone(),
780+
}
781+
}
782+
}

0 commit comments

Comments
 (0)