hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
315 stars 138 forks source link

chore: replace `Platform.getAddressBook()` with `Platform.getRoster()` #16722

Closed edward-swirldslabs closed 4 days ago

edward-swirldslabs commented 4 days ago

Description: As part of the platform refactor to replace usage of AddressBook with Roster, this PR replaces the use of Platform.getAddressBook() with Platform.getRoster(). The impacted code is updated with equivalent usage for rosters.

Related issue(s):

Fixes #16717

codacy-production[bot] commented 4 days ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.01% (target: -1.00%) :white_check_mark: 7.69%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (82638c19ab5c02ee3b0a359e70ac828c7f46b140) | 97253 | 63426 | 65.22% | | | Head commit (a33355e785fa14544196ede643c58611d8fee934) | 97244 (-9) | 63429 (+3) | 65.23% (**+0.01%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#16722) | 26 | 2 | **7.69%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

codecov[bot] commented 4 days ago

Codecov Report

Attention: Patch coverage is 7.69231% with 24 lines in your changes missing coverage. Please review.

Project coverage is 63.51%. Comparing base (82638c1) to head (a33355e). Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
...latform/state/address/AddressBookNetworkUtils.java 0.00% 12 Missing :warning:
...swirlds/platform/gui/internal/WinTabAddresses.java 0.00% 8 Missing :warning:
...main/java/com/swirlds/platform/gui/SwirldsGui.java 0.00% 3 Missing :warning:
...-app/src/main/java/com/hedera/node/app/Hedera.java 50.00% 1 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722/graphs/tree.svg?width=650&height=150&src=pr&token=ZPMV8C93DV&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph)](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) ```diff @@ Coverage Diff @@ ## develop #16722 +/- ## ============================================= + Coverage 63.50% 63.51% +0.01% - Complexity 20295 20300 +5 ============================================= Files 2544 2544 Lines 94488 94479 -9 Branches 9868 9868 ============================================= + Hits 60004 60010 +6 + Misses 30873 30861 -12 + Partials 3611 3608 -3 ``` | [Files with missing lines](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | Coverage Δ | | |---|---|---| | [...a/com/hedera/node/app/platform/PlatformModule.java](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?src=pr&el=tree&filepath=hedera-node%2Fhedera-app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fhedera%2Fnode%2Fapp%2Fplatform%2FPlatformModule.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-aGVkZXJhLW5vZGUvaGVkZXJhLWFwcC9zcmMvbWFpbi9qYXZhL2NvbS9oZWRlcmEvbm9kZS9hcHAvcGxhdGZvcm0vUGxhdGZvcm1Nb2R1bGUuamF2YQ==) | `100.00% <100.00%> (ø)` | | | [...ain/java/com/swirlds/platform/SwirldsPlatform.java](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?src=pr&el=tree&filepath=platform-sdk%2Fswirlds-platform-core%2Fsrc%2Fmain%2Fjava%2Fcom%2Fswirlds%2Fplatform%2FSwirldsPlatform.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGxhdGZvcm0tc2RrL3N3aXJsZHMtcGxhdGZvcm0tY29yZS9zcmMvbWFpbi9qYXZhL2NvbS9zd2lybGRzL3BsYXRmb3JtL1N3aXJsZHNQbGF0Zm9ybS5qYXZh) | `0.64% <ø> (+<0.01%)` | :arrow_up: | | [...s/platform/recovery/internal/RecoveryPlatform.java](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?src=pr&el=tree&filepath=platform-sdk%2Fswirlds-platform-core%2Fsrc%2Fmain%2Fjava%2Fcom%2Fswirlds%2Fplatform%2Frecovery%2Finternal%2FRecoveryPlatform.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGxhdGZvcm0tc2RrL3N3aXJsZHMtcGxhdGZvcm0tY29yZS9zcmMvbWFpbi9qYXZhL2NvbS9zd2lybGRzL3BsYXRmb3JtL3JlY292ZXJ5L2ludGVybmFsL1JlY292ZXJ5UGxhdGZvcm0uamF2YQ==) | `0.00% <ø> (ø)` | | | [...-app/src/main/java/com/hedera/node/app/Hedera.java](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?src=pr&el=tree&filepath=hedera-node%2Fhedera-app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fhedera%2Fnode%2Fapp%2FHedera.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-aGVkZXJhLW5vZGUvaGVkZXJhLWFwcC9zcmMvbWFpbi9qYXZhL2NvbS9oZWRlcmEvbm9kZS9hcHAvSGVkZXJhLmphdmE=) | `56.70% <50.00%> (-0.13%)` | :arrow_down: | | [...main/java/com/swirlds/platform/gui/SwirldsGui.java](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?src=pr&el=tree&filepath=platform-sdk%2Fswirlds-platform-core%2Fsrc%2Fmain%2Fjava%2Fcom%2Fswirlds%2Fplatform%2Fgui%2FSwirldsGui.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGxhdGZvcm0tc2RrL3N3aXJsZHMtcGxhdGZvcm0tY29yZS9zcmMvbWFpbi9qYXZhL2NvbS9zd2lybGRzL3BsYXRmb3JtL2d1aS9Td2lybGRzR3VpLmphdmE=) | `0.00% <0.00%> (ø)` | | | [...swirlds/platform/gui/internal/WinTabAddresses.java](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?src=pr&el=tree&filepath=platform-sdk%2Fswirlds-platform-core%2Fsrc%2Fmain%2Fjava%2Fcom%2Fswirlds%2Fplatform%2Fgui%2Finternal%2FWinTabAddresses.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGxhdGZvcm0tc2RrL3N3aXJsZHMtcGxhdGZvcm0tY29yZS9zcmMvbWFpbi9qYXZhL2NvbS9zd2lybGRzL3BsYXRmb3JtL2d1aS9pbnRlcm5hbC9XaW5UYWJBZGRyZXNzZXMuamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...latform/state/address/AddressBookNetworkUtils.java](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?src=pr&el=tree&filepath=platform-sdk%2Fswirlds-platform-core%2Fsrc%2Fmain%2Fjava%2Fcom%2Fswirlds%2Fplatform%2Fstate%2Faddress%2FAddressBookNetworkUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGxhdGZvcm0tc2RrL3N3aXJsZHMtcGxhdGZvcm0tY29yZS9zcmMvbWFpbi9qYXZhL2NvbS9zd2lybGRzL3BsYXRmb3JtL3N0YXRlL2FkZHJlc3MvQWRkcmVzc0Jvb2tOZXR3b3JrVXRpbHMuamF2YQ==) | `31.57% <0.00%> (-11.28%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) [![Impacted file tree graph](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722/graphs/tree.svg?width=650&height=150&src=pr&token=ZPMV8C93DV&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph)](https://app.codecov.io/gh/hashgraph/hedera-services/pull/16722?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph)

🚨 Try these New Features: