Skip to content

Commit

Permalink
getProof encoding fix for 4249 (#4261)
Browse files Browse the repository at this point in the history
* getProof encoding fix for 4249

Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Aug 16, 2022
1 parent e0d4da2 commit 1807833
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
### Bug Fixes
- Fixes off-by-one error for mainnet TTD fallback [#4223](https://github.com/hyperledger/besu/pull/4223)
- Fix off-by-one error in AbstractRetryingPeerTask [#4254](https://github.com/hyperledger/besu/pull/4254)
- Fix encoding of key (short hex) in eth_getProof [#4261](https://github.com/hyperledger/besu/pull/4261)

## 22.7.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public StorageEntryProof(final UInt256 key, final UInt256 value, final List<Byte

@JsonGetter(value = "key")
public String getKey() {
return key.toDecimalString();
return key.toShortHexString();
}

@JsonGetter(value = "value")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ void getProof() {

assertThat(result).usingRecursiveComparison().isEqualTo(expectedResponse);
assertThat(result.getNonce()).isEqualTo("0xfffffffffffffffe");
assertThat(result.getStorageProof().size()).isGreaterThan(0);
assertThat(result.getStorageProof().get(0).getKey()).isEqualTo(storageKey.toShortHexString());
}

private JsonRpcRequestContext requestWithParams(final Object... params) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"key" : "0x347",
"value" : "0x0",
"proof" : [ ]
} ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"key" : "0x347",
"value" : "0x0",
"proof" : [ ]
} ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"key" : "0x347",
"value" : "0x0",
"proof" : [ ]
} ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"key" : "0x347",
"value" : "0x0",
"proof" : [ ]
} ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"key" : "0x347",
"value" : "0x0",
"proof" : [ ]
} ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"key" : "0x347",
"value" : "0x0",
"proof" : [ ]
} ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"nonce" : "0x0",
"storageHash" : "0xdd3fa56425f8195f314c22547243081293b3f5537cd98ed8f84d4fda3f9a515b",
"storageProof" : [ {
"key" : "839",
"key" : "0x347",
"value" : "0x0",
"proof" : [ "0xf8b18080a0c7f91ee5ea67d593275fcc773a02a5e5fb37b0625ca5c5cdc783483d43f2d7c280a06672614c102b0f02e747250bae452ed105110e25761c15a2a459afbd9eb8cf2e808080a0f671e05fab19f512b16fdcbc938f5fbbfbbc2fa67fecb575bb7721c221f71cf78080a0ba2fc36b0235d7ea299126bd4d404cb38456f32a6c236b422a3868f98c69eda1a0d77552655c7b63916586a73350b1933836f2378789613b548b90fa0a44125df180808080"]
} ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"nonce" : "0x0",
"storageHash" : "0xdd3fa56425f8195f314c22547243081293b3f5537cd98ed8f84d4fda3f9a515b",
"storageProof" : [ {
"key" : "839",
"key" : "0x347",
"value" : "0x0",
"proof" : [ "0xf8b18080a0c7f91ee5ea67d593275fcc773a02a5e5fb37b0625ca5c5cdc783483d43f2d7c280a06672614c102b0f02e747250bae452ed105110e25761c15a2a459afbd9eb8cf2e808080a0f671e05fab19f512b16fdcbc938f5fbbfbbc2fa67fecb575bb7721c221f71cf78080a0ba2fc36b0235d7ea299126bd4d404cb38456f32a6c236b422a3868f98c69eda1a0d77552655c7b63916586a73350b1933836f2378789613b548b90fa0a44125df180808080"]
} ]
Expand Down

0 comments on commit 1807833

Please sign in to comment.