Skip to content

Commit

Permalink
chore!: use american spelling of "serialize" in stdlib (#2675)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Sep 13, 2023
1 parent 9e7a0f0 commit 56c96d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions compiler/noirc_frontend/src/hir/def_map/aztec_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ fn create_context(ty: &str, params: &[(Pattern, UnresolvedType, Visibility)]) ->
let expression = match unresolved_type {
// `hasher.add_multiple({ident}.serialize())`
UnresolvedTypeData::Named(..) => add_struct_to_hasher(identifier),
// TODO: if this is an array of structs, we should call serialise on each of them (no methods currently do this yet)
// TODO: if this is an array of structs, we should call serialize on each of them (no methods currently do this yet)
UnresolvedTypeData::Array(..) => add_array_to_hasher(identifier),
// `hasher.add({ident})`
UnresolvedTypeData::FieldElement => add_field_to_hasher(identifier),
Expand Down Expand Up @@ -445,12 +445,12 @@ fn make_return_push_array(push_value: Expression) -> Statement {
/// ```noir
/// `context.return_values.push_array({push_value}.serialize())`
fn make_struct_return_type(expression: Expression) -> Statement {
let serialised_call = method_call(
let serialized_call = method_call(
expression.clone(), // variable
"serialize", // method name
vec![], // args
);
make_return_push_array(serialised_call)
make_return_push_array(serialized_call)
}

/// Make array return type
Expand Down Expand Up @@ -547,7 +547,7 @@ pub(crate) fn create_context_finish() -> Statement {

fn add_struct_to_hasher(identifier: &Ident) -> Statement {
// If this is a struct, we call serialize and add the array to the hasher
let serialised_call = method_call(
let serialized_call = method_call(
variable_path(path(identifier.clone())), // variable
"serialize", // method name
vec![], // args
Expand All @@ -556,7 +556,7 @@ fn add_struct_to_hasher(identifier: &Ident) -> Statement {
Statement::Semi(method_call(
variable("hasher"), // variable
"add_multiple", // method name
vec![serialised_call], // args
vec![serialized_call], // args
))
}

Expand Down
6 changes: 3 additions & 3 deletions noir_stdlib/src/grumpkin_scalar.nr
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ impl GrumpkinScalar {
}
}

global GRUMPKIN_SCALAR_SERIALISED_LEN: Field = 2;
global GRUMPKIN_SCALAR_SERIALIZED_LEN: Field = 2;

fn deserialise_grumpkin_scalar(fields: [Field; GRUMPKIN_SCALAR_SERIALISED_LEN]) -> GrumpkinScalar {
fn deserialize_grumpkin_scalar(fields: [Field; GRUMPKIN_SCALAR_SERIALIZED_LEN]) -> GrumpkinScalar {
GrumpkinScalar { low: fields[0], high: fields[1] }
}

fn serialise_grumpkin_scalar(scalar: GrumpkinScalar) -> [Field; GRUMPKIN_SCALAR_SERIALISED_LEN] {
fn serialize_grumpkin_scalar(scalar: GrumpkinScalar) -> [Field; GRUMPKIN_SCALAR_SERIALIZED_LEN] {
[scalar.low, scalar.high]
}

0 comments on commit 56c96d0

Please sign in to comment.