-
Notifications
You must be signed in to change notification settings - Fork 271
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
fix: checking funded amount is enough #7648
Changes from all commits
0f60baf
1cf23b7
38e4b8c
feca6fb
c3ec437
b65794f
8c3c8c7
a2ad290
265233a
5d3471f
ec6fb94
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
"formatting": "run -T prettier --check ./src && run -T eslint ./src", | ||
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", | ||
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests", | ||
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. There was a bug in TXE which resulted in a test passing even when an error was thrown. Grego fixed it in this PR and what follows are changes made by him. |
||
"dev": "DEBUG='aztec:*' LOG_LEVEL=debug && node ./dest/bin/index.js", | ||
"dev": "DEBUG='aztec:*' LOG_LEVEL=debug node ./dest/bin/index.js", | ||
"start": "node ./dest/bin/index.js" | ||
}, | ||
"inherits": [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -772,8 +772,12 @@ export class TXE implements TypedOracle { | |
|
||
const executionResult = await this.executePublicFunction(targetContractAddress, args, callContext); | ||
|
||
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. There was a bug in TXE which resulted in a test passing even when an error was thrown. Grego fixed it in this PR and what follows are changes made by him. |
||
if (executionResult.reverted) { | ||
throw new Error(`Execution reverted with reason: ${executionResult.revertReason}`); | ||
} | ||
|
||
// Apply side effects | ||
this.sideEffectsCounter = executionResult.endSideEffectCounter.toNumber(); | ||
this.sideEffectsCounter += executionResult.endSideEffectCounter.toNumber(); | ||
this.setContractAddress(currentContractAddress); | ||
this.setMsgSender(currentMessageSender); | ||
this.setFunctionSelector(currentFunctionSelector); | ||
|
@@ -808,6 +812,10 @@ export class TXE implements TypedOracle { | |
|
||
const executionResult = await this.executePublicFunction(targetContractAddress, args, callContext); | ||
|
||
if (executionResult.reverted) { | ||
throw new Error(`Execution reverted with reason: ${executionResult.revertReason}`); | ||
} | ||
|
||
// Apply side effects | ||
this.sideEffectsCounter += executionResult.endSideEffectCounter.toNumber(); | ||
this.setContractAddress(currentContractAddress); | ||
|
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 imagine that
x + G_amt * y
is equal tox
ify == 0
? So removing this term is the same as sayingamount = 0
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 don't follow what you are trying to say here but I've noticed that the related comments needed to be updated as well and I did that in c0570e6
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 meant that the comment now doesn't list
amount
as being included in the computation, I was thinking how this is equivalent toamount
actually being there, but being equal to 0.This is relevant for things like #7585, since we'd want to avoid having to track whether the amount is inside the point or not.