Explorar el Código

PedersenAssignment::var() convenience function

Get the `Ident` for the committed private `Scalar` in a `PedersenAssignment`
Ian Goldberg hace 4 meses
padre
commit
d080daa250
Se han modificado 2 ficheros con 9 adiciones y 1 borrados
  1. 8 0
      sigma_compiler_core/src/pedersen.rs
  2. 1 1
      sigma_compiler_core/src/rangeproof.rs

+ 8 - 0
sigma_compiler_core/src/pedersen.rs

@@ -817,6 +817,14 @@ pub struct PedersenAssignment {
     pub pedersen: Pedersen,
 }
 
+impl PedersenAssignment {
+    /// Get the `Ident` for the committed private `Scalar` in a
+    /// [`PedersenAssignment`]
+    pub fn var(&self) -> Ident {
+        self.pedersen.var()
+    }
+}
+
 /// Parse an [`Expr`] to see if we recognize it as an assignment
 /// statement assigning a [Pedersen expression](Pedersen) to an
 /// [`struct@Ident`] for a public `Point`.

+ 1 - 1
sigma_compiler_core/src/rangeproof.rs

@@ -237,7 +237,7 @@ pub fn transform(
             if let Some(ped_assign) =
                 recognize_pedersen_assignment(vars, &randoms, &vardict, leafexpr)
             {
-                Some((ped_assign.pedersen.var(), ped_assign))
+                Some((ped_assign.var(), ped_assign))
             } else {
                 None
             }