Skip to content

Commit

Permalink
Remove segments from AggregatableTxnProofs
Browse files Browse the repository at this point in the history
  • Loading branch information
LindaGuiga committed Jun 6, 2024
1 parent 60f67a8 commit 0153a62
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions proof_gen/src/proof_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ pub enum SegmentAggregatableProof {
/// away whether or not the proof was a txn or agg proof.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub enum TxnAggregatableProof {
/// The underlying proof is a segment proof. It first needs to be aggregated
/// with a dummy proof.
Segment(GeneratedSegmentProof),
/// The underlying proof is a transaction proof.
Txn(GeneratedSegmentAggProof),
/// The underlying proof is an aggregation proof.
Expand Down Expand Up @@ -103,23 +100,20 @@ impl SegmentAggregatableProof {
impl TxnAggregatableProof {
pub(crate) fn public_values(&self) -> PublicValues {
match self {
TxnAggregatableProof::Segment(info) => info.p_vals.clone(),
TxnAggregatableProof::Txn(info) => info.p_vals.clone(),
TxnAggregatableProof::Agg(info) => info.p_vals.clone(),
}
}

pub(crate) fn is_agg(&self) -> bool {
match self {
TxnAggregatableProof::Segment(_) => false,
TxnAggregatableProof::Txn(_) => false,
TxnAggregatableProof::Agg(_) => true,
}
}

pub(crate) fn intern(&self) -> &PlonkyProofIntern {
match self {
TxnAggregatableProof::Segment(info) => &info.intern,
TxnAggregatableProof::Txn(info) => &info.intern,
TxnAggregatableProof::Agg(info) => &info.intern,
}
Expand Down Expand Up @@ -154,7 +148,9 @@ impl From<SegmentAggregatableProof> for TxnAggregatableProof {
fn from(v: SegmentAggregatableProof) -> Self {
match v {
SegmentAggregatableProof::Agg(agg) => TxnAggregatableProof::Txn(agg),
SegmentAggregatableProof::Txn(seg) => TxnAggregatableProof::Segment(seg),
SegmentAggregatableProof::Txn(_) => {
panic!("Should be an aggregation by now. Missing segment?")
}
}
}
}

0 comments on commit 0153a62

Please sign in to comment.