Multi-Transfer (12 transfers per tx) and E2E Test #1031
Conversation
0da4574 to
429032d
Compare
429032d to
0f016cc
Compare
305f21b to
472db53
Compare
3989b6d to
9a9e461
Compare
rahul-kothari
left a comment
There was a problem hiding this comment.
GREAT WORK MY MAN!
I'd consider removing debug log statements though!
| [notes[0], notes[1]] | ||
| } | ||
|
|
||
| fn get_4_notes<P>(notes: [Option<ValueNote>; MAX_READ_REQUESTS_PER_CALL], _x: P) -> [Option<ValueNote>; 4] { |
There was a problem hiding this comment.
@sirasistant are we still unable to have a generic get_notes function? (generic over the number of notes)?
(Also, what's P?)
There was a problem hiding this comment.
It should be possible, using slices
fn get_p_notes<P>(notes: [Option<ValueNote>; MAX_READ_REQUESTS_PER_CALL], p: Field) -> [Option<ValueNote>]
or changing the signature to pass an empty array of the correct size
fn get_p_notes<P>(notes: [Option<ValueNote>; MAX_READ_REQUESTS_PER_CALL], p: [Option<ValueNote>; P]) -> [Option<ValueNote>; P]
|
This is coming along nicely! Nice one! |
simplify test. name fix. Use non-deterministic unenc log in zk token contract Add multi-transfer test to cci. Fix e2e build but multi transfer fails. Fix batchTx call. Co-authored-by: Jean M <jeanmon@users.noreply.github.com> fix multi test compilation contracts compile. Fix e2e multi compilation. minor syntax change. minor syntax change. contracts compile. Fix e2e test compilation. fix multi contract. Fix e2e multi test compilation. Remove files that must be gitignored.
bump timeouts. bump multi test timeout.
b91863b to
2ccefe6
Compare
| indexOfTxInABlock * MAX_NEW_COMMITMENTS_PER_TX, | ||
| (indexOfTxInABlock + 1) * MAX_NEW_COMMITMENTS_PER_TX, | ||
| ); | ||
| const newNullifiers = block.newNullifiers.slice( |
There was a problem hiding this comment.
for my understanding - why did we move this earlier?
There was a problem hiding this comment.
We were fetching the newNullifiers from the L2 block inside the decryption logic. This means for each successfully decrypted note, we re-do the slicing on block.newNullifiers to get the same value over and over again. I moved it outside to fetch the newNullifiers for a transaction just once.
| expect(balance).toBe(expectedBalance); | ||
| }; | ||
|
|
||
| /** |
There was a problem hiding this comment.
love this - thank you for adding it!!!
65adc34 to
21793c0
Compare
Not sure what I did but you're welcome I guess 😅 |
Description
Multi-transfer contract demonstrates upto 12 transfers per transaction for applications like payroll. We add two e2e tests, one that spends notes to transfer tokens to 12 unique recipients, other that splits a single note into 12 smaller denomination notes. The second test also tests creation and spending of value notes in the same transaction.
Co-credit: @rahul-kothari, @jeanmon, @Cooper-Kunz, @jfecher.
Thanks to @LeilaWang for helping fix
get_balancein aztec-noir.Also resolves #987 (This PR ensures that we emit different unencrypted logs in the same transaction, @rahul-kothari wrote specific execution tests for this issue in #1026)
Checklist: