-
Notifications
You must be signed in to change notification settings - Fork 117
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
base: main
Are you sure you want to change the base?
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
String hexData = Hex.toHexString(data); | ||
return String.format(""" | ||
{ | ||
"data": "%s", |
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.
Also missing from
Note from
is also optional in the case we're simulating a contract create flow in which the data contains contract bytecode
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.
Added.
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]>
.execute(testEnv.client); | ||
|
||
var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); | ||
|
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.
Write a comment why we do this
@@ -40,7 +42,7 @@ | |||
/** | |||
* Utility class used internally by the sdk. | |||
*/ | |||
class EntityIdHelper { | |||
public class EntityIdHelper { |
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.
note:
Made this class public in order to access it from the tests, changed most public methods to package private
Description:
A new
MirrorNodeContractQuery
is added to support EVM gas estimation and simulation. The inputs should match that ofContractExecuteTransaction
as devs will be looking to calculate the cost of a follow up transaction.This query issues an
api/v1/contracts/call
to the mirror node web3 module that support estimate and simulation of state changing transactions.Related issue(s):
Fixes #2076
Notes for reviewer:
Checklist