test(packages): cover utils + wallet pure-Dart surface (+38 tests)#324
Merged
Conversation
Adds 38 unit tests across six previously-untested files in `lib/packages/utils/` and `lib/packages/wallet/`. Each spec lives in the mirror path under `test/` per the project convention. - fast_hash: FNV-1a determinism, distinct inputs differ, ordering matters, unicode safety, empty-string offset basis - jwt_decoder: well-formed payload parsing, segment-count errors, non-map payload rejection, all three valid base64url padding lengths, illegal length-mod-4 rejection - payment_uri: empty-amount short form, dotted and comma-locale amounts, preservation of decimal precision - wallet_account: BIP-44 derivation path format, deterministic Hardhat account #0 address, distinct indices, signMessage shape + determinism + sensitivity to addressIndex - wallet: SoftwareWallet walletType + primary/current account identity + selectAccount semantics + id/name mutability; DebugWallet sign refusal - eip7702_signer: hardware-credential refusal, software-credential signing, signature determinism, nonce-sensitivity No production code changed. All tests pass locally on Flutter 3.38.5 with the project's pinned web3dart fork.
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
Adds 38 unit tests across six previously-untested files in
lib/packages/utils/andlib/packages/wallet/. Each spec lives in the mirror path undertest/per the project convention.lib/packages/utils/fast_hash.darttest/packages/utils/fast_hash_test.dartlib/packages/utils/jwt_decoder.darttest/packages/utils/jwt_decoder_test.dartlib/packages/wallet/payment_uri.darttest/packages/wallet/payment_uri_test.dartlib/packages/wallet/wallet_account.darttest/packages/wallet/wallet_account_test.dartlib/packages/wallet/wallet.darttest/packages/wallet/wallet_test.dartlib/packages/wallet/eip7702_signer.darttest/packages/wallet/eip7702_signer_test.dartWhat each file covers
SoftwareWalletwalletType + primary/current account identity +selectAccountsemantics + id/name mutability;DebugWalletsign refusal.Why
Stage 2 of the coverage push tracked in the README features matrix (#322). These six files are pure-Dart with no platform dependencies, so they were the cheapest meaningful coverage win available — no service mocks, no widget rendering, no merge-conflict risk with the three in-flight test PRs (#319, #320, #321).
Test plan
flutter analyzeclean on all six new test files (locally on Flutter 3.38.5)flutter test test/packages/utils/ test/packages/wallet/— 38 / 38 passing