diff --git a/CHANGELOG.md b/CHANGELOG.md index b9b0b1f2e65..4ac21768f6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Support for `nodes-whitelist` and `accounts-whitelist` will be removed in a futu - Add `perm_getAccountsAllowlist` as an alternative equivalent to `perm_getAccountsWhitelist` - Add `perm_addAccountsToAllowlist` as an alternative equivalent to `perm_addAccountsToWhitelist` - Add `perm_removeAccountsFromAllowlist` as an alternative equivalent to `perm_removeAccountsFromWhitelist` +- Add missing `mixHash` field for `eth_getBlockBy*` JSON RPC endpoints ## 1.4.6 diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResult.java index 6306b81cf33..5bf2705069b 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResult.java @@ -28,6 +28,7 @@ @JsonPropertyOrder({ "number", "hash", + "mixHash", "parentHash", "nonce", "sha3Uncles", @@ -51,6 +52,7 @@ public class BlockResult implements JsonRpcResult { private final String number; private final String hash; + private final String mixHash; private final String parentHash; private final String nonce; private final String sha3Uncles; @@ -89,6 +91,7 @@ public BlockResult( final boolean includeCoinbase) { this.number = Quantity.create(header.getNumber()); this.hash = header.getHash().toString(); + this.mixHash = header.getMixHash().toString(); this.parentHash = header.getParentHash().toString(); this.nonce = Quantity.longToPaddedHex(header.getNonce(), 8); this.sha3Uncles = header.getOmmersHash().toString(); @@ -120,6 +123,11 @@ public String getHash() { return hash; } + @JsonGetter(value = "mixHash") + public String getMixHash() { + return mixHash; + } + @JsonGetter(value = "parentHash") public String getParentHash() { return parentHash; diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockByNumber_complete.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockByNumber_complete.json index 081d750ac51..8f8da4ace03 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockByNumber_complete.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockByNumber_complete.json @@ -14,6 +14,7 @@ "result": { "number": "0x10", "hash": "0x1878c6f27178250f3d55186a2887b076936599f307d96dabcf331b2ff0a38f0c", + "mixHash": "0xa358a5b5e5faed469d9603e454ace5764cc6da652f22eed5318b40982973d822", "parentHash": "0x9dcd5e20cc30e48e3635ac3a1c398c2f45ee818fcbc232110878ddf0e936e7ea", "nonce": "0xdfc50ac1134d764f", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockByNumber_hashes.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockByNumber_hashes.json index 63ad083507a..204e0ecbc72 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockByNumber_hashes.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockByNumber_hashes.json @@ -14,6 +14,7 @@ "result": { "number": "0x10", "hash": "0x1878c6f27178250f3d55186a2887b076936599f307d96dabcf331b2ff0a38f0c", + "mixHash": "0xa358a5b5e5faed469d9603e454ace5764cc6da652f22eed5318b40982973d822", "parentHash": "0x9dcd5e20cc30e48e3635ac3a1c398c2f45ee818fcbc232110878ddf0e936e7ea", "nonce": "0xdfc50ac1134d764f", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",