utils
Standalone Functions
create_note_getter_options_for_decreasing_balance
create_note_getter_options_for_decreasing_balance(amount);
Pick the fewest notes whose sum is equal to or greater than amount
.
Parameters
Name | Type |
---|---|
amount | Field |
increment
increment(balance, &mut PrivateContext>, amount, recipient, outgoing_viewer);
Inserts it to the recipient's set of notes.
Parameters
Name | Type |
---|---|
balance | PrivateSet<ValueNote |
&mut PrivateContext> | |
amount | Field |
recipient | AztecAddress |
outgoing_viewer | AztecAddress |
decrement
decrement(balance, &mut PrivateContext>, amount, owner, outgoing_viewer);
Fail if the sum of the selected notes is less than the amount.
Parameters
Name | Type |
---|---|
balance | PrivateSet<ValueNote |
&mut PrivateContext> | |
amount | Field |
owner | AztecAddress |
outgoing_viewer | AztecAddress |
decrement_by_at_most
decrement_by_at_most(balance, &mut PrivateContext>, max_amount, owner, outgoing_viewer);
// It returns the decremented amount, which should be less than or equal to max_amount.
Parameters
Name | Type |
---|---|
balance | PrivateSet<ValueNote |
&mut PrivateContext> | |
max_amount | Field |
owner | AztecAddress |
outgoing_viewer | AztecAddress |
destroy_note
destroy_note(balance, &mut PrivateContext>, note);
Returns the value of the destroyed note.
Parameters
Name | Type |
---|---|
balance | PrivateSet<ValueNote |
&mut PrivateContext> | |
note | ValueNote |