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

Update eth_getBlock* to add base fee in the response. #841

Merged
merged 1 commit into from
May 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update eth_getBlock* to add base fee in the response.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
  • Loading branch information
AbdelStark committed May 5, 2020
commit b059a0f62424af95cedee2f2e11016e8b972bcb7
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"difficulty",
"totalDifficulty",
"extraData",
"baseFee",
"size",
"gasLimit",
"gasUsed",
Expand All @@ -61,6 +62,7 @@ public class BlockResult implements JsonRpcResult {
private final String difficulty;
private final String totalDifficulty;
private final String extraData;
private final String baseFee;
private final String size;
private final String gasLimit;
private final String gasUsed;
Expand Down Expand Up @@ -98,6 +100,7 @@ public <T extends TransactionResult> BlockResult(
this.difficulty = Quantity.create(header.getDifficulty());
this.totalDifficulty = Quantity.create(totalDifficulty);
this.extraData = header.getExtraData().toString();
this.baseFee = header.getBaseFee().map(Quantity::create).orElse(null);
this.size = Quantity.create(size);
this.gasLimit = Quantity.create(header.getGasLimit());
this.gasUsed = Quantity.create(header.getGasUsed());
Expand Down Expand Up @@ -172,6 +175,11 @@ public String getExtraData() {
return extraData;
}

@JsonGetter(value = "baseFee")
public String getBaseFee() {
return baseFee;
}

@JsonGetter(value = "size")
public String getSize() {
return size;
Expand Down