vault-strategy: rename WhitelistEntry to ApprovedAsset (Anchor and Quasar)#112
Merged
Merged
Conversation
Name the account after what it is, one curator-approved asset bound to its official price feed, rather than after the list mechanic. whitelist_asset becomes approve_asset, the PDA seed "whitelist" becomes "approved_asset", and the unused AssetNotWhitelisted error goes away (approval is checked by the ApprovedAsset account's existence, so no error path ever fired). Also correct the Registry's description in doc comments, README, and CHANGELOG: the Registry account is the curator record at the root of the approved set, not the list itself. It stores only the authority; the set is the collection of ApprovedAsset accounts derived from it. Fix two stale MAX_ASSETS (8) references the cap raise missed. 20 tests pass under cargo build-sbf + cargo test; fmt and clippy clean.
Bring the Quasar port in line with the Anchor version: WhitelistEntry becomes ApprovedAsset, whitelist_asset becomes approve_asset, the PDA seed "whitelist" becomes "approved_asset", and the unused AssetNotWhitelisted error is removed. Instruction and account discriminators are explicit in Quasar, so the wire format is otherwise unchanged. Registry doc comments and the README now state that the Registry account is the curator record at the root of the approved set, not the list itself. Also restore the anchor CHANGELOG's merged entry to describe what shipped on 2026-07-01 under a dated heading (correcting its stale MAX_ASSETS figure), and record the rename as a new dated entry in both changelogs. Verified with quasar build + cargo test on both programs (router 2 tests, vault 3 tests, all passing); the renamed seed is exercised end to end.
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.
Summary
Renames the vault-strategy approval account after what it is, in both ports:
WhitelistEntryis nowApprovedAsset: one curator-approved asset bound to its official Pyth price feed.whitelist_assetis nowapprove_asset, and the PDA seed"whitelist"is now"approved_asset"(["approved_asset", registry, mint]).AssetNotWhitelistederror is removed. Approval is checked by theApprovedAssetaccount's existence, so no error path ever fired.Registryaccount is the curator record at the root of the approved set, not the list itself: it stores only the curator's authority, the set is the collection ofApprovedAssetaccounts derived from it, and an asset is approved exactly when its account exists (which is howadd_assetchecks it).Notes
finance/vault-strategy/anchor): rename plus the Registry/ApprovedAsset doc corrections; prose "whitelisted" becomes "approved"/"curator-approved" throughout README and comments.finance/vault-strategy/quasar): same rename. Quasar's instruction and account discriminators are explicit (#[instruction(discriminator = 1)],#[account(discriminator = 2)]), so the wire format is otherwise unchanged.quasar buildruns rustfmt over the crate, which also normalized pre-existing formatting in a few files not otherwise touched by the rename (deposit.rs,withdraw.rs,oracle.rs, and the router's swap/set-rate files) — those hunks are whitespace-only.2026-07-01heading describing what shipped then (with its staleMAX_ASSETS (8)figure corrected to 16); the rename is recorded as a new2026-07-20entry in both ports' changelogs.Verification
cargo build-sbf+cargo test(LiteSVM), 20 tests pass;cargo fmt --checkandcargo clippy -D warningsclean.quasar build+cargo teston both programs, router 2 tests and vault 3 tests pass; the renamed"approved_asset"seed is exercised end to end by the setup and deposit tests. Local builds used platform-tools v1.54 staged under the CLI's v1.52 cache key (this sandbox cannot download v1.52); CI performs the authoritative v1.52 build.🤖 Generated with Claude Code
https://claude.ai/code/session_01RajngzX57RGaQx5sKPbysZ
Generated by Claude Code