Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Aug 6, 2024
1 parent 0e98a7f commit 3d70eeb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ use dep::aztec::{
};
use dep::std::{embedded_curve_ops::multi_scalar_mul, hash::from_field_unsafe};

// This trait is only used by `balances_map.nr` and it's name is quite weird now (all the notes have npk_m_hash so why
// call it OwnedNote?) TODO: Rename or nuke.
trait OwnedNote {
fn new(amount: U128, owner_npk_m_hash: Field) -> Self;
fn get_amount(self) -> U128;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ contract TokenWithRefunds {
/// a limited set of fee paying contracts will be used and they will be known, searching for fingerprints
/// by trying different fee payer npk values of these known contracts is a feasible attack.
///
/// fee_payer_point and user_point above are public information since there are args to the public
/// `fee_payer_point` and `user_point` above are public information because they are passed as args to the public
/// `complete_refund(...)` function.
#[aztec(private)]
fn setup_refund(
Expand Down Expand Up @@ -529,7 +529,7 @@ contract TokenWithRefunds {
let tx_fee = U128::from_integer(context.transaction_fee());

// 1. We check that user funded the fee payer contract with at least the transaction fee.
assert(funded_amount >= tx_fee, "funded amount not enough to conver tx fee");
assert(funded_amount >= tx_fee, "funded amount not enough to cover tx fee");

// 2. We compute the refund amount as the difference between funded amount and tx fee.
let refund_amount = funded_amount - tx_fee;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ unconstrained fn setup_refund_success() {

// TODO(#7694): Ideally we would check the error message here but it's currently not supported by TXE. Once this
// is supported, check the message here and delete try deleting the corresponding e2e test.
// #[test(should_fail_with = "funded amount not enough to conver tx fee")]
// #[test(should_fail_with = "funded amount not enough to cover tx fee")]
#[test(should_fail)]
unconstrained fn setup_refund_insufficient_funded_amount() {
let (env, token_contract_address, owner, recipient, mint_amount) = utils::setup_and_mint(true);
Expand All @@ -97,6 +97,6 @@ unconstrained fn setup_refund_insufficient_funded_amount() {

env.impersonate(fee_payer);

// The following should fail with "funded amount not enough to conver tx fee" because funded amount is 0
// The following should fail with "funded amount not enough to cover tx fee" because funded amount is 0
env.call_private_void(setup_refund_from_call_interface);
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('e2e_fees/private_refunds', () => {
),
},
}),
).rejects.toThrow('funded amount not enough to conver tx fee');
).rejects.toThrow('funded amount not enough to cover tx fee');
});
});

Expand Down

0 comments on commit 3d70eeb

Please sign in to comment.