Rename identifier to circuit_name in Circuit type

This commit is contained in:
howardwu 2020-06-20 00:45:41 -07:00
parent 825b06e9f1
commit 3df120f9d0
2 changed files with 6 additions and 6 deletions

View File

@ -519,7 +519,7 @@ impl<F: Field + PrimeField, G: GroupType<F>> ConstrainedProgram<F, G> {
} }
if let Some(ConstrainedValue::CircuitDefinition(circuit_definition)) = self.get_mut(&program_identifier) { if let Some(ConstrainedValue::CircuitDefinition(circuit_definition)) = self.get_mut(&program_identifier) {
let circuit_identifier = circuit_definition.identifier.clone(); let circuit_identifier = circuit_definition.circuit_name.clone();
let mut resolved_members = vec![]; let mut resolved_members = vec![];
for member in circuit_definition.members.clone().into_iter() { for member in circuit_definition.members.clone().into_iter() {
match member { match member {
@ -660,13 +660,13 @@ impl<F: Field + PrimeField, G: GroupType<F>> ConstrainedProgram<F, G> {
} }
_ => { _ => {
return Err(ExpressionError::UndefinedStaticAccess( return Err(ExpressionError::UndefinedStaticAccess(
circuit.identifier.to_string(), circuit.circuit_name.to_string(),
circuit_member.to_string(), circuit_member.to_string(),
)); ));
} }
}; };
Ok(ConstrainedValue::Function(Some(circuit.identifier), function)) Ok(ConstrainedValue::Function(Some(circuit.circuit_name), function))
} }
fn enforce_function_call_expression<CS: ConstraintSystem<F>>( fn enforce_function_call_expression<CS: ConstraintSystem<F>>(

View File

@ -5,7 +5,7 @@ use std::fmt;
#[derive(Clone, PartialEq, Eq)] #[derive(Clone, PartialEq, Eq)]
pub struct Circuit { pub struct Circuit {
pub identifier: Identifier, pub circuit_name: Identifier,
pub members: Vec<CircuitMember>, pub members: Vec<CircuitMember>,
} }
@ -19,7 +19,7 @@ impl<'ast> From<AstCircuit<'ast>> for Circuit {
.collect(); .collect();
Self { Self {
identifier: variable, circuit_name: variable,
members, members,
} }
} }
@ -27,7 +27,7 @@ impl<'ast> From<AstCircuit<'ast>> for Circuit {
impl Circuit { impl Circuit {
fn format(&self, f: &mut fmt::Formatter) -> fmt::Result { fn format(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "circuit {} {{ \n", self.identifier)?; write!(f, "circuit {} {{ \n", self.circuit_name)?;
for field in self.members.iter() { for field in self.members.iter() {
write!(f, " {}\n", field)?; write!(f, " {}\n", field)?;
} }