-
Notifications
You must be signed in to change notification settings - Fork 310
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: add inclusion proofs txe tests #11711
base: ek/fix/make-block-number-in-txe-make-sense
Are you sure you want to change the base?
feat: add inclusion proofs txe tests #11711
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
93133f7
to
d31fc38
Compare
ae7c789
to
65b3357
Compare
d31fc38
to
3410f84
Compare
65b3357
to
20d86fd
Compare
1abffff
to
282a5bc
Compare
20d86fd
to
aa5d4ba
Compare
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.
Why not delete the e2e test?
let owner = env.create_account(); | ||
env.impersonate(owner); | ||
|
||
// Advance a block so we know that at block 2 our contract has not been deployed yet. |
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 understand this comment
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.
Yeah reading this back its definitely not thorough enough. Addressed in 20a0708
|
||
#[test] | ||
unconstrained fn note_flow() { | ||
let (env, contract_address, owner) = setup(INITIAL_VALUE); |
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.
Can you add here more comments regarding what you are testing?
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.
Yep, have added more comments in general in 20a0708 !
} | ||
|
||
#[test(should_fail_with = "Nullifier witness not found for nullifier")] | ||
unconstrained fn test_contract_not_initialized() { |
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.
unconstrained fn test_contract_not_initialized() { | |
unconstrained fn contract_not_initialized() { |
for consistency
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.
Ah very good point thank you 🙏. Have reworked some of the naming in 20a0708
} | ||
|
||
#[test(should_fail_with = "Nullifier witness not found for nullifier")] | ||
unconstrained fn test_contract_not_deployed() { |
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.
This test seems to be equal to the one above.
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.
Hmm to me it seems to not be equal to the above test, one checks for the fail of initialization, the other for the fail of deployment. But I think it's definitely not clear enough so thank you for pointing that out. Have added some comments to explain this in 20a0708
let NOTE_VALUE = 69; | ||
InclusionProofs::at(contract_address).create_note(owner, NOTE_VALUE).call(&mut env.private()); | ||
|
||
env.advance_block_by(2); |
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.
Why 2?
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 not sure anymore 😅. Changed to the default (1) in 20a0708
aa5d4ba
to
c96f3fb
Compare
d5127ab
to
f317db5
Compare
c96f3fb
to
bb58c87
Compare
f317db5
to
df09858
Compare
baa69a2
to
edbd170
Compare
df09858
to
0882c5b
Compare
0882c5b
to
353748e
Compare
edbd170
to
3bb2506
Compare
955f6b0
to
a750023
Compare
3bb2506
to
57bee7d
Compare
57bee7d
to
e763b46
Compare
f2aa25e
to
c80549f
Compare
c80549f
to
20a0708
Compare
Adding inclusion proof txe tests to hopefully replace
flaky_e2e_inclusion_tests