hedera-sdk-java
hedera-sdk-java copied to clipboard
feat: solution to query the mirror node for the account balance, account info, and contract info data
Description: This PR adds a solution to query the mirror node for the account balance, account info, and contract info data.
Related issue(s): Fixes #1697
Notes for reviewer:
- What’s changed
- Introduced
MirrorNodeRouter,MirrorNodeGatewayandMirrorNodeServiceto interact with the Mirror Node via REST API. - Added new queries to the mirror node related to HIP-367.
- Refactored old queries to the mirror node related to populating account num, account EVM address, etc.
- Updated
AccountBalanceQuery,AccountInfoQueryandContractInfoQueryto fetch some data from the mirror node (per HIP-367). - Added
wiremockdependency for unit tests.MockingTestrelies on updated queries, so there is a need to mock the REST API as well. - Added
Thread#sleep()to integration tests and examples (to wait until the mirror node updates with the new data). This will increase the time for CI checks. - Updated
ClientTestto make it work as intended (not rely on the local node).
- Introduced
- Other points
- Added
LOCAL_NODE_PORTstatic variable to theMirrorNodeRouterspecifically forMockingTest. Since we now have interaction with the mirror node via the REST API (previously we only had interactions via gRPC), there is a need to add an SDK API to configure it to step over this temporary solution. - Address points from the sonarcloud?
- Added
Checklist
- [x] Documented (Code comments, README, etc.)
- [x] Tested (unit, integration, etc.)
Quality Gate failed
Failed conditions
C Reliability Rating on New Code (required ≥ A)
See analysis details on SonarCloud
Catch issues before they fail your Quality Gate with our IDE extension
SonarLint
Quality Gate failed
Failed conditions
C Reliability Rating on New Code (required ≥ A)
See analysis details on SonarCloud
Catch issues before they fail your Quality Gate with our IDE extension
SonarLint