test(e2e): consolidate automine token suites - #24489
Merged
Merged
Conversation
Merge the automine token test files into fewer, parameterized files and
extract a shared token failure-case DSL, preserving every asserted behavior.
- Transfer quintet -> transfer.test.ts (happy) + transfer_failures.test.ts (table)
- burn + blacklist_burn -> burn.test.ts (describe.each over both harnesses)
- blacklist_transfer_{private,public} -> blacklist_transfer.test.ts (by authwit mechanism)
- minting.test.ts -> describe.each(['Public','Private'])
- reading_constants: drop .parallel, convert 6 its to it.each, delete empty beforeEach
- New token_test_helpers.ts: balance/authwit-replay helpers, runTokenFailureCases
runner, and deployAmmWithTokens (used by amm.test.ts and kernelless_simulation)
Part of the e2e round-2 consolidation.
Roll back the runTokenFailureCases/runFailureMode failure-case DSL in favor of explicit per-case tests, unify the mint method (applyMint) and the secondary account name (otherAddress) between TokenContractTest and BlacklistTokenContractTest, and dedupe the burn scenarios so each returns its harness directly with only the differing private-burn method mapped.
spalladino
force-pushed
the
spl/e2e-r2-token
branch
from
July 3, 2026 20:26
49b7861 to
33066b7
Compare
PhilWindle
approved these changes
Jul 5, 2026
rangozd
pushed a commit
to rangozd/aztec-packages
that referenced
this pull request
Aug 5, 2026
Clean forward-port of AztecProtocol#24524 (merge-train spartan-v5, merge commit f397aa5, parents aba2a2e..7e7d8d0) onto cb/private-port-next-7. Cherry-pick -m 1 applied with zero conflicts; resulting tree touches exactly the 152 files of the source merge diff. Pure TS/docs/CI (117 e2e-consolidation test files + sequencer-client, archiver, stdlib TS, p2p, ethereum, validator-client, foundation, docs, .test_patterns.yml). No noir/circuit/pinned-artifact surfaces → no standard-contracts regen. Bundles sub-PRs AztecProtocol#24504 AztecProtocol#24506 AztecProtocol#24507 AztecProtocol#24509 AztecProtocol#24513 AztecProtocol#24515 AztecProtocol#24474 AztecProtocol#24489 AztecProtocol#24490 AztecProtocol#24491 AztecProtocol#24492 AztecProtocol#24494 AztecProtocol#24495 AztecProtocol#24498 AztecProtocol#24500 AztecProtocol#24503 AztecProtocol#24475. Tracker: AztecProtocol/aztec-packages-private#570
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the e2e round-2 consolidation (PR 1 of 9). Merges the automine
token/suites into fewer, parameterized files, with no loss of asserted behavior. Failure cases are written as explicit per-case tests (no shared dispatch DSL), and the two token harnesses share member names so the merged suites can reuse code.Merges (old files → new)
transfer.test.ts(happy paths + the privateTransferevent assertion, grouped by entrypoint) and newtransfer_failures.test.ts(explicit per-case failure tests, grouped by entrypoint). Deletestransfer_in_private,transfer_in_public,transfer_to_private,transfer_to_public.burn.test.ts+blacklist_burn.test.ts→burn.test.tsviadescribe.eachover the two harnesses. Each scenario's setup returns its harness directly; only the differing private-burn method (burn_privatevsburn) is mapped per scenario (burn_publicis identical on both). The blacklist-only "sender is blacklisted" cases are an extra block. Deletesblacklist_burn.test.ts.blacklist_transfer_private.test.ts+blacklist_transfer_public.test.ts→blacklist_transfer.test.ts, parameterized by authwit mechanism (private-proxy vs public) over a single shared harness (private transfers only touch private balances, public only public, so neither disturbs the other's mint). Failure cases are explicit per-case tests inside the mechanism loop. Deletes both.minting.test.ts→describe.each(['Public','Private'])for the mirrored role/overflow cases; the private-only ABI-encoding overflow case stays explicit.reading_constants.parallel.test.ts→reading_constants.test.ts: dropped the.parallelsuffix, converted the 6 its to a singleit.each, and deleted the empty no-opbeforeEach.Shared helpers (
token_test_helpers.ts)balanceOf/halfBalanceOf/amountAboveBalance— the "read balance, take half or balance±1, assert > 0" idiom.assertPublicAuthwitReplayRejected/assertAuthwitProxyReplayRejected— the grant/consume-then-replay dances for public and private-proxy authwits.deployAmmWithTokens— the AMM + 3-token + authwit-minter deployment boilerplate previously duplicated intoken/amm.test.tsandsimulation/kernelless_simulation.test.ts; both now call it.Adopted the balance helpers (and the proxy-replay helper in unshielding) in
blacklist_shielding.test.tsandblacklist_unshielding.test.ts.Harness name unification
TokenContractTestandBlacklistTokenContractTestnow share member names so the merged burn suite reads members off the harness directly:applyMint()called aftersetup(); the Token harness's pre-setupapplyMintSnapshot()flag is gone.account1Address→otherAddressto match the blacklist harness's owner/other vocabulary. Consumers updated accordingly (transfer,minting,access_control.parallel,private_transfer_recursion.parallel).Quick wins
it('transfer on behalf of other, wrong designated caller')in the oldtransfer_in_public.it.skip('transfer into account to overflow')(GH Cheatcodes tracking issue #1259) to a single copy intransfer_failures.test.ts.new TokenContractTest('transfer_private')harness-name collision (the two files that shared it were merged; the survivors use distinct names).tokenSim.check()calls from the oldtransfer_to_private(the harnessafterEachalready checks).Preserved-assertion mapping (summary)
Every asserted behavior survives: each failure mode × entrypoint pair is an explicit test; happy paths and event/balance/simulator assertions stay explicit. The
CHECK_ALERTS/Grafanapublishing_mana_per_secondQoS guard from the oldtransfer_in_publicmoved totransfer.test.ts(which now owns the public-transfer execution).Intentional changes (no assertion lost)
simulatecannot move balances.createAuthWit+authWitnessesin the oldtransfer_in_publicover-balance-via-authwit case: the public authwit alone is the authorization mechanism (the private witness was inert on a public call); the U128-underflow revert + balances-unchanged assertions are unchanged.transfer_to_publicover-balance / invalid-nonce, the recipient is nowotherrather than self; the asserted error (Balance too low / invalid nonce) is independent of the recipient.Verification
yarn build,yarn format,yarn lintclean. CI is the oracle for the full matrix.