-
Notifications
You must be signed in to change notification settings - Fork 599
feat!: no_from #21716
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!: no_from #21716
Changes from all commits
a8893ac
4a235c6
5155d65
cd90ea3
999ec45
91f55e3
0bcd34c
9a6a4d8
64cd6b3
cf97030
f75c2db
e31d5e3
457dd71
05af60e
f07b83e
e143a94
dff80ba
edfcf13
d3328b4
0401e9e
0b6172f
6518c30
87d9e73
08f5ac6
575de76
e95719d
6932570
b6c4b8e
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 |
|---|---|---|
|
|
@@ -6,15 +6,17 @@ import { getSponsoredFPCInstance } from "./scripts/sponsored_fpc.js"; | |
| import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC"; | ||
| import { ValueNotEqualContract } from "./artifacts/ValueNotEqual.js"; | ||
| import { EmbeddedWallet } from "@aztec/wallets/embedded"; | ||
| import { AztecAddress } from "@aztec/aztec.js/addresses"; | ||
| import { NO_FROM } from "@aztec/aztec.js/account"; | ||
| import { Fr } from "@aztec/aztec.js/fields"; | ||
| import assert from "node:assert"; | ||
| import fs from "node:fs"; | ||
| // docs:end:imports | ||
|
|
||
| // docs:start:sample_data | ||
| if (!fs.existsSync("data.json")) { | ||
| console.error("data.json not found. Run 'yarn data' first to generate proof data."); | ||
| console.error( | ||
| "data.json not found. Run 'yarn data' first to generate proof data.", | ||
| ); | ||
|
Comment on lines
+17
to
+19
Contributor
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. Is your formatter configured to fewer than 120 chars?
Contributor
Author
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. the doc examples are...weird. I cannot get the ts server to behave with them and editing them does whatever. They also take forever to build...we have to talk to devrel about this |
||
| process.exit(1); | ||
| } | ||
| const data = JSON.parse(fs.readFileSync("data.json", "utf-8")); | ||
|
|
@@ -57,7 +59,7 @@ async function main() { | |
| // Deploy the account contract | ||
| const deployMethod = await manager.getDeployMethod(); | ||
| await deployMethod.send({ | ||
| from: AztecAddress.ZERO, | ||
| from: NO_FROM, | ||
| fee: { paymentMethod: sponsoredPaymentMethod }, | ||
| }); | ||
|
|
||
|
|
@@ -84,9 +86,11 @@ async function main() { | |
|
|
||
| // Step 3: Read initial counter value | ||
| // simulate() executes without submitting a transaction | ||
| let counterValue = (await valueNotEqual.methods | ||
| .get_counter(accounts[0].item) | ||
| .simulate({ from: accounts[0].item })).result; | ||
| let counterValue = ( | ||
| await valueNotEqual.methods | ||
| .get_counter(accounts[0].item) | ||
| .simulate({ from: accounts[0].item }) | ||
| ).result; | ||
| console.log(`Counter value: ${counterValue}`); // Should be 10 | ||
|
|
||
| // Step 4: Call increment() with proof data | ||
|
|
@@ -107,9 +111,11 @@ async function main() { | |
| await interaction.send(opts); | ||
|
|
||
| // Step 6: Read updated counter | ||
| counterValue = (await valueNotEqual.methods | ||
| .get_counter(accounts[0].item) | ||
| .simulate({ from: accounts[0].item })).result; | ||
| counterValue = ( | ||
| await valueNotEqual.methods | ||
| .get_counter(accounts[0].item) | ||
| .simulate({ from: accounts[0].item }) | ||
| ).result; | ||
| console.log(`Counter value: ${counterValue}`); // Should be 11 | ||
|
|
||
| assert(counterValue === 11n, "Counter should be 11 after verification"); | ||
|
|
||
This file was deleted.
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.
NO_FROMsounds so strange, isn't there some other way to name this hinting at its effects? maybe something likePAYLOAD_DEFINED_FROM(which is probably wronger and horribler, but I'm trying to convey my objection)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.
seeing the changes to the docs, maybe
CREATED_BY_TXThere 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.
Not in love with the naming too, I went for parallelism with NO_WAIT...
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.
It is weird, yes, but I'm also having trouble coming up with something better. Perhaps
from: DIRECT_CALL? idkThere 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 agree that
NO_FROMsounds strange. Now that Claude is back up, it suggested a few options:And it even provided a ranking 😅
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.
Sorry but all of those are worse IMO xD
from is pretty generic, it has no concept of account (wallet just happens to make it so from is an account, but we had the exception of the multicall entrypoint...which is not one). The NO_WAIT parallel is also a pro in my book