Skip to content

Commit

Permalink
chore: update formatter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Apr 20, 2024
1 parent 5453a68 commit 0445ec5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions tooling/nargo_fmt/src/visitor/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ impl super::FmtVisitor<'_> {
self.push_rewrite(use_tree, span);
self.last_position = span.end();
}

// TODO: rewrite instances of "Field" into "field" in these items.
ItemKind::Struct(_)
| ItemKind::Trait(_)
| ItemKind::TraitImpl(_)
Expand Down
2 changes: 1 addition & 1 deletion tooling/nargo_fmt/tests/expected/contract.nr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract Benchmarking {

struct Storage {
notes: Map<AztecAddress, PrivateSet<ValueNote, VALUE_NOTE_LEN>>,
balances: Map<AztecAddress, PublicMutable<field, field_SERIALIZED_LEN>>,
balances: Map<AztecAddress, PublicMutable<Field, FIELD_SERIALIZED_LEN>>,
}

impl Storage {
Expand Down
2 changes: 1 addition & 1 deletion tooling/nargo_fmt/tests/expected/module.nr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod a {
mod b {
struct Data {
a: field
a: Field
}
}

Expand Down
12 changes: 6 additions & 6 deletions tooling/nargo_fmt/tests/expected/struct.nr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
struct Foo {
bar: field,
array: [field; 2],
bar: Field,
array: [Field; 2],
}

struct Pair {
first: Foo,
second: field,
second: Field,
}

impl Foo {
Expand All @@ -25,8 +25,8 @@ impl Pair {
}

struct Nested {
a: field,
b: field
a: Field,
b: Field
}
struct MyStruct {
my_bool: bool,
Expand All @@ -39,7 +39,7 @@ fn test_struct_in_tuple(a_bool: bool, x: field, y: field) -> (MyStruct, bool) {
}

struct Animal {
legs: field,
legs: Field,
eyes: u8,
}

Expand Down
2 changes: 1 addition & 1 deletion tooling/nargo_fmt/tests/input/contract.nr
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ contract Benchmarking {
storage.balances.at(owner).write(current + value);
let _callStackItem1 = context.call_public_function(
context.this_address(),
FunctionSelector::from_signature("broadcast(Field)"),
FunctionSelector::from_signature("broadcast(field)"),
[owner]
);
}
Expand Down

0 comments on commit 0445ec5

Please sign in to comment.