Skip to content

Commit 5ff9d75

Browse files
committed
feat(rpc): add mixHash field to block dto with zero value
1 parent c26c2a8 commit 5ff9d75

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rskj-core/src/main/java/org/ethereum/rpc/dto/BlockResultDTO.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ public class BlockResultDTO {
6565
private final String paidFees;
6666
private final String cumulativeDifficulty;
6767
private final short[] rskPteEdges;
68+
private final String mixHash;
6869

6970
private BlockResultDTO(
7071
Long number,
7172
Keccak256 hash,
7273
Keccak256 parentHash,
74+
Keccak256 mixHash,
7375
byte[] sha3Uncles,
7476
byte[] logsBloom,
7577
byte[] transactionsRoot,
@@ -96,6 +98,7 @@ private BlockResultDTO(
9698
this.number = number != null ? HexUtils.toQuantityJsonHex(number) : null;
9799
this.hash = hash != null ? hash.toJsonString() : null;
98100
this.parentHash = parentHash.toJsonString();
101+
this.mixHash = mixHash != null ? mixHash.toJsonString() : null;
99102
this.sha3Uncles = HexUtils.toUnformattedJsonHex(sha3Uncles);
100103
this.logsBloom = logsBloom != null ? HexUtils.toUnformattedJsonHex(logsBloom) : null;
101104
this.transactionsRoot = HexUtils.toUnformattedJsonHex(transactionsRoot);
@@ -160,6 +163,7 @@ public static BlockResultDTO fromBlock(Block b, boolean fullTx, BlockStore block
160163
isPending ? null : b.getNumber(),
161164
isPending ? null : b.getHash(),
162165
b.getParentHash(),
166+
Keccak256.ZERO_HASH,
163167
b.getUnclesHash(),
164168
isPending ? null : b.getLogBloom(),
165169
transactionsRoot,
@@ -299,4 +303,8 @@ public String getPaidFees() {
299303
public short[] getRskPteEdges() {
300304
return rskPteEdges;
301305
}
302-
}
306+
307+
public String getMixHash() {
308+
return mixHash;
309+
}
310+
}

0 commit comments

Comments
 (0)