-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: private refunds optimizations #7968
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,7 +153,7 @@ describe('e2e_fees/private_refunds', () => { | |
aliceRandomness, | ||
bobRandomness, | ||
t.bobWallet.getAddress(), // Bob is the recipient of the fee notes. | ||
true, // We set max fee/funded amount to zero to trigger the error. | ||
true, // We set max fee/funded amount to 1 to trigger the error. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had to bump this to 1 instead because otherwise the test would revert here and not in the expected assert. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is rather yucky, we should prioritze #7694 |
||
), | ||
}, | ||
}), | ||
|
@@ -195,10 +195,10 @@ class PrivateRefundPaymentMethod implements FeePaymentMethod { | |
private feeRecipient: AztecAddress, | ||
|
||
/** | ||
* If true, the max fee will be set to 0. | ||
* If true, the max fee will be set to 1. | ||
* TODO(#7694): Remove this param once the lacking feature in TXE is implemented. | ||
*/ | ||
private setMaxFeeToZero = false, | ||
private setMaxFeeToOne = false, | ||
) {} | ||
|
||
/** | ||
|
@@ -221,7 +221,7 @@ class PrivateRefundPaymentMethod implements FeePaymentMethod { | |
async getFunctionCalls(gasSettings: GasSettings): Promise<FunctionCall[]> { | ||
// We assume 1:1 exchange rate between fee juice and token. But in reality you would need to convert feeLimit | ||
// (maxFee) to be in token denomination. | ||
const maxFee = this.setMaxFeeToZero ? Fr.ZERO : gasSettings.getFeeLimit(); | ||
const maxFee = this.setMaxFeeToOne ? Fr.ONE : gasSettings.getFeeLimit(); | ||
|
||
await this.wallet.createAuthWit({ | ||
caller: this.paymentContract, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this function is available here, I thought we had only added it to the token contract. Did we replicate those changes here?
At any point we should likely nuke
with_refunds
and merge it into the main token.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I updated the token in a PR down the stack.