Skip to content

Commit

Permalink
Update eth_getBlock* to add base fee in the response. (#841)
Browse files Browse the repository at this point in the history
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
  • Loading branch information
AbdelStark authored May 5, 2020
1 parent 31489b5 commit 7ceeecc
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 7ceeecc

Please sign in to comment.