Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

thenswan
Copy link
Contributor

@thenswan thenswan commented Jan 5, 2024

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

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

… for AccountBalanceQuery

Signed-off-by: Nikita Lebedev <[email protected]>
…elper` to new mirror node related classes

Signed-off-by: Nikita Lebedev <[email protected]>
…fo-mirror-node-queries

# Conflicts:
#	sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfoQuery.java
#	sdk/src/main/java/com/hedera/hashgraph/sdk/ContractInfoQuery.java
Signed-off-by: Nikita Lebedev <[email protected]>
Signed-off-by: Nikita Lebedev <[email protected]>
…SyncTimeout() work as intended (not depend on local node)

Signed-off-by: Nikita Lebedev <[email protected]>
…est#testExecuteSyncTimeout()

Signed-off-by: Nikita Lebedev <[email protected]>
Signed-off-by: Nikita Lebedev <[email protected]>
Signed-off-by: Nikita Lebedev <[email protected]>
Signed-off-by: Nikita Lebedev <[email protected]>
Signed-off-by: Nikita Lebedev <[email protected]>
Signed-off-by: Nikita Lebedev <[email protected]>
Signed-off-by: Nikita Lebedev <[email protected]>
@thenswan thenswan changed the title feat: Add Account Balance/Info, Contract Info Mirror Node Queries feat: solution to query the mirror node for the account balance, account info, and contract info data Mar 21, 2024
@thenswan thenswan marked this pull request as ready for review March 21, 2024 08:53
@thenswan thenswan requested a review from 0xivanov March 21, 2024 08:53
Copy link

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

Copy link

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

Copy link
Contributor

@0xivanov 0xivanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@agadzhalov agadzhalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thenswan thenswan merged commit 8243cf6 into main May 23, 2024
6 of 7 checks passed
@thenswan thenswan deleted the 01697-add-account-balanceinfo-contract-info-mirror-node-queries branch May 23, 2024 13:43
thenswan added a commit that referenced this pull request Jun 10, 2024
…ce, account info, and contract info data (#1698)"

(leave some useful chores which not really related to the feat)
This reverts commit 8243cf6

Signed-off-by: Nikita Lebedev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Account Balance/Info, Contract Info Mirror Node Queries
3 participants