Skip to content
This repository was archived by the owner on Jul 10, 2026. It is now read-only.

test: e2e tests tokenized vault - authwits - #152

Merged
ilpepepig merged 70 commits into
feat/yield-bearing-tokenfrom
test/e2e-tests-tokenized-vault-authwits
Jul 28, 2025
Merged

test: e2e tests tokenized vault - authwits#152
ilpepepig merged 70 commits into
feat/yield-bearing-tokenfrom
test/e2e-tests-tokenized-vault-authwits

Conversation

@ilpepepig

@ilpepepig ilpepepig commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

🤖 Linear

Closes AZT-255

Description

Check parent linear issue for more context https://linear.app/defi-wonderland/issue/AZT-184/typescript-testing-suite

Note that the new tests are the ones inside describe('Successful interactions with authwits.'.

ilpepepig and others added 30 commits June 12, 2025 22:26
…-wonderland/aztec-standards into feat/tokenized-vault-redeem-tests
…-wonderland/aztec-standards into feat/tokenized-vault-redeem-tests
@linear

linear Bot commented Jul 15, 2025

Copy link
Copy Markdown

@ilpepepig
ilpepepig marked this pull request as ready for review July 15, 2025 17:59
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

depositAction.with({ authWitnesses: [depositAuthWitness] }),
alice,
assetsAlice,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Vault Authorization Overwrite Bug

The callVaultWithPrivateAuthWit function incorrectly overwrites existing authWitnesses on Aztec.js method calls. It replaces any pre-set authWitnesses (e.g., for deposit or issue operations) with only [transferAuthWitness], causing the original authorization to be lost and the vault operation to fail. A similar, inconsistent pattern exists in callVaultWithPublicAuthWit.

Locations (6)

Fix in CursorFix in Web

publicDepositAction.with({ authWitnesses: [publicDepositAuthWitness] }),
bob,
assetsBob,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Incorrect Authwit Handling Causes Test Failures

A private authorization witness (authwit), generated by setPrivateAuthWit, is incorrectly passed to callVaultWithPublicAuthWit. This helper function is designed for public authwits and will ignore the private one, causing authorization failures in test cases involving private shares, such as deposit_public_to_private, issue_public_to_private, and deposit_public_to_private_exact.

Locations (3)

Fix in CursorFix in Web

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is bs, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. Not the greatest variable name though.

@github-actions

This comment was marked as outdated.

Base automatically changed from test/e2e-tests-tokenized-vault to feat/yield-bearing-token July 25, 2025 17:17
…dards into test/e2e-tests-tokenized-vault-authwits
@github-actions

Copy link
Copy Markdown

Benchmark Comparison

Contract: nft

Function Gates DA Gas L2 Gas
Status Base PR Diff Base PR Diff Base PR Diff
burn_private 331,755 331,755 2,816 2,816 44,502 44,502
burn_public 227,539 227,539 3,380 3,380 51,581 51,581
mint_to_private 356,923 356,923 13,517 13,517 44,218 44,218
mint_to_public 227,539 227,539 3,380 3,380 57,811 57,811
transfer_private_to_private 325,803 325,803 12,954 12,954 5,296 5,296
transfer_private_to_public 331,758 331,758 2,816 2,816 37,886 37,886
transfer_public_to_private 353,411 353,411 13,517 13,517 44,618 44,618
transfer_public_to_public 227,539 227,539 2,253 2,253 43,782 43,782

Contract: token

Function Gates DA Gas L2 Gas
Status Base PR Diff Base PR Diff Base PR Diff
burn_private 363,830 363,830 14,081 14,081 38,837 38,837
burn_public 227,539 227,539 3,380 3,380 51,660 51,660
mint_to_private 357,673 357,673 13,517 13,517 37,008 37,008
mint_to_public 227,539 227,539 3,380 3,380 57,610 57,610
transfer_private_to_private 363,311 363,311 24,218 24,218 6,706 6,706
transfer_private_to_public 363,910 363,910 14,081 14,081 51,140 51,140
transfer_private_to_public_with_commitment 394,872 394,872 25,345 25,345 52,801 52,801
transfer_public_to_private 354,161 354,161 13,517 13,517 49,535 49,535
transfer_public_to_public 227,539 227,539 3,380 3,380 63,593 63,593

Contract: tokenized_vault

Function Gates DA Gas L2 Gas
Status Base PR Diff Base PR Diff Base PR Diff
deposit_private_to_private 602,470 602,470 15,770 15,770 147,163 147,163
deposit_private_to_private_exact 632,822 632,822 27,034 27,034 118,406 118,406
deposit_private_to_public 575,200 575,200 5,632 5,632 128,658 128,658
deposit_public_to_private 358,394 358,394 16,896 16,896 239,612 239,612
deposit_public_to_private_exact 388,756 388,756 28,161 28,161 210,855 210,855
deposit_public_to_public 227,539 227,539 6,759 6,759 211,324 211,324
issue_private_to_private_exact 732,056 732,056 27,034 27,034 149,817 149,817
issue_private_to_public_exact 704,947 704,947 16,896 16,896 163,614 163,614
issue_public_to_private 358,396 358,396 16,896 16,896 240,718 240,718
issue_public_to_public 227,539 227,539 6,759 6,759 212,248 212,248
redeem_private_to_public 363,970 363,970 5,069 5,069 148,664 148,664
redeem_public_to_public 227,539 227,539 5,632 5,632 131,222 131,222
withdraw_private_to_public_exact 394,605 394,605 16,333 16,333 130,803 130,803
withdraw_public_to_public 227,539 227,539 5,632 5,632 131,146 131,146

@xorsal xorsal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

publicDepositAction.with({ authWitnesses: [publicDepositAuthWitness] }),
bob,
assetsBob,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is bs, right?

@ilpepepig
ilpepepig merged commit b6275d4 into feat/yield-bearing-token Jul 28, 2025
1 check passed
@ilpepepig
ilpepepig deleted the test/e2e-tests-tokenized-vault-authwits branch July 28, 2025 13:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants