Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc: Expose RPC request/response fields publicly #636

Merged
merged 2 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
- `[rpc]` The subscription client interface provides a structured `Query`
mechanism to help ensure compile-time validity of subscription queries.
See the crate docs and [#584] for details.
- `[rpc]` The RPC request and response types' fields are now all publicly
accessible ([#636]).

[#414]: https://github.com/informalsystems/tendermint-rs/issues/414
[#524]: https://github.com/informalsystems/tendermint-rs/issues/524
Expand All @@ -54,6 +56,7 @@
[#536]: https://github.com/informalsystems/tendermint-rs/issues/536
[#585]: https://github.com/informalsystems/tendermint-rs/issues/585
[#584]: https://github.com/informalsystems/tendermint-rs/pull/584
[#636]: https://github.com/informalsystems/tendermint-rs/pull/636

## v0.16.0

Expand Down
8 changes: 4 additions & 4 deletions rpc/src/endpoint/abci_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ use tendermint::serializers;
pub struct Request {
/// Path to the data
#[serde(skip_serializing_if = "Option::is_none")]
path: Option<Path>,
pub path: Option<Path>,

/// Data to query
#[serde(with = "serializers::bytes::hexstring")]
data: Vec<u8>,
pub data: Vec<u8>,

/// Block height
#[serde(skip_serializing_if = "Option::is_none")]
height: Option<block::Height>,
pub height: Option<block::Height>,

/// Include proof in response
prove: bool,
pub prove: bool,
}

impl Request {
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/endpoint/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Request {
/// Height of the block to request.
///
/// If no height is provided, it will fetch results for the latest block.
height: Option<block::Height>,
pub height: Option<block::Height>,
}

impl Request {
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/endpoint/block_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Request {
/// Height of the block to request.
///
/// If no height is provided, it will fetch results for the latest block.
height: Option<block::Height>,
pub height: Option<block::Height>,
}

impl Request {
Expand Down
4 changes: 2 additions & 2 deletions rpc/src/endpoint/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ use tendermint::block;
pub struct Request {
/// First block in the sequence to request info about
#[serde(rename = "minHeight")]
min_height: block::Height,
pub min_height: block::Height,

/// Last block in the sequence to request info about
#[serde(rename = "maxHeight")]
max_height: block::Height,
pub max_height: block::Height,
}

impl Request {
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/endpoint/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tendermint::{block, block::signed_header::SignedHeader};
/// Get commit information about a specific block
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub struct Request {
height: Option<block::Height>,
pub height: Option<block::Height>,
}

impl Request {
Expand Down
18 changes: 9 additions & 9 deletions rpc/src/endpoint/net_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,37 +105,37 @@ pub struct Monitor {

/// Bytes
#[serde(rename = "Bytes", with = "serializers::from_str")]
bytes: u64,
pub bytes: u64,

/// Samples
#[serde(rename = "Samples", with = "serializers::from_str")]
samples: u64,
pub samples: u64,

/// Instant rate
#[serde(rename = "InstRate", with = "serializers::from_str")]
inst_rate: u64,
pub inst_rate: u64,

/// Current rate
#[serde(rename = "CurRate", with = "serializers::from_str")]
cur_rate: u64,
pub cur_rate: u64,

/// Average rate
#[serde(rename = "AvgRate", with = "serializers::from_str")]
avg_rate: u64,
pub avg_rate: u64,

/// Peak rate
#[serde(rename = "PeakRate", with = "serializers::from_str")]
peak_rate: u64,
pub peak_rate: u64,

/// Bytes remaining
#[serde(rename = "BytesRem", with = "serializers::from_str")]
bytes_rem: u64,
pub bytes_rem: u64,

/// Time remaining
#[serde(rename = "TimeRem", with = "serializers::from_str")]
time_rem: u64,
pub time_rem: u64,

/// Progress
#[serde(rename = "Progress")]
progress: u64,
pub progress: u64,
}
2 changes: 1 addition & 1 deletion rpc/src/endpoint/validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tendermint::{block, validator};
/// List validators for a specific block
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Request {
height: block::Height,
pub height: block::Height,
}

impl Request {
Expand Down