Skip to content

vault-strategy: rename WhitelistEntry to ApprovedAsset (Anchor and Quasar)#112

Merged
mikemaccana merged 2 commits into
mainfrom
claude/vault-strategy-indexing-jw34h7
Jul 20, 2026
Merged

vault-strategy: rename WhitelistEntry to ApprovedAsset (Anchor and Quasar)#112
mikemaccana merged 2 commits into
mainfrom
claude/vault-strategy-indexing-jw34h7

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

Summary

Renames the vault-strategy approval account after what it is, in both ports:

  • WhitelistEntry is now ApprovedAsset: one curator-approved asset bound to its official Pyth price feed.
  • whitelist_asset is now approve_asset, and the PDA seed "whitelist" is now "approved_asset" (["approved_asset", registry, mint]).
  • The unused AssetNotWhitelisted error is removed. Approval is checked by the ApprovedAsset account's existence, so no error path ever fired.
  • Doc comments and READMEs now state precisely that the Registry account 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 of ApprovedAsset accounts derived from it, and an asset is approved exactly when its account exists (which is how add_asset checks it).

Notes

  • Anchor port (finance/vault-strategy/anchor): rename plus the Registry/ApprovedAsset doc corrections; prose "whitelisted" becomes "approved"/"curator-approved" throughout README and comments.
  • Quasar port (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 build runs 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.
  • Changelogs: the anchor CHANGELOG's merged feature entry now sits under a dated 2026-07-01 heading describing what shipped then (with its stale MAX_ASSETS (8) figure corrected to 16); the rename is recorded as a new 2026-07-20 entry in both ports' changelogs.
  • Follow-up to vault-strategy: index-seeded strategies, auto-deploying deposits, and set_weight #82, which merged before the rename landed on the branch.

Verification

  • Anchor: cargo build-sbf + cargo test (LiteSVM), 20 tests pass; cargo fmt --check and cargo clippy -D warnings clean.
  • Quasar: quasar build + cargo test on 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

claude added 2 commits July 17, 2026 22:58
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.
@mikemaccana
mikemaccana merged commit b4355e0 into main Jul 20, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants