-
Notifications
You must be signed in to change notification settings - Fork 119
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: Implement MirrorNodeContractQuery
#2073
Conversation
Signed-off-by: Ivan Ivanov <[email protected]>
Signed-off-by: Ivan Ivanov <[email protected]>
Signed-off-by: Ivan Ivanov <[email protected]>
Signed-off-by: Ivan Ivanov <[email protected]>
MirrorNodeContractQuery
MirrorNodeContractQuery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start.
Missing some fields.
Also you might be able to leverage some Mirror Node web3 module tests as references of example calls.
@kselveliev should be able to help
sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractQuery.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ivan Ivanov <[email protected]>
Signed-off-by: Ivan Ivanov <[email protected]>
Signed-off-by: Ivan Ivanov <[email protected]>
Signed-off-by: Ivan Ivanov <[email protected]>
Signed-off-by: Ivan Ivanov <[email protected]>
sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractQuery.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ivan Ivanov <[email protected]>
...n/java/com/hedera/hashgraph/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approval applies to gradle/plugins/src/main/kotlin/com.hedera.gradle.java.gradle.kts
Signed-off-by: Ivan Ivanov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2073 +/- ##
============================================
+ Coverage 82.20% 83.14% +0.94%
- Complexity 3588 4029 +441
============================================
Files 186 202 +16
Lines 11697 12820 +1123
Branches 1150 1266 +116
============================================
+ Hits 9615 10659 +1044
- Misses 1604 1701 +97
+ Partials 478 460 -18 ☔ View full report in Codecov by Sentry. |
sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractQuery.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ivan Ivanov <[email protected]>
Signed-off-by: Ivan Ivanov <[email protected]>
examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ivan Ivanov <[email protected]>
Hey @Nana-EC @SimiHunjan can you please take a look at the updated version of the queries? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, some comments
examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java
Show resolved
Hide resolved
Signed-off-by: Ivan Ivanov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applies to files owned by us: gradle/plugins/src/main/kotlin/com.hedera.gradle.java.gradle.kts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, left some details on the examples section
examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java
Show resolved
Hide resolved
examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java
Show resolved
Hide resolved
Signed-off-by: Ivan Ivanov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, thanks
Signed-off-by: Ivan Ivanov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-approving:
applies to files owned by us: gradle/plugins/src/main/kotlin/com.hedera.gradle.java.gradle.kts
Description:
A new
MirrorNodeContractQuery
class has been introduced to support EVM gas estimation and simulation. This query class provides two distinct types of queries:MirrorNodeContractCallQuery
– Executes a contract call and returns the result, simulating the execution of the contract.MirrorNodeContractEstimateGasQuery
– Estimates the gas usage for a contract call, allowing developers to understand the cost of executing a transaction.The inputs for these queries match those of
ContractExecuteTransaction
, making it easy for developers to calculate the cost of a follow-up transaction.The
MirrorNodeContractQuery
issues an HTTP request to theapi/v1/contracts/call
endpoint of the Mirror Node Web3 module, which supports both gas estimation and transient simulation of state-changing transactions. This enables accurate cost predictions and helps developers optimize their contract interactions before executing them on the network.Related issue(s):
Fixes #2076
Notes for reviewer:
Checklist