Repository navigation
chore(tron): type the mock snap clients in the staking and wallet service tests - #623
Open
ulissesferreira wants to merge 3 commits into
Open
ulissesferreira wants to merge 3 commits into
ulissesferreira wants to merge 3 commits into
Conversation
ulissesferreira
temporarily deployed
to
default-branch
November 17, 2026 01:40 — with
GitHub Actions
Inactive
…and wallet service tests
…essions-staking-wallet-tests # Conflicts: # oxlint-suppressions.json
|
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.



Description
Removes the remaining
no-explicit-any/no-unsafe-*suppressions from the staking and wallet service tests by giving the mocked TronWeb clients a real structural type instead ofany. Every mock still resolves the same fixtures and every assertion is unchanged, so the tests exercise exactly the same paths as before; the only non-typing edits are the redundantas anycasts on already-correct asset IDs, which are simply dropped, and anas unknown asnarrow cast for the deliberately-invalid asset ID / JSON-RPC request fixtures that the tests rely on.Changes
packages/tron-wallet-snap/src/services/staking/StakingService.test.ts— added aMockTronWebtype (MockedFunctionpertransactionBuilder/trxmethod) and typed the transaction-expiration refresher mock'stransactionparameter; dropped the redundantas anyasset-ID assertions and typed the invalid asset ID asStakedCaipAssetType(no-explicit-any,no-unsafe-member-access,no-unsafe-call,no-unsafe-return,no-unnecessary-type-assertion)packages/tron-wallet-snap/src/services/wallet/WalletService.test.ts— added aMockTronWebtype coveringtrx,utilsandisAddress, typed thetxJsonToPbandderiveTronKeypairmocks, replaced theas anyservice/factory casts withas unknown as Mocked<...>, built the user-rejection error withObject.assigninstead of anany-typed local, and typed the missing-method request asJsonRpcRequest(no-explicit-any,no-unsafe-member-access,no-unsafe-call,no-unsafe-return,no-unsafe-argument,no-unnecessary-type-assertion)Quality gates
yarn lint:oxlint packages/tron-wallet-snap— clean, 11 suppressions entries removed (0 left for these two files)tsc --noEmit— cleanvitest run— 63 files / 1052 tests passoxfmt --check— clean