Skip to content

Commit

Permalink
feat(rpc): add mixHash field to block dto with zero value
Browse files Browse the repository at this point in the history
  • Loading branch information
Vovchyk committed Dec 27, 2024
1 parent 87bde23 commit 632fe0e
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ public class BlockResultDTO {
private final String paidFees;
private final String cumulativeDifficulty;
private final short[] rskPteEdges;
private final String mixHash;

private BlockResultDTO(
Long number,
Keccak256 hash,
Keccak256 parentHash,
Keccak256 mixHash,
byte[] sha3Uncles,
byte[] logsBloom,
byte[] transactionsRoot,
Expand All @@ -96,6 +98,7 @@ private BlockResultDTO(
this.number = number != null ? HexUtils.toQuantityJsonHex(number) : null;
this.hash = hash != null ? hash.toJsonString() : null;
this.parentHash = parentHash.toJsonString();
this.mixHash = mixHash != null ? mixHash.toJsonString() : null;
this.sha3Uncles = HexUtils.toUnformattedJsonHex(sha3Uncles);
this.logsBloom = logsBloom != null ? HexUtils.toUnformattedJsonHex(logsBloom) : null;
this.transactionsRoot = HexUtils.toUnformattedJsonHex(transactionsRoot);
Expand Down Expand Up @@ -160,6 +163,7 @@ public static BlockResultDTO fromBlock(Block b, boolean fullTx, BlockStore block
isPending ? null : b.getNumber(),
isPending ? null : b.getHash(),
b.getParentHash(),
Keccak256.ZERO_HASH,
b.getUnclesHash(),
isPending ? null : b.getLogBloom(),
transactionsRoot,
Expand Down Expand Up @@ -299,4 +303,8 @@ public String getPaidFees() {
public short[] getRskPteEdges() {
return rskPteEdges;
}
}

public String getMixHash() {
return mixHash;
}
}

0 comments on commit 632fe0e

Please sign in to comment.