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

feature: add getheader method. #502

Merged

Conversation

halibobo1205
Copy link
Contributor

No description provided.

@halibobo1205 halibobo1205 force-pushed the feat/add_header_query branch 2 times, most recently from 1acecb2 to 4777991 Compare July 27, 2022 03:08
@halibobo1205 halibobo1205 changed the base branch from develop to release_4.4.2 July 27, 2022 03:10
boolean detail = false;
if (parameters == null || parameters.length == 0) {
// query current header
System.out.println("Get current header !!!");
Copy link
Contributor

@waynercheung waynercheung Jul 28, 2022

Choose a reason for hiding this comment

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

if no parameters, it should remind how to use the command and then return.
such as "GetBlockByIdOrNum needs 2 parameters like following: "
...

@@ -1083,4 +1083,23 @@ public Optional<MarketOrder> getMarketOrderById(byte[] order) {
return Optional.ofNullable(orderPair);
}

public Optional<BlockExtention> getBlock(String idOrNum, boolean detail) {
Copy link
Contributor

Choose a reason for hiding this comment

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

use BlockExtention instead of BlockExtention

idOrNum = parameters[0];
}
} else {
idOrNum = parameters[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

we should check if the input blocknum is negative

@halibobo1205 halibobo1205 merged commit 3c35352 into tronprotocol:release_4.4.2 Jul 28, 2022
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.

3 participants