Skip to content

Commit

Permalink
[4844] Add dataGasUsed and excessDataGas to Blockresult (#5586)
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel-Trintinalia <[email protected]>
  • Loading branch information
Gabriel-Trintinalia authored Jun 13, 2023
1 parent 49549da commit 67cf22e
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public class BlockResult implements JsonRpcResult {
private final String withdrawalsRoot;
private final List<WithdrawalParameter> withdrawals;

private final String dataGasUsed;
private final String excessDataGas;

public BlockResult(
final BlockHeader header,
final List<TransactionResult> transactions,
Expand Down Expand Up @@ -128,6 +131,10 @@ public BlockResult(
withdrawals
.map(w -> w.stream().map(WithdrawalParameter::fromWithdrawal).collect(toList()))
.orElse(null);

this.dataGasUsed =
header.getExcessDataGas().isPresent() ? Quantity.create(header.getDataGasUsed()) : null;
this.excessDataGas = header.getExcessDataGas().map(Quantity::create).orElse(null);
}

@JsonGetter(value = "number")
Expand Down Expand Up @@ -250,4 +257,14 @@ public String getWithdrawalsRoot() {
public List<WithdrawalParameter> getWithdrawals() {
return withdrawals;
}

@JsonGetter(value = "dataGasUsed")
public String getDataGasUsed() {
return dataGasUsed;
}

@JsonGetter(value = "excessDataGas")
public String getExcessDataGas() {
return excessDataGas;
}
}

0 comments on commit 67cf22e

Please sign in to comment.