hedera-sdk-java icon indicating copy to clipboard operation
hedera-sdk-java copied to clipboard

feat: solution to query the mirror node for the account balance, account info, and contract info data

Open thenswan opened this issue 2 years ago • 2 comments

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, MirrorNodeGateway and MirrorNodeService to 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, AccountInfoQuery and ContractInfoQuery to fetch some data from the mirror node (per HIP-367).
    • Added wiremock dependency for unit tests. MockingTest relies 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 ClientTest to make it work as intended (not rely on the local node).
  • Other points
    • Added LOCAL_NODE_PORT static variable to the MirrorNodeRouter specifically for MockingTest. 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?

Checklist

  • [x] Documented (Code comments, README, etc.)
  • [x] Tested (unit, integration, etc.)

thenswan avatar Jan 05 '24 07:01 thenswan

Quality Gate Failed 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

sonarqubecloud[bot] avatar Mar 21 '24 09:03 sonarqubecloud[bot]

Quality Gate Failed 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

sonarqubecloud[bot] avatar Apr 22 '24 13:04 sonarqubecloud[bot]