Skip to content

Commit c1c0e74

Browse files
committed
refactor: remove 'pub' visibility from utility function return types
1 parent fcf01f5 commit c1c0e74

18 files changed

Lines changed: 27 additions & 25 deletions

File tree

boxes/boxes/react/src/contracts/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ contract BoxReact {
4040
}
4141

4242
#[utility]
43-
unconstrained fn getNumber(owner: AztecAddress) -> pub ValueNote {
43+
unconstrained fn getNumber(owner: AztecAddress) -> ValueNote {
4444
let numbers = storage.numbers;
4545
numbers.at(owner).view_note()
4646
}

boxes/boxes/vanilla/src/contracts/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ contract Vanilla {
4040
}
4141

4242
#[utility]
43-
unconstrained fn getNumber(owner: AztecAddress) -> pub ValueNote {
43+
unconstrained fn getNumber(owner: AztecAddress) -> ValueNote {
4444
let numbers = storage.numbers;
4545
numbers.at(owner).view_note()
4646
}

boxes/boxes/vite/src/contracts/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ contract BoxReact {
4040
}
4141

4242
#[utility]
43-
unconstrained fn getNumber(owner: AztecAddress) -> pub ValueNote {
43+
unconstrained fn getNumber(owner: AztecAddress) -> ValueNote {
4444
let numbers = storage.numbers;
4545
numbers.at(owner).view_note()
4646
}

docs/docs/migration_notes.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ keywords: [sandbox, aztec, notes, migration, updating, upgrading]
66

77
Aztec is in full-speed development. Literally every version breaks compatibility with the previous ones. This page attempts to target errors and difficulties you might encounter when upgrading, and how to resolve them.
88

9-
## 0.83.0
9+
## TBD
1010

1111
### [Aztec.nr] #[utility] functions
1212

@@ -20,11 +20,13 @@ For this reason you need to apply #[utility] macro to functions which were origi
2020

2121
```diff
2222
+ #[utility]
23-
unconstrained fn balance_of_private(owner: AztecAddress) -> pub u128 {
23+
unconstrained fn balance_of_private(owner: AztecAddress) -> u128 {
2424
storage.balances.at(owner).balance_of()
2525
}
2626
```
2727

28+
## 0.83.0
29+
2830
### [aztec.js] AztecNode.getPrivateEvents API change
2931

3032
The `getPrivateEvents` method signature has changed to require an address of a contract that emitted the event and use recipient addresses instead of viewing public keys:

noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub contract AppSubscription {
116116
}
117117

118118
#[utility]
119-
unconstrained fn is_initialized(subscriber: AztecAddress) -> pub bool {
119+
unconstrained fn is_initialized(subscriber: AztecAddress) -> bool {
120120
storage.subscriptions.at(subscriber).is_initialized()
121121
}
122122
}

noir-projects/noir-contracts/contracts/auth_registry_contract/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub contract AuthRegistry {
132132
unconstrained fn unconstrained_is_consumable(
133133
on_behalf_of: AztecAddress,
134134
message_hash: Field,
135-
) -> pub bool {
135+
) -> bool {
136136
storage.approved_actions.at(on_behalf_of).at(message_hash).read()
137137
}
138138
}

noir-projects/noir-contracts/contracts/card_game_contract/src/main.nr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub contract CardGame {
138138
unconstrained fn view_collection_cards(
139139
owner: AztecAddress,
140140
offset: u32,
141-
) -> pub BoundedVec<Card, MAX_NOTES_PER_PAGE> {
141+
) -> BoundedVec<Card, MAX_NOTES_PER_PAGE> {
142142
let collection = storage.collections.at(owner);
143143
collection.view_cards(offset)
144144
}
@@ -148,14 +148,14 @@ pub contract CardGame {
148148
game: u32,
149149
player: AztecAddress,
150150
offset: u32,
151-
) -> pub BoundedVec<Card, MAX_NOTES_PER_PAGE> {
151+
) -> BoundedVec<Card, MAX_NOTES_PER_PAGE> {
152152
let game_deck = storage.game_decks.at(game as Field).at(player);
153153

154154
game_deck.view_cards(offset)
155155
}
156156

157157
#[utility]
158-
unconstrained fn view_game(game: u32) -> pub Game {
158+
unconstrained fn view_game(game: u32) -> Game {
159159
storage.games.at(game as Field).read()
160160
}
161161
}

noir-projects/noir-contracts/contracts/counter_contract/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub contract Counter {
8484

8585
// docs:start:get_counter
8686
#[utility]
87-
unconstrained fn get_counter(owner: AztecAddress) -> pub Field {
87+
unconstrained fn get_counter(owner: AztecAddress) -> Field {
8888
let counters = storage.counters;
8989
balance_utils::get_balance(counters.at(owner).set)
9090
}

noir-projects/noir-contracts/contracts/easy_private_token_contract/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub contract EasyPrivateToken {
4343

4444
// Helper function to get the balance of a user.
4545
#[utility]
46-
unconstrained fn get_balance(owner: AztecAddress) -> pub Field {
46+
unconstrained fn get_balance(owner: AztecAddress) -> Field {
4747
let balances = storage.balances;
4848

4949
// Return the sum of all notes in the set.

noir-projects/noir-contracts/contracts/easy_private_voting_contract/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub contract EasyPrivateVoting {
6969
// docs:end:end_vote
7070
// docs:start:get_vote
7171
#[utility]
72-
unconstrained fn get_vote(candidate: Field) -> pub Field {
72+
unconstrained fn get_vote(candidate: Field) -> Field {
7373
storage.tally.at(candidate).read()
7474
}
7575
// docs:end:get_vote

0 commit comments

Comments
 (0)