Skip to content

chore: remove unused signing and auth token functions from crypto utils#58

Merged
DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
Danielodingz:chore/remove-unused-crypto-functions
Jun 27, 2026
Merged

chore: remove unused signing and auth token functions from crypto utils#58
DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
Danielodingz:chore/remove-unused-crypto-functions

Conversation

@Danielodingz

Copy link
Copy Markdown
Contributor

Closes #38

Description

This PR addresses dead code within the src/utils/crypto.ts file.
Previously, signWithPlatformKey() and generateChallengeToken() were defined but never utilized anywhere in the codebase. The Stellar signing logic is already correctly implemented and managed directly within src/stellar/signatures.ts.

This cleanup reduces code duplication and streamlines the utility module by safely removing these unused functions and their corresponding dead imports.

Changes Made

  • src/utils/crypto.ts: Removed the signWithPlatformKey and generateChallengeToken functions.
  • src/utils/crypto.ts: Cleaned up the unused imports for getPlatformKeypair and getNetworkPassphrase.

Impact

No functional changes or impact on existing workflows. Improves overall codebase maintainability by eliminating redundant and dead code, ensuring the Stellar signing logic remains centralized in src/stellar/signatures.ts.

@DeFiVC DeFiVC 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.

PR Review: chore: remove unused signing and auth token functions from crypto utils

Author: Danielodingz | Closes: #38 | CI: ✅ Green | Conflicts: ✅ None

Blocking Issues

None.

Code Issues

None. The removal is clean — both signWithPlatformKey and generateChallengeToken are confirmed unused (grep finds zero imports outside crypto.ts). The unused imports (getPlatformKeypair, getNetworkPassphrase) are correctly removed alongside the functions.

Minor Nits

  • Entire crypto.ts may be dead code — After this removal, verifyStellarSignature and sha256Hash are the only remaining exports. Grep shows neither is imported anywhere in the codebase. Consider a follow-up to remove the entire file if these functions are also unused. This is outside the scope of #38.

What's Good

  • Minimal, focused change — Only removes what the issue describes, no scope creep
  • Correct cleanup — Functions, their JSDoc comments, and unused imports all removed together
  • No functional impact — Confirmed by CI (Lint + Test both pass)
  • Follows codebase conventions — Clean diff, consistent with existing style

Straightforward dead code removal. Approving."

@DeFiVC DeFiVC merged commit b8db5ff into ChainLearnOfficial:main Jun 27, 2026
2 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.

[LOW] Unused functions signWithPlatformKey and generateChallengeToken in crypto.ts

2 participants