Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

tendermint-rs: /abci_query RPC endpoint (closes #287) #296

Merged
merged 1 commit into from
Jul 19, 2019

Conversation

tarcieri
Copy link
Contributor

Adds support for invoking the ABCIQuery endpoint:

https://tendermint.com/rpc/#abciquery


/// ABCI Merkle proofs
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct Proof(Vec<u8>);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ebuchman this seems like it might have some overlap with the stuff you're working on? That said, is this an OK start?

@@ -9,7 +9,7 @@ use std::{
/// Block height for a particular chain (i.e. number of blocks created since
/// the chain began)
#[derive(Copy, Clone, Eq, Hash, PartialEq, PartialOrd, Ord)]
pub struct Height(pub u64);
pub struct Height(u64);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With pub on the u64 this wraps, the Height type can't maintain invariants (i.e. >0 or >=0)

/// `/abci_query` endpoint
#[test]
fn abci_query() {
// TODO(tarcieri): write integration test for this endpoint
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike the other endpoints it wasn't clear how to immediately test this in an integration test (with gaiad)

@@ -0,0 +1,15 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike the other JSON examples found in this directory, this one wasn't taken live from a gaiad RPC response, but is copy/paste from https://tendermint.com/rpc/#abciquery

@tarcieri tarcieri merged commit 874c3a8 into master Jul 19, 2019
@tarcieri tarcieri deleted the tendermint-rs/abci_query branch July 19, 2019 17:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants