hiero-ledger / hiero-ledger/hiero-consensus-node
Improve TokenService (Crypto Service as well) Code Coverage
- Dominant language
- Java
- Stars
- 407
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
Add more unit tests to improve code coverage to each class in Token Service
1. Checked box without issue indicates False negative for coverage where codacy reports 0% coverage but test exists.
2. Checked box with Issue indicates the associated issue has been addressed.
3. List items in bold represent classes falling below 80% coverage and targeted for improvement
----------------------------------------------------------
**API**
- [x] TokenServiceApiImpl [-]
- [x] TokenServiceApiProvider [100 %]
- [x] #13110
----------------------------------------------------------
**CODEC**
- [ ] TokenComparators [83.33 %]
----------------------------------------------------------
**COMPARATOR**
- [x] #13153
----------------------------------------------------------
**STAKING HANDLERS**
- [ ] EndOfStakingPeriodUtils [97.98 %]
- [ ] StakeIdChangeType [70.59 %]
- [ ] StakeInfoHelper [96.77 %]
- [x] StakePeriodManager [100 %]
- [x] #13111
- [x] #13340
- [ ] StakingRewardsDistributor [95.00 %]
- [x] StakingRewardsHandler [100 %]
- [ ] StakingRewardsHandlerImpl [87.98 %]
- [x] #13202
- [x] #13112
----------------------------------------------------------
**CUSTOM FEES HANDLERS**
- [ ] AdjustmentUtils [89.55 %]
- [ ] AssessmentResult [97.67 %]
- [x] #13214
- [x] #13141
- [x] CustomFeeMeta [100 %]
- [x] #13212
- [x] #13213
- [x] #13163
- [ ] AdjustFungibleTokenChangesStep [84.34 %]
----------------------------------------------------------
**TRANSFER HANDLERS**
- [ ] AdjustHbarChangesStep [92.19 %]
- [x] #16926
- [x] AutoAccountCreator [100 %]
- [ ] #13162
- [ ] EnsureAliasesStep [95.29 %]
- [ ] NFTOwnersChangeStep [91.06 %]
- [ ] ReplaceAliasesWithIDsInOp [92.86 %]
- [ ] **TransferContext [72.56 %]**
- [x] #17502
- [x] TransferStep [100 %]
----------------------------------------------------------
**HANDLERS**
- [x] #13146
- [x] BaseTokenHandler [100%]
- [ ] **CryptoAddLiveHashHandler [71.43 %]** – #13187
- [ ] **CryptoApproveAllowanceHandler [76.83 %]** – #13187
- [x] #13234
- [x] #16833
- [x] #16831
- [ ] CryptoDeleteLiveHashHandler [83.33 %]
- [x] CryptoGetAccountBalanceHandler [100 %]
- [ ] CryptoGetAccountInfoHandler [91.94 %]
- [x] #17410
- [x] CryptoGetLiveHashHandler [100 %]
- [x] CryptoGetStakersHandler [100 %]
- [ ] **CryptoTransferHandler [57.94 %]** #13166
- [ ] **CryptoUpdateHandler [65.41 %]** #13166
- [x] FinalizeChildRecordHandler [100 %]
- [x] #16931
- [ ] TokenAccountWipeHandler [84.16 %]
- [ ] TokenAssociateToAccountHandler [82.46 %]
- [ ] TokenBurnHandler [85.71 %]
- [ ] TokenCreateHandler [86.52 %]
- [ ] TokenDeleteHandler [83.33 %]
- [ ] TokenDissociateFromAccountHandler [82.73 %]
- [ ] **TokenFeeScheduleUpdateHandler** #13166
- [ ] TokenFreezeAccountHandler [89.13 %]
- [x] TokenGetAccountNftInfosHandler [100 %]
- [ ] TokenGetInfoHandler [91.95 %]
- [ ] TokenGetNftInfoHandler [88.33 %]
- [x] TokenGetNftInfosHandler [100 %]
- [ ] TokenGrantKycToAccountHandler [89.74 %]
- [x] #13160
- [x] TokenMintHandler [100 %]
- [x] #13355
- [ ] TokenRevokeKycFromAccountHandler [90.24 %]
- [ ] TokenUnfreezeAccountHandler [89.13 %]
- [x] #13356
- [ ] TokenUpdateHandler [94.06 %]
- [ ] TokenUpdateNftsHandler [82 %]
----------------------------------------------------------
**SCHEMAS**
- [x] #13509
- [ ] SyntheticRecordsGenerator [94.6 %]
----------------------------------------------------------
**SERDES**
- [ ] EntityNumCodec [90 %]
----------------------------------------------------------
**UTIL**
- [ ] TokenHandlerHelper [93.75 %]
- [ ] TokenKey [96.3 %]
- [ ] TokenRelListCalculator [97.37 %]
----------------------------------------------------------
**VALIDATORS**
- [ ] AllowanceValidator [96.88 %]
- [x] ApproveAllowanceValidator [100 %]
- [ ] CryptoCreateValidator [83.33 %]
- [ ] CryptoTransferValidator [96.43 %]
- [ ] CustomFeesValidator [98.32 %]
- [ ] DeleteAllowanceValidator [97.3 %]
- [ ] StakingValidator [90.91 %]
- [x] TokenAttributesValidator [100 %]
- [x] TokenCreateValidator [100 %]
- [ ] **TokenListChecks [68 %]** – the only missing line is a private constructor...
- [x] TokenSupplyChangeOpsValidator [100 %]
- [x] TokenUpdateValidator [100 %]
----------------------------------------------------------
**BASE PACKAGE**
- [ ] BlocklistParser [95.65 %]
- [x] CryptoSignatureWaiversImpl [100 %]
- [ ] ReadableAccountStoreImpl [94.29 %]
- [x] ReadableNetworkStakingRewardsStoreImpl [100 %]
- [x] ReadableNftStoreImpl [100 %]
- [x] ReadableStakingInfoStoreImpl [100 %]
- [x] ReadableTokenRelationStoreImpl [100 %]
- [x] ReadableTokenStoreImpl [100 %]
- [ ] RecordFinalizerBase [80.16 %]
- [x] #13164
- [ ] **TokenServiceInjectionModule [0 %]**
- [ ] WritableAccountStore [90 %]
- [x] WritableNetworkStakingRewardsStore [100 %]
- [ ] WritableNftStore [96.15 %]
- [x] WritableStakingInfoStore [100 %]
- [x] WritableTokenRelationStore [100 %]
- [ ] WritableTokenStore [85 %]
----------------------------------------------------------
**hedera-token-service**
- [x] #13725
- [x] #13726
- [ ] Units [0 %]
- [x] #18528
Contributor guide
Research direction
Start by reviewing the unchecked classes listed across the Token Service and Crypto Service sections, then locate their existing unit tests and coverage reports. Add tests for the remaining uncovered behavior, prioritizing the bold classes and the classes reported at 0% coverage; done means the targeted classes have improved, verified coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, testing-qa
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100