Skip to content
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

chore(e2e): Test multiple decryption keys on the same tx #1110

Merged
merged 10 commits into from
Jul 31, 2023

Conversation

spalladino
Copy link
Collaborator

@spalladino spalladino commented Jul 18, 2023

Fixes #1010

@netlify
Copy link

netlify bot commented Jul 24, 2023

Deploy Preview for preeminent-bienenstitch-606ad0 canceled.

Name Link
🔨 Latest commit 8432ff4
🔍 Latest deploy log https://app.netlify.com/sites/preeminent-bienenstitch-606ad0/deploys/64c12c582a885f0008b5e148

@spalladino spalladino force-pushed the palla/e2e-multiple-keys branch 7 times, most recently from cd019e4 to 83394c2 Compare July 31, 2023 15:36
Comment on lines +87 to +91
it('refuses to withdraw funds as a non-owner', async () => {
await expect(
escrowContract.methods.withdraw(zkTokenContract.address, 30, recipient).simulate({ origin: recipient }),
).rejects.toThrowError();
}, 60_000);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd've expected this test to fail with a cannot satisfy constraints, but I got this error instead. For context, I'm running an ensure_note_exists for a note which does not exist. Is it possible to catch this somehow? cc @LeilaWang

  wasm Error(2018): private data tree root mismatch at read_request[0]
  wasm 	expected root:    0x01834dbe674ccaa98f5aaafdcd8a42267503a0c141f582ad7f53564fab450c23
  wasm 	but got root*:    0x23b12bc80a094747ce77a30b71288abcb7cbf648a8891cfe907405db219c8549
  wasm 	read_request:     0x156409eef4798a1db5b3a8d73dfa047c3c0de0f06fc888209b1a191c31b5dde8
  wasm 	siloed-rr (leaf): 0x1115a070391204040030b3f5e4ab5d5e6fc5b3c82e16be7de43f2b089961e7c6
  wasm 	leaf_index: 0x0000000000000000000000000000000000000000000000000000000000000040
  wasm 	is_transient: 0
  wasm 	hint_to_commitment: 0x0000000000000000000000000000000000000000000000000000000000000000
  wasm 	* got root by siloing read_request (compressing with storage_contract_address to get leaf) and merkle-hashing to a root using membership witness (mem: 34.50MB) +30s

@spalladino spalladino marked this pull request as ready for review July 31, 2023 15:48
Copy link
Contributor

@benesjan benesjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

global ADDRESS_NOTE_LEN: Field = 2;

// Stores an address
struct AddressNote {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've already created AddressNote in the Pokeable contract. The only difference there is that owner and address are the same thing (it was enough for the test case I used pokeable contract for).

Maybe it would be worth it to remove my implementation of AddressNote and move yours to noir-libs. This sounds like something which will be needed by a lot of contracts. But maybe it would be better to do that in separate PR.

@spalladino spalladino enabled auto-merge (squash) July 31, 2023 17:21
@spalladino spalladino merged commit 8717827 into master Jul 31, 2023
@spalladino spalladino deleted the palla/e2e-multiple-keys branch July 31, 2023 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Create and e2e test where we use multiple encryption keys in a single transaction.
2 participants