Skip to content

Commit

Permalink
Specify default value for tendermint::block::Size (#931)
Browse files Browse the repository at this point in the history
* Specify default value for `tendermint::block::Size`

* Add .changelog entry

* Add test for `time_iota_ms` default (#933)

* Bump supported rpc-probe version of Tendermint to v0.34.9
* Regenerate kvstore fixtures using Tendermint v0.34.9
* Update kvstore tests to test #931
* Expose Size::default_time_iota_ms to access from integration test
* Implement test for #931

Co-authored-by: Thane Thomson <thane@informal.systems>
  • Loading branch information
romac and thanethomson authored Jul 16, 2021
1 parent 1a7c160 commit a93a215
Show file tree
Hide file tree
Showing 67 changed files with 337 additions and 325 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/930-newblock-event-parse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix bug where `NewBlock` events emitted by Tendermint could not be parsed because of a missing field ([#930](https://github.com/informalsystems/tendermint-rs/issues/930))

6 changes: 5 additions & 1 deletion rpc/tests/kvstore_fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,10 @@ fn incoming_fixtures() {
assert_eq!(result.genesis.validators[0].power(), 10);
assert!(result.genesis.validators[0].pub_key.ed25519().is_some());
assert_eq!(result.genesis.validators[0].proposer_priority.value(), 0);
assert_eq!(
result.genesis.consensus_params.block.time_iota_ms,
tendermint::block::Size::default_time_iota_ms(),
);
}
"net_info" => {
let result = endpoint::net_info::Response::from_string(content).unwrap();
Expand Down Expand Up @@ -703,7 +707,7 @@ fn incoming_fixtures() {
app: 1
}
);
assert_eq!(result.node_info.version.to_string(), "v0.34.0");
assert_eq!(result.node_info.version.to_string(), "v0.34.9");
assert!(!result.sync_info.catching_up);
assert_eq!(result.sync_info.latest_app_hash.value(), [0; 8]);
assert!(!result.sync_info.latest_block_hash.is_empty());
Expand Down
4 changes: 2 additions & 2 deletions rpc/tests/kvstore_fixtures/incoming/abci_info.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"id": "8a289a02-d7e4-45ed-a0db-97445ff3825a",
"id": "48e82c4a-4018-433e-9557-c40ac927676f",
"jsonrpc": "2.0",
"result": {
"response": {
"app_version": "1",
"data": "{\"size\":0}",
"last_block_app_hash": "AAAAAAAAAAA=",
"last_block_height": "14",
"last_block_height": "32",
"version": "0.17.0"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"id": "6e4d4855-631f-4cf9-b341-d6460eab88a3",
"id": "ae5b4026-3be4-46ea-876e-2177b74e79a7",
"jsonrpc": "2.0",
"result": {
"response": {
"code": 0,
"codespace": "",
"height": "26",
"height": "44",
"index": "0",
"info": "",
"key": "dHgw",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"id": "fbd10e8a-a975-4e47-8f9a-97646da4cb38",
"id": "a8a36384-95f9-481f-8fc5-4a820176e869",
"jsonrpc": "2.0",
"result": {
"response": {
"code": 0,
"codespace": "",
"height": "14",
"height": "32",
"index": "0",
"info": "",
"key": "bm9uX2V4aXN0ZW50X2tleQ==",
Expand Down
2 changes: 1 addition & 1 deletion rpc/tests/kvstore_fixtures/incoming/block_at_height_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"data": "height must be greater than 0, but got 0",
"message": "Internal error"
},
"id": "8becc1c0-0c44-4b0d-bb95-8f3ff2f9893e",
"id": "c0ba0ff6-0afd-4d18-bc15-0891696d42f2",
"jsonrpc": "2.0"
}
14 changes: 7 additions & 7 deletions rpc/tests/kvstore_fixtures/incoming/block_at_height_1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "5be87751-4f5a-4e31-b4db-91a2562a92ea",
"id": "0166b641-4967-4b3c-a36a-73ea4e5a737a",
"jsonrpc": "2.0",
"result": {
"block": {
Expand All @@ -25,10 +25,10 @@
},
"last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"next_validators_hash": "518FD4E4CCE99DB15463EA5EBAD3B2BEE1030C31D53065F2FD7C53F8A7BC3E7C",
"proposer_address": "ABAF73F9A1D15E78CA39C1E066E07D3F3B3BAFAF",
"time": "2020-12-21T07:05:55.8988413Z",
"validators_hash": "518FD4E4CCE99DB15463EA5EBAD3B2BEE1030C31D53065F2FD7C53F8A7BC3E7C",
"next_validators_hash": "ADFA3B40824D69EAD7828B9A78D16D80DFA93499D1DB0EC362916AE61182A64D",
"proposer_address": "ABA577531E6D6F4119E7E1E0EE1909B908A8346D",
"time": "2021-07-16T12:16:29.232984022Z",
"validators_hash": "ADFA3B40824D69EAD7828B9A78D16D80DFA93499D1DB0EC362916AE61182A64D",
"version": {
"app": "1",
"block": "11"
Expand All @@ -48,9 +48,9 @@
}
},
"block_id": {
"hash": "F313BFEE2921709CA1DACF5BB55367FE293194F9C5A9827970C88993D97D47DC",
"hash": "44C37753BF31FD4238227E19213F042699F62416D4E5422BBA59095FC4BEE039",
"parts": {
"hash": "693DBA913A007C963FBF674A99BC79B05A4C0A872E4F839B1B1FD2D7D1B588CD",
"hash": "13EEDAF51D61F7FF513FCD1B6387E0A3E306E49E5DCEA43CAFE77FB7B951DD4B",
"total": 1
}
}
Expand Down
30 changes: 15 additions & 15 deletions rpc/tests/kvstore_fixtures/incoming/block_at_height_10.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "9428b752-8b5a-4dc6-b751-0ab12e3bc4f6",
"id": "d01f0a06-172c-48b8-a9ce-5db74af08ad1",
"jsonrpc": "2.0",
"result": {
"block": {
Expand All @@ -17,28 +17,28 @@
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"height": "10",
"last_block_id": {
"hash": "904729E98E9468E2430B3691020ABDA34291EF7F95F15667C0F6EC957432C893",
"hash": "4AED585851DEE548A0143C8B41FA72FDA0597CA304807BEF06222D335EDD404D",
"parts": {
"hash": "6D2590541B2FDF59A60B062BB17AFA5AE0903211E33F632A17DB22C591889DFC",
"hash": "B2A89B0BAC1FEF0C15D3ED44105E75DB7F8DB42ECEA33E32B3B820AEDAB132BD",
"total": 1
}
},
"last_commit_hash": "68092239B80DAFDF43C01657159CA708A2BE923B7B14F8F7DD771CA51D596F7B",
"last_commit_hash": "515DAA8790FBC39D93EA23229826BA45205DAF178F8BD9A7D4835AA07C663C68",
"last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"next_validators_hash": "518FD4E4CCE99DB15463EA5EBAD3B2BEE1030C31D53065F2FD7C53F8A7BC3E7C",
"proposer_address": "ABAF73F9A1D15E78CA39C1E066E07D3F3B3BAFAF",
"time": "2020-12-21T07:06:00.5796845Z",
"validators_hash": "518FD4E4CCE99DB15463EA5EBAD3B2BEE1030C31D53065F2FD7C53F8A7BC3E7C",
"next_validators_hash": "ADFA3B40824D69EAD7828B9A78D16D80DFA93499D1DB0EC362916AE61182A64D",
"proposer_address": "ABA577531E6D6F4119E7E1E0EE1909B908A8346D",
"time": "2021-07-16T12:16:33.997760354Z",
"validators_hash": "ADFA3B40824D69EAD7828B9A78D16D80DFA93499D1DB0EC362916AE61182A64D",
"version": {
"app": "1",
"block": "11"
}
},
"last_commit": {
"block_id": {
"hash": "904729E98E9468E2430B3691020ABDA34291EF7F95F15667C0F6EC957432C893",
"hash": "4AED585851DEE548A0143C8B41FA72FDA0597CA304807BEF06222D335EDD404D",
"parts": {
"hash": "6D2590541B2FDF59A60B062BB17AFA5AE0903211E33F632A17DB22C591889DFC",
"hash": "B2A89B0BAC1FEF0C15D3ED44105E75DB7F8DB42ECEA33E32B3B820AEDAB132BD",
"total": 1
}
},
Expand All @@ -47,17 +47,17 @@
"signatures": [
{
"block_id_flag": 2,
"signature": "PcfqCfcTs9C+N9h/R6zC2xdu+C7fVCSWLxhEj7h0+tVe48fCxOP4HO51MV0iplHi7Og3dz6DMVXVyYQ27R+XAg==",
"timestamp": "2020-12-21T07:06:00.5796845Z",
"validator_address": "ABAF73F9A1D15E78CA39C1E066E07D3F3B3BAFAF"
"signature": "V0pC4gdCnBBhIoidoAPEuUWP9QTYtTc7EN5VZuXUdSDmYhM8NCcezy9+IxGXqAd7TUBV1aPT/SVv8KFH98u9Ag==",
"timestamp": "2021-07-16T12:16:33.997760354Z",
"validator_address": "ABA577531E6D6F4119E7E1E0EE1909B908A8346D"
}
]
}
},
"block_id": {
"hash": "84F558CDCCA7D7D7B26F4BB02862C0DA72607F74937C549AEB0ACFDEC599C877",
"hash": "223B6924AC98CE99678027C712954C565D4359507C3DECFF9D2D5B5A9E4231F6",
"parts": {
"hash": "B5647568016ECDEF740E897D95EEF5CD17A6E20221B7A58CEC7F3DFABA63C7C7",
"hash": "F2FC723B88EFD18C4599BDF9441AA962F19C146C8601ED0854973189D11816DE",
"total": 1
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "c8effc20-13ec-4724-b788-ac8994b21f5c",
"id": "421a030f-0b5d-4adb-bb17-537d11228040",
"jsonrpc": "2.0",
"result": {
"begin_block_events": null,
Expand Down
Loading

0 comments on commit a93a215

Please sign in to comment.