hashgraph / hedera-mirror-node-explorer

Hedera Mirror Node Explorer for the Hedera Hashgraph DLT.
Apache License 2.0
14 stars 9 forks source link

chore: name service refactoring #1071

Closed ericleponner closed 1 month ago

ericleponner commented 1 month ago

Description:

Changes below refactor name service part of explorer. Goal is twofold: 1) make addition of a new name service easier 2) ease further work on name display (see #972).

Changes summary: 1) new abstract NameServiceProvider is introduced with two implementations KNSProvider and HNSProvider. 2) NameService class singleton is now the interface used by the rest of explorer code 3) SearchRequest class now delegates name resolution to NameService.resolve() 4) NameService has its own unit test

Checklist

github-actions[bot] commented 1 month ago

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 82.78% 39044 / 47161
🔵 Statements 82.78% 39044 / 47161
🔵 Functions 62.91% 884 / 1405
🔵 Branches 84.13% 4072 / 4840
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/utils/RouteManager.ts 74.8% 97.01% 68.42% 74.8% 62, 84-87, 157-166, 169-178, 196-197, 215-224, 231-234, 237-238, 259-268, 271-275, 285-294, 297-306, 317-326, 337-346, 357-366, 377-386, 393-398, 401-402, 413-414, 453-454
src/utils/SearchRequest.ts 92.02% 79.72% 100% 92.02% 122-128, 140-141, 162-165, 194-196, 202-203, 223-224, 306-309, 341-342, 347-348
src/utils/name_service/NameService.ts 97.93% 94.11% 100% 97.93% 55-56
src/utils/name_service/provider/AllProviders.ts 100% 100% 100% 100%
src/utils/name_service/provider/HNSProvider.ts 89.15% 44.44% 100% 89.15% 46-48, 63-64, 66-67, 78-79
src/utils/name_service/provider/KNSProvider.ts 90.9% 44.44% 100% 90.9% 46, 51-52, 55-56, 73-74
src/utils/name_service/provider/NameServiceProvider.ts 100% 100% 100% 100%
Generated in workflow #927
sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud