refactor: remove dead code and tests that cannot fail - #258
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Compute Unit Report
🔺 increase · 🔻 decrease · – unchanged · 🆕 new · 🗑 removed (vs Generated: 2026-09-28 |
|
amilz
previously approved these changes
Sep 28, 2026
Delete unused token/mint/ATA init helpers, the test-only TryFrom<u32> for SubscriptionsError, the manual From<AccountDiscriminator> for u8, the unused generic on ProgramAccountInit::init and the unused program_id parameter on emit_event. Header layout asserts now use offset_of! so they check the real layout. Drop self-referential event_engine tests, redundant check_min_account_size cases and toBeDefined assertions on signatures that sendTransaction already guarantees. The webapp reuses clusterIdToNetwork and findSubscriptionAuthorityPda instead of copies. No public API, error code, IDL or wire format change.
The client tests import webapp/src/lib/collect-utils.ts directly, and CI runs them without building @solana/subscriptions, whose exports point at dist. Importing findSubscriptionAuthorityPda there made both collect-utils test files fail to resolve the package.
dev-jodee
force-pushed
the
chore/slop-cleanup
branch
from
September 28, 2026 15:03
f39cce9 to
b175d64
Compare
amilz
approved these changes
Sep 28, 2026
amilz
left a comment
Collaborator
There was a problem hiding this comment.
Removes dead init helpers/unused generics, reuses check_with_program, header asserts now use offset_of!. No on-chain behavior change. CI green.
This branch was previously deployed
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.
Linked issue
None, maintainer cleanup.
What and why
MintInit,TokenInit,AssociatedTokenAccountInit,init_*,check_with_bump), the test-onlyTryFrom<u32>forSubscriptionsError, the manualFrom<AccountDiscriminator> for u8, the unused genericTonProgramAccountInit::initand the unusedprogram_idparam onemit_event::processcheck_accounts_with_programcallscheck_with_programinstead of duplicating itoffset_of!so they check the real struct layout instead of comparing literalsevent_enginetests, 3 redundantcheck_min_account_sizecases andtoBeDefinedassertions on signaturessendTransactionalready guaranteesclusterIdToNetworkfromlib/cluster.tsandfindSubscriptionAuthorityPdafrom@solana/subscriptionsNo public API, error code, IDL or instruction/account wire format change. Error variants, client exports,
Event,DATA_LENand thev1_to_v2scaffolding are kept on purpose.Testing
cargo test -p subscriptions-program: 50 passedcargo test -p tests-subscriptions: 284 passedjust build-program,just build-test-hook,cargo fmt --check, clippy-D warningspnpm run lint: regenerated IDL and clients identical to committedtsc -bandpnpm test(20/20), clienttsc --noEmitjust test-clientagainst surfpool: 66/66 fork, 1/1 offlineAI disclosure
Check exactly one. See CONTRIBUTING.md.