Skip to content

Commit

Permalink
fix(rpc): validator_updates in block results might be explicit null
Browse files Browse the repository at this point in the history
  • Loading branch information
xoac committed May 22, 2023
1 parent bdef988 commit 156a3a0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `[tendermint-rpc]` - `validator_updates` in block results might be explicit null.
4 changes: 2 additions & 2 deletions rpc/src/endpoint/block_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct Response {
pub end_block_events: Option<Vec<abci::Event>>,

/// Validator updates (might be explicit null)
pub validator_updates: Vec<validator::Update>,
pub validator_updates: Option<Vec<validator::Update>>,

/// New consensus params (might be explicit null)
pub consensus_param_updates: Option<consensus::Params>,
Expand Down Expand Up @@ -104,7 +104,7 @@ where
end_block_events: msg
.end_block_events
.map(|v| v.into_iter().map(Into::into).collect()),
validator_updates: msg.validator_updates,
validator_updates: Some(msg.validator_updates),
consensus_param_updates: msg.consensus_param_updates,
}
}
Expand Down
2 changes: 1 addition & 1 deletion rpc/tests/kvstore_fixtures/v0_34.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ fn incoming_fixtures() {
assert!(result.end_block_events.is_none());
assert_eq!(result.height.value(), 10);
assert!(result.txs_results.is_none());
assert!(result.validator_updates.is_empty());
assert!(result.validator_updates.unwrap().is_empty());
},
"block_by_hash" => {
let result = endpoint::block_by_hash::Response::from_string(content).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion rpc/tests/kvstore_fixtures/v0_37.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ fn incoming_fixtures() {
assert!(result.end_block_events.is_none());
assert_eq!(result.height.value(), 10);
assert!(result.txs_results.is_none());
assert!(result.validator_updates.is_empty());
assert!(result.validator_updates.unwrap().is_empty());
},
"block_by_hash" => {
let result = endpoint::block_by_hash::Response::from_string(content).unwrap();
Expand Down

0 comments on commit 156a3a0

Please sign in to comment.