From 9962a4f16f00ce3a1f717080380cc3886c59996e Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 17 May 2023 17:05:38 +0300 Subject: [PATCH 01/27] rpc: 0.38 support for /block_results endpoint In the v0_37+ dialect helper, support the new finalize_block_events field if it is present. Also default the begin_block_events and end_block_events fields to None if they are not present. --- rpc/src/endpoint/block_results.rs | 165 +++++++++++++++++++++------- rpc/tests/gaia_fixtures.rs | 4 +- rpc/tests/kvstore_fixtures/v0_34.rs | 2 +- rpc/tests/kvstore_fixtures/v0_37.rs | 2 +- 4 files changed, 129 insertions(+), 44 deletions(-) diff --git a/rpc/src/endpoint/block_results.rs b/rpc/src/endpoint/block_results.rs index ee28cb03b..dd2d5c355 100644 --- a/rpc/src/endpoint/block_results.rs +++ b/rpc/src/endpoint/block_results.rs @@ -1,13 +1,11 @@ //! `/block_results` endpoint JSON-RPC wrapper -use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use tendermint::{abci, block, consensus, validator}; use crate::dialect::{self, Dialect}; use crate::prelude::*; use crate::request::RequestMessage; -use crate::serializers; /// Get ABCI results at a given height. #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] @@ -33,11 +31,19 @@ impl RequestMessage for Request { } } -impl crate::Request for Request { - type Response = DialectResponse; +impl crate::Request for Request { + type Response = self::v0_34::DialectResponse; } -impl crate::SimpleRequest for Request { +impl crate::Request for Request { + type Response = self::v0_37::DialectResponse; +} + +impl crate::SimpleRequest for Request +where + Self: crate::Request, + Response: From, +{ type Output = Response; } @@ -50,10 +56,19 @@ pub struct Response { /// Txs results (might be explicit null) pub txs_results: Option>, + /// Events from FinalizeBlock. + /// + /// This field is only populated with events since CometBFT version 0.38. + pub finalize_block_events: Vec, + /// Begin block events (might be explicit null) + /// + /// This field is not used and set to `None` since CometBFT version 0.38. pub begin_block_events: Option>, /// End block events (might be explicit null) + /// + /// This field is not used and set to `None` since CometBFT version 0.38. pub end_block_events: Option>, /// Validator updates (might be explicit null) @@ -63,49 +78,119 @@ pub struct Response { pub consensus_param_updates: Option, } -/// RPC dialect helper for serialization of the response. -#[derive(Debug, Serialize, Deserialize)] -pub struct DialectResponse { - /// Block height - pub height: block::Height, +pub mod v0_34 { + use super::Response; + use crate::dialect::v0_34::Event; + use crate::prelude::*; + use crate::{dialect, serializers}; + use serde::{Deserialize, Serialize}; + use tendermint::{block, consensus, validator}; - /// Txs results (might be explicit null) - pub txs_results: Option>>, + /// RPC dialect helper for serialization of the response. + #[derive(Debug, Serialize, Deserialize)] + pub struct DialectResponse { + /// Block height + pub height: block::Height, - /// Begin block events (might be explicit null) - pub begin_block_events: Option>, + /// Txs results (might be explicit null) + pub txs_results: Option>>, - /// End block events (might be explicit null) - pub end_block_events: Option>, + /// Begin block events (might be explicit null) + pub begin_block_events: Option>, - /// Validator updates (might be explicit null) - #[serde(deserialize_with = "serializers::nullable::deserialize")] - pub validator_updates: Vec, + /// End block events (might be explicit null) + pub end_block_events: Option>, - /// New consensus params (might be explicit null) - pub consensus_param_updates: Option, + /// Validator updates (might be explicit null) + #[serde(deserialize_with = "serializers::nullable::deserialize")] + pub validator_updates: Vec, + + /// New consensus params (might be explicit null) + pub consensus_param_updates: Option, + } + + impl crate::Response for DialectResponse {} + + impl From for Response { + fn from(msg: DialectResponse) -> Self { + Response { + height: msg.height, + txs_results: msg + .txs_results + .map(|v| v.into_iter().map(Into::into).collect()), + finalize_block_events: vec![], + begin_block_events: msg + .begin_block_events + .map(|v| v.into_iter().map(Into::into).collect()), + end_block_events: msg + .end_block_events + .map(|v| v.into_iter().map(Into::into).collect()), + validator_updates: msg.validator_updates, + consensus_param_updates: msg.consensus_param_updates, + } + } + } } -impl crate::Response for DialectResponse where Ev: Serialize + DeserializeOwned {} +pub mod v0_37 { + use super::Response; + use crate::dialect::v0_37::Event; + use crate::prelude::*; + use crate::{dialect, serializers}; + use serde::{Deserialize, Serialize}; + use tendermint::{block, consensus, validator}; -impl From> for Response -where - Ev: Into, -{ - fn from(msg: DialectResponse) -> Self { - Response { - height: msg.height, - txs_results: msg - .txs_results - .map(|v| v.into_iter().map(Into::into).collect()), - begin_block_events: msg - .begin_block_events - .map(|v| v.into_iter().map(Into::into).collect()), - end_block_events: msg - .end_block_events - .map(|v| v.into_iter().map(Into::into).collect()), - validator_updates: msg.validator_updates, - consensus_param_updates: msg.consensus_param_updates, + /// RPC dialect helper for serialization of the response. + #[derive(Debug, Serialize, Deserialize)] + pub struct DialectResponse { + /// Block height + pub height: block::Height, + + /// Txs results (might be explicit null) + pub txs_results: Option>>, + + #[serde(default)] + pub finalize_block_events: Vec, + + /// Begin block events (might be explicit null) + #[serde(default)] + pub begin_block_events: Option>, + + /// End block events (might be explicit null) + #[serde(default)] + pub end_block_events: Option>, + + /// Validator updates (might be explicit null) + #[serde(deserialize_with = "serializers::nullable::deserialize")] + pub validator_updates: Vec, + + /// New consensus params (might be explicit null) + pub consensus_param_updates: Option, + } + + impl crate::Response for DialectResponse {} + + impl From for Response { + fn from(msg: DialectResponse) -> Self { + Response { + height: msg.height, + txs_results: msg + .txs_results + .map(|v| v.into_iter().map(Into::into).collect()), + finalize_block_events: msg + .finalize_block_events + .into_iter() + .map(Into::into) + .collect(), + begin_block_events: msg + .begin_block_events + .map(|v| v.into_iter().map(Into::into).collect()), + end_block_events: msg + .end_block_events + .map(|v| v.into_iter().map(Into::into).collect()), + validator_updates: msg.validator_updates, + consensus_param_updates: msg.consensus_param_updates, + } } } } diff --git a/rpc/tests/gaia_fixtures.rs b/rpc/tests/gaia_fixtures.rs index 486913f6a..ec71bffd5 100644 --- a/rpc/tests/gaia_fixtures.rs +++ b/rpc/tests/gaia_fixtures.rs @@ -54,11 +54,11 @@ fn incoming_fixtures() { assert!(r.is_ok(), "{r:?}"); }, "block_results_at_height_10" => { - let r = endpoint::block_results::DialectResponse::::from_string(content); + let r = endpoint::block_results::v0_34::DialectResponse::from_string(content); assert!(r.is_ok(), "block_results_at_height_10: {r:?}"); }, "block_results_at_height_4555980" => { - let r = endpoint::block_results::DialectResponse::::from_string(content); + let r = endpoint::block_results::v0_34::DialectResponse::from_string(content); assert!(r.is_ok(), "block_results_at_height_4555980: {r:?}"); }, "blockchain_from_1_to_10" => { diff --git a/rpc/tests/kvstore_fixtures/v0_34.rs b/rpc/tests/kvstore_fixtures/v0_34.rs index 8b8d528ab..269f94425 100644 --- a/rpc/tests/kvstore_fixtures/v0_34.rs +++ b/rpc/tests/kvstore_fixtures/v0_34.rs @@ -420,7 +420,7 @@ fn incoming_fixtures() { }, "block_results_at_height_10" => { let result: endpoint::block_results::Response = - endpoint::block_results::DialectResponse::::from_string(content) + endpoint::block_results::v0_34::DialectResponse::from_string(content) .unwrap() .into(); assert!(result.begin_block_events.is_none()); diff --git a/rpc/tests/kvstore_fixtures/v0_37.rs b/rpc/tests/kvstore_fixtures/v0_37.rs index 9d2fa3550..1f4c1ac40 100644 --- a/rpc/tests/kvstore_fixtures/v0_37.rs +++ b/rpc/tests/kvstore_fixtures/v0_37.rs @@ -419,7 +419,7 @@ fn incoming_fixtures() { }, "block_results_at_height_10" => { let result: endpoint::block_results::Response = - endpoint::block_results::DialectResponse::::from_string(content) + endpoint::block_results::v0_37::DialectResponse::from_string(content) .unwrap() .into(); assert!(result.begin_block_events.is_none()); From 8328820add2a5ff4b0cbb115a667465e6b6af2fe Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 17 May 2023 17:33:41 +0300 Subject: [PATCH 02/27] rpc: add app_hash field to /block_results response --- rpc/src/endpoint/block_results.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/rpc/src/endpoint/block_results.rs b/rpc/src/endpoint/block_results.rs index dd2d5c355..96f4eab8e 100644 --- a/rpc/src/endpoint/block_results.rs +++ b/rpc/src/endpoint/block_results.rs @@ -1,7 +1,7 @@ //! `/block_results` endpoint JSON-RPC wrapper use serde::{Deserialize, Serialize}; -use tendermint::{abci, block, consensus, validator}; +use tendermint::{abci, block, consensus, serializers, validator, AppHash}; use crate::dialect::{self, Dialect}; use crate::prelude::*; @@ -76,6 +76,10 @@ pub struct Response { /// New consensus params (might be explicit null) pub consensus_param_updates: Option, + + /// Merkle hash of the application state + #[serde(with = "serializers::apphash")] + pub app_hash: AppHash, } pub mod v0_34 { @@ -127,6 +131,7 @@ pub mod v0_34 { .map(|v| v.into_iter().map(Into::into).collect()), validator_updates: msg.validator_updates, consensus_param_updates: msg.consensus_param_updates, + app_hash: Default::default(), } } } @@ -138,7 +143,7 @@ pub mod v0_37 { use crate::prelude::*; use crate::{dialect, serializers}; use serde::{Deserialize, Serialize}; - use tendermint::{block, consensus, validator}; + use tendermint::{block, consensus, validator, AppHash}; /// RPC dialect helper for serialization of the response. #[derive(Debug, Serialize, Deserialize)] @@ -166,6 +171,10 @@ pub mod v0_37 { /// New consensus params (might be explicit null) pub consensus_param_updates: Option, + + #[serde(default)] + #[serde(with = "serializers::apphash")] + pub app_hash: AppHash, } impl crate::Response for DialectResponse {} @@ -190,6 +199,7 @@ pub mod v0_37 { .map(|v| v.into_iter().map(Into::into).collect()), validator_updates: msg.validator_updates, consensus_param_updates: msg.consensus_param_updates, + app_hash: msg.app_hash, } } } From 320decd8217919c5c24192c442cb68c6f3169692 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Fri, 19 May 2023 19:35:42 +0300 Subject: [PATCH 03/27] tendermint: restore Deserialize on some types For abci::Event and abci::response::CheckTx, restore the Deserialize implementation on domain types themselves. The event serialization format as used in 0.37+ will be established as the "canonical" serialization. --- tendermint/src/abci/event.rs | 7 ++++--- tendermint/src/abci/response/check_tx.rs | 11 ++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tendermint/src/abci/event.rs b/tendermint/src/abci/event.rs index 4dc13e443..988145ad8 100644 --- a/tendermint/src/abci/event.rs +++ b/tendermint/src/abci/event.rs @@ -1,4 +1,4 @@ -use serde::Serialize; +use serde::{Deserialize, Serialize}; use crate::prelude::*; @@ -12,12 +12,13 @@ use crate::prelude::*; /// be queried using these events. /// /// [ABCI documentation](https://docs.tendermint.com/master/spec/abci/abci.html#events) -#[derive(Clone, PartialEq, Eq, Debug, Serialize, Hash)] +#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize, Hash)] pub struct Event { /// The kind of event. /// /// Tendermint calls this the `type`, but we use `kind` to avoid confusion /// with Rust types and follow Rust conventions. + #[serde(rename = "type")] pub kind: String, /// A list of [`EventAttribute`]s describing the event. pub attributes: Vec, @@ -115,7 +116,7 @@ where /// [`Event::new`] for details. /// /// [ABCI documentation](https://docs.tendermint.com/master/spec/abci/abci.html#events) -#[derive(Clone, PartialEq, Eq, Debug, Serialize, Hash)] +#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize, Hash)] pub struct EventAttribute { /// The event key. pub key: String, diff --git a/tendermint/src/abci/response/check_tx.rs b/tendermint/src/abci/response/check_tx.rs index f5c117fb7..d0685013e 100644 --- a/tendermint/src/abci/response/check_tx.rs +++ b/tendermint/src/abci/response/check_tx.rs @@ -1,11 +1,12 @@ use bytes::Bytes; -use serde::Serialize; +use serde::{Deserialize, Serialize}; -use super::super::{Code, Event}; +use crate::abci::{Code, Event}; use crate::prelude::*; +use crate::serializers; #[doc = include_str!("../doc/response-checktx.md")] -#[derive(Clone, PartialEq, Eq, Debug, Default, Serialize)] +#[derive(Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize)] pub struct CheckTx { /// The response code. /// @@ -14,6 +15,7 @@ pub struct CheckTx { /// Tendermint attributes no other value to the response code. pub code: Code, /// Result bytes, if any. + #[serde(with = "serializers::nullable")] pub data: Bytes, /// The output of the application's logger. /// @@ -24,8 +26,10 @@ pub struct CheckTx { /// **May be non-deterministic**. pub info: String, /// Amount of gas requested for the transaction. + #[serde(with = "serializers::from_str")] pub gas_wanted: i64, /// Amount of gas consumed by the transaction. + #[serde(with = "serializers::from_str")] pub gas_used: i64, /// Events that occurred while checking the transaction. pub events: Vec, @@ -34,6 +38,7 @@ pub struct CheckTx { /// The transactions's sender. Not used since CometBFT 0.38. pub sender: String, /// Priority for the mempool. Not used since CometBFT 0.38. + #[serde(with = "serializers::from_str")] pub priority: i64, /// Error reported for the mempool. Not used since CometBFT 0.38. pub mempool_error: String, From ad73c4ba66168d155d8e3fd226cf252c06401e5e Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Fri, 19 May 2023 19:36:15 +0300 Subject: [PATCH 04/27] tendermint: serde impls for ExecTxResult --- tendermint/src/abci/types.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tendermint/src/abci/types.rs b/tendermint/src/abci/types.rs index 709a4daaf..d03ae2130 100644 --- a/tendermint/src/abci/types.rs +++ b/tendermint/src/abci/types.rs @@ -6,6 +6,7 @@ //! [ABCI documentation](https://docs.tendermint.com/master/spec/abci/abci.html#data-types) use bytes::Bytes; +use serde::{Deserialize, Serialize}; use super::{Code, Event}; use crate::{ @@ -195,7 +196,7 @@ pub struct Snapshot { /// deprecated and removed. /// /// [`response::DeliverTx`]: super::response::DeliverTx -#[derive(Clone, PartialEq, Eq, Debug, Default)] +#[derive(Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize)] pub struct ExecTxResult { /// The response code. /// From 4c0cb74c22e838a910afe7a75e2032e2954f359a Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Fri, 19 May 2023 19:47:27 +0300 Subject: [PATCH 05/27] rpc: support more changes in CometBFT 0.38 Add the new fields and types without static differentiation for 0.38.x. Use the domain type ExecTxResult in deserializing the endpoint response types in the current (i.e. 0.37+) dialect for these endpoints: - /block_results - /broadcast_tx_commit - /tx - /tx_commit The Deserialize impls are restored on the response types, corresponding to the JSON schema for the current RPC dialect. Simplify the 0.34 dialect support for these responses, no longer using generics. In endpoint::tx_commit::Response, rename the deliver_tx field to tx_result to correspond to the current JSON schema. The Deserialize impl falls back to deliver_tx to also be able to parse 0.37 responses. --- rpc/src/client/transport/mock.rs | 2 +- rpc/src/dialect/deliver_tx.rs | 18 +++++ rpc/src/dialect/v0_37.rs | 63 ++--------------- rpc/src/endpoint/block_results.rs | 80 +++------------------- rpc/src/endpoint/broadcast/tx_commit.rs | 76 ++++++++++++--------- rpc/src/endpoint/tx.rs | 90 +++++++++++++++---------- rpc/src/endpoint/tx_search.rs | 66 +++++++++++------- rpc/tests/kvstore_fixtures/v0_34.rs | 53 +++++++-------- rpc/tests/kvstore_fixtures/v0_37.rs | 67 +++++++----------- 9 files changed, 224 insertions(+), 291 deletions(-) diff --git a/rpc/src/client/transport/mock.rs b/rpc/src/client/transport/mock.rs index 987885779..4500baf74 100644 --- a/rpc/src/client/transport/mock.rs +++ b/rpc/src/client/transport/mock.rs @@ -334,8 +334,8 @@ mod test { mod v0_37 { use super::*; - use crate::dialect::v0_37::Event as RpcEvent; use crate::event::DialectEvent; + use tendermint::abci::Event as RpcEvent; async fn read_event(name: &str) -> Event { let msg = DialectEvent::::from_string(read_json_fixture("v0_37", name).await) diff --git a/rpc/src/dialect/deliver_tx.rs b/rpc/src/dialect/deliver_tx.rs index ccb0452ec..0aa83bab7 100644 --- a/rpc/src/dialect/deliver_tx.rs +++ b/rpc/src/dialect/deliver_tx.rs @@ -70,3 +70,21 @@ where } } } + +impl From> for abci::types::ExecTxResult +where + Ev: Into, +{ + fn from(msg: DeliverTx) -> Self { + Self { + code: msg.code, + data: msg.data, + log: msg.log, + info: msg.info, + gas_wanted: msg.gas_wanted, + gas_used: msg.gas_used, + events: msg.events.into_iter().map(Into::into).collect(), + codespace: msg.codespace, + } + } +} diff --git a/rpc/src/dialect/v0_37.rs b/rpc/src/dialect/v0_37.rs index 2f28501f7..e3f3317a5 100644 --- a/rpc/src/dialect/v0_37.rs +++ b/rpc/src/dialect/v0_37.rs @@ -1,9 +1,13 @@ -use tendermint::{abci, evidence}; +use tendermint::evidence; use tendermint_proto::v0_37 as raw; use crate::prelude::*; use serde::{Deserialize, Serialize}; +/// The Event serialization in the latest RPC dialect is the canonical +/// serialization for the ABCI domain type. +pub use tendermint::abci::Event; + #[derive(Default, Clone)] pub struct Dialect; @@ -12,63 +16,6 @@ impl crate::dialect::Dialect for Dialect { type Evidence = Evidence; } -#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] -pub struct Event { - #[serde(rename = "type")] - pub kind: String, - pub attributes: Vec, -} - -impl From for abci::Event { - fn from(msg: Event) -> Self { - Self { - kind: msg.kind, - attributes: msg.attributes.into_iter().map(Into::into).collect(), - } - } -} - -impl From for Event { - fn from(msg: abci::Event) -> Self { - Self { - kind: msg.kind, - attributes: msg.attributes.into_iter().map(Into::into).collect(), - } - } -} - -#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] -pub struct EventAttribute { - /// The event key. - pub key: String, - /// The event value. - pub value: String, - /// Whether Tendermint's indexer should index this event. - /// - /// **This field is nondeterministic**. - pub index: bool, -} - -impl From for abci::EventAttribute { - fn from(msg: EventAttribute) -> Self { - Self { - key: msg.key, - value: msg.value, - index: msg.index, - } - } -} - -impl From for EventAttribute { - fn from(msg: abci::EventAttribute) -> Self { - Self { - key: msg.key, - value: msg.value, - index: msg.index, - } - } -} - #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(into = "raw::types::Evidence", try_from = "raw::types::Evidence")] pub struct Evidence(evidence::Evidence); diff --git a/rpc/src/endpoint/block_results.rs b/rpc/src/endpoint/block_results.rs index 96f4eab8e..91bef979e 100644 --- a/rpc/src/endpoint/block_results.rs +++ b/rpc/src/endpoint/block_results.rs @@ -36,7 +36,7 @@ impl crate::Request for Request { } impl crate::Request for Request { - type Response = self::v0_37::DialectResponse; + type Response = Response; } impl crate::SimpleRequest for Request @@ -48,17 +48,18 @@ where } /// ABCI result response. -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Response { /// Block height pub height: block::Height, /// Txs results (might be explicit null) - pub txs_results: Option>, + pub txs_results: Option>, /// Events from FinalizeBlock. /// /// This field is only populated with events since CometBFT version 0.38. + #[serde(deserialize_with = "serializers::nullable::deserialize")] pub finalize_block_events: Vec, /// Begin block events (might be explicit null) @@ -72,16 +73,21 @@ pub struct Response { pub end_block_events: Option>, /// Validator updates (might be explicit null) + #[serde(deserialize_with = "serializers::nullable::deserialize")] pub validator_updates: Vec, /// New consensus params (might be explicit null) pub consensus_param_updates: Option, /// Merkle hash of the application state + #[serde(default)] #[serde(with = "serializers::apphash")] pub app_hash: AppHash, } +impl crate::Response for Response {} + +/// Serialization for /block_results endpoint format in Tendermint 0.34 pub mod v0_34 { use super::Response; use crate::dialect::v0_34::Event; @@ -136,71 +142,3 @@ pub mod v0_34 { } } } - -pub mod v0_37 { - use super::Response; - use crate::dialect::v0_37::Event; - use crate::prelude::*; - use crate::{dialect, serializers}; - use serde::{Deserialize, Serialize}; - use tendermint::{block, consensus, validator, AppHash}; - - /// RPC dialect helper for serialization of the response. - #[derive(Debug, Serialize, Deserialize)] - pub struct DialectResponse { - /// Block height - pub height: block::Height, - - /// Txs results (might be explicit null) - pub txs_results: Option>>, - - #[serde(default)] - pub finalize_block_events: Vec, - - /// Begin block events (might be explicit null) - #[serde(default)] - pub begin_block_events: Option>, - - /// End block events (might be explicit null) - #[serde(default)] - pub end_block_events: Option>, - - /// Validator updates (might be explicit null) - #[serde(deserialize_with = "serializers::nullable::deserialize")] - pub validator_updates: Vec, - - /// New consensus params (might be explicit null) - pub consensus_param_updates: Option, - - #[serde(default)] - #[serde(with = "serializers::apphash")] - pub app_hash: AppHash, - } - - impl crate::Response for DialectResponse {} - - impl From for Response { - fn from(msg: DialectResponse) -> Self { - Response { - height: msg.height, - txs_results: msg - .txs_results - .map(|v| v.into_iter().map(Into::into).collect()), - finalize_block_events: msg - .finalize_block_events - .into_iter() - .map(Into::into) - .collect(), - begin_block_events: msg - .begin_block_events - .map(|v| v.into_iter().map(Into::into).collect()), - end_block_events: msg - .end_block_events - .map(|v| v.into_iter().map(Into::into).collect()), - validator_updates: msg.validator_updates, - consensus_param_updates: msg.consensus_param_updates, - app_hash: msg.app_hash, - } - } - } -} diff --git a/rpc/src/endpoint/broadcast/tx_commit.rs b/rpc/src/endpoint/broadcast/tx_commit.rs index 195f04295..b82ddccae 100644 --- a/rpc/src/endpoint/broadcast/tx_commit.rs +++ b/rpc/src/endpoint/broadcast/tx_commit.rs @@ -1,7 +1,6 @@ //! `/broadcast_tx_commit`: only returns error if `mempool.CheckTx()` errs or //! if we timeout waiting for tx to commit. -use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use tendermint::{abci, block, Hash}; @@ -34,22 +33,31 @@ impl RequestMessage for Request { } } -impl crate::Request for Request { - type Response = DialectResponse; +impl crate::Request for Request { + type Response = self::v0_34::DialectResponse; } -impl crate::SimpleRequest for Request { +impl crate::Request for Request { + type Response = Response; +} + +impl crate::SimpleRequest for Request +where + Self: crate::Request, + Response: From, +{ type Output = Response; } /// Response from `/broadcast_tx_commit`. -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Response { /// `CheckTx` result pub check_tx: abci::response::CheckTx, - /// `DeliverTx` result - pub deliver_tx: abci::response::DeliverTx, + /// Result of executing the transaction + #[serde(alias = "deliver_tx")] + pub tx_result: abci::types::ExecTxResult, /// Transaction pub hash: Hash, @@ -58,34 +66,42 @@ pub struct Response { pub height: block::Height, } -/// RPC dialect helper for serialization of the response. -#[derive(Debug, Deserialize, Serialize)] -pub struct DialectResponse { - /// `CheckTx` result - pub check_tx: dialect::CheckTx, +impl crate::Response for Response {} - /// `DeliverTx` result - pub deliver_tx: dialect::DeliverTx, +/// Serialization for /broadcast_tx_commit endpoint format in Tendermint 0.34 +pub mod v0_34 { + use super::Response; + use crate::dialect; + use crate::dialect::v0_34::Event; + use serde::{Deserialize, Serialize}; + use tendermint::{block, Hash}; - /// Transaction - pub hash: Hash, + /// RPC dialect helper for serialization of the response. + #[derive(Debug, Deserialize, Serialize)] + pub struct DialectResponse { + /// `CheckTx` result + pub check_tx: dialect::CheckTx, - /// Height - pub height: block::Height, -} + /// `DeliverTx` result + pub deliver_tx: dialect::DeliverTx, -impl crate::Response for DialectResponse where Ev: Serialize + DeserializeOwned {} + /// Transaction + pub hash: Hash, -impl From> for Response -where - Ev: Into, -{ - fn from(msg: DialectResponse) -> Self { - Self { - check_tx: msg.check_tx.into(), - deliver_tx: msg.deliver_tx.into(), - hash: msg.hash, - height: msg.height, + /// Height + pub height: block::Height, + } + + impl crate::Response for DialectResponse {} + + impl From for Response { + fn from(msg: DialectResponse) -> Self { + Self { + check_tx: msg.check_tx.into(), + tx_result: msg.deliver_tx.into(), + hash: msg.hash, + height: msg.height, + } } } } diff --git a/rpc/src/endpoint/tx.rs b/rpc/src/endpoint/tx.rs index dcf6fad9d..d5bc7630e 100644 --- a/rpc/src/endpoint/tx.rs +++ b/rpc/src/endpoint/tx.rs @@ -1,10 +1,9 @@ //! `/tx` endpoint JSON-RPC wrapper -use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use tendermint::{abci, block, tx, Hash}; -use crate::dialect::{DeliverTx, Dialect}; +use crate::dialect::{self, Dialect}; use crate::{prelude::*, request::RequestMessage, serializers, Method}; /// Request for finding a transaction by its hash. @@ -34,32 +33,24 @@ impl RequestMessage for Request { } } -impl crate::Request for Request { - type Response = DialectResponse; +impl crate::Request for Request { + type Response = self::v0_34::DialectResponse; } -impl crate::SimpleRequest for Request { - type Output = Response; +impl crate::Request for Request { + type Response = Response; } -#[derive(Clone, Debug, Serialize)] -pub struct Response { - /// The hash of the transaction. - /// - /// Deserialized from a hex-encoded string (there is a discrepancy between - /// the format used for the request and the format used for the response in - /// the Tendermint RPC). - pub hash: Hash, - pub height: block::Height, - pub index: u32, - pub tx_result: abci::response::DeliverTx, - pub tx: Vec, - pub proof: Option, +impl crate::SimpleRequest for Request +where + Self: crate::Request, + Response: From, +{ + type Output = Response; } -/// RPC dialect helper for serialization of the response. -#[derive(Debug, Deserialize, Serialize)] -pub struct DialectResponse { +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct Response { /// The hash of the transaction. /// /// Deserialized from a hex-encoded string (there is a discrepancy between @@ -68,27 +59,54 @@ pub struct DialectResponse { pub hash: Hash, pub height: block::Height, pub index: u32, - pub tx_result: DeliverTx, + pub tx_result: abci::types::ExecTxResult, #[serde(with = "serializers::bytes::base64string")] pub tx: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub proof: Option, } -impl crate::Response for DialectResponse where Ev: Serialize + DeserializeOwned {} +impl crate::Response for Response {} -impl From> for Response -where - Ev: Into, -{ - fn from(msg: DialectResponse) -> Self { - Self { - hash: msg.hash, - height: msg.height, - index: msg.index, - tx_result: msg.tx_result.into(), - tx: msg.tx, - proof: msg.proof, +/// Serialization for /tx endpoint format in Tendermint 0.34 +pub mod v0_34 { + use super::Response; + use crate::dialect::v0_34::Event; + use crate::prelude::*; + use crate::{dialect, serializers}; + use serde::{Deserialize, Serialize}; + use tendermint::{block, tx, Hash}; + + /// RPC dialect helper for serialization of the response. + #[derive(Debug, Deserialize, Serialize)] + pub struct DialectResponse { + /// The hash of the transaction. + /// + /// Deserialized from a hex-encoded string (there is a discrepancy between + /// the format used for the request and the format used for the response in + /// the Tendermint RPC). + pub hash: Hash, + pub height: block::Height, + pub index: u32, + pub tx_result: dialect::DeliverTx, + #[serde(with = "serializers::bytes::base64string")] + pub tx: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub proof: Option, + } + + impl crate::Response for DialectResponse {} + + impl From for Response { + fn from(msg: DialectResponse) -> Self { + Self { + hash: msg.hash, + height: msg.height, + index: msg.index, + tx_result: msg.tx_result.into(), + tx: msg.tx, + proof: msg.proof, + } } } } diff --git a/rpc/src/endpoint/tx_search.rs b/rpc/src/endpoint/tx_search.rs index 278a66c79..e936405db 100644 --- a/rpc/src/endpoint/tx_search.rs +++ b/rpc/src/endpoint/tx_search.rs @@ -1,11 +1,15 @@ //! `/tx_search` endpoint JSON-RPC wrapper -use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; -use tendermint::abci; +use crate::{ + dialect::{self, Dialect}, + prelude::*, + request::RequestMessage, + serializers, Method, Order, +}; pub use super::tx; -use crate::{dialect::Dialect, prelude::*, request::RequestMessage, serializers, Method, Order}; /// Request for searching for transactions with their results. #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] @@ -44,38 +48,54 @@ impl RequestMessage for Request { } } -impl crate::Request for Request { - type Response = DialectResponse; +impl crate::Request for Request { + type Response = self::v0_34::DialectResponse; } -impl crate::SimpleRequest for Request { +impl crate::Request for Request { + type Response = Response; +} + +impl crate::SimpleRequest for Request +where + Self: crate::Request, + Response: From, +{ type Output = Response; } -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Response { pub txs: Vec, - pub total_count: u32, -} - -/// RPC dialect helper for serialization of the response. -#[derive(Debug, Deserialize, Serialize)] -pub struct DialectResponse { - pub txs: Vec>, #[serde(with = "serializers::from_str")] pub total_count: u32, } -impl crate::Response for DialectResponse where Ev: Serialize + DeserializeOwned {} +impl crate::Response for Response {} -impl From> for Response -where - Ev: Into, -{ - fn from(msg: DialectResponse) -> Self { - Self { - txs: msg.txs.into_iter().map(Into::into).collect(), - total_count: msg.total_count, +/// Serialization for /tx_search endpoint format in Tendermint 0.34 +pub mod v0_34 { + use super::{tx, Response}; + use crate::prelude::*; + use crate::serializers; + use serde::{Deserialize, Serialize}; + + /// RPC dialect helper for serialization of the response. + #[derive(Debug, Deserialize, Serialize)] + pub struct DialectResponse { + pub txs: Vec, + #[serde(with = "serializers::from_str")] + pub total_count: u32, + } + + impl crate::Response for DialectResponse {} + + impl From for Response { + fn from(msg: DialectResponse) -> Self { + Self { + txs: msg.txs.into_iter().map(Into::into).collect(), + total_count: msg.total_count, + } } } } diff --git a/rpc/tests/kvstore_fixtures/v0_34.rs b/rpc/tests/kvstore_fixtures/v0_34.rs index 269f94425..556b57d4c 100644 --- a/rpc/tests/kvstore_fixtures/v0_34.rs +++ b/rpc/tests/kvstore_fixtures/v0_34.rs @@ -492,11 +492,9 @@ fn incoming_fixtures() { }, "broadcast_tx_commit" => { let result: endpoint::broadcast::tx_commit::Response = - endpoint::broadcast::tx_commit::DialectResponse::::from_string( - content, - ) - .unwrap() - .into(); + endpoint::broadcast::tx_commit::v0_34::DialectResponse::from_string(content) + .unwrap() + .into(); assert_eq!(result.check_tx.code, abci::Code::Ok); assert!(result.check_tx.codespace.is_empty()); assert!(result.check_tx.data.is_empty()); @@ -506,36 +504,33 @@ fn incoming_fixtures() { // assert_eq!(result.check_tx.gas_wanted.value(), 1); assert!(result.check_tx.info.to_string().is_empty()); assert!(result.check_tx.log.is_empty()); - assert_eq!(result.deliver_tx.code, abci::Code::Ok); - assert!(result.deliver_tx.codespace.is_empty()); - assert!(result.deliver_tx.data.is_empty()); - assert_eq!(result.deliver_tx.events.len(), 1); - assert_eq!(result.deliver_tx.events[0].attributes.len(), 4); - assert_eq!(result.deliver_tx.events[0].attributes[0].key, "creator"); + assert_eq!(result.tx_result.code, abci::Code::Ok); + assert!(result.tx_result.codespace.is_empty()); + assert!(result.tx_result.data.is_empty()); + assert_eq!(result.tx_result.events.len(), 1); + assert_eq!(result.tx_result.events[0].attributes.len(), 4); + assert_eq!(result.tx_result.events[0].attributes[0].key, "creator"); assert_eq!( - result.deliver_tx.events[0].attributes[0].value, + result.tx_result.events[0].attributes[0].value, "Cosmoshi Netowoko" ); - assert_eq!(result.deliver_tx.events[0].attributes[1].key, "key"); - assert_eq!( - result.deliver_tx.events[0].attributes[1].value, - "commit-key" - ); - assert_eq!(result.deliver_tx.events[0].attributes[2].key, "index_key"); + assert_eq!(result.tx_result.events[0].attributes[1].key, "key"); + assert_eq!(result.tx_result.events[0].attributes[1].value, "commit-key"); + assert_eq!(result.tx_result.events[0].attributes[2].key, "index_key"); assert_eq!( - result.deliver_tx.events[0].attributes[2].value, + result.tx_result.events[0].attributes[2].value, "index is working" ); - assert_eq!(result.deliver_tx.events[0].attributes[3].key, "noindex_key"); + assert_eq!(result.tx_result.events[0].attributes[3].key, "noindex_key"); assert_eq!( - result.deliver_tx.events[0].attributes[3].value, + result.tx_result.events[0].attributes[3].value, "index is working" ); - assert_eq!(result.deliver_tx.events[0].kind, "app"); - assert_eq!(result.deliver_tx.gas_used, 0); - assert_eq!(result.deliver_tx.gas_wanted, 0); - assert!(result.deliver_tx.info.to_string().is_empty()); - assert!(result.deliver_tx.log.is_empty()); + assert_eq!(result.tx_result.events[0].kind, "app"); + assert_eq!(result.tx_result.gas_used, 0); + assert_eq!(result.tx_result.gas_wanted, 0); + assert!(result.tx_result.info.to_string().is_empty()); + assert!(result.tx_result.log.is_empty()); assert_ne!( result.hash, Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() @@ -1329,7 +1324,7 @@ fn incoming_fixtures() { }, "tx" => { let result: endpoint::tx::Response = - endpoint::tx::DialectResponse::::from_string(content) + endpoint::tx::v0_34::DialectResponse::from_string(content) .unwrap() .into(); assert_eq!( @@ -1348,7 +1343,7 @@ fn incoming_fixtures() { }, "tx_search_no_prove" => { let result: endpoint::tx_search::Response = - endpoint::tx_search::DialectResponse::::from_string(content) + endpoint::tx_search::v0_34::DialectResponse::from_string(content) .unwrap() .into(); assert_eq!(result.total_count as usize, result.txs.len()); @@ -1367,7 +1362,7 @@ fn incoming_fixtures() { }, "tx_search_with_prove" => { let result: endpoint::tx_search::Response = - endpoint::tx_search::DialectResponse::::from_string(content) + endpoint::tx_search::v0_34::DialectResponse::from_string(content) .unwrap() .into(); assert_eq!(result.total_count as usize, result.txs.len()); diff --git a/rpc/tests/kvstore_fixtures/v0_37.rs b/rpc/tests/kvstore_fixtures/v0_37.rs index 1f4c1ac40..5c496ec6c 100644 --- a/rpc/tests/kvstore_fixtures/v0_37.rs +++ b/rpc/tests/kvstore_fixtures/v0_37.rs @@ -418,10 +418,7 @@ fn incoming_fixtures() { assert_eq!(result.block_id.part_set_header.total, 1); }, "block_results_at_height_10" => { - let result: endpoint::block_results::Response = - endpoint::block_results::v0_37::DialectResponse::from_string(content) - .unwrap() - .into(); + let result = endpoint::block_results::Response::from_string(content).unwrap(); assert!(result.begin_block_events.is_none()); assert!(result.consensus_param_updates.is_none()); assert!(result.end_block_events.is_none()); @@ -490,12 +487,8 @@ fn incoming_fixtures() { assert!(result.log.is_empty()); }, "broadcast_tx_commit" => { - let result: endpoint::broadcast::tx_commit::Response = - endpoint::broadcast::tx_commit::DialectResponse::::from_string( - content, - ) - .unwrap() - .into(); + let result = + endpoint::broadcast::tx_commit::Response::from_string(content).unwrap(); assert_eq!(result.check_tx.code, abci::Code::Ok); assert!(result.check_tx.codespace.is_empty()); assert!(result.check_tx.data.is_empty()); @@ -505,36 +498,33 @@ fn incoming_fixtures() { // assert_eq!(result.check_tx.gas_wanted.value(), 1); assert!(result.check_tx.info.to_string().is_empty()); assert!(result.check_tx.log.is_empty()); - assert_eq!(result.deliver_tx.code, abci::Code::Ok); - assert!(result.deliver_tx.codespace.is_empty()); - assert!(result.deliver_tx.data.is_empty()); - assert_eq!(result.deliver_tx.events.len(), 2); - assert_eq!(result.deliver_tx.events[0].attributes.len(), 4); - assert_eq!(result.deliver_tx.events[0].attributes[0].key, "creator"); + assert_eq!(result.tx_result.code, abci::Code::Ok); + assert!(result.tx_result.codespace.is_empty()); + assert!(result.tx_result.data.is_empty()); + assert_eq!(result.tx_result.events.len(), 2); + assert_eq!(result.tx_result.events[0].attributes.len(), 4); + assert_eq!(result.tx_result.events[0].attributes[0].key, "creator"); assert_eq!( - result.deliver_tx.events[0].attributes[0].value, + result.tx_result.events[0].attributes[0].value, "Cosmoshi Netowoko" ); - assert_eq!(result.deliver_tx.events[0].attributes[1].key, "key"); + assert_eq!(result.tx_result.events[0].attributes[1].key, "key"); + assert_eq!(result.tx_result.events[0].attributes[1].value, "commit-key"); + assert_eq!(result.tx_result.events[0].attributes[2].key, "index_key"); assert_eq!( - result.deliver_tx.events[0].attributes[1].value, - "commit-key" - ); - assert_eq!(result.deliver_tx.events[0].attributes[2].key, "index_key"); - assert_eq!( - result.deliver_tx.events[0].attributes[2].value, + result.tx_result.events[0].attributes[2].value, "index is working" ); - assert_eq!(result.deliver_tx.events[0].attributes[3].key, "noindex_key"); + assert_eq!(result.tx_result.events[0].attributes[3].key, "noindex_key"); assert_eq!( - result.deliver_tx.events[0].attributes[3].value, + result.tx_result.events[0].attributes[3].value, "index is working" ); - assert_eq!(result.deliver_tx.events[0].kind, "app"); - assert_eq!(result.deliver_tx.gas_used, 0); - assert_eq!(result.deliver_tx.gas_wanted, 0); - assert!(result.deliver_tx.info.to_string().is_empty()); - assert!(result.deliver_tx.log.is_empty()); + assert_eq!(result.tx_result.events[0].kind, "app"); + assert_eq!(result.tx_result.gas_used, 0); + assert_eq!(result.tx_result.gas_wanted, 0); + assert!(result.tx_result.info.to_string().is_empty()); + assert!(result.tx_result.log.is_empty()); assert_ne!( result.hash, Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() @@ -1327,10 +1317,7 @@ fn incoming_fixtures() { assert!(result.log.is_empty()); }, "tx" => { - let result: endpoint::tx::Response = - endpoint::tx::DialectResponse::::from_string(content) - .unwrap() - .into(); + let result = endpoint::tx::Response::from_string(content).unwrap(); assert_eq!( result.hash, Hash::from_bytes( @@ -1346,10 +1333,7 @@ fn incoming_fixtures() { assert_eq!(u64::from(result.height), 12u64); }, "tx_search_no_prove" => { - let result: endpoint::tx_search::Response = - endpoint::tx_search::DialectResponse::::from_string(content) - .unwrap() - .into(); + let result = endpoint::tx_search::Response::from_string(content).unwrap(); assert_eq!(result.total_count as usize, result.txs.len()); // Test a few selected attributes of the results. for tx in result.txs { @@ -1365,10 +1349,7 @@ fn incoming_fixtures() { } }, "tx_search_with_prove" => { - let result: endpoint::tx_search::Response = - endpoint::tx_search::DialectResponse::::from_string(content) - .unwrap() - .into(); + let result = endpoint::tx_search::Response::from_string(content).unwrap(); assert_eq!(result.total_count as usize, result.txs.len()); // Test a few selected attributes of the results. for tx in result.txs { From 14cda479e14217b8b492500a065a35d3692c7cb2 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Fri, 19 May 2023 20:02:14 +0300 Subject: [PATCH 06/27] rpc: recognize 0.38 in CompatMode::from_version --- rpc/src/client/compat.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rpc/src/client/compat.rs b/rpc/src/client/compat.rs index ccc698097..5ed0fea7c 100644 --- a/rpc/src/client/compat.rs +++ b/rpc/src/client/compat.rs @@ -49,6 +49,7 @@ impl CompatMode { match (version.major, version.minor) { (0, 34) => Ok(CompatMode::V0_34), (0, 37) => Ok(CompatMode::V0_37), + (0, 38) => Ok(CompatMode::V0_37), _ => Err(Error::unsupported_tendermint_version(version.to_string())), } } From ba7045636ef287b7fad28c47533724029b10810f Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 22 May 2023 14:07:51 +0300 Subject: [PATCH 07/27] Fix CompatMode parsing test --- rpc/src/client/compat.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpc/src/client/compat.rs b/rpc/src/client/compat.rs index 5ed0fea7c..05824d875 100644 --- a/rpc/src/client/compat.rs +++ b/rpc/src/client/compat.rs @@ -89,7 +89,11 @@ mod tests { CompatMode::from_version(parse_version("v0.37.0")).unwrap(), CompatMode::V0_37 ); - let res = CompatMode::from_version(parse_version("v0.38.0")); + assert_eq!( + CompatMode::from_version(parse_version("v0.38.0")).unwrap(), + CompatMode::V0_37 + ); + let res = CompatMode::from_version(parse_version("v0.39.0")); assert!(res.is_err()); let res = CompatMode::from_version(parse_version("v1.0.0")); assert!(res.is_err()); From c8d8497203e6833890331a573471393cd8dc5779 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 22 May 2023 15:15:12 +0300 Subject: [PATCH 08/27] Fix deserialization of RPC results Some serde attributes were not migrated onto the ExecTxResult domain type when it has been tasked with deserializing the latest RPC dialect. On abci::response::CheckTx, add serde(default) on fields that are no longer present in CometBFT 0.38. --- tendermint/src/abci/response/check_tx.rs | 3 +++ tendermint/src/abci/types.rs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tendermint/src/abci/response/check_tx.rs b/tendermint/src/abci/response/check_tx.rs index d0685013e..7786b2737 100644 --- a/tendermint/src/abci/response/check_tx.rs +++ b/tendermint/src/abci/response/check_tx.rs @@ -36,11 +36,14 @@ pub struct CheckTx { /// The namespace for the `code`. pub codespace: String, /// The transactions's sender. Not used since CometBFT 0.38. + #[serde(default)] pub sender: String, /// Priority for the mempool. Not used since CometBFT 0.38. + #[serde(default)] #[serde(with = "serializers::from_str")] pub priority: i64, /// Error reported for the mempool. Not used since CometBFT 0.38. + #[serde(default)] pub mempool_error: String, } diff --git a/tendermint/src/abci/types.rs b/tendermint/src/abci/types.rs index d03ae2130..f52b4bf47 100644 --- a/tendermint/src/abci/types.rs +++ b/tendermint/src/abci/types.rs @@ -12,7 +12,7 @@ use super::{Code, Event}; use crate::{ block::{self, BlockIdFlag}, prelude::*, - vote, Signature, Time, + serializers, vote, Signature, Time, }; /// A validator address with voting power. @@ -205,6 +205,7 @@ pub struct ExecTxResult { /// the application state. pub code: Code, /// Result bytes, if any. + #[serde(with = "serializers::nullable")] pub data: Bytes, /// The output of the application's logger. /// @@ -215,8 +216,10 @@ pub struct ExecTxResult { /// **May be non-deterministic**. pub info: String, /// Amount of gas requested for the transaction. + #[serde(with = "serializers::from_str")] pub gas_wanted: i64, /// Amount of gas consumed by the transaction. + #[serde(with = "serializers::from_str")] pub gas_used: i64, /// Events that occurred while executing the transaction. pub events: Vec, From 009e6969bcc6fd7c33e212c280ab8ff46873b134 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 22 May 2023 15:17:08 +0300 Subject: [PATCH 09/27] rpc: 0.37 compat on /block_results response If the finalize_block_events is not present, default to an empty vector. Conversely, skip the field from serializing if it's set to an empty vector. --- rpc/src/endpoint/block_results.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rpc/src/endpoint/block_results.rs b/rpc/src/endpoint/block_results.rs index 91bef979e..7b39ac3ad 100644 --- a/rpc/src/endpoint/block_results.rs +++ b/rpc/src/endpoint/block_results.rs @@ -59,6 +59,7 @@ pub struct Response { /// Events from FinalizeBlock. /// /// This field is only populated with events since CometBFT version 0.38. + #[serde(default, skip_serializing_if = "Vec::is_empty")] #[serde(deserialize_with = "serializers::nullable::deserialize")] pub finalize_block_events: Vec, From 7ba4b1cb8d02c30f1424de8258acd8e3a7b57f6f Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 22 May 2023 16:54:56 +0300 Subject: [PATCH 10/27] Add kvstore fixtures for 0.38 --- rpc/tests/kvstore_fixtures.rs | 1 + rpc/tests/kvstore_fixtures/v0_38.rs | 1412 +++++++++ .../v0_38/incoming/abci_info.json | 13 + .../abci_query_with_existing_key.json | 17 + .../abci_query_with_non_existent_key.json | 17 + .../v0_38/incoming/block_at_height_0.json | 9 + .../v0_38/incoming/block_at_height_1.json | 58 + .../v0_38/incoming/block_at_height_10.json | 65 + .../v0_38/incoming/block_by_hash.json | 65 + .../incoming/block_results_at_height_10.json | 12 + .../v0_38/incoming/block_search.json | 2754 +++++++++++++++++ .../incoming/blockchain_from_1_to_10.json | 369 +++ .../v0_38/incoming/broadcast_tx_async.json | 11 + .../v0_38/incoming/broadcast_tx_commit.json | 79 + .../v0_38/incoming/broadcast_tx_sync.json | 11 + .../v0_38/incoming/commit_at_height_10.json | 53 + .../v0_38/incoming/consensus_params.json | 29 + .../v0_38/incoming/consensus_state.json | 30 + .../v0_38/incoming/genesis.json | 45 + .../v0_38/incoming/net_info.json | 12 + .../v0_38/incoming/status.json | 42 + .../v0_38/incoming/subscribe_malformed.json | 9 + .../v0_38/incoming/subscribe_newblock.json | 1 + .../v0_38/incoming/subscribe_newblock_0.json | 80 + .../v0_38/incoming/subscribe_newblock_1.json | 80 + .../v0_38/incoming/subscribe_newblock_2.json | 80 + .../v0_38/incoming/subscribe_newblock_3.json | 80 + .../v0_38/incoming/subscribe_newblock_4.json | 80 + .../v0_38/incoming/subscribe_txs.json | 5 + .../v0_38/incoming/subscribe_txs_0.json | 97 + .../v0_38/incoming/subscribe_txs_1.json | 97 + .../v0_38/incoming/subscribe_txs_2.json | 97 + .../v0_38/incoming/subscribe_txs_3.json | 97 + .../v0_38/incoming/subscribe_txs_4.json | 97 + .../subscribe_txs_broadcast_tx_0.json | 11 + .../subscribe_txs_broadcast_tx_1.json | 11 + .../subscribe_txs_broadcast_tx_2.json | 11 + .../subscribe_txs_broadcast_tx_3.json | 11 + .../subscribe_txs_broadcast_tx_4.json | 11 + .../subscribe_txs_broadcast_tx_5.json | 11 + .../v0_38/incoming/tx_search_no_prove.json | 612 ++++ .../v0_38/incoming/tx_search_with_prove.json | 702 +++++ .../v0_38/outgoing/abci_info.json | 6 + .../abci_query_with_existing_key.json | 8 + .../abci_query_with_non_existent_key.json | 8 + .../v0_38/outgoing/block_at_height_0.json | 8 + .../v0_38/outgoing/block_at_height_1.json | 8 + .../v0_38/outgoing/block_at_height_10.json | 8 + .../v0_38/outgoing/block_by_hash.json | 8 + .../outgoing/block_results_at_height_10.json | 8 + .../v0_38/outgoing/block_search.json | 11 + .../outgoing/blockchain_from_1_to_10.json | 9 + .../v0_38/outgoing/broadcast_tx_async.json | 8 + .../v0_38/outgoing/broadcast_tx_commit.json | 8 + .../v0_38/outgoing/broadcast_tx_sync.json | 8 + .../v0_38/outgoing/commit_at_height_10.json | 8 + .../v0_38/outgoing/consensus_params.json | 8 + .../v0_38/outgoing/consensus_state.json | 6 + .../v0_38/outgoing/genesis.json | 6 + .../v0_38/outgoing/net_info.json | 6 + .../v0_38/outgoing/status.json | 6 + .../v0_38/outgoing/subscribe_malformed.json | 8 + .../v0_38/outgoing/subscribe_newblock.json | 8 + .../v0_38/outgoing/subscribe_txs.json | 8 + .../subscribe_txs_broadcast_tx_0.json | 8 + .../subscribe_txs_broadcast_tx_1.json | 8 + .../subscribe_txs_broadcast_tx_2.json | 8 + .../subscribe_txs_broadcast_tx_3.json | 8 + .../subscribe_txs_broadcast_tx_4.json | 8 + .../subscribe_txs_broadcast_tx_5.json | 8 + .../v0_38/outgoing/tx_search_no_prove.json | 12 + .../v0_38/outgoing/tx_search_with_prove.json | 12 + 72 files changed, 7626 insertions(+) create mode 100644 rpc/tests/kvstore_fixtures/v0_38.rs create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/abci_info.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/abci_query_with_existing_key.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/abci_query_with_non_existent_key.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_0.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_1.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_10.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/block_by_hash.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/block_results_at_height_10.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/block_search.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/blockchain_from_1_to_10.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_async.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_commit.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_sync.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/commit_at_height_10.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/consensus_params.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/consensus_state.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/genesis.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/net_info.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/status.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_malformed.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_0.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_1.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_2.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_3.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_4.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_0.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_1.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_2.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_3.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_4.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_0.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_1.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_2.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_3.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_4.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_5.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/tx_search_no_prove.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/incoming/tx_search_with_prove.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_info.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_query_with_existing_key.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_query_with_non_existent_key.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_0.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_1.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_10.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/block_by_hash.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/block_results_at_height_10.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/block_search.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/blockchain_from_1_to_10.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_async.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_commit.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_sync.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/commit_at_height_10.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/consensus_params.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/consensus_state.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/genesis.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/net_info.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/status.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_malformed.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_newblock.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_0.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_1.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_2.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_3.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_4.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_5.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/tx_search_no_prove.json create mode 100644 rpc/tests/kvstore_fixtures/v0_38/outgoing/tx_search_with_prove.json diff --git a/rpc/tests/kvstore_fixtures.rs b/rpc/tests/kvstore_fixtures.rs index 76a31ea86..837bbb9aa 100644 --- a/rpc/tests/kvstore_fixtures.rs +++ b/rpc/tests/kvstore_fixtures.rs @@ -28,6 +28,7 @@ mod kvstore_fixtures { use super::*; mod v0_34; mod v0_37; + mod v0_38; } fn find_fixtures(ver_folder_name: &str, in_out_folder_name: &str) -> Vec { diff --git a/rpc/tests/kvstore_fixtures/v0_38.rs b/rpc/tests/kvstore_fixtures/v0_38.rs new file mode 100644 index 000000000..08406a839 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38.rs @@ -0,0 +1,1412 @@ +use super::*; + +#[test] +fn outgoing_fixtures() { + for json_file in find_fixtures("v0_38", "outgoing") { + let file_name = json_file + .file_name() + .unwrap() + .to_str() + .unwrap() + .strip_suffix(".json") + .unwrap(); + let content = fs::read_to_string(&json_file).unwrap(); + match file_name { + "abci_info" => assert!(serde_json::from_str::< + RequestWrapper, + >(&content) + .is_ok()), + "abci_query_with_existing_key" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert!(wrapped.params().path.is_none()); + assert_eq!(wrapped.params().data, hex::decode("747830").unwrap()); + assert!(wrapped.params().height.is_none()); + assert!(!wrapped.params().prove); + }, + "abci_query_with_non_existent_key" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert!(wrapped.params().path.is_none()); + assert_eq!( + wrapped.params().data, + hex::decode("6e6f6e5f6578697374656e745f6b6579").unwrap() + ); + assert!(wrapped.params().height.is_none()); + assert!(!wrapped.params().prove); + }, + "block_at_height_0" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().height.unwrap().value(), 0); + }, + "block_at_height_1" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().height.unwrap().value(), 1); + }, + "block_at_height_10" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().height.unwrap().value(), 10); + }, + "block_by_hash" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!( + wrapped.params().hash.unwrap().to_string(), + "47493B51E102705F6DCCE5981E05B7C025BB5BF19CF5E4B54FE28CAFE9D20C8A" + ); + }, + "block_results_at_height_10" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!(wrapped.params().height.unwrap().value(), 10); + }, + "block_search" => { + let wrapped = + serde_json::from_str::>( + &content, + ) + .unwrap(); + assert_eq!(wrapped.params().query, "block.height > 1"); + assert_eq!(wrapped.params().page, 1); + assert_eq!(wrapped.params().per_page, 100); + assert_eq!(wrapped.params().order_by, Order::Ascending); + }, + "blockchain_from_1_to_10" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().min_height.value(), 1); + assert_eq!(wrapped.params().max_height.value(), 10); + }, + "broadcast_tx_async" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!( + wrapped.params().tx, + base64::decode("YXN5bmMta2V5PXZhbHVl").unwrap() + ); + }, + "broadcast_tx_commit" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!( + wrapped.params().tx, + base64::decode("Y29tbWl0LWtleT12YWx1ZQ==").unwrap() + ); + }, + "broadcast_tx_sync" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!( + wrapped.params().tx, + base64::decode("c3luYy1rZXk9dmFsdWU=").unwrap() + ); + }, + "commit_at_height_10" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().height.unwrap().value(), 10); + }, + "consensus_params" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + let height = wrapped.params().height.unwrap(); + assert_eq!(u64::from(height), 10u64); + }, + "consensus_state" => assert!(serde_json::from_str::< + RequestWrapper, + >(&content) + .is_ok()), + "genesis" => assert!(serde_json::from_str::< + RequestWrapper>, + >(&content) + .is_ok()), + "net_info" => assert!(serde_json::from_str::< + RequestWrapper, + >(&content) + .is_ok()), + "status" => assert!( + serde_json::from_str::>(&content).is_ok() + ), + "subscribe_malformed" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().query, "malformed query"); + }, + "subscribe_newblock" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().query, "tm.event = 'NewBlock'"); + }, + "subscribe_txs" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().query, "tm.event = 'Tx'"); + }, + "subscribe_txs_broadcast_tx_0" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!(wrapped.params().tx, base64::decode("dHgwPXZhbHVl").unwrap()); + }, + "subscribe_txs_broadcast_tx_1" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!(wrapped.params().tx, base64::decode("dHgxPXZhbHVl").unwrap()); + }, + "subscribe_txs_broadcast_tx_2" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!(wrapped.params().tx, base64::decode("dHgyPXZhbHVl").unwrap()); + }, + "subscribe_txs_broadcast_tx_3" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!(wrapped.params().tx, base64::decode("dHgzPXZhbHVl").unwrap()); + }, + "subscribe_txs_broadcast_tx_4" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!(wrapped.params().tx, base64::decode("dHg0PXZhbHVl").unwrap()); + }, + "subscribe_txs_broadcast_tx_5" => { + let wrapped = serde_json::from_str::< + RequestWrapper, + >(&content) + .unwrap(); + assert_eq!(wrapped.params().tx, base64::decode("dHg1PXZhbHVl").unwrap()); + }, + "tx" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!( + wrapped.params().hash, + Hash::from_bytes( + Algorithm::Sha256, + &[ + 214, 63, 156, 35, 121, 30, 97, 4, 16, 181, 118, 216, 194, 123, 181, + 174, 172, 147, 204, 26, 88, 82, 36, 40, 167, 179, 42, 18, 118, 8, 88, + 96 + ] + ) + .unwrap() + ); + assert!(!wrapped.params().prove); + }, + "tx_search_no_prove" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().query, "tx.height > 1"); + assert!(!wrapped.params().prove); + assert_eq!(wrapped.params().page, 1); + assert_eq!(wrapped.params().per_page, 10); + assert_eq!(wrapped.params().order_by, Order::Ascending); + }, + "tx_search_with_prove" => { + let wrapped = + serde_json::from_str::>(&content) + .unwrap(); + assert_eq!(wrapped.params().query, "tx.height > 1"); + assert!(wrapped.params().prove); + assert_eq!(wrapped.params().page, 1); + assert_eq!(wrapped.params().per_page, 10); + assert_eq!(wrapped.params().order_by, Order::Ascending); + }, + _ => { + panic!("cannot parse file name: {file_name}"); + }, + } + } +} + +#[test] +fn incoming_fixtures() { + use tendermint::abci::Event as RpcEvent; + + let empty_merkle_root_hash = Some( + tendermint::Hash::from_hex_upper( + tendermint::hash::Algorithm::Sha256, + "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + ) + .unwrap(), + ); + let informal_epoch = + tendermint::Time::parse_from_rfc3339("2020-01-01T00:00:00.000000000Z").unwrap(); + + for json_file in find_fixtures("v0_38", "incoming") { + let file_name = json_file + .file_name() + .unwrap() + .to_str() + .unwrap() + .strip_suffix(".json") + .unwrap(); + let content = fs::read_to_string(&json_file).unwrap(); + match file_name { + "abci_info" => { + let result = endpoint::abci_info::Response::from_string(content).unwrap(); + assert_eq!(result.response.app_version, 1); + assert_eq!(result.response.data, "{\"size\":0}"); + assert_eq!( + result.response.last_block_app_hash.as_bytes(), + b"AAAAAAAAAAA=" + ); + assert_eq!(result.response.version, "2.0.0"); + }, + "abci_query_with_existing_key" => { + let result = endpoint::abci_query::Response::from_string(content).unwrap(); + assert_eq!(result.response.code.value(), 0); + assert!(result.response.codespace.is_empty()); + assert_eq!(result.response.index, 0); + assert!(result.response.info.is_empty()); + assert_eq!(result.response.key, base64::decode("dHgw").unwrap()); + assert_eq!(result.response.log, "exists"); + assert!(result.response.proof.is_none()); + assert_eq!(result.response.value, base64::decode("dmFsdWU=").unwrap()); + }, + "abci_query_with_non_existent_key" => { + let result = endpoint::abci_query::Response::from_string(content).unwrap(); + assert_eq!(result.response.code.value(), 0); + assert!(result.response.codespace.is_empty()); + assert_eq!(result.response.index, 0); + assert!(result.response.info.is_empty()); + assert_eq!( + result.response.key, + base64::decode("bm9uX2V4aXN0ZW50X2tleQ==").unwrap() + ); + assert_eq!(result.response.log, "does not exist"); + assert!(result.response.proof.is_none()); + assert!(result.response.value.is_empty()); + }, + "block_at_height_0" => { + let res = endpoint::block::Response::from_string(&content); + + match res { + Err(Error(ErrorDetail::Response(e), _)) => { + let response = e.source; + assert_eq!(response.code(), Code::InternalError); + assert_eq!(response.message(), "Internal error"); + assert_eq!( + response.data(), + Some("height must be greater than 0, but got 0") + ); + }, + _ => panic!("expected Response error"), + } + }, + "block_at_height_1" => { + let result = endpoint::block::Response::from_string(content).unwrap(); + assert!(result.block.data.get(0).is_none()); + assert!(result.block.evidence.iter().next().is_none()); + assert_eq!(result.block.header.app_hash.as_bytes(), [0u8; 8]); + assert_eq!(result.block.header.chain_id.as_str(), CHAIN_ID); + assert!(!result.block.header.consensus_hash.is_empty()); + assert_eq!(result.block.header.data_hash, empty_merkle_root_hash); + assert_eq!(result.block.header.evidence_hash, empty_merkle_root_hash); + assert_eq!(result.block.header.height.value(), 1); + assert!(result.block.header.last_block_id.is_none()); + assert_eq!(result.block.header.last_commit_hash, empty_merkle_root_hash); + assert_eq!( + result.block.header.last_results_hash, + empty_merkle_root_hash + ); + assert!(!result.block.header.next_validators_hash.is_empty()); + assert_ne!( + result.block.header.proposer_address.as_bytes(), + [0u8; tendermint::account::LENGTH] + ); + assert!( + result + .block + .header + .time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(!result.block.header.validators_hash.is_empty()); + assert_eq!( + result.block.header.version, + tendermint::block::header::Version { block: 11, app: 1 } + ); + assert!(result.block.last_commit.is_none()); + assert!(!result.block_id.hash.is_empty()); + assert!(!result.block_id.part_set_header.hash.is_empty()); + assert_eq!(result.block_id.part_set_header.total, 1); + }, + "block_at_height_10" => { + let result = endpoint::block::Response::from_string(content).unwrap(); + assert!(result.block.data.get(0).is_none()); + assert!(result.block.evidence.iter().next().is_none()); + assert_eq!(result.block.header.app_hash.as_bytes(), &[0u8; 8]); + assert_eq!(result.block.header.chain_id.as_str(), CHAIN_ID); + assert!(!result.block.header.consensus_hash.is_empty()); + assert_eq!(result.block.header.data_hash, empty_merkle_root_hash); + assert_eq!(result.block.header.evidence_hash, empty_merkle_root_hash); + assert_eq!(result.block.header.height.value(), 10); + assert!(result.block.header.last_block_id.is_some()); + assert!(result.block.header.last_commit_hash.is_some()); + assert!(result.block.header.last_results_hash.is_some()); + assert!(!result.block.header.next_validators_hash.is_empty()); + assert_ne!( + result.block.header.proposer_address.as_bytes(), + [0u8; tendermint::account::LENGTH] + ); + assert!( + result + .block + .header + .time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(!result.block.header.validators_hash.is_empty()); + assert_eq!( + result.block.header.version, + tendermint::block::header::Version { block: 11, app: 1 } + ); + let last_commit = result.block.last_commit.unwrap(); + assert!(!last_commit.block_id.hash.is_empty()); + assert!(!last_commit.block_id.part_set_header.hash.is_empty()); + assert_eq!(last_commit.block_id.part_set_header.total, 1); + assert_eq!(last_commit.height.value(), 9); + assert_eq!(last_commit.round.value(), 0); + assert_eq!(last_commit.signatures.len(), 1); + assert!(last_commit.signatures[0].is_commit()); + assert!(last_commit.signatures[0].validator_address().is_some()); + // It's weird but there is no implementation to get the signature out of CommitSig. + assert!(!result.block_id.hash.is_empty()); + assert!(!result.block_id.part_set_header.hash.is_empty()); + assert_eq!(result.block_id.part_set_header.total, 1); + }, + "block_results_at_height_10" => { + let result = endpoint::block_results::Response::from_string(content).unwrap(); + assert!(result.begin_block_events.is_none()); + assert!(result.consensus_param_updates.is_none()); + 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()); + }, + "block_by_hash" => { + let result = endpoint::block_by_hash::Response::from_string(content).unwrap(); + assert_eq!( + result.block_id.hash.to_string(), + "47493B51E102705F6DCCE5981E05B7C025BB5BF19CF5E4B54FE28CAFE9D20C8A" + ); + }, + "block_search" => { + let result = endpoint::block_search::Response::from_string(content).unwrap(); + assert_eq!(result.total_count as usize, result.blocks.len()); + for response in result.blocks { + assert!(response.block.header.height.value() > 1); + } + }, + "block_search_evidence" => { + let result = endpoint::block_search::Response::from_string(content).unwrap(); + assert_eq!(result.total_count as usize, result.blocks.len()); + + // Test a few selected attributes of the results. + for block in result.blocks { + let evidence = block.block.evidence.iter().next().unwrap(); + + use tendermint::vote; + + fn check_vote(vote: &Vote) { + assert_eq!(vote.vote_type, vote::Type::Precommit); + assert_eq!(vote.height.value(), 8009); + assert_eq!(vote.round.value(), 0); + assert_eq!( + vote.validator_address, + "9319035301DA526CC78DCF174A47A74F81401291".parse().unwrap(), + ); + assert_eq!(vote.validator_index.value(), 8); + } + + if let Evidence::DuplicateVote(dup) = evidence { + assert_eq!(dup.total_voting_power.value(), 121); + assert_eq!(dup.validator_power.value(), 1); + assert_eq!( + dup.timestamp, + "2022-09-12T19:49:49.984608464Z".parse().unwrap() + ); + + check_vote(&dup.vote_a); + check_vote(&dup.vote_b); + } else { + panic!("not a duplicate vote: {evidence:?}"); + } + } + }, + "broadcast_tx_async" => { + let result = endpoint::broadcast::tx_async::Response::from_string(content).unwrap(); + assert_eq!(result.code, abci::Code::Ok); + assert!(result.data.is_empty()); + assert_ne!( + result.hash, + Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() + ); + assert!(result.log.is_empty()); + }, + "broadcast_tx_commit" => { + let result = + endpoint::broadcast::tx_commit::Response::from_string(content).unwrap(); + assert_eq!(result.check_tx.code, abci::Code::Ok); + assert!(result.check_tx.codespace.is_empty()); + assert!(result.check_tx.data.is_empty()); + assert!(result.check_tx.events.is_empty()); + assert_eq!(result.check_tx.gas_used, 0); + // Todo: https://github.com/informalsystems/tendermint-rs/issues/761 + // assert_eq!(result.check_tx.gas_wanted.value(), 1); + assert!(result.check_tx.info.to_string().is_empty()); + assert!(result.check_tx.log.is_empty()); + assert_eq!(result.tx_result.code, abci::Code::Ok); + assert!(result.tx_result.codespace.is_empty()); + assert!(result.tx_result.data.is_empty()); + assert_eq!(result.tx_result.events.len(), 2); + assert_eq!(result.tx_result.events[0].attributes.len(), 4); + assert_eq!(result.tx_result.events[0].attributes[0].key, "creator"); + assert_eq!( + result.tx_result.events[0].attributes[0].value, + "Cosmoshi Netowoko" + ); + assert_eq!(result.tx_result.events[0].attributes[1].key, "key"); + assert_eq!(result.tx_result.events[0].attributes[1].value, "commit-key"); + assert_eq!(result.tx_result.events[0].attributes[2].key, "index_key"); + assert_eq!( + result.tx_result.events[0].attributes[2].value, + "index is working" + ); + assert_eq!(result.tx_result.events[0].attributes[3].key, "noindex_key"); + assert_eq!( + result.tx_result.events[0].attributes[3].value, + "index is working" + ); + assert_eq!(result.tx_result.events[0].kind, "app"); + assert_eq!(result.tx_result.gas_used, 0); + assert_eq!(result.tx_result.gas_wanted, 0); + assert!(result.tx_result.info.to_string().is_empty()); + assert!(result.tx_result.log.is_empty()); + assert_ne!( + result.hash, + Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() + ); + }, + "broadcast_tx_sync" => { + let result = endpoint::broadcast::tx_sync::Response::from_string(content).unwrap(); + assert_eq!(result.code, abci::Code::Ok); + assert!(result.data.is_empty()); + assert_ne!( + result.hash, + Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() + ); + assert!(result.log.is_empty()); + }, + "commit_at_height_10" => { + let result = endpoint::commit::Response::from_string(content).unwrap(); + assert!(!result.signed_header.commit.block_id.hash.is_empty()); + assert_eq!(result.signed_header.commit.height.value(), 10); + assert_eq!(result.signed_header.commit.round.value(), 0); + assert_eq!(result.signed_header.commit.signatures.len(), 1); + assert!(result.signed_header.commit.signatures[0].is_commit()); + assert!(result.signed_header.commit.signatures[0] + .validator_address() + .is_some()); + assert_eq!(result.signed_header.header.app_hash.as_bytes(), [0u8; 8]); + assert_eq!(result.signed_header.header.chain_id.as_str(), CHAIN_ID); + assert!(!result.signed_header.header.consensus_hash.is_empty()); + assert_eq!( + result.signed_header.header.data_hash, + empty_merkle_root_hash + ); + assert_eq!( + result.signed_header.header.evidence_hash, + empty_merkle_root_hash + ); + assert_eq!(result.signed_header.header.height.value(), 10); + assert!(result.signed_header.header.last_block_id.is_some()); + assert!(result.signed_header.header.last_commit_hash.is_some()); + assert!(result.signed_header.header.last_results_hash.is_some()); + assert!(!result.signed_header.header.next_validators_hash.is_empty()); + assert_ne!( + result.signed_header.header.proposer_address.as_bytes(), + [0u8; tendermint::account::LENGTH] + ); + assert!( + result + .signed_header + .header + .time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(!result.signed_header.header.validators_hash.is_empty()); + assert_eq!( + result.signed_header.header.version, + tendermint::block::header::Version { block: 11, app: 1 } + ); + }, + "consensus_params" => { + let result = endpoint::consensus_params::Response::from_string(content).unwrap(); + assert_eq!(u64::from(result.block_height), 10_u64); + assert_eq!(result.consensus_params.block.max_bytes, 22020096_u64); + assert_eq!(result.consensus_params.block.max_gas, -1_i64); + assert_eq!(result.consensus_params.block.time_iota_ms, 1000_i64); + assert_eq!( + result.consensus_params.evidence.max_age_duration, + Duration(core::time::Duration::from_nanos(172800000000000_u64)) + ); + assert_eq!( + result.consensus_params.evidence.max_age_num_blocks, + 100000_u64 + ); + assert_eq!(result.consensus_params.evidence.max_bytes, 1048576_i64); + assert_eq!( + result.consensus_params.validator.pub_key_types, + vec![public_key::Algorithm::Ed25519] + ); + }, + "consensus_state" => { + assert!(endpoint::consensus_state::Response::from_string(content).is_ok()); + }, + "genesis" => { + let result = + endpoint::genesis::Response::>::from_string(content) + .unwrap(); + assert!(result.genesis.app_hash.as_bytes().is_empty()); + assert_eq!(result.genesis.chain_id.as_str(), CHAIN_ID); + assert_eq!(result.genesis.consensus_params.block.max_bytes, 22020096); + assert_eq!(result.genesis.consensus_params.block.max_gas, -1); + assert_eq!( + result + .genesis + .consensus_params + .evidence + .max_age_duration + .0 + .as_nanos(), + 172800000000000 + ); + assert_eq!( + result.genesis.consensus_params.evidence.max_age_num_blocks, + 100000 + ); + assert_eq!(result.genesis.consensus_params.evidence.max_bytes, 1048576); + assert_eq!( + result + .genesis + .consensus_params + .validator + .pub_key_types + .len(), + 1 + ); + assert_eq!( + result.genesis.consensus_params.validator.pub_key_types[0], + tendermint::public_key::Algorithm::Ed25519 + ); + assert!(result.genesis.consensus_params.version.is_none()); + assert!( + result + .genesis + .genesis_time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert_eq!(result.genesis.validators.len(), 1); + assert_ne!( + result.genesis.validators[0].address.as_bytes(), + [0; tendermint::account::LENGTH] + ); + 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, 1000); + }, + "net_info" => { + let result = endpoint::net_info::Response::from_string(content).unwrap(); + assert_eq!(result.listeners.len(), 1); + assert_eq!(result.listeners[0].to_string(), "Listener(@)"); + assert!(result.listening); + assert_eq!(result.n_peers, 0); + assert!(result.peers.is_empty()); + }, + "status" => { + let result = endpoint::status::Response::from_string(content).unwrap(); + assert_eq!( + Address::from_listen_address(&result.node_info.listen_addr).unwrap(), + Address::from_str("tcp://0.0.0.0:26656").unwrap() + ); + assert_eq!(result.node_info.moniker.to_string(), "dockernode"); + assert_eq!(result.node_info.network.to_string(), CHAIN_ID); + assert_eq!( + result.node_info.other.rpc_address, + format!("{}", Address::from_str("tcp://0.0.0.0:26657").unwrap()) + ); + assert_eq!( + result.node_info.other.tx_index, + tendermint::node::info::TxIndexStatus::On + ); + assert_eq!( + result.node_info.protocol_version, + tendermint::node::info::ProtocolVersionInfo { + p2p: 8, + block: 11, + app: 1 + } + ); + assert_eq!(result.node_info.version.to_string(), "0.38.0-alpha.1"); + assert!(!result.sync_info.catching_up); + assert_eq!( + result.sync_info.latest_app_hash.as_bytes(), + [6, 0, 0, 0, 0, 0, 0, 0] + ); + assert!(!result.sync_info.latest_block_hash.is_empty()); + assert!( + result + .sync_info + .latest_block_time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(result.validator_info.pub_key.ed25519().is_some()); + assert_eq!(result.validator_info.power.value(), 10); + }, + "blockchain_from_1_to_10" => { + let result = endpoint::blockchain::Response::from_string(content).unwrap(); + assert_eq!(result.block_metas.len(), 10); + for block_meta in result.block_metas { + assert!(!block_meta.block_id.hash.is_empty()); + assert!(!block_meta.block_id.part_set_header.hash.is_empty()); + assert_eq!(block_meta.block_id.part_set_header.total, 1); + assert!(block_meta.block_size > 0); + if block_meta.header.height.value() == 1 { + assert_eq!(block_meta.header.app_hash.as_bytes(), &[0u8; 8]); + assert_eq!(block_meta.header.data_hash, empty_merkle_root_hash); + assert_eq!(block_meta.header.evidence_hash, empty_merkle_root_hash); + assert!(block_meta.header.last_block_id.is_none()); + assert_eq!(block_meta.header.last_commit_hash, empty_merkle_root_hash); + assert_eq!(block_meta.header.last_results_hash, empty_merkle_root_hash); + } else { + assert!(!block_meta.header.app_hash.as_bytes().is_empty()); + assert!(block_meta.header.data_hash.is_some()); + assert!(block_meta.header.evidence_hash.is_some()); + assert!(block_meta.header.last_block_id.is_some()); + assert!(block_meta.header.last_commit_hash.is_some()); + assert!(block_meta.header.last_results_hash.is_some()); + } + assert_eq!(block_meta.header.chain_id.as_str(), CHAIN_ID); + assert!(!block_meta.header.consensus_hash.is_empty()); + assert!(!block_meta.header.next_validators_hash.is_empty()); + assert_ne!( + block_meta.header.proposer_address.as_bytes(), + [0u8; tendermint::account::LENGTH] + ); + assert!( + block_meta + .header + .time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(!block_meta.header.validators_hash.is_empty()); + assert_eq!( + block_meta.header.version, + tendermint::block::header::Version { block: 11, app: 1 } + ); + assert_eq!(block_meta.num_txs, 0); + } + }, + "subscribe_malformed" => { + let result = endpoint::subscribe::Response::from_string(content); + + match result { + Err(Error(ErrorDetail::Response(e), _)) => { + let response = e.source; + + assert_eq!(response.code(), Code::InternalError); + assert_eq!(response.message(), "Internal error"); + assert_eq!(response.data().unwrap(),"failed to parse query: \nparse error near PegText (line 1 symbol 2 - line 1 symbol 11):\n\"malformed\"\n"); + }, + _ => panic!("expected Response error"), + } + }, + "subscribe_newblock" => { + let result = endpoint::subscribe::Response::from_string(content); + + match result { + Err(Error(ErrorDetail::Serde(_), _)) => {}, + _ => panic!("expected Serde parse error, instead got {result:?}"), + } + }, + "subscribe_newblock_0" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + if let tendermint_rpc::event::EventData::NewBlock { + block, + result_begin_block, + result_end_block, + } = result.data.into() + { + let b = block.unwrap(); + assert!(b.data.get(0).is_none()); + assert!(b.evidence.iter().next().is_none()); + assert!(!b.header.app_hash.as_bytes().is_empty()); + assert_eq!(b.header.chain_id.as_str(), CHAIN_ID); + assert!(!b.header.consensus_hash.is_empty()); + assert_eq!(b.header.data_hash, empty_merkle_root_hash); + assert_eq!(b.header.evidence_hash, empty_merkle_root_hash); + assert!(b.header.last_block_id.is_some()); + assert!(b.header.last_commit_hash.is_some()); + assert!(b.header.last_results_hash.is_some()); + assert!(!b.header.next_validators_hash.is_empty()); + assert_ne!( + b.header.proposer_address.as_bytes(), + [0u8; tendermint::account::LENGTH] + ); + assert!( + b.header + .time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(!b.header.validators_hash.is_empty()); + assert_eq!( + b.header.version, + tendermint::block::header::Version { block: 11, app: 1 } + ); + let last_commit = b.last_commit.unwrap(); + assert!(!last_commit.block_id.hash.is_empty()); + assert!(!last_commit.block_id.part_set_header.hash.is_empty()); + assert_eq!(last_commit.block_id.part_set_header.total, 1); + assert_eq!(last_commit.round.value(), 0); + assert_eq!(last_commit.signatures.len(), 1); + assert!(last_commit.signatures[0].is_commit()); + assert!(last_commit.signatures[0].validator_address().is_some()); + assert!(result_begin_block.unwrap().events.is_empty()); + let reb = result_end_block.unwrap(); + assert!(reb.validator_updates.is_empty()); + assert!(reb.consensus_param_updates.is_none()); + assert!(reb.events.is_empty()); + } else { + panic!("not a newblock"); + } + assert_eq!(result.query, "tm.event = 'NewBlock'"); + }, + "subscribe_newblock_1" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + if let tendermint_rpc::event::EventData::NewBlock { + block, + result_begin_block, + result_end_block, + } = result.data.into() + { + let b = block.unwrap(); + assert!(b.data.get(0).is_none()); + assert!(b.evidence.iter().next().is_none()); + assert!(!b.header.app_hash.as_bytes().is_empty()); + assert_eq!(b.header.chain_id.as_str(), CHAIN_ID); + assert!(!b.header.consensus_hash.is_empty()); + assert_eq!(b.header.data_hash, empty_merkle_root_hash); + assert_eq!(b.header.evidence_hash, empty_merkle_root_hash); + assert!(b.header.last_block_id.is_some()); + assert!(b.header.last_commit_hash.is_some()); + assert!(b.header.last_results_hash.is_some()); + assert!(!b.header.next_validators_hash.is_empty()); + assert_ne!( + b.header.proposer_address.as_bytes(), + [0u8; tendermint::account::LENGTH] + ); + assert!( + b.header + .time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(!b.header.validators_hash.is_empty()); + assert_eq!( + b.header.version, + tendermint::block::header::Version { block: 11, app: 1 } + ); + let last_commit = b.last_commit.unwrap(); + assert!(!last_commit.block_id.hash.is_empty()); + assert!(!last_commit.block_id.part_set_header.hash.is_empty()); + assert_eq!(last_commit.block_id.part_set_header.total, 1); + assert_eq!(last_commit.round.value(), 0); + assert_eq!(last_commit.signatures.len(), 1); + assert!(last_commit.signatures[0].is_commit()); + assert!(last_commit.signatures[0].validator_address().is_some()); + let rbb = result_begin_block.unwrap(); + assert_eq!(rbb.events.len(), 2); + assert_eq!(rbb.events[0].kind, "transfer"); + assert_eq!(rbb.events[0].attributes.len(), 2); + assert_eq!(rbb.events[0].attributes[0].key, "recipient"); + assert_eq!( + rbb.events[0].attributes[0].value, + "cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta" + ); + assert!(rbb.events[0].attributes[0].index); + assert_eq!(rbb.events[0].attributes[1].key, "sender"); + assert_eq!( + rbb.events[0].attributes[1].value, + "cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q" + ); + assert!(!rbb.events[0].attributes[1].index); + assert_eq!(rbb.events[1].kind, "message"); + assert_eq!(rbb.events[1].attributes.len(), 1); + assert_eq!(rbb.events[1].attributes[0].key, "sender"); + assert_eq!( + rbb.events[1].attributes[0].value, + "cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q" + ); + let reb = result_end_block.unwrap(); + assert!(reb.validator_updates.is_empty()); + assert!(reb.consensus_param_updates.is_none()); + assert!(reb.events.is_empty()); + } else { + panic!("not a newblock"); + } + assert_eq!(result.query, "tm.event = 'NewBlock'"); + }, + "subscribe_newblock_2" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + if let tendermint_rpc::event::EventData::NewBlock { + block, + result_begin_block, + result_end_block, + } = result.data.into() + { + let b = block.unwrap(); + assert!(b.data.get(0).is_none()); + assert!(b.evidence.iter().next().is_none()); + assert!(!b.header.app_hash.as_bytes().is_empty()); + assert_eq!(b.header.chain_id.as_str(), CHAIN_ID); + assert!(!b.header.consensus_hash.is_empty()); + assert_eq!(b.header.data_hash, empty_merkle_root_hash); + assert_eq!(b.header.evidence_hash, empty_merkle_root_hash); + assert!(b.header.last_block_id.is_some()); + assert!(b.header.last_commit_hash.is_some()); + assert!(b.header.last_results_hash.is_some()); + assert!(!b.header.next_validators_hash.is_empty()); + assert_ne!( + b.header.proposer_address.as_bytes(), + [0u8; tendermint::account::LENGTH] + ); + assert!( + b.header + .time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(!b.header.validators_hash.is_empty()); + assert_eq!( + b.header.version, + tendermint::block::header::Version { block: 11, app: 1 } + ); + let last_commit = b.last_commit.unwrap(); + assert!(!last_commit.block_id.hash.is_empty()); + assert!(!last_commit.block_id.part_set_header.hash.is_empty()); + assert_eq!(last_commit.block_id.part_set_header.total, 1); + assert_eq!(last_commit.round.value(), 0); + assert_eq!(last_commit.signatures.len(), 1); + assert!(last_commit.signatures[0].is_commit()); + assert!(last_commit.signatures[0].validator_address().is_some()); + assert!(result_begin_block.unwrap().events.is_empty()); + let reb = result_end_block.unwrap(); + assert!(reb.validator_updates.is_empty()); + assert!(reb.consensus_param_updates.is_none()); + assert!(reb.events.is_empty()); + } else { + panic!("not a newblock"); + } + assert_eq!(result.query, "tm.event = 'NewBlock'"); + }, + "subscribe_newblock_3" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + if let tendermint_rpc::event::EventData::NewBlock { + block, + result_begin_block, + result_end_block, + } = result.data.into() + { + let b = block.unwrap(); + assert!(b.data.get(0).is_none()); + assert!(b.evidence.iter().next().is_none()); + assert!(!b.header.app_hash.as_bytes().is_empty()); + assert_eq!(b.header.chain_id.as_str(), CHAIN_ID); + assert!(!b.header.consensus_hash.is_empty()); + assert_eq!(b.header.data_hash, empty_merkle_root_hash); + assert_eq!(b.header.evidence_hash, empty_merkle_root_hash); + assert!(b.header.last_block_id.is_some()); + assert!(b.header.last_commit_hash.is_some()); + assert!(b.header.last_results_hash.is_some()); + assert!(!b.header.next_validators_hash.is_empty()); + assert_ne!( + b.header.proposer_address.as_bytes(), + [0u8; tendermint::account::LENGTH] + ); + assert!( + b.header + .time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(!b.header.validators_hash.is_empty()); + assert_eq!( + b.header.version, + tendermint::block::header::Version { block: 11, app: 1 } + ); + let last_commit = b.last_commit.unwrap(); + assert!(!last_commit.block_id.hash.is_empty()); + assert!(!last_commit.block_id.part_set_header.hash.is_empty()); + assert_eq!(last_commit.block_id.part_set_header.total, 1); + assert_eq!(last_commit.round.value(), 0); + assert_eq!(last_commit.signatures.len(), 1); + assert!(last_commit.signatures[0].is_commit()); + assert!(last_commit.signatures[0].validator_address().is_some()); + assert!(result_begin_block.unwrap().events.is_empty()); + let reb = result_end_block.unwrap(); + assert!(reb.validator_updates.is_empty()); + assert!(reb.consensus_param_updates.is_none()); + assert!(reb.events.is_empty()); + } else { + panic!("not a newblock"); + } + assert_eq!(result.query, "tm.event = 'NewBlock'"); + }, + "subscribe_newblock_4" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + if let tendermint_rpc::event::EventData::NewBlock { + block, + result_begin_block, + result_end_block, + } = result.data.into() + { + let b = block.unwrap(); + assert!(b.data.get(0).is_none()); + assert!(b.evidence.iter().next().is_none()); + assert!(!b.header.app_hash.as_bytes().is_empty()); + assert_eq!(b.header.chain_id.as_str(), CHAIN_ID); + assert!(!b.header.consensus_hash.is_empty()); + assert_eq!(b.header.data_hash, empty_merkle_root_hash); + assert_eq!(b.header.evidence_hash, empty_merkle_root_hash); + assert!(b.header.last_block_id.is_some()); + assert!(b.header.last_commit_hash.is_some()); + assert!(b.header.last_results_hash.is_some()); + assert!(!b.header.next_validators_hash.is_empty()); + assert_ne!( + b.header.proposer_address.as_bytes(), + [0u8; tendermint::account::LENGTH] + ); + assert!( + b.header + .time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); + assert!(!b.header.validators_hash.is_empty()); + assert_eq!( + b.header.version, + tendermint::block::header::Version { block: 11, app: 1 } + ); + let last_commit = b.last_commit.unwrap(); + assert!(!last_commit.block_id.hash.is_empty()); + assert!(!last_commit.block_id.part_set_header.hash.is_empty()); + assert_eq!(last_commit.block_id.part_set_header.total, 1); + assert_eq!(last_commit.round.value(), 0); + assert_eq!(last_commit.signatures.len(), 1); + assert!(last_commit.signatures[0].is_commit()); + assert!(last_commit.signatures[0].validator_address().is_some()); + assert!(result_begin_block.unwrap().events.is_empty()); + let reb = result_end_block.unwrap(); + assert!(reb.validator_updates.is_empty()); + assert!(reb.consensus_param_updates.is_none()); + assert!(reb.events.is_empty()); + } else { + panic!("not a newblock"); + } + assert_eq!(result.query, "tm.event = 'NewBlock'"); + }, + "subscribe_txs" => { + assert!(endpoint::subscribe::Response::from_string(content).is_ok()); + }, + "subscribe_txs_0" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let height; + if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + height = tx_result.height; + assert!(tx_result.result.log.is_none()); + assert!(tx_result.result.gas_wanted.is_none()); + assert!(tx_result.result.gas_used.is_none()); + assert_eq!(tx_result.result.events.len(), 2); + assert_eq!(tx_result.result.events[0].kind, "app"); + for attr in &tx_result.result.events[0].attributes { + match attr.key.as_str() { + "creator" => { + assert_eq!(attr.value, "Cosmoshi Netowoko") + }, + "key" => assert_eq!(attr.value, "tx0"), + "index_key" => { + assert_eq!(attr.value, "index is working") + }, + "noindex_key" => { + assert_eq!(attr.value, "index is working") + }, + _ => panic!("unknown attribute found {}", attr.key), + } + } + assert_eq!(tx_result.tx, base64::decode("dHgwPXZhbHVl").unwrap()); + } else { + panic!("not a tx"); + } + check_event_attrs(&result.events.unwrap(), "tx0", height); + assert_eq!(result.query, "tm.event = 'Tx'"); + }, + "subscribe_txs_1" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let height; + if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + height = tx_result.height; + assert!(tx_result.result.log.is_none()); + assert!(tx_result.result.gas_wanted.is_none()); + assert!(tx_result.result.gas_used.is_none()); + assert_eq!(tx_result.result.events.len(), 2); + assert_eq!(tx_result.result.events[0].kind, "app"); + for attr in &tx_result.result.events[0].attributes { + match attr.key.as_str() { + "creator" => { + assert_eq!(attr.value, "Cosmoshi Netowoko") + }, + "key" => assert_eq!(attr.value, "tx1"), + "index_key" => { + assert_eq!(attr.value, "index is working") + }, + "noindex_key" => { + assert_eq!(attr.value, "index is working") + }, + _ => panic!("unknown attribute found {}", attr.key), + } + } + assert_eq!(tx_result.tx, base64::decode("dHgxPXZhbHVl").unwrap()); + } else { + panic!("not a tx"); + } + + check_event_attrs(&result.events.unwrap(), "tx1", height); + assert_eq!(result.query, "tm.event = 'Tx'"); + }, + "subscribe_txs_2" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let height; + if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + height = tx_result.height; + assert!(tx_result.result.log.is_none()); + assert!(tx_result.result.gas_wanted.is_none()); + assert!(tx_result.result.gas_used.is_none()); + assert_eq!(tx_result.result.events.len(), 2); + assert_eq!(tx_result.result.events[0].kind, "app"); + for attr in &tx_result.result.events[0].attributes { + match attr.key.as_str() { + "creator" => { + assert_eq!(attr.value, "Cosmoshi Netowoko") + }, + "key" => assert_eq!(attr.value, "tx2"), + "index_key" => { + assert_eq!(attr.value, "index is working") + }, + "noindex_key" => { + assert_eq!(attr.value, "index is working") + }, + _ => panic!("unknown attribute found {}", attr.key), + } + } + assert_eq!(tx_result.tx, base64::decode("dHgyPXZhbHVl").unwrap()); + } else { + panic!("not a tx"); + } + check_event_attrs(&result.events.unwrap(), "tx2", height); + assert_eq!(result.query, "tm.event = 'Tx'"); + }, + "subscribe_txs_3" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let height; + if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + height = tx_result.height; + assert!(tx_result.result.log.is_none()); + assert!(tx_result.result.gas_wanted.is_none()); + assert!(tx_result.result.gas_used.is_none()); + assert_eq!(tx_result.result.events.len(), 2); + assert_eq!(tx_result.result.events[0].kind, "app"); + for attr in &tx_result.result.events[0].attributes { + match attr.key.as_str() { + "creator" => { + assert_eq!(attr.value, "Cosmoshi Netowoko") + }, + "key" => assert_eq!(attr.value, "tx3"), + "index_key" => { + assert_eq!(attr.value, "index is working") + }, + "noindex_key" => { + assert_eq!(attr.value, "index is working") + }, + _ => panic!("unknown attribute found {}", attr.key), + } + } + assert_eq!(tx_result.tx, base64::decode("dHgzPXZhbHVl").unwrap()); + } else { + panic!("not a tx"); + } + check_event_attrs(&result.events.unwrap(), "tx3", height); + assert_eq!(result.query, "tm.event = 'Tx'"); + }, + "subscribe_txs_4" => { + let result = + tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let height; + if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + height = tx_result.height; + assert!(tx_result.result.log.is_none()); + assert!(tx_result.result.gas_wanted.is_none()); + assert!(tx_result.result.gas_used.is_none()); + assert_eq!(tx_result.result.events.len(), 2); + assert_eq!(tx_result.result.events[0].kind, "app"); + for attr in &tx_result.result.events[0].attributes { + match attr.key.as_str() { + "creator" => { + assert_eq!(attr.value, "Cosmoshi Netowoko") + }, + "key" => assert_eq!(attr.value, "tx4"), + "index_key" => { + assert_eq!(attr.value, "index is working") + }, + "noindex_key" => { + assert_eq!(attr.value, "index is working") + }, + _ => panic!("unknown attribute found {}", attr.key), + } + } + assert_eq!(tx_result.tx, base64::decode("dHg0PXZhbHVl").unwrap()); + } else { + panic!("not a tx"); + } + check_event_attrs(&result.events.unwrap(), "tx4", height); + assert_eq!(result.query, "tm.event = 'Tx'"); + }, + "subscribe_txs_broadcast_tx_0" => { + let result = endpoint::broadcast::tx_async::Response::from_string(content).unwrap(); + assert_eq!(result.code, abci::Code::Ok); + assert!(result.data.is_empty()); + assert_ne!( + result.hash, + Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() + ); + assert!(result.log.is_empty()); + }, + "subscribe_txs_broadcast_tx_1" => { + let result = endpoint::broadcast::tx_async::Response::from_string(content).unwrap(); + assert_eq!(result.code, abci::Code::Ok); + assert!(result.data.is_empty()); + assert_ne!( + result.hash, + Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() + ); + assert!(result.log.is_empty()); + }, + "subscribe_txs_broadcast_tx_2" => { + let result = endpoint::broadcast::tx_async::Response::from_string(content).unwrap(); + assert_eq!(result.code, abci::Code::Ok); + assert!(result.data.is_empty()); + assert_ne!( + result.hash, + Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() + ); + assert!(result.log.is_empty()); + }, + "subscribe_txs_broadcast_tx_3" => { + let result = endpoint::broadcast::tx_async::Response::from_string(content).unwrap(); + assert_eq!(result.code, abci::Code::Ok); + assert!(result.data.is_empty()); + assert_ne!( + result.hash, + Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() + ); + assert!(result.log.is_empty()); + }, + "subscribe_txs_broadcast_tx_4" => { + let result = endpoint::broadcast::tx_async::Response::from_string(content).unwrap(); + assert_eq!(result.code, abci::Code::Ok); + assert!(result.data.is_empty()); + assert_ne!( + result.hash, + Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() + ); + assert!(result.log.is_empty()); + }, + "subscribe_txs_broadcast_tx_5" => { + let result = endpoint::broadcast::tx_async::Response::from_string(content).unwrap(); + assert_eq!(result.code, abci::Code::Ok); + assert!(result.data.is_empty()); + assert_ne!( + result.hash, + Hash::from_bytes(Algorithm::Sha256, &[0; 32]).unwrap() + ); + assert!(result.log.is_empty()); + }, + "tx" => { + let result = endpoint::tx::Response::from_string(content).unwrap(); + assert_eq!( + result.hash, + Hash::from_bytes( + Algorithm::Sha256, + &[ + 214, 63, 156, 35, 121, 30, 97, 4, 16, 181, 118, 216, 194, 123, 181, + 174, 172, 147, 204, 26, 88, 82, 36, 40, 167, 179, 42, 18, 118, 8, 88, + 96 + ] + ) + .unwrap() + ); + assert_eq!(u64::from(result.height), 12u64); + }, + "tx_search_no_prove" => { + let result = endpoint::tx_search::Response::from_string(content).unwrap(); + assert_eq!(result.total_count as usize, result.txs.len()); + // Test a few selected attributes of the results. + for tx in result.txs { + assert_ne!(tx.hash.as_bytes(), [0; 32]); + assert_eq!(tx.tx_result.code, abci::Code::Ok); + assert_eq!(tx.tx_result.events.len(), 2); + assert_eq!(tx.tx_result.events[0].kind, "app"); + assert_eq!(tx.tx_result.gas_used, 0); + assert_eq!(tx.tx_result.gas_wanted, 0); + assert!(tx.tx_result.info.to_string().is_empty()); + assert!(tx.tx_result.log.is_empty()); + assert!(tx.proof.is_none()); + } + }, + "tx_search_with_prove" => { + let result = endpoint::tx_search::Response::from_string(content).unwrap(); + assert_eq!(result.total_count as usize, result.txs.len()); + // Test a few selected attributes of the results. + for tx in result.txs { + assert_ne!(tx.hash.as_bytes(), [0; 32]); + assert_eq!(tx.tx_result.code, abci::Code::Ok); + assert_eq!(tx.tx_result.events.len(), 2); + assert_eq!(tx.tx_result.events[0].kind, "app"); + assert_eq!(tx.tx_result.gas_used, 0); + assert_eq!(tx.tx_result.gas_wanted, 0); + assert!(tx.tx_result.info.to_string().is_empty()); + assert!(tx.tx_result.log.is_empty()); + let proof = tx.proof.unwrap(); + assert_eq!(proof.data, tx.tx); + assert_eq!(proof.proof.total, 1); + assert_eq!(proof.proof.index, 0); + assert_ne!(proof.root_hash.as_bytes(), [0; 32]); + } + }, + _ => { + panic!("cannot parse file name: {file_name}"); + }, + } + } +} + +fn check_event_attrs(events: &HashMap>, app_key: &str, height: i64) { + for (k, v) in events { + match k.as_str() { + "app.creator" => { + assert_eq!(v.len(), 2); + assert_eq!(v[0], "Cosmoshi Netowoko"); + }, + "app.index_key" => { + assert_eq!(v.len(), 2); + assert_eq!(v[0], "index is working"); + }, + "app.key" => { + assert_eq!(v.len(), 2); + assert_eq!(v[0], app_key); + }, + "app.noindex_key" => { + assert_eq!(v.len(), 2); + assert_eq!(v[0], "index is working"); + }, + "tm.event" => { + assert_eq!(v.len(), 1); + assert_eq!(v[0], "Tx"); + }, + "tx.hash" => { + assert_eq!(v.len(), 1); + assert_eq!(v[0].len(), 64); + }, + "tx.height" => { + assert_eq!(v.len(), 1); + assert_eq!(v[0], height.to_string()); + }, + _ => panic!("unknown event found {k}"), + } + } +} diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/abci_info.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/abci_info.json new file mode 100644 index 000000000..81ec66d58 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/abci_info.json @@ -0,0 +1,13 @@ +{ + "id": "3034a148-da51-4039-b8e8-3dc12990b639", + "jsonrpc": "2.0", + "result": { + "response": { + "app_version": "1", + "data": "{\"size\":0}", + "last_block_app_hash": "AAAAAAAAAAA=", + "last_block_height": "198", + "version": "2.0.0" + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/abci_query_with_existing_key.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/abci_query_with_existing_key.json new file mode 100644 index 000000000..b6f135f33 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/abci_query_with_existing_key.json @@ -0,0 +1,17 @@ +{ + "id": "e1871729-f0c5-476d-8a66-731c058c8766", + "jsonrpc": "2.0", + "result": { + "response": { + "code": 0, + "codespace": "", + "height": "254", + "index": "0", + "info": "", + "key": "dHgw", + "log": "exists", + "proofOps": null, + "value": "dmFsdWU=" + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/abci_query_with_non_existent_key.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/abci_query_with_non_existent_key.json new file mode 100644 index 000000000..10cdc9572 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/abci_query_with_non_existent_key.json @@ -0,0 +1,17 @@ +{ + "id": "2e5aec1f-7e0d-4f17-bec5-8c1148fd8253", + "jsonrpc": "2.0", + "result": { + "response": { + "code": 0, + "codespace": "", + "height": "200", + "index": "0", + "info": "", + "key": "bm9uX2V4aXN0ZW50X2tleQ==", + "log": "does not exist", + "proofOps": null, + "value": null + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_0.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_0.json new file mode 100644 index 000000000..b87b8d71d --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_0.json @@ -0,0 +1,9 @@ +{ + "error": { + "code": -32603, + "data": "height must be greater than 0, but got 0", + "message": "Internal error" + }, + "id": "0634391f-a6b0-445c-b568-e41a2446849e", + "jsonrpc": "2.0" +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_1.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_1.json new file mode 100644 index 000000000..af39c86c7 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_1.json @@ -0,0 +1,58 @@ +{ + "id": "ac0d2aa0-e54f-415e-9144-79b965b43d18", + "jsonrpc": "2.0", + "result": { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "1", + "last_block_id": { + "hash": "", + "parts": { + "hash": "", + "total": 0 + } + }, + "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:48.347696215Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "", + "parts": { + "hash": "", + "total": 0 + } + }, + "height": "0", + "round": 0, + "signatures": [] + } + }, + "block_id": { + "hash": "6CD5CF4E23A49D9BC073D6F305D29D1B8B5193B534C237696D42FEA5AFBCD520", + "parts": { + "hash": "F021777213F7EF77494C9B5C11D246A6F532DA146D205422D1FB85600F6B479C", + "total": 1 + } + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_10.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_10.json new file mode 100644 index 000000000..26edba19a --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_at_height_10.json @@ -0,0 +1,65 @@ +{ + "id": "dd6680c9-3da4-4af8-b98b-ba7a540f7274", + "jsonrpc": "2.0", + "result": { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "10", + "last_block_id": { + "hash": "678A83FB0422D053A3792154703122861DD68ABB8247A4FF2945DF832DB18FC8", + "parts": { + "hash": "29FE32F6B57D8439C9E9F6240B436DD560646FDA8C8C105E2C261B6F4746E89C", + "total": 1 + } + }, + "last_commit_hash": "A3AD467820428D99FD53BFCF38CDC1EB141DD27E3B5F0F3931BBE91FBA8B097D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:53.088875124Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "678A83FB0422D053A3792154703122861DD68ABB8247A4FF2945DF832DB18FC8", + "parts": { + "hash": "29FE32F6B57D8439C9E9F6240B436DD560646FDA8C8C105E2C261B6F4746E89C", + "total": 1 + } + }, + "height": "9", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "BMy5pB3a9xeEnuBkja/a6GUvP1guZ2lMQtZYvdrl8s0ri1/LaF0JuI9rOsy1biVTv+TDKzlBXTZ5gdgiq0uCAg==", + "timestamp": "2023-05-17T14:12:53.088875124Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "00ECDAC463C201ECD4BDBBAAE4A53A4C80291D4051FD69ED97F6420CE1388BFE", + "parts": { + "hash": "FF0A320E696FD233DD4D3CC7CD82FF90F54B8FDBC9C700D9375C95A02782B062", + "total": 1 + } + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/block_by_hash.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_by_hash.json new file mode 100644 index 000000000..5b8eeeb0d --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_by_hash.json @@ -0,0 +1,65 @@ +{ + "jsonrpc": "2.0", + "id": "2eb70c44-72a5-49ec-b40a-dcc42c2d9f9c", + "result": { + "block_id": { + "hash": "47493B51E102705F6DCCE5981E05B7C025BB5BF19CF5E4B54FE28CAFE9D20C8A", + "parts": { + "total": 1, + "hash": "6AD33682C8298796C51C09F0726BF898B3BB7DAD2BF3BC1ADDEA31F59F2F57AA" + } + }, + "block": { + "header": { + "version": { + "block": "11", + "app": "1" + }, + "chain_id": "dockerchain", + "height": "10", + "time": "2023-05-22T11:21:50.320037418Z", + "last_block_id": { + "hash": "6B41BE8E7DD399DEBB3709DA26F97FB8CDF6CCE601AD9E4F1FC9EBD770EE17E1", + "parts": { + "total": 1, + "hash": "7B7A8DE208A98273072997B8E9ED1DF814A891836DDEAC1F4F9B856A85C38B55" + } + }, + "last_commit_hash": "120204E1DF684560658E0C4E2644AFBD1E34C11AA65996D5EF5EB97D6D1B9856", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "validators_hash": "7FC05FAC50A07104F109F097E4EC987A45C4873D8C4240CB1F480A6D0C659D8A", + "next_validators_hash": "7FC05FAC50A07104F109F097E4EC987A45C4873D8C4240CB1F480A6D0C659D8A", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "app_hash": "0000000000000000", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "proposer_address": "A68DCAB542928319BB7EAF672C17FEAD37E2577C" + }, + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "last_commit": { + "height": "9", + "round": 0, + "block_id": { + "hash": "6B41BE8E7DD399DEBB3709DA26F97FB8CDF6CCE601AD9E4F1FC9EBD770EE17E1", + "parts": { + "total": 1, + "hash": "7B7A8DE208A98273072997B8E9ED1DF814A891836DDEAC1F4F9B856A85C38B55" + } + }, + "signatures": [ + { + "block_id_flag": 2, + "validator_address": "A68DCAB542928319BB7EAF672C17FEAD37E2577C", + "timestamp": "2023-05-22T11:21:50.320037418Z", + "signature": "iixbKDQGBCwGZr1bqbjPGn0BXnDYXR99/fcszD6jIUiCMA4BU9UdT4uMmihDNhCaa77J0UokksEvMkF2lIkmBg==" + } + ] + } + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/block_results_at_height_10.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_results_at_height_10.json new file mode 100644 index 000000000..b1d36b458 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_results_at_height_10.json @@ -0,0 +1,12 @@ +{ + "id": "f9f35bd2-8a8b-48c2-b04c-5c1e1b673ce1", + "jsonrpc": "2.0", + "result": { + "app_hash": null, + "consensus_param_updates": null, + "finalize_block_events": null, + "height": "10", + "txs_results": null, + "validator_updates": null + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/block_search.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_search.json new file mode 100644 index 000000000..f3b67c8f4 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/block_search.json @@ -0,0 +1,2754 @@ +{ + "id": "eb430b0c-df54-4434-817b-9b53000522b1", + "jsonrpc": "2.0", + "result": { + "blocks": [ + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "2", + "last_block_id": { + "hash": "6CD5CF4E23A49D9BC073D6F305D29D1B8B5193B534C237696D42FEA5AFBCD520", + "parts": { + "hash": "F021777213F7EF77494C9B5C11D246A6F532DA146D205422D1FB85600F6B479C", + "total": 1 + } + }, + "last_commit_hash": "8204E61CDD32DD6056F2DAE2D5E1A48AC26E4BA6C257952954C2470604CDBAAD", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:48.936921432Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "6CD5CF4E23A49D9BC073D6F305D29D1B8B5193B534C237696D42FEA5AFBCD520", + "parts": { + "hash": "F021777213F7EF77494C9B5C11D246A6F532DA146D205422D1FB85600F6B479C", + "total": 1 + } + }, + "height": "1", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "Ui+aVj2J2XiutJivXorKO4QUKvBS+AiyCI1zhQGirWnBdaBKrT0LufSnkbvJrB3PThmy7e7L3twH320D4T1rDA==", + "timestamp": "2023-05-17T14:12:48.936921432Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "70302722FE881D45C2683268F3CCD8B72B6BAE35DE3765960244B956FA426F2C", + "parts": { + "hash": "B1CE80F8E2150C3FCC23370CF72E24048C734451FC88EBFB8C9B5633C512BF4C", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "3", + "last_block_id": { + "hash": "70302722FE881D45C2683268F3CCD8B72B6BAE35DE3765960244B956FA426F2C", + "parts": { + "hash": "B1CE80F8E2150C3FCC23370CF72E24048C734451FC88EBFB8C9B5633C512BF4C", + "total": 1 + } + }, + "last_commit_hash": "7E9C345B92FDE2D3007509E3F884FC8E383D5130F42E5427AFF68D59D6C7E1C9", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:49.452618685Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "70302722FE881D45C2683268F3CCD8B72B6BAE35DE3765960244B956FA426F2C", + "parts": { + "hash": "B1CE80F8E2150C3FCC23370CF72E24048C734451FC88EBFB8C9B5633C512BF4C", + "total": 1 + } + }, + "height": "2", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "l1bPl2KbQ1h14fgR6KhixqkPygH8XID1sO8PynIQgyexjDyWRQLiCH3vP127IC6f2s6xHAuAru9AfQPpRRMoBQ==", + "timestamp": "2023-05-17T14:12:49.452618685Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "7937D62B37155F3C723BDBEE2B19813B3EFDCD1E620CCF400C5CAA754DFB8AB1", + "parts": { + "hash": "B1C0D25DB583D511EC23F4797374337D9926DD19FA71828426EFFFFE7DF1C19F", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "4", + "last_block_id": { + "hash": "7937D62B37155F3C723BDBEE2B19813B3EFDCD1E620CCF400C5CAA754DFB8AB1", + "parts": { + "hash": "B1C0D25DB583D511EC23F4797374337D9926DD19FA71828426EFFFFE7DF1C19F", + "total": 1 + } + }, + "last_commit_hash": "8AE1AA2B69E53E25D5A005380EA289AB0CDD3968A05AD625FB733F19408685D4", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:49.974876236Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "7937D62B37155F3C723BDBEE2B19813B3EFDCD1E620CCF400C5CAA754DFB8AB1", + "parts": { + "hash": "B1C0D25DB583D511EC23F4797374337D9926DD19FA71828426EFFFFE7DF1C19F", + "total": 1 + } + }, + "height": "3", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "EwYynCfBKqrp/8dIDLNfyorCBDUts/QmW0+meVLPUtDL+MhMixq7xIeM4z4FzNMWbN4r0UxMtVB8xGAypfLICw==", + "timestamp": "2023-05-17T14:12:49.974876236Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "F28AC02B47A10ED843320BEA7677812B40980218FAA18A59C2F7C298F9C3CC23", + "parts": { + "hash": "6236C5DE711E11DE7079348B94222870E385B077E05C474820A63B1D61D82FF2", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "5", + "last_block_id": { + "hash": "F28AC02B47A10ED843320BEA7677812B40980218FAA18A59C2F7C298F9C3CC23", + "parts": { + "hash": "6236C5DE711E11DE7079348B94222870E385B077E05C474820A63B1D61D82FF2", + "total": 1 + } + }, + "last_commit_hash": "071ABC6A41C774A3017A628F6E84AEA6C4722B3050B2821A7DEB938A63063F6E", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:50.491083452Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "F28AC02B47A10ED843320BEA7677812B40980218FAA18A59C2F7C298F9C3CC23", + "parts": { + "hash": "6236C5DE711E11DE7079348B94222870E385B077E05C474820A63B1D61D82FF2", + "total": 1 + } + }, + "height": "4", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "bxoeRDCl45tUcni9jqUJ9JWeLGe4QgnsSP62mEax6VGnArz4YjXQMyF91BgabA64EObBBtVcMyOKUBrgiR1kDQ==", + "timestamp": "2023-05-17T14:12:50.491083452Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "5338CEC2D2DA7D8AFD152C677072AC954E776D2222EB523D7D03B6DFEB6CAA04", + "parts": { + "hash": "6F88DFF2D9FC0EC4B860960E4F1B2E47AE1DA3206042EE01064CF794C8246421", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "6", + "last_block_id": { + "hash": "5338CEC2D2DA7D8AFD152C677072AC954E776D2222EB523D7D03B6DFEB6CAA04", + "parts": { + "hash": "6F88DFF2D9FC0EC4B860960E4F1B2E47AE1DA3206042EE01064CF794C8246421", + "total": 1 + } + }, + "last_commit_hash": "63FBD5C103F243ACC16C2C9FFB26144BC88CCB6818A263DA086304C3779F281D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:51.012251242Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "5338CEC2D2DA7D8AFD152C677072AC954E776D2222EB523D7D03B6DFEB6CAA04", + "parts": { + "hash": "6F88DFF2D9FC0EC4B860960E4F1B2E47AE1DA3206042EE01064CF794C8246421", + "total": 1 + } + }, + "height": "5", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "RDT+BP84fL96gSBYkgiBI82OVYUKCtDFrxuOmGU4fWbMp10N1xwRxDyDkOlXcWebQ6gDrTmkmb/eCT61w9guAQ==", + "timestamp": "2023-05-17T14:12:51.012251242Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "CABD0A09CD90B45CDBD7E254ED0951EA7B731417F5EED2675153861FF869B07A", + "parts": { + "hash": "285AAF4CC8056539DD28B6B91BC9A49F884C1B08AB8E423D39CB277186A7F9FB", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "7", + "last_block_id": { + "hash": "CABD0A09CD90B45CDBD7E254ED0951EA7B731417F5EED2675153861FF869B07A", + "parts": { + "hash": "285AAF4CC8056539DD28B6B91BC9A49F884C1B08AB8E423D39CB277186A7F9FB", + "total": 1 + } + }, + "last_commit_hash": "E66E7E297034705D9CBEC9BBD88181215219135E5000281B16EE3CB486AA6D5D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:51.530224659Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "CABD0A09CD90B45CDBD7E254ED0951EA7B731417F5EED2675153861FF869B07A", + "parts": { + "hash": "285AAF4CC8056539DD28B6B91BC9A49F884C1B08AB8E423D39CB277186A7F9FB", + "total": 1 + } + }, + "height": "6", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "YkMIQL92ceJ+P9M537h29OHBTh9PoDlGUOEKVO9tN15LTwvwatrlEmqRR5XY6d95f5pac700vo6XPuV/5AfEDg==", + "timestamp": "2023-05-17T14:12:51.530224659Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "CD37BA5042D2E6D430E063E528D2A9BF47F0929298E84E044713E8A8FDA3B0B8", + "parts": { + "hash": "13D878AF1A006D3E346B5A97E8BD11F9D4D1D1EABD64F474872CD4C639F42349", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "8", + "last_block_id": { + "hash": "CD37BA5042D2E6D430E063E528D2A9BF47F0929298E84E044713E8A8FDA3B0B8", + "parts": { + "hash": "13D878AF1A006D3E346B5A97E8BD11F9D4D1D1EABD64F474872CD4C639F42349", + "total": 1 + } + }, + "last_commit_hash": "CD2C414D7E3A5CB996B6A1D3C1BB99EB7780F87385CB693D5957FA9AFE3888C8", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:52.052745971Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "CD37BA5042D2E6D430E063E528D2A9BF47F0929298E84E044713E8A8FDA3B0B8", + "parts": { + "hash": "13D878AF1A006D3E346B5A97E8BD11F9D4D1D1EABD64F474872CD4C639F42349", + "total": 1 + } + }, + "height": "7", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "bjmMbo4hqE67EkR/zqYAMYw9P/gNcrtM4WpLbLoW+po8PM8NcFTuCEx/4D0KYFOQ1MaA4RDG+bjk9y3qOeXlDA==", + "timestamp": "2023-05-17T14:12:52.052745971Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "0FD9EFBBC42938EBE2AFC1A72CFD3D95303573A8F247FE60105154A363869EE0", + "parts": { + "hash": "CAA389BC14C73BFE452E01DC5DB89EEB20BA4331402DD0EF385F1FCA2A3B8F07", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "9", + "last_block_id": { + "hash": "0FD9EFBBC42938EBE2AFC1A72CFD3D95303573A8F247FE60105154A363869EE0", + "parts": { + "hash": "CAA389BC14C73BFE452E01DC5DB89EEB20BA4331402DD0EF385F1FCA2A3B8F07", + "total": 1 + } + }, + "last_commit_hash": "AB99F72D02B4ADFEA560A2AFEE0332C3CC3723CBE485330679513AB0A192ED00", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:52.570941867Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "0FD9EFBBC42938EBE2AFC1A72CFD3D95303573A8F247FE60105154A363869EE0", + "parts": { + "hash": "CAA389BC14C73BFE452E01DC5DB89EEB20BA4331402DD0EF385F1FCA2A3B8F07", + "total": 1 + } + }, + "height": "8", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "AOPKnT/QOJ2vtCxP69L3VLyNfZSqxDYMP+ftyRo0Y7hfdFGlI5Y6ZEjNXqOg5N9uuBy2fTXgLeEVrhovhUASBA==", + "timestamp": "2023-05-17T14:12:52.570941867Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "678A83FB0422D053A3792154703122861DD68ABB8247A4FF2945DF832DB18FC8", + "parts": { + "hash": "29FE32F6B57D8439C9E9F6240B436DD560646FDA8C8C105E2C261B6F4746E89C", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "10", + "last_block_id": { + "hash": "678A83FB0422D053A3792154703122861DD68ABB8247A4FF2945DF832DB18FC8", + "parts": { + "hash": "29FE32F6B57D8439C9E9F6240B436DD560646FDA8C8C105E2C261B6F4746E89C", + "total": 1 + } + }, + "last_commit_hash": "A3AD467820428D99FD53BFCF38CDC1EB141DD27E3B5F0F3931BBE91FBA8B097D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:53.088875124Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "678A83FB0422D053A3792154703122861DD68ABB8247A4FF2945DF832DB18FC8", + "parts": { + "hash": "29FE32F6B57D8439C9E9F6240B436DD560646FDA8C8C105E2C261B6F4746E89C", + "total": 1 + } + }, + "height": "9", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "BMy5pB3a9xeEnuBkja/a6GUvP1guZ2lMQtZYvdrl8s0ri1/LaF0JuI9rOsy1biVTv+TDKzlBXTZ5gdgiq0uCAg==", + "timestamp": "2023-05-17T14:12:53.088875124Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "00ECDAC463C201ECD4BDBBAAE4A53A4C80291D4051FD69ED97F6420CE1388BFE", + "parts": { + "hash": "FF0A320E696FD233DD4D3CC7CD82FF90F54B8FDBC9C700D9375C95A02782B062", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "11", + "last_block_id": { + "hash": "00ECDAC463C201ECD4BDBBAAE4A53A4C80291D4051FD69ED97F6420CE1388BFE", + "parts": { + "hash": "FF0A320E696FD233DD4D3CC7CD82FF90F54B8FDBC9C700D9375C95A02782B062", + "total": 1 + } + }, + "last_commit_hash": "2E1F20678B93D4CE2F7E7A3704FDB65D9DDBB1121825456A800A6B83ABA35A36", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:53.605374524Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "00ECDAC463C201ECD4BDBBAAE4A53A4C80291D4051FD69ED97F6420CE1388BFE", + "parts": { + "hash": "FF0A320E696FD233DD4D3CC7CD82FF90F54B8FDBC9C700D9375C95A02782B062", + "total": 1 + } + }, + "height": "10", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "5y0Kas3bSrgVYG/QKwWovMpTBfavZfy/A8DXkQHzFHVMjOcVk2TK6xhYQasfiodordg1bjDf7NDwNi/YdilaAw==", + "timestamp": "2023-05-17T14:12:53.605374524Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "36BBAEE4798B46C1B1EFCFB1CFB062AA67E3ECB360FB2C8623F3FA83D1A68E92", + "parts": { + "hash": "248F36FF2F4BE78FA3B66C1AC4D8C578E7D3A5D1C709B353B6E7AA3E8F77B925", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "12", + "last_block_id": { + "hash": "36BBAEE4798B46C1B1EFCFB1CFB062AA67E3ECB360FB2C8623F3FA83D1A68E92", + "parts": { + "hash": "248F36FF2F4BE78FA3B66C1AC4D8C578E7D3A5D1C709B353B6E7AA3E8F77B925", + "total": 1 + } + }, + "last_commit_hash": "6246FE92A10C90DA79BFFB95181D426852A942C01B53514F67FC089764ED5097", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:54.121779678Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "36BBAEE4798B46C1B1EFCFB1CFB062AA67E3ECB360FB2C8623F3FA83D1A68E92", + "parts": { + "hash": "248F36FF2F4BE78FA3B66C1AC4D8C578E7D3A5D1C709B353B6E7AA3E8F77B925", + "total": 1 + } + }, + "height": "11", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "Q6epmT5ebOJt3+QNcVIJ5nsmGAFeSZZ0QeUb3wBwXoBnaUcN8j1g2AO5vTQlKYS2X9EDSaB3FrRkZkSkAjzwCg==", + "timestamp": "2023-05-17T14:12:54.121779678Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "3D33DF1D7DFAA1A9A8591F3620B54F6CFFAE168ADC1FC62063510ED06DDE7BB8", + "parts": { + "hash": "BA6C57799EAC3D4F35618AEAB247F1EDC690CFF2DFE3DB38703490E669B014CC", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "13", + "last_block_id": { + "hash": "3D33DF1D7DFAA1A9A8591F3620B54F6CFFAE168ADC1FC62063510ED06DDE7BB8", + "parts": { + "hash": "BA6C57799EAC3D4F35618AEAB247F1EDC690CFF2DFE3DB38703490E669B014CC", + "total": 1 + } + }, + "last_commit_hash": "82F8A1098AAE92F3DEE30854E146B619485A01499C759D104ECF9FC79DEE2CCE", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:54.640232805Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "3D33DF1D7DFAA1A9A8591F3620B54F6CFFAE168ADC1FC62063510ED06DDE7BB8", + "parts": { + "hash": "BA6C57799EAC3D4F35618AEAB247F1EDC690CFF2DFE3DB38703490E669B014CC", + "total": 1 + } + }, + "height": "12", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "3mc6jcjoyqgGYOzLCqW482YKKicAun+XG7zIcX9Eh5Y7wQV3m1/szz95zxowFvtxe8WqvJub8xl+j4BJziJbDA==", + "timestamp": "2023-05-17T14:12:54.640232805Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "963E94A769D4CDC3173329C9F4915699C2AD678D7AF57D62C347967F21A92073", + "parts": { + "hash": "D0AA147761C45B1897C333E13EF6AD5A9F1C97B2BBC32B5B9F2C30D7954A3702", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "14", + "last_block_id": { + "hash": "963E94A769D4CDC3173329C9F4915699C2AD678D7AF57D62C347967F21A92073", + "parts": { + "hash": "D0AA147761C45B1897C333E13EF6AD5A9F1C97B2BBC32B5B9F2C30D7954A3702", + "total": 1 + } + }, + "last_commit_hash": "5C69CE670A586FD4C4E226254CB445BC9096C34F532CFB3150EE7CF1E3F1ADA1", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:55.159498093Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "963E94A769D4CDC3173329C9F4915699C2AD678D7AF57D62C347967F21A92073", + "parts": { + "hash": "D0AA147761C45B1897C333E13EF6AD5A9F1C97B2BBC32B5B9F2C30D7954A3702", + "total": 1 + } + }, + "height": "13", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "4rW3K6kkrVXdo8CHHzUXemmVM87PuAnBbECIe/FC8jlJwxOqEpE0ZkMy2o3Dq2tSEEnrWMHyNrTS1H3AEsUbDA==", + "timestamp": "2023-05-17T14:12:55.159498093Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "685AD3F2A9B05BB382F4140A068DCA2E97909408B665A8664D2B0B578A77F11F", + "parts": { + "hash": "1265FC22A6B99078D4C51CC8CA75A1521FF931621301BCB050E0543088A9DDF9", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "15", + "last_block_id": { + "hash": "685AD3F2A9B05BB382F4140A068DCA2E97909408B665A8664D2B0B578A77F11F", + "parts": { + "hash": "1265FC22A6B99078D4C51CC8CA75A1521FF931621301BCB050E0543088A9DDF9", + "total": 1 + } + }, + "last_commit_hash": "EBA4E675536CC9127523FDA770CED60260A434DB56C096857AE0EB0AA8392962", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:55.681776131Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "685AD3F2A9B05BB382F4140A068DCA2E97909408B665A8664D2B0B578A77F11F", + "parts": { + "hash": "1265FC22A6B99078D4C51CC8CA75A1521FF931621301BCB050E0543088A9DDF9", + "total": 1 + } + }, + "height": "14", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "QxYqutc08KQHTxJJLw2OYdYtg/KoOLrVqrUAGQRFlJePE/yUR9ghSHCSa6JoetyVyGjTn/Kp7BCGuUlnpURpBg==", + "timestamp": "2023-05-17T14:12:55.681776131Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "85D4AE555E01116C275579A843124BC158CA86C9FDD604867CD01D4E93DA84F8", + "parts": { + "hash": "23CBEF9C47F2E6CD9201CCA8C37B632D6D987A600D8AD1ABA430E6A04874C20C", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "16", + "last_block_id": { + "hash": "85D4AE555E01116C275579A843124BC158CA86C9FDD604867CD01D4E93DA84F8", + "parts": { + "hash": "23CBEF9C47F2E6CD9201CCA8C37B632D6D987A600D8AD1ABA430E6A04874C20C", + "total": 1 + } + }, + "last_commit_hash": "CD61B87BCD5E751262517B07AC538974E3B415E093F96431F1972502C6A811B1", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:56.201473762Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "85D4AE555E01116C275579A843124BC158CA86C9FDD604867CD01D4E93DA84F8", + "parts": { + "hash": "23CBEF9C47F2E6CD9201CCA8C37B632D6D987A600D8AD1ABA430E6A04874C20C", + "total": 1 + } + }, + "height": "15", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "5FkvTJq8SsOfB0NG6Xo/UXER7Yhuz44gryzMrTNxQ6enE2ci94N3MZpwnrjNKwecYQxw5YvA5npJRKSG3kX+Bg==", + "timestamp": "2023-05-17T14:12:56.201473762Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "DCFFB563710622F76B0ABC73C6BB388E7E9FA5AD9BA8436FB20DF1C5D3DF510E", + "parts": { + "hash": "C5D2C2CEA03C049584322A84173C7914D9CA4C8263997232A075FB89AE874C9E", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "17", + "last_block_id": { + "hash": "DCFFB563710622F76B0ABC73C6BB388E7E9FA5AD9BA8436FB20DF1C5D3DF510E", + "parts": { + "hash": "C5D2C2CEA03C049584322A84173C7914D9CA4C8263997232A075FB89AE874C9E", + "total": 1 + } + }, + "last_commit_hash": "3CEB7D2F7E207F28E94DF4B9FE463D1F43FE13AA81699F308E7A8A70E57D174E", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:56.721270064Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "DCFFB563710622F76B0ABC73C6BB388E7E9FA5AD9BA8436FB20DF1C5D3DF510E", + "parts": { + "hash": "C5D2C2CEA03C049584322A84173C7914D9CA4C8263997232A075FB89AE874C9E", + "total": 1 + } + }, + "height": "16", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "ros+evafgxFAvWvVtvJEQSsNqoVBuWYv8rpCFL0vCohkjbxtBKaiv2NiVYeIJ7bsxRWP9FQkByZHRrp0HiKMDQ==", + "timestamp": "2023-05-17T14:12:56.721270064Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "55EF92B171AB617EE9B535D97AA22DAF241783AA6B7564123E6F3C31F30B17FA", + "parts": { + "hash": "649245AB8D3AFE1F075A12938E70544FD18CD6B1D227A4A3FF633C186B4DEEA9", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "18", + "last_block_id": { + "hash": "55EF92B171AB617EE9B535D97AA22DAF241783AA6B7564123E6F3C31F30B17FA", + "parts": { + "hash": "649245AB8D3AFE1F075A12938E70544FD18CD6B1D227A4A3FF633C186B4DEEA9", + "total": 1 + } + }, + "last_commit_hash": "323B6350AB50EDE87B54D3F8440EB38BF9A30A6BA8C0E47F71B75829368EEDA9", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:57.237672057Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "55EF92B171AB617EE9B535D97AA22DAF241783AA6B7564123E6F3C31F30B17FA", + "parts": { + "hash": "649245AB8D3AFE1F075A12938E70544FD18CD6B1D227A4A3FF633C186B4DEEA9", + "total": 1 + } + }, + "height": "17", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "sRnCAHPlcFee5wLX5hWaYGZgRYKxdR30bOZhj8f9ENGVBqwD/3MY0rG/Ric8/yYntNlLnD7Qeht3ryFoo685DQ==", + "timestamp": "2023-05-17T14:12:57.237672057Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "40B35FC6D9FA795F2A180C8785D46174F9A506787C0F15DF0BE9F053544B90E4", + "parts": { + "hash": "0CF59B341E01DBD9D8515BB19B57D3E33BDFF6D10EA9B47D121AB8B20606951C", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "19", + "last_block_id": { + "hash": "40B35FC6D9FA795F2A180C8785D46174F9A506787C0F15DF0BE9F053544B90E4", + "parts": { + "hash": "0CF59B341E01DBD9D8515BB19B57D3E33BDFF6D10EA9B47D121AB8B20606951C", + "total": 1 + } + }, + "last_commit_hash": "18A4180B5F1684670BE65C4E93DC9A202F214438935058F8CB9C3C41BF5814BF", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:57.754867189Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "40B35FC6D9FA795F2A180C8785D46174F9A506787C0F15DF0BE9F053544B90E4", + "parts": { + "hash": "0CF59B341E01DBD9D8515BB19B57D3E33BDFF6D10EA9B47D121AB8B20606951C", + "total": 1 + } + }, + "height": "18", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "WoaOsmfC1J6njviYK9KaF/7QAwzVrx7gPSv4/BICFz/p5xoO2Zyoc4WTzJ1Wkyro94hR4g3wxnKdIEHlQT+9Dg==", + "timestamp": "2023-05-17T14:12:57.754867189Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "C989768A9AAA875100D6483A1FE26F66D46F95AE7539BCC9998B7195CFD5CE15", + "parts": { + "hash": "80DF815372667B57487DC5A8CBF25CD1F1DA4214223141029AE6AD00DDD880C8", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "20", + "last_block_id": { + "hash": "C989768A9AAA875100D6483A1FE26F66D46F95AE7539BCC9998B7195CFD5CE15", + "parts": { + "hash": "80DF815372667B57487DC5A8CBF25CD1F1DA4214223141029AE6AD00DDD880C8", + "total": 1 + } + }, + "last_commit_hash": "391EFE656F740F424DB6D8E032F39FDA8356076895D10797A6D85E2B552CC8F3", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:58.274319192Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "C989768A9AAA875100D6483A1FE26F66D46F95AE7539BCC9998B7195CFD5CE15", + "parts": { + "hash": "80DF815372667B57487DC5A8CBF25CD1F1DA4214223141029AE6AD00DDD880C8", + "total": 1 + } + }, + "height": "19", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "yoCneb/+dlmgOxLQI38VcpyyMw12m/QLIXBs3KstvMK+eRhHXiAb1YTN083/epe6z9V3loJuPFe3gQvzRwXTBA==", + "timestamp": "2023-05-17T14:12:58.274319192Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "A87785003C6140FF04509B99B531DDB887138E4DD2DC4AEAA258678DB34CAAF9", + "parts": { + "hash": "86AD65628C8DDF77C94F058CDCB309FFBDE4156219EEAD578F5FA21D2F18AC01", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "21", + "last_block_id": { + "hash": "A87785003C6140FF04509B99B531DDB887138E4DD2DC4AEAA258678DB34CAAF9", + "parts": { + "hash": "86AD65628C8DDF77C94F058CDCB309FFBDE4156219EEAD578F5FA21D2F18AC01", + "total": 1 + } + }, + "last_commit_hash": "74C25173603E4852483686FFFF240A8C6211E80D3AF1337CF15299F588F0EE1C", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:58.792704502Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "A87785003C6140FF04509B99B531DDB887138E4DD2DC4AEAA258678DB34CAAF9", + "parts": { + "hash": "86AD65628C8DDF77C94F058CDCB309FFBDE4156219EEAD578F5FA21D2F18AC01", + "total": 1 + } + }, + "height": "20", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "TexGhZb5RxfoJnADtzbvROckmR/HbiknwCSWizX+YE1qV33CCJkpCOTB9b98kUVkTEnLxd8zznvUMCnr7+HyCQ==", + "timestamp": "2023-05-17T14:12:58.792704502Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "168E1C9A9C0A271EB192232F4867B5822D5FE22CCCCB5832693D332B578EC63F", + "parts": { + "hash": "9F081D946C3BA0BD3F32AF8AD03DFB7686CC69872A2A38A980DD521FCF58FAFA", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "22", + "last_block_id": { + "hash": "168E1C9A9C0A271EB192232F4867B5822D5FE22CCCCB5832693D332B578EC63F", + "parts": { + "hash": "9F081D946C3BA0BD3F32AF8AD03DFB7686CC69872A2A38A980DD521FCF58FAFA", + "total": 1 + } + }, + "last_commit_hash": "0ED8420F5222D28C09622DB8494DC9639FDCFCE5F678D81793878B41367B54B8", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:59.313619874Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "168E1C9A9C0A271EB192232F4867B5822D5FE22CCCCB5832693D332B578EC63F", + "parts": { + "hash": "9F081D946C3BA0BD3F32AF8AD03DFB7686CC69872A2A38A980DD521FCF58FAFA", + "total": 1 + } + }, + "height": "21", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "r0onK8qwhDZbaNwNNt5VCCHeECppUygIHXRKF46xNmHm2QtrFlxYCdf8x3e82Hmw9gdXtxeC2l5FKpg/LHQ9DA==", + "timestamp": "2023-05-17T14:12:59.313619874Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "1FF602AFF1188F5247A0317362E9605C6C91AF0DC73D1042C18E081140BC1E09", + "parts": { + "hash": "1DEB91E5EF04129601D3035D544B5F7E569BE300AF4F2E211F3DEB6AFF710CF0", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "23", + "last_block_id": { + "hash": "1FF602AFF1188F5247A0317362E9605C6C91AF0DC73D1042C18E081140BC1E09", + "parts": { + "hash": "1DEB91E5EF04129601D3035D544B5F7E569BE300AF4F2E211F3DEB6AFF710CF0", + "total": 1 + } + }, + "last_commit_hash": "F8362B6B2898F90D75BAA4A64121567D7939831DE5E630F6B362B0231F7AF77D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:59.833111661Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "1FF602AFF1188F5247A0317362E9605C6C91AF0DC73D1042C18E081140BC1E09", + "parts": { + "hash": "1DEB91E5EF04129601D3035D544B5F7E569BE300AF4F2E211F3DEB6AFF710CF0", + "total": 1 + } + }, + "height": "22", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "wyQwbdnnqohH8XSX0HGuFmd1mNmvq1tqqzTJvZ3S7srY1lF0E3TjpPiqyoepBn2KHJz9Lk5WlV+bMCP1fiS3BQ==", + "timestamp": "2023-05-17T14:12:59.833111661Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "AA0C7F59BCECC4F31762AB39FD8E60AE33788010B3021527FFB8205C23210320", + "parts": { + "hash": "E102DA1B75FD8393D01AFAFBE7FDF6CA98C5DDF12639A5192DBA05C235E43C33", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "24", + "last_block_id": { + "hash": "AA0C7F59BCECC4F31762AB39FD8E60AE33788010B3021527FFB8205C23210320", + "parts": { + "hash": "E102DA1B75FD8393D01AFAFBE7FDF6CA98C5DDF12639A5192DBA05C235E43C33", + "total": 1 + } + }, + "last_commit_hash": "8BF6EC9E83F62338119B79F86E7E0D993C9D8A89E67496C54E1A9EF4233B504A", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:00.353965377Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "AA0C7F59BCECC4F31762AB39FD8E60AE33788010B3021527FFB8205C23210320", + "parts": { + "hash": "E102DA1B75FD8393D01AFAFBE7FDF6CA98C5DDF12639A5192DBA05C235E43C33", + "total": 1 + } + }, + "height": "23", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "75uOU4XcoMVdpeMwnrSHd+/Wd31Y8T3ZUss5TPYlvVdLTLcmCUxOKLq8ndNe53lPI9653hriPEIlWr+fZC+FCA==", + "timestamp": "2023-05-17T14:13:00.353965377Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "1C66B5035E047FF7ABF487A0314BCFCCBAB96063AA899C36CF97D613DD1F5D07", + "parts": { + "hash": "4ED7544D576A97E1FE0D0B257FE004366C0297E06D6C40454610317B00F07041", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "25", + "last_block_id": { + "hash": "1C66B5035E047FF7ABF487A0314BCFCCBAB96063AA899C36CF97D613DD1F5D07", + "parts": { + "hash": "4ED7544D576A97E1FE0D0B257FE004366C0297E06D6C40454610317B00F07041", + "total": 1 + } + }, + "last_commit_hash": "C2D04B2BC76518C08EE58167D5BDB85C6FFC7FEE703F92B18BA2B270B86F72E9", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:00.872663164Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "1C66B5035E047FF7ABF487A0314BCFCCBAB96063AA899C36CF97D613DD1F5D07", + "parts": { + "hash": "4ED7544D576A97E1FE0D0B257FE004366C0297E06D6C40454610317B00F07041", + "total": 1 + } + }, + "height": "24", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "SBCiUMs19jJlLl7G4K0ADCjcOs4trUjT4YXvUxsPupFNOBndCPaLbhJAVwfXkc9Y4GURP39tufsMEUormAvTBQ==", + "timestamp": "2023-05-17T14:13:00.872663164Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "179A984A4FD2D7B16E975660BE9BDEF9056A751830581A8088BAAE81DBB330E5", + "parts": { + "hash": "8C3ECA449F3FF320E8DF272D8793CC3E69E9D616E4A2E495C31F514CB21013F4", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "26", + "last_block_id": { + "hash": "179A984A4FD2D7B16E975660BE9BDEF9056A751830581A8088BAAE81DBB330E5", + "parts": { + "hash": "8C3ECA449F3FF320E8DF272D8793CC3E69E9D616E4A2E495C31F514CB21013F4", + "total": 1 + } + }, + "last_commit_hash": "163E769E67213D4157FF137A56216B8D7BF3CA51A29F9211E8702E209AC157C4", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:01.389354255Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "179A984A4FD2D7B16E975660BE9BDEF9056A751830581A8088BAAE81DBB330E5", + "parts": { + "hash": "8C3ECA449F3FF320E8DF272D8793CC3E69E9D616E4A2E495C31F514CB21013F4", + "total": 1 + } + }, + "height": "25", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "+GIgZcpLcXtoJWn5Q34CsFjqI23pVmHE72bcKaa70efKWyiwrRsBrTKUSVECo6KDeyyaoE347w1xh4BxF3J/Ag==", + "timestamp": "2023-05-17T14:13:01.389354255Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "3FBE7F6D2752EED81B1E6A2F39394AB19333E73C08127EEA5DF285A38633AF03", + "parts": { + "hash": "40BFF8CABC9E8CAA5B5E86DAE53A2A37684B945D2FE889190DB9E2B1476D5455", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "27", + "last_block_id": { + "hash": "3FBE7F6D2752EED81B1E6A2F39394AB19333E73C08127EEA5DF285A38633AF03", + "parts": { + "hash": "40BFF8CABC9E8CAA5B5E86DAE53A2A37684B945D2FE889190DB9E2B1476D5455", + "total": 1 + } + }, + "last_commit_hash": "BCF728609BAE67E07037BCCD7DCAD9D806C179CE9E56018BAB69ECAC6B81E5D3", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:01.908390259Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "3FBE7F6D2752EED81B1E6A2F39394AB19333E73C08127EEA5DF285A38633AF03", + "parts": { + "hash": "40BFF8CABC9E8CAA5B5E86DAE53A2A37684B945D2FE889190DB9E2B1476D5455", + "total": 1 + } + }, + "height": "26", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "odGw6dXvAp5up7vUsT8Argq6AFHXIdGP0SZDTTO3cDUoekn41CQX3vbcV2nfxZK0v/kveGwj4ovjIENuE1cwBQ==", + "timestamp": "2023-05-17T14:13:01.908390259Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "35A46D838D56DC26097CF24875774E488E71FD86057829F1F202E315248AC19F", + "parts": { + "hash": "87960DED3098171A0E1BC6662ED6CAE2A6C007738E02D23848E8BF330FFC8C6D", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "28", + "last_block_id": { + "hash": "35A46D838D56DC26097CF24875774E488E71FD86057829F1F202E315248AC19F", + "parts": { + "hash": "87960DED3098171A0E1BC6662ED6CAE2A6C007738E02D23848E8BF330FFC8C6D", + "total": 1 + } + }, + "last_commit_hash": "545206578C848303469B6BDC1AEDC2C5733445F8210C8D601A4C79B27381B66E", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:02.427967512Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "35A46D838D56DC26097CF24875774E488E71FD86057829F1F202E315248AC19F", + "parts": { + "hash": "87960DED3098171A0E1BC6662ED6CAE2A6C007738E02D23848E8BF330FFC8C6D", + "total": 1 + } + }, + "height": "27", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "PgQI8B/PkXMILpLrPy/Mnofk+6sq9VhtWfr0HqMnmg5jMtd/JeyFlyixuH7ZDLsiUUzBJza3DniSCJBMZN9QAw==", + "timestamp": "2023-05-17T14:13:02.427967512Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "3AABB8C1518B5B243ED610E9B730AECE8CD44C49401A8B9A1938E28351E34F4C", + "parts": { + "hash": "7B323C299430F92DA143ACADA1DD00083D1D0716F3A4A952045088347001BBD0", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "29", + "last_block_id": { + "hash": "3AABB8C1518B5B243ED610E9B730AECE8CD44C49401A8B9A1938E28351E34F4C", + "parts": { + "hash": "7B323C299430F92DA143ACADA1DD00083D1D0716F3A4A952045088347001BBD0", + "total": 1 + } + }, + "last_commit_hash": "522E597F435104125DE7FA0F5AE301A002A6898E2D5E6B5324CB12A812B2D6FE", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:02.947106031Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "3AABB8C1518B5B243ED610E9B730AECE8CD44C49401A8B9A1938E28351E34F4C", + "parts": { + "hash": "7B323C299430F92DA143ACADA1DD00083D1D0716F3A4A952045088347001BBD0", + "total": 1 + } + }, + "height": "28", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "EqHXM8ZCwVVMfrOvNn1qX+cLES8QFaAy18rXRWlu2drbD3+T+c0kF4iXmYnEXsXqm5k04168CIk+PzCeGaVuBw==", + "timestamp": "2023-05-17T14:13:02.947106031Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "CD5612608F56B4FA9F2A4111B0BE8CA9A31F42BDE8A6A6D33FE1E82437D16BB5", + "parts": { + "hash": "30C05554F87121490A215FE8EE9EAD7D3F0FD9E06E6CFD295A53D892794D0B1A", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "30", + "last_block_id": { + "hash": "CD5612608F56B4FA9F2A4111B0BE8CA9A31F42BDE8A6A6D33FE1E82437D16BB5", + "parts": { + "hash": "30C05554F87121490A215FE8EE9EAD7D3F0FD9E06E6CFD295A53D892794D0B1A", + "total": 1 + } + }, + "last_commit_hash": "44F0DDAD3CC7D12C5C7AB3FF0AA151873B0EFFC30D8CE06C2B6D99EADCC64D27", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:03.465238718Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "CD5612608F56B4FA9F2A4111B0BE8CA9A31F42BDE8A6A6D33FE1E82437D16BB5", + "parts": { + "hash": "30C05554F87121490A215FE8EE9EAD7D3F0FD9E06E6CFD295A53D892794D0B1A", + "total": 1 + } + }, + "height": "29", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "3Chd1QhGXibmeFqYBWrPJ1acLfk60DzT08uTXw25s2y8yKvYP1k8KUDWekmhyLkxEKy6g9x4WKG6kRexqy80AQ==", + "timestamp": "2023-05-17T14:13:03.465238718Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "B707CC3FEE90BC841F67E5073C497EB48D8FFCFF82EE43E450B8768D0F83DF3C", + "parts": { + "hash": "0B9C3B9AEED837CC16275B3C92DE64E8A31A217C53A3589C3F3B0F0565703BDC", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "31", + "last_block_id": { + "hash": "B707CC3FEE90BC841F67E5073C497EB48D8FFCFF82EE43E450B8768D0F83DF3C", + "parts": { + "hash": "0B9C3B9AEED837CC16275B3C92DE64E8A31A217C53A3589C3F3B0F0565703BDC", + "total": 1 + } + }, + "last_commit_hash": "CA67E5FEECDFD4F3A6EACAA3A481E5BD47BB8C8E22BBE1410F281F74A8F6B703", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:03.982044228Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "B707CC3FEE90BC841F67E5073C497EB48D8FFCFF82EE43E450B8768D0F83DF3C", + "parts": { + "hash": "0B9C3B9AEED837CC16275B3C92DE64E8A31A217C53A3589C3F3B0F0565703BDC", + "total": 1 + } + }, + "height": "30", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "vdAoNt3xQO/lk03p+itj3s+VAjnir2Y7/C/R5Q1t2Fwyy4akteTw1HmPOWMp580JAdILvaz4NeRqbb7FxNl6Bg==", + "timestamp": "2023-05-17T14:13:03.982044228Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "05E4E4307C998550EFDAB119FA25030C19008FB9C5501D30721F74639A79566F", + "parts": { + "hash": "69B754FD05EC22EB71632F146C8E7E282C35170C909C2F235044638F443455B0", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "32", + "last_block_id": { + "hash": "05E4E4307C998550EFDAB119FA25030C19008FB9C5501D30721F74639A79566F", + "parts": { + "hash": "69B754FD05EC22EB71632F146C8E7E282C35170C909C2F235044638F443455B0", + "total": 1 + } + }, + "last_commit_hash": "E34512266F5ACEE46D40AEEB113DE49DF72E6B4E43DF5C5B50D63636A4A550DB", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:04.510391124Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "05E4E4307C998550EFDAB119FA25030C19008FB9C5501D30721F74639A79566F", + "parts": { + "hash": "69B754FD05EC22EB71632F146C8E7E282C35170C909C2F235044638F443455B0", + "total": 1 + } + }, + "height": "31", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "zrM8q1wyvY+98Wp/ed8lL+h1MwZKQV3gMWo2k0NlstoKovxHBnJmMORXG1Etoy1M77oGL/8GCJXFQQ8YyaXHCQ==", + "timestamp": "2023-05-17T14:13:04.510391124Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "27891D3373EE44E65290CF157618C211243288D91F235088ACD01A074985E277", + "parts": { + "hash": "DB31F93D24D6AE30C85E42937B799D1F4162B3E58EBE018262B43BEBDDE7B205", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "33", + "last_block_id": { + "hash": "27891D3373EE44E65290CF157618C211243288D91F235088ACD01A074985E277", + "parts": { + "hash": "DB31F93D24D6AE30C85E42937B799D1F4162B3E58EBE018262B43BEBDDE7B205", + "total": 1 + } + }, + "last_commit_hash": "9A934CA4D382E54BD8E41460D248B155F87945C0E5293D686BFE943C707F624B", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:05.028423316Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "27891D3373EE44E65290CF157618C211243288D91F235088ACD01A074985E277", + "parts": { + "hash": "DB31F93D24D6AE30C85E42937B799D1F4162B3E58EBE018262B43BEBDDE7B205", + "total": 1 + } + }, + "height": "32", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "UxoNngTw6sRHGZFr+1TZgN2965mLD69TQ4hZDsaCQ2jRMyBIm9/8d+2rrcL2IN3lwmaT4WoUs7OBnJw1vSH+BQ==", + "timestamp": "2023-05-17T14:13:05.028423316Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "4DBDBB2E6CE11AFF74BF29E026EB1B77289F03A4EE3D144F25420684AA0B7988", + "parts": { + "hash": "B7CD4944B708AAE584A26D37DE37B76D8D472E23D60271C94559C1D0EE9CF778", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "34", + "last_block_id": { + "hash": "4DBDBB2E6CE11AFF74BF29E026EB1B77289F03A4EE3D144F25420684AA0B7988", + "parts": { + "hash": "B7CD4944B708AAE584A26D37DE37B76D8D472E23D60271C94559C1D0EE9CF778", + "total": 1 + } + }, + "last_commit_hash": "8DEB2A59E31FE833910D16D2289F3155CCC9900B6098755A98E435F1452667F7", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:05.546851571Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "4DBDBB2E6CE11AFF74BF29E026EB1B77289F03A4EE3D144F25420684AA0B7988", + "parts": { + "hash": "B7CD4944B708AAE584A26D37DE37B76D8D472E23D60271C94559C1D0EE9CF778", + "total": 1 + } + }, + "height": "33", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "3gH1ApMWp+9MtKqH2+9PZ9zn0TMKRt3NBSGT93cv5FaTsCUBRU8LFb2rqOHgYUtjWO9qzs/yyK8ysEwyWXS7Cw==", + "timestamp": "2023-05-17T14:13:05.546851571Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "F0381F92BEA47DBA8C299326B0D093744CFBFF5518BFFC875B55F6586F77D0DC", + "parts": { + "hash": "40B77ACF8335CAD6C0FB6258347B92150444057F5A60726C723F099C0C5F63CC", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "35", + "last_block_id": { + "hash": "F0381F92BEA47DBA8C299326B0D093744CFBFF5518BFFC875B55F6586F77D0DC", + "parts": { + "hash": "40B77ACF8335CAD6C0FB6258347B92150444057F5A60726C723F099C0C5F63CC", + "total": 1 + } + }, + "last_commit_hash": "FEB6D4317A1FE3F70DDE00C69532FB19ED0C7640209F24283FB9B9838227C0FC", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:06.063659113Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "F0381F92BEA47DBA8C299326B0D093744CFBFF5518BFFC875B55F6586F77D0DC", + "parts": { + "hash": "40B77ACF8335CAD6C0FB6258347B92150444057F5A60726C723F099C0C5F63CC", + "total": 1 + } + }, + "height": "34", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "5VgMGbjwzAk71Ft8uuPWJV3hkFkfulZDz5/qr7Jo6eopQQ4+AdvtmhB6WQI4fnXTayyT4+BUg4l/Ey3EunWyAQ==", + "timestamp": "2023-05-17T14:13:06.063659113Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "5A9F3F8809C454BDAF2B151D6ED1E80E6785E0CBBED03E1B37B3F5FB21F02B7A", + "parts": { + "hash": "B41C3BEA52752A1423327541DD57894832EBDF2D2E5A6DC5F25A2825BC252D68", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "36", + "last_block_id": { + "hash": "5A9F3F8809C454BDAF2B151D6ED1E80E6785E0CBBED03E1B37B3F5FB21F02B7A", + "parts": { + "hash": "B41C3BEA52752A1423327541DD57894832EBDF2D2E5A6DC5F25A2825BC252D68", + "total": 1 + } + }, + "last_commit_hash": "24D0CBED6CC561AFE167B4484A16D7F7CA9D9C0BAA95D8FC2FDDA2561D87D95A", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:06.579842701Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "5A9F3F8809C454BDAF2B151D6ED1E80E6785E0CBBED03E1B37B3F5FB21F02B7A", + "parts": { + "hash": "B41C3BEA52752A1423327541DD57894832EBDF2D2E5A6DC5F25A2825BC252D68", + "total": 1 + } + }, + "height": "35", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "guFZRcPb/NpaxWWUcmaSRn3KszLOC5pfvsLvwNQ2RB2MZs0zuq9WcwoG1tSOXUUzc2qcUlyDbpXLqSZcezaYBg==", + "timestamp": "2023-05-17T14:13:06.579842701Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "E20352D210D09E35643A098AADEF67701BEA6DA571148FFBFF2C0F48B7679038", + "parts": { + "hash": "187A8C3675DACAF7B075256AFC6C08DE83E8E62683A1C79EF4C21D0AC4A74F59", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "37", + "last_block_id": { + "hash": "E20352D210D09E35643A098AADEF67701BEA6DA571148FFBFF2C0F48B7679038", + "parts": { + "hash": "187A8C3675DACAF7B075256AFC6C08DE83E8E62683A1C79EF4C21D0AC4A74F59", + "total": 1 + } + }, + "last_commit_hash": "D2FE6CDC8B156FD3C64D4E574B3F9FD75597577C70EE69595285CBA83C574E0F", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:07.097728823Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "E20352D210D09E35643A098AADEF67701BEA6DA571148FFBFF2C0F48B7679038", + "parts": { + "hash": "187A8C3675DACAF7B075256AFC6C08DE83E8E62683A1C79EF4C21D0AC4A74F59", + "total": 1 + } + }, + "height": "36", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "ptd63Oi1m661J1P7Cwb15JySvk329meem8KzFMViIn7iXFTbFU+A7qjvh8KftRzytGq41Sv8zCQBqU3/5yCyBA==", + "timestamp": "2023-05-17T14:13:07.097728823Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "CD0CC6C1E294D801E1F33AC82792CCFAB7103DAA7FACBFE8476B5ADB2DE62890", + "parts": { + "hash": "B870BD6B234AFF98B86C1BAD3987A9594574D59A9F1653DFEF86159CC44AC0D0", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "38", + "last_block_id": { + "hash": "CD0CC6C1E294D801E1F33AC82792CCFAB7103DAA7FACBFE8476B5ADB2DE62890", + "parts": { + "hash": "B870BD6B234AFF98B86C1BAD3987A9594574D59A9F1653DFEF86159CC44AC0D0", + "total": 1 + } + }, + "last_commit_hash": "503E13D9696C368C92C8CF6A9347B5550DAFFE3D721D1AB44D7317475DD85EAC", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:07.618803569Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "CD0CC6C1E294D801E1F33AC82792CCFAB7103DAA7FACBFE8476B5ADB2DE62890", + "parts": { + "hash": "B870BD6B234AFF98B86C1BAD3987A9594574D59A9F1653DFEF86159CC44AC0D0", + "total": 1 + } + }, + "height": "37", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "hiNgu2338XHT8URRRVghgiVJ+ePDe8Bt+c7CEIotq6sXRsR1aRPto24P63V2kXv9a22rWRBqsomMNZWrg/vPBg==", + "timestamp": "2023-05-17T14:13:07.618803569Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "7475552C9F598D976B90E866041F90F166F240A82B11EB34613FCC614D387C9D", + "parts": { + "hash": "C942512908C1B7247151B5AAFD30A5584D00A0BFD11CF701D7E9CEB7BE3791CE", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "39", + "last_block_id": { + "hash": "7475552C9F598D976B90E866041F90F166F240A82B11EB34613FCC614D387C9D", + "parts": { + "hash": "C942512908C1B7247151B5AAFD30A5584D00A0BFD11CF701D7E9CEB7BE3791CE", + "total": 1 + } + }, + "last_commit_hash": "EF192302752B0D6ED3B2DB80EB232D248455F93EA96685C64265AAD021652BCE", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:08.135839948Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "7475552C9F598D976B90E866041F90F166F240A82B11EB34613FCC614D387C9D", + "parts": { + "hash": "C942512908C1B7247151B5AAFD30A5584D00A0BFD11CF701D7E9CEB7BE3791CE", + "total": 1 + } + }, + "height": "38", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "UIrToj9z6xEz/auGC+KwbkrAvc1iCGVOsU1VP9QrHbsFej+N6pHalKkdmu1nWGgvo6gyIOmXUWCYF1MpLHFaBA==", + "timestamp": "2023-05-17T14:13:08.135839948Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "FBD5AF67C04AC388FA1D384A46CA7FB42DDC19275AF5640147A3F6DCEF07888F", + "parts": { + "hash": "1B751266F94B7E829A8DFB000A57591B0E5979CA64D722325558B9DAB77B2D26", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "40", + "last_block_id": { + "hash": "FBD5AF67C04AC388FA1D384A46CA7FB42DDC19275AF5640147A3F6DCEF07888F", + "parts": { + "hash": "1B751266F94B7E829A8DFB000A57591B0E5979CA64D722325558B9DAB77B2D26", + "total": 1 + } + }, + "last_commit_hash": "BB447075A11F91E6B7B50752C7F535E75424F4E5F5BCE33BB14891304541D902", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:08.653424498Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "FBD5AF67C04AC388FA1D384A46CA7FB42DDC19275AF5640147A3F6DCEF07888F", + "parts": { + "hash": "1B751266F94B7E829A8DFB000A57591B0E5979CA64D722325558B9DAB77B2D26", + "total": 1 + } + }, + "height": "39", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "Hnx4VJYVBfJTDtugh8vTnugOmf9KDLGeExsQsAQrwNK5h7bzlBjvHI+lrP0oBRrXWez6tI7iYbB17oJdMjJSCg==", + "timestamp": "2023-05-17T14:13:08.653424498Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "D277064939B8D3B1A153FD3642AF842ECC64461E93A6B04583567E047E92720E", + "parts": { + "hash": "52A6439D1B8B8DB899707FC4715FF5C61D2848AFE17918BD6FD9E7EC3F39196D", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "41", + "last_block_id": { + "hash": "D277064939B8D3B1A153FD3642AF842ECC64461E93A6B04583567E047E92720E", + "parts": { + "hash": "52A6439D1B8B8DB899707FC4715FF5C61D2848AFE17918BD6FD9E7EC3F39196D", + "total": 1 + } + }, + "last_commit_hash": "FB424B029C2F5E577650ACE9159352CFA92BB45EAB360799A183E58FBEF9577C", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:09.170152274Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "D277064939B8D3B1A153FD3642AF842ECC64461E93A6B04583567E047E92720E", + "parts": { + "hash": "52A6439D1B8B8DB899707FC4715FF5C61D2848AFE17918BD6FD9E7EC3F39196D", + "total": 1 + } + }, + "height": "40", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "XSZh+0J7ZvHv95cT4EL2+k+ildMpHQJOitgJDYyo08FVBpLumSqepHQZetLYXbJdL9Tj2PAdm0eCb7LpWFYMDg==", + "timestamp": "2023-05-17T14:13:09.170152274Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "111EDA47151E52093D9A2CF1F0829C7A1739E04CD8EEEC5A78DF543AB7534A39", + "parts": { + "hash": "BB05335191DACC68C00F734CFF172CF3547DC7565D03CA44D0A5EFFDBCEACA55", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "42", + "last_block_id": { + "hash": "111EDA47151E52093D9A2CF1F0829C7A1739E04CD8EEEC5A78DF543AB7534A39", + "parts": { + "hash": "BB05335191DACC68C00F734CFF172CF3547DC7565D03CA44D0A5EFFDBCEACA55", + "total": 1 + } + }, + "last_commit_hash": "415162126EF919E5A67DBEB4211F6EB3684750B410B4C49AFD06A75DCAB062C3", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:09.686114873Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "111EDA47151E52093D9A2CF1F0829C7A1739E04CD8EEEC5A78DF543AB7534A39", + "parts": { + "hash": "BB05335191DACC68C00F734CFF172CF3547DC7565D03CA44D0A5EFFDBCEACA55", + "total": 1 + } + }, + "height": "41", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "NpatVh++xpaBA8R6l1IF96sqjADIwMcxffYOyZo4+8WivktkO8k90gTq0ZTymTg8DMcTrw2tYobRlwmFXGZSAg==", + "timestamp": "2023-05-17T14:13:09.686114873Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "769EEC7627F751548E51C93A690353E10D6E8FEF0D6B1687B6DB9BD91935F423", + "parts": { + "hash": "6D3E1284AD3DF316345F3D7A707568997A5B648CB5F7CC5F85BB8E880F1F7D21", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "43", + "last_block_id": { + "hash": "769EEC7627F751548E51C93A690353E10D6E8FEF0D6B1687B6DB9BD91935F423", + "parts": { + "hash": "6D3E1284AD3DF316345F3D7A707568997A5B648CB5F7CC5F85BB8E880F1F7D21", + "total": 1 + } + }, + "last_commit_hash": "50C6D5EEBA54AAB78CFB367E710F5AD39FD39110804169787EAA9383F845DF82", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:10.203057501Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "769EEC7627F751548E51C93A690353E10D6E8FEF0D6B1687B6DB9BD91935F423", + "parts": { + "hash": "6D3E1284AD3DF316345F3D7A707568997A5B648CB5F7CC5F85BB8E880F1F7D21", + "total": 1 + } + }, + "height": "42", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "bsjMIK7OmyhlnFpWm/HiT0ML8eoRTYCz2WGZ/88WqnsuzfyDMlG5z6IREfGZdO8Un37GvqSp1OMLgGYgnWdfAQ==", + "timestamp": "2023-05-17T14:13:10.203057501Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "0B7CDB2978D7450C545B9FA13E0B59A1CC327F5638CAC489A632A28CC8B77100", + "parts": { + "hash": "16AF29AFE5285694CEBE3C5D73EA79F42E5A5F0F89D78BD2999C22F03F334078", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "44", + "last_block_id": { + "hash": "0B7CDB2978D7450C545B9FA13E0B59A1CC327F5638CAC489A632A28CC8B77100", + "parts": { + "hash": "16AF29AFE5285694CEBE3C5D73EA79F42E5A5F0F89D78BD2999C22F03F334078", + "total": 1 + } + }, + "last_commit_hash": "54F98C074EC010D2E96CB1558F2672BD5CA77EF95A4FAA4CFBEFD6AEEDC025E9", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:10.720793541Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "0B7CDB2978D7450C545B9FA13E0B59A1CC327F5638CAC489A632A28CC8B77100", + "parts": { + "hash": "16AF29AFE5285694CEBE3C5D73EA79F42E5A5F0F89D78BD2999C22F03F334078", + "total": 1 + } + }, + "height": "43", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "mhxPzdeKH+ZPmcGcTTYHjVGVb/KX19lTkEqVUpZJRwO4XZEKrL/5N7ihmM4c5oKRSSqOzeFhVi9MkUyypjZ3CQ==", + "timestamp": "2023-05-17T14:13:10.720793541Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "DE16D2D240603C13904EA609EF05D4BA64A25BA0A066587B574F475D294FC081", + "parts": { + "hash": "476253FA09292C13C6CF479C155EEC752D2DDD201E5186E985682216BFDB20EA", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "45", + "last_block_id": { + "hash": "DE16D2D240603C13904EA609EF05D4BA64A25BA0A066587B574F475D294FC081", + "parts": { + "hash": "476253FA09292C13C6CF479C155EEC752D2DDD201E5186E985682216BFDB20EA", + "total": 1 + } + }, + "last_commit_hash": "6D4010100B59CCA13813A8320CD2C7EB4F2E6972AB2A48DF6C02C4327DABFF79", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:11.238521337Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "DE16D2D240603C13904EA609EF05D4BA64A25BA0A066587B574F475D294FC081", + "parts": { + "hash": "476253FA09292C13C6CF479C155EEC752D2DDD201E5186E985682216BFDB20EA", + "total": 1 + } + }, + "height": "44", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "4GcLz6b2wkOdFv7Nd7SaSLJQHukjtplBJlWZgy9pAz697K3QiYZqYpQe0SYPtMuplFywH+mtnEJrVtxyfJkFAg==", + "timestamp": "2023-05-17T14:13:11.238521337Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "1ADC398BAB1C0EBD93617135C8C8E89FEF1D26B001A3D1723E02B995CBAA8BBC", + "parts": { + "hash": "CB7E6A1E262E60D11CAE8EE47CD04D1F5DE792F43D66DBD014A6447E86B96081", + "total": 1 + } + } + }, + { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "46", + "last_block_id": { + "hash": "1ADC398BAB1C0EBD93617135C8C8E89FEF1D26B001A3D1723E02B995CBAA8BBC", + "parts": { + "hash": "CB7E6A1E262E60D11CAE8EE47CD04D1F5DE792F43D66DBD014A6447E86B96081", + "total": 1 + } + }, + "last_commit_hash": "4B585829CCB470503FDCB77D370CC00AA354BAB22249A6CCE1A0F15F467D7E33", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:13:11.758129602Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "1ADC398BAB1C0EBD93617135C8C8E89FEF1D26B001A3D1723E02B995CBAA8BBC", + "parts": { + "hash": "CB7E6A1E262E60D11CAE8EE47CD04D1F5DE792F43D66DBD014A6447E86B96081", + "total": 1 + } + }, + "height": "45", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "yA6GPEMAJKwbxd2s9maTXOwdoV8PiFfV7oKGXPerBUqyHbaCDj14qUaZDVNBWUmTIzf4iECe9Xw/AZBt3UwJCQ==", + "timestamp": "2023-05-17T14:13:11.758129602Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "9E7353AA3AEBB8ADC700C858A62FA4FD1BC5BBDC00A2228E93E489C1A45944C5", + "parts": { + "hash": "A244DA3DC4EEC9A458B4544A0F04841012003F69E2FAAE32DC9228CC25FAA63C", + "total": 1 + } + } + } + ], + "total_count": "45" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/blockchain_from_1_to_10.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/blockchain_from_1_to_10.json new file mode 100644 index 000000000..07e8aa85e --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/blockchain_from_1_to_10.json @@ -0,0 +1,369 @@ +{ + "id": "6865d6c8-c17f-4149-8d9b-1bfabbe3a97c", + "jsonrpc": "2.0", + "result": { + "block_metas": [ + { + "block_id": { + "hash": "00ECDAC463C201ECD4BDBBAAE4A53A4C80291D4051FD69ED97F6420CE1388BFE", + "parts": { + "hash": "FF0A320E696FD233DD4D3CC7CD82FF90F54B8FDBC9C700D9375C95A02782B062", + "total": 1 + } + }, + "block_size": "569", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "10", + "last_block_id": { + "hash": "678A83FB0422D053A3792154703122861DD68ABB8247A4FF2945DF832DB18FC8", + "parts": { + "hash": "29FE32F6B57D8439C9E9F6240B436DD560646FDA8C8C105E2C261B6F4746E89C", + "total": 1 + } + }, + "last_commit_hash": "A3AD467820428D99FD53BFCF38CDC1EB141DD27E3B5F0F3931BBE91FBA8B097D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:53.088875124Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + }, + { + "block_id": { + "hash": "678A83FB0422D053A3792154703122861DD68ABB8247A4FF2945DF832DB18FC8", + "parts": { + "hash": "29FE32F6B57D8439C9E9F6240B436DD560646FDA8C8C105E2C261B6F4746E89C", + "total": 1 + } + }, + "block_size": "571", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "9", + "last_block_id": { + "hash": "0FD9EFBBC42938EBE2AFC1A72CFD3D95303573A8F247FE60105154A363869EE0", + "parts": { + "hash": "CAA389BC14C73BFE452E01DC5DB89EEB20BA4331402DD0EF385F1FCA2A3B8F07", + "total": 1 + } + }, + "last_commit_hash": "AB99F72D02B4ADFEA560A2AFEE0332C3CC3723CBE485330679513AB0A192ED00", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:52.570941867Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + }, + { + "block_id": { + "hash": "0FD9EFBBC42938EBE2AFC1A72CFD3D95303573A8F247FE60105154A363869EE0", + "parts": { + "hash": "CAA389BC14C73BFE452E01DC5DB89EEB20BA4331402DD0EF385F1FCA2A3B8F07", + "total": 1 + } + }, + "block_size": "569", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "8", + "last_block_id": { + "hash": "CD37BA5042D2E6D430E063E528D2A9BF47F0929298E84E044713E8A8FDA3B0B8", + "parts": { + "hash": "13D878AF1A006D3E346B5A97E8BD11F9D4D1D1EABD64F474872CD4C639F42349", + "total": 1 + } + }, + "last_commit_hash": "CD2C414D7E3A5CB996B6A1D3C1BB99EB7780F87385CB693D5957FA9AFE3888C8", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:52.052745971Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + }, + { + "block_id": { + "hash": "CD37BA5042D2E6D430E063E528D2A9BF47F0929298E84E044713E8A8FDA3B0B8", + "parts": { + "hash": "13D878AF1A006D3E346B5A97E8BD11F9D4D1D1EABD64F474872CD4C639F42349", + "total": 1 + } + }, + "block_size": "571", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "7", + "last_block_id": { + "hash": "CABD0A09CD90B45CDBD7E254ED0951EA7B731417F5EED2675153861FF869B07A", + "parts": { + "hash": "285AAF4CC8056539DD28B6B91BC9A49F884C1B08AB8E423D39CB277186A7F9FB", + "total": 1 + } + }, + "last_commit_hash": "E66E7E297034705D9CBEC9BBD88181215219135E5000281B16EE3CB486AA6D5D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:51.530224659Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + }, + { + "block_id": { + "hash": "CABD0A09CD90B45CDBD7E254ED0951EA7B731417F5EED2675153861FF869B07A", + "parts": { + "hash": "285AAF4CC8056539DD28B6B91BC9A49F884C1B08AB8E423D39CB277186A7F9FB", + "total": 1 + } + }, + "block_size": "569", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "6", + "last_block_id": { + "hash": "5338CEC2D2DA7D8AFD152C677072AC954E776D2222EB523D7D03B6DFEB6CAA04", + "parts": { + "hash": "6F88DFF2D9FC0EC4B860960E4F1B2E47AE1DA3206042EE01064CF794C8246421", + "total": 1 + } + }, + "last_commit_hash": "63FBD5C103F243ACC16C2C9FFB26144BC88CCB6818A263DA086304C3779F281D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:51.012251242Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + }, + { + "block_id": { + "hash": "5338CEC2D2DA7D8AFD152C677072AC954E776D2222EB523D7D03B6DFEB6CAA04", + "parts": { + "hash": "6F88DFF2D9FC0EC4B860960E4F1B2E47AE1DA3206042EE01064CF794C8246421", + "total": 1 + } + }, + "block_size": "571", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "5", + "last_block_id": { + "hash": "F28AC02B47A10ED843320BEA7677812B40980218FAA18A59C2F7C298F9C3CC23", + "parts": { + "hash": "6236C5DE711E11DE7079348B94222870E385B077E05C474820A63B1D61D82FF2", + "total": 1 + } + }, + "last_commit_hash": "071ABC6A41C774A3017A628F6E84AEA6C4722B3050B2821A7DEB938A63063F6E", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:50.491083452Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + }, + { + "block_id": { + "hash": "F28AC02B47A10ED843320BEA7677812B40980218FAA18A59C2F7C298F9C3CC23", + "parts": { + "hash": "6236C5DE711E11DE7079348B94222870E385B077E05C474820A63B1D61D82FF2", + "total": 1 + } + }, + "block_size": "571", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "4", + "last_block_id": { + "hash": "7937D62B37155F3C723BDBEE2B19813B3EFDCD1E620CCF400C5CAA754DFB8AB1", + "parts": { + "hash": "B1C0D25DB583D511EC23F4797374337D9926DD19FA71828426EFFFFE7DF1C19F", + "total": 1 + } + }, + "last_commit_hash": "8AE1AA2B69E53E25D5A005380EA289AB0CDD3968A05AD625FB733F19408685D4", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:49.974876236Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + }, + { + "block_id": { + "hash": "7937D62B37155F3C723BDBEE2B19813B3EFDCD1E620CCF400C5CAA754DFB8AB1", + "parts": { + "hash": "B1C0D25DB583D511EC23F4797374337D9926DD19FA71828426EFFFFE7DF1C19F", + "total": 1 + } + }, + "block_size": "571", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "3", + "last_block_id": { + "hash": "70302722FE881D45C2683268F3CCD8B72B6BAE35DE3765960244B956FA426F2C", + "parts": { + "hash": "B1CE80F8E2150C3FCC23370CF72E24048C734451FC88EBFB8C9B5633C512BF4C", + "total": 1 + } + }, + "last_commit_hash": "7E9C345B92FDE2D3007509E3F884FC8E383D5130F42E5427AFF68D59D6C7E1C9", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:49.452618685Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + }, + { + "block_id": { + "hash": "70302722FE881D45C2683268F3CCD8B72B6BAE35DE3765960244B956FA426F2C", + "parts": { + "hash": "B1CE80F8E2150C3FCC23370CF72E24048C734451FC88EBFB8C9B5633C512BF4C", + "total": 1 + } + }, + "block_size": "571", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "2", + "last_block_id": { + "hash": "6CD5CF4E23A49D9BC073D6F305D29D1B8B5193B534C237696D42FEA5AFBCD520", + "parts": { + "hash": "F021777213F7EF77494C9B5C11D246A6F532DA146D205422D1FB85600F6B479C", + "total": 1 + } + }, + "last_commit_hash": "8204E61CDD32DD6056F2DAE2D5E1A48AC26E4BA6C257952954C2470604CDBAAD", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:48.936921432Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + }, + { + "block_id": { + "hash": "6CD5CF4E23A49D9BC073D6F305D29D1B8B5193B534C237696D42FEA5AFBCD520", + "parts": { + "hash": "F021777213F7EF77494C9B5C11D246A6F532DA146D205422D1FB85600F6B479C", + "total": 1 + } + }, + "block_size": "322", + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "1", + "last_block_id": { + "hash": "", + "parts": { + "hash": "", + "total": 0 + } + }, + "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:48.347696215Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "num_txs": "0" + } + ], + "last_height": "214" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_async.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_async.json new file mode 100644 index 000000000..f36c70747 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_async.json @@ -0,0 +1,11 @@ +{ + "id": "619d31c4-5735-45c4-95ca-7dfd8d5af651", + "jsonrpc": "2.0", + "result": { + "code": 0, + "codespace": "", + "data": "", + "hash": "9F28904F9C0F3AB74A81CBA48E39124DA1C680B47FBFCBA0126870DB722BCC30", + "log": "" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_commit.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_commit.json new file mode 100644 index 000000000..7c67a0aec --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_commit.json @@ -0,0 +1,79 @@ +{ + "id": "f356464f-dd5c-4b81-a88d-73d5aef4db8d", + "jsonrpc": "2.0", + "result": { + "check_tx": { + "code": 0, + "codespace": "", + "data": null, + "events": [], + "gas_used": "0", + "gas_wanted": "1", + "info": "", + "log": "" + }, + "hash": "D63F9C23791E610410B576D8C27BB5AEAC93CC1A58522428A7B32A1276085860", + "height": "227", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "commit-key" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_sync.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_sync.json new file mode 100644 index 000000000..408b83ebb --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/broadcast_tx_sync.json @@ -0,0 +1,11 @@ +{ + "id": "52e1c399-68e0-4fc3-ac35-68cacdb66d49", + "jsonrpc": "2.0", + "result": { + "code": 0, + "codespace": "", + "data": "", + "hash": "57018296EE0919C9D351F2FFEA82A8D28DE223724D79965FC8D00A7477ED48BC", + "log": "" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/commit_at_height_10.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/commit_at_height_10.json new file mode 100644 index 000000000..ccecbff5c --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/commit_at_height_10.json @@ -0,0 +1,53 @@ +{ + "id": "ee769e8a-4fa9-4e9a-9019-fc72ef5c3f02", + "jsonrpc": "2.0", + "result": { + "canonical": true, + "signed_header": { + "commit": { + "block_id": { + "hash": "00ECDAC463C201ECD4BDBBAAE4A53A4C80291D4051FD69ED97F6420CE1388BFE", + "parts": { + "hash": "FF0A320E696FD233DD4D3CC7CD82FF90F54B8FDBC9C700D9375C95A02782B062", + "total": 1 + } + }, + "height": "10", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "5y0Kas3bSrgVYG/QKwWovMpTBfavZfy/A8DXkQHzFHVMjOcVk2TK6xhYQasfiodordg1bjDf7NDwNi/YdilaAw==", + "timestamp": "2023-05-17T14:12:53.605374524Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + }, + "header": { + "app_hash": "0000000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "10", + "last_block_id": { + "hash": "678A83FB0422D053A3792154703122861DD68ABB8247A4FF2945DF832DB18FC8", + "parts": { + "hash": "29FE32F6B57D8439C9E9F6240B436DD560646FDA8C8C105E2C261B6F4746E89C", + "total": 1 + } + }, + "last_commit_hash": "A3AD467820428D99FD53BFCF38CDC1EB141DD27E3B5F0F3931BBE91FBA8B097D", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:12:53.088875124Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + } + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/consensus_params.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/consensus_params.json new file mode 100644 index 000000000..fed70b52c --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/consensus_params.json @@ -0,0 +1,29 @@ +{ + "id": "56d91e8f-1d2e-46b3-8d4d-686860344721", + "jsonrpc": "2.0", + "result": { + "block_height": "10", + "consensus_params": { + "abci": { + "vote_extensions_enable_height": "0" + }, + "block": { + "max_bytes": "22020096", + "max_gas": "-1" + }, + "evidence": { + "max_age_duration": "172800000000000", + "max_age_num_blocks": "100000", + "max_bytes": "1048576" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": { + "app": "0" + } + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/consensus_state.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/consensus_state.json new file mode 100644 index 000000000..6acc730f3 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/consensus_state.json @@ -0,0 +1,30 @@ +{ + "id": "11f67985-68c8-4c9c-a2d6-4c9b8167a792", + "jsonrpc": "2.0", + "result": { + "round_state": { + "height/round/step": "221/0/1", + "height_vote_set": [ + { + "precommits": [ + "nil-Vote" + ], + "precommits_bit_array": "BA{1:_} 0/10 = 0.00", + "prevotes": [ + "nil-Vote" + ], + "prevotes_bit_array": "BA{1:_} 0/10 = 0.00", + "round": 0 + } + ], + "locked_block_hash": "", + "proposal_block_hash": "", + "proposer": { + "address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "index": 0 + }, + "start_time": "2023-05-17T14:14:43.338360213Z", + "valid_block_hash": "" + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/genesis.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/genesis.json new file mode 100644 index 000000000..d511014a3 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/genesis.json @@ -0,0 +1,45 @@ +{ + "id": "30eff052-f14f-4d84-97c0-1d1e464cd55e", + "jsonrpc": "2.0", + "result": { + "genesis": { + "app_hash": "", + "chain_id": "dockerchain", + "consensus_params": { + "abci": { + "vote_extensions_enable_height": "0" + }, + "block": { + "max_bytes": "22020096", + "max_gas": "-1" + }, + "evidence": { + "max_age_duration": "172800000000000", + "max_age_num_blocks": "100000", + "max_bytes": "1048576" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": { + "app": "0" + } + }, + "genesis_time": "2023-05-17T14:12:48.347696215Z", + "initial_height": "1", + "validators": [ + { + "address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "name": "", + "power": "10", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "bNNlGls5R25wC3Sd8720F/3+7IZBhXcD22MNFtPk/v0=" + } + } + ] + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/net_info.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/net_info.json new file mode 100644 index 000000000..28e440e16 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/net_info.json @@ -0,0 +1,12 @@ +{ + "id": "ee138ef6-f083-4746-9ed7-e30d50753308", + "jsonrpc": "2.0", + "result": { + "listeners": [ + "Listener(@)" + ], + "listening": true, + "n_peers": "0", + "peers": [] + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/status.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/status.json new file mode 100644 index 000000000..49195b275 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/status.json @@ -0,0 +1,42 @@ +{ + "id": "eaef4f0c-184a-4d50-96fa-1268410ddb04", + "jsonrpc": "2.0", + "result": { + "node_info": { + "channels": "40202122233038606100", + "id": "cf4a66aa29e5123abfdfbdf485da6788bb8e46d1", + "listen_addr": "tcp://0.0.0.0:26656", + "moniker": "dockernode", + "network": "dockerchain", + "other": { + "rpc_address": "tcp://0.0.0.0:26657", + "tx_index": "on" + }, + "protocol_version": { + "app": "1", + "block": "11", + "p2p": "8" + }, + "version": "0.38.0-alpha.1" + }, + "sync_info": { + "catching_up": false, + "earliest_app_hash": "0000000000000000", + "earliest_block_hash": "6CD5CF4E23A49D9BC073D6F305D29D1B8B5193B534C237696D42FEA5AFBCD520", + "earliest_block_height": "1", + "earliest_block_time": "2023-05-17T14:12:48.347696215Z", + "latest_app_hash": "0600000000000000", + "latest_block_hash": "B647CF507155BADAC86FADD00E38B065C63A84953A847AA9FA99DB1CEE6C4DA9", + "latest_block_height": "232", + "latest_block_time": "2023-05-17T14:14:48.530153458Z" + }, + "validator_info": { + "address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "bNNlGls5R25wC3Sd8720F/3+7IZBhXcD22MNFtPk/v0=" + }, + "voting_power": "10" + } + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_malformed.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_malformed.json new file mode 100644 index 000000000..87573835f --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_malformed.json @@ -0,0 +1,9 @@ +{ + "error": { + "code": -32603, + "data": "failed to parse query: offset 10: got tag, wanted <= operator, >= operator, < operator, > operator, = operator, CONTAINS operator or EXISTS operator", + "message": "Internal error" + }, + "id": "d6bb6715-6d1c-4aae-9f4c-ec684d5f7ed0", + "jsonrpc": "2.0" +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_0.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_0.json new file mode 100644 index 000000000..dabde613e --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_0.json @@ -0,0 +1,80 @@ +{ + "id": "8e4bb2a3-1304-46c6-9647-4493ef0fa5f2", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/NewBlock", + "value": { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0600000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "235", + "last_block_id": { + "hash": "657D0859C6F0E0D556D150A14D9D76EF0ED0FBF83932980562B98B535916DF2C", + "parts": { + "hash": "458E660E1F2488E0C42FE4E0E21FDBDDE5369AA9391E3A19E3A769382F341396", + "total": 1 + } + }, + "last_commit_hash": "C15FEC631B67DD50F86782E57143E8B698DCCCC41D83844509A354EB17F49801", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:14:50.081741308Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "657D0859C6F0E0D556D150A14D9D76EF0ED0FBF83932980562B98B535916DF2C", + "parts": { + "hash": "458E660E1F2488E0C42FE4E0E21FDBDDE5369AA9391E3A19E3A769382F341396", + "total": 1 + } + }, + "height": "234", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "/sTY1fEFE0vpbjM9r+1E3Fo0vOdMh6HTBfCLK3UHR2jf4VGQxdebXzEnNShfQg+UQkvGp7Rqe4nhxmhbo/DmCQ==", + "timestamp": "2023-05-17T14:14:50.081741308Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "FA01C08688623731FA4250FB7873FE2049349DAE5352CB823E5BE0F472017C22", + "parts": { + "hash": "FA665C1C3E2348640E60153A50663E9C99323E096D15DC13AEB1C7B9F84DA8EB", + "total": 1 + } + }, + "result_finalize_block": { + "app_hash": "BgAAAAAAAAA=", + "validator_updates": [] + } + } + }, + "events": { + "tm.event": [ + "NewBlock" + ] + }, + "query": "tm.event = 'NewBlock'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_1.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_1.json new file mode 100644 index 000000000..c33d48fef --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_1.json @@ -0,0 +1,80 @@ +{ + "id": "8e4bb2a3-1304-46c6-9647-4493ef0fa5f2", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/NewBlock", + "value": { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0600000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "236", + "last_block_id": { + "hash": "FA01C08688623731FA4250FB7873FE2049349DAE5352CB823E5BE0F472017C22", + "parts": { + "hash": "FA665C1C3E2348640E60153A50663E9C99323E096D15DC13AEB1C7B9F84DA8EB", + "total": 1 + } + }, + "last_commit_hash": "682F05D93AC93E2853A6B0059E775F506E61AC04519A5FB3991975DE581EB72C", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:14:50.601315661Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "FA01C08688623731FA4250FB7873FE2049349DAE5352CB823E5BE0F472017C22", + "parts": { + "hash": "FA665C1C3E2348640E60153A50663E9C99323E096D15DC13AEB1C7B9F84DA8EB", + "total": 1 + } + }, + "height": "235", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "a2v8BAsI6vQc6UGTz5rdgp84GN0toN4qEoeMU4y7CaY4Kothcq5AmjNL4sR1qR58ZUIe9/YFZOcFZN5KuHcQBw==", + "timestamp": "2023-05-17T14:14:50.601315661Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "80A660B1AD0E3C8A6393239111174D2FDCE615612055FA7CD61793D9E8351D12", + "parts": { + "hash": "051A5E711FA370C706B917FBDC9891D7262F8DA0595A2F09BA5A598D79BCFF4A", + "total": 1 + } + }, + "result_finalize_block": { + "app_hash": "BgAAAAAAAAA=", + "validator_updates": [] + } + } + }, + "events": { + "tm.event": [ + "NewBlock" + ] + }, + "query": "tm.event = 'NewBlock'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_2.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_2.json new file mode 100644 index 000000000..ae0399c78 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_2.json @@ -0,0 +1,80 @@ +{ + "id": "8e4bb2a3-1304-46c6-9647-4493ef0fa5f2", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/NewBlock", + "value": { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0600000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "237", + "last_block_id": { + "hash": "80A660B1AD0E3C8A6393239111174D2FDCE615612055FA7CD61793D9E8351D12", + "parts": { + "hash": "051A5E711FA370C706B917FBDC9891D7262F8DA0595A2F09BA5A598D79BCFF4A", + "total": 1 + } + }, + "last_commit_hash": "B627A5006CADC6053C50B46F910862022344FB2E290DEBB9E33E2C6138BACD63", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:14:51.11962031Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "80A660B1AD0E3C8A6393239111174D2FDCE615612055FA7CD61793D9E8351D12", + "parts": { + "hash": "051A5E711FA370C706B917FBDC9891D7262F8DA0595A2F09BA5A598D79BCFF4A", + "total": 1 + } + }, + "height": "236", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "OdahnfzEryoPt7/mh3JpAGqh2Ug2Xm+bxM5WZuNFAiLL7gMEOVEbTpR2LKoFabUzXc6tLTfP24seNw59Pp8bAg==", + "timestamp": "2023-05-17T14:14:51.11962031Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "95590A6F18C7B1D43356D86992F5E3FDFD41508FF3A81918E38F274695E45447", + "parts": { + "hash": "147DF332018EB6AC5E853EA0126452E81391D0A836B3CE49431D0FEE6BC57A12", + "total": 1 + } + }, + "result_finalize_block": { + "app_hash": "BgAAAAAAAAA=", + "validator_updates": [] + } + } + }, + "events": { + "tm.event": [ + "NewBlock" + ] + }, + "query": "tm.event = 'NewBlock'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_3.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_3.json new file mode 100644 index 000000000..d9dbb39ee --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_3.json @@ -0,0 +1,80 @@ +{ + "id": "8e4bb2a3-1304-46c6-9647-4493ef0fa5f2", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/NewBlock", + "value": { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0600000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "238", + "last_block_id": { + "hash": "95590A6F18C7B1D43356D86992F5E3FDFD41508FF3A81918E38F274695E45447", + "parts": { + "hash": "147DF332018EB6AC5E853EA0126452E81391D0A836B3CE49431D0FEE6BC57A12", + "total": 1 + } + }, + "last_commit_hash": "E895F1B2FE0B47C732B5885173FB2C5A13637EDA3BF4FF368B088CD8AC9D6675", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:14:51.638580152Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "95590A6F18C7B1D43356D86992F5E3FDFD41508FF3A81918E38F274695E45447", + "parts": { + "hash": "147DF332018EB6AC5E853EA0126452E81391D0A836B3CE49431D0FEE6BC57A12", + "total": 1 + } + }, + "height": "237", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "Rz3ETtJgQy0A2ULecZB4AcNIfDNkGeNsF2IZ4wdMon8lmE/XnnBztzQ2lGkKF+/hQrjgyNqq51tUensmFsPzBQ==", + "timestamp": "2023-05-17T14:14:51.638580152Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "CA72F4B34DAE4A5367E140334E865162D6B259DD5F04B521524C36C6C0C5A27A", + "parts": { + "hash": "8386E1C2220C0F042561035FBE7B1CE8967279C1274A6EF18C24DFAA9993A7CC", + "total": 1 + } + }, + "result_finalize_block": { + "app_hash": "BgAAAAAAAAA=", + "validator_updates": [] + } + } + }, + "events": { + "tm.event": [ + "NewBlock" + ] + }, + "query": "tm.event = 'NewBlock'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_4.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_4.json new file mode 100644 index 000000000..dac5ef950 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_newblock_4.json @@ -0,0 +1,80 @@ +{ + "id": "8e4bb2a3-1304-46c6-9647-4493ef0fa5f2", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/NewBlock", + "value": { + "block": { + "data": { + "txs": [] + }, + "evidence": { + "evidence": [] + }, + "header": { + "app_hash": "0600000000000000", + "chain_id": "dockerchain", + "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", + "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "height": "239", + "last_block_id": { + "hash": "CA72F4B34DAE4A5367E140334E865162D6B259DD5F04B521524C36C6C0C5A27A", + "parts": { + "hash": "8386E1C2220C0F042561035FBE7B1CE8967279C1274A6EF18C24DFAA9993A7CC", + "total": 1 + } + }, + "last_commit_hash": "55A618BB7914C5F4D7BEFCAB3BE499D392EF0F4E997DCE2CC389C63783C5D53E", + "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "next_validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "proposer_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0", + "time": "2023-05-17T14:14:52.157708698Z", + "validators_hash": "33415EFFCEDA5BD0A3A443A727457D9F7B9E38389BF27A936FEDF749A7B7566E", + "version": { + "app": "1", + "block": "11" + } + }, + "last_commit": { + "block_id": { + "hash": "CA72F4B34DAE4A5367E140334E865162D6B259DD5F04B521524C36C6C0C5A27A", + "parts": { + "hash": "8386E1C2220C0F042561035FBE7B1CE8967279C1274A6EF18C24DFAA9993A7CC", + "total": 1 + } + }, + "height": "238", + "round": 0, + "signatures": [ + { + "block_id_flag": 2, + "signature": "Ys4wFfu9Wo5hOvUE4D/LCJ3Z5udo5v7Z8i76uted/1VhNWv2/znVdw/hz4OucJezuohjwu4C5ri50OdQ/XZOCw==", + "timestamp": "2023-05-17T14:14:52.157708698Z", + "validator_address": "2DD9F44FD9067555C322243C3C913BA7B51D2BE0" + } + ] + } + }, + "block_id": { + "hash": "71C6B19C7931F264766AE567D6D17609AD9D257E76EC0E1BA5E9AE9E33934EBD", + "parts": { + "hash": "CAE5DC225290AECB1C311BDD3E93B28B20D59C0B83669E76E68EDCB8EB383CA7", + "total": 1 + } + }, + "result_finalize_block": { + "app_hash": "BgAAAAAAAAA=", + "validator_updates": [] + } + } + }, + "events": { + "tm.event": [ + "NewBlock" + ] + }, + "query": "tm.event = 'NewBlock'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs.json new file mode 100644 index 000000000..bcddfa5e0 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs.json @@ -0,0 +1,5 @@ +{ + "id": "8d385392-918c-4f2e-b848-daa092a8d9b8", + "jsonrpc": "2.0", + "result": {} +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_0.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_0.json new file mode 100644 index 000000000..4982e604a --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_0.json @@ -0,0 +1,97 @@ +{ + "id": "8d385392-918c-4f2e-b848-daa092a8d9b8", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/Tx", + "value": { + "TxResult": { + "height": "243", + "result": { + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx0" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ] + }, + "tx": "dHgwPXZhbHVl" + } + } + }, + "events": { + "app.creator": [ + "Cosmoshi Netowoko", + "Cosmoshi" + ], + "app.index_key": [ + "index is working", + "index is working" + ], + "app.key": [ + "tx0", + "value" + ], + "app.noindex_key": [ + "index is working", + "index is working" + ], + "tm.event": [ + "Tx" + ], + "tx.hash": [ + "FCB86F71C4EFF43E13C51FA12791F6DD1DDB8600A51131BE2289614D6882F6BE" + ], + "tx.height": [ + "243" + ] + }, + "query": "tm.event = 'Tx'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_1.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_1.json new file mode 100644 index 000000000..f6e9f2ea6 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_1.json @@ -0,0 +1,97 @@ +{ + "id": "8d385392-918c-4f2e-b848-daa092a8d9b8", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/Tx", + "value": { + "TxResult": { + "height": "245", + "result": { + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx1" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ] + }, + "tx": "dHgxPXZhbHVl" + } + } + }, + "events": { + "app.creator": [ + "Cosmoshi Netowoko", + "Cosmoshi" + ], + "app.index_key": [ + "index is working", + "index is working" + ], + "app.key": [ + "tx1", + "value" + ], + "app.noindex_key": [ + "index is working", + "index is working" + ], + "tm.event": [ + "Tx" + ], + "tx.hash": [ + "9F424A8E634AAF63CFA61151A306AA788C9CC792F16B370F7867ED0BD972476C" + ], + "tx.height": [ + "245" + ] + }, + "query": "tm.event = 'Tx'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_2.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_2.json new file mode 100644 index 000000000..ea4dea4c5 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_2.json @@ -0,0 +1,97 @@ +{ + "id": "8d385392-918c-4f2e-b848-daa092a8d9b8", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/Tx", + "value": { + "TxResult": { + "height": "247", + "result": { + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx2" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ] + }, + "tx": "dHgyPXZhbHVl" + } + } + }, + "events": { + "app.creator": [ + "Cosmoshi Netowoko", + "Cosmoshi" + ], + "app.index_key": [ + "index is working", + "index is working" + ], + "app.key": [ + "tx2", + "value" + ], + "app.noindex_key": [ + "index is working", + "index is working" + ], + "tm.event": [ + "Tx" + ], + "tx.hash": [ + "C9D123E2CF19B9F0EC3CA1F64CD3BF0735397C84778B40B3EB5C49A752D53BF4" + ], + "tx.height": [ + "247" + ] + }, + "query": "tm.event = 'Tx'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_3.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_3.json new file mode 100644 index 000000000..bdd6ee186 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_3.json @@ -0,0 +1,97 @@ +{ + "id": "8d385392-918c-4f2e-b848-daa092a8d9b8", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/Tx", + "value": { + "TxResult": { + "height": "249", + "result": { + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx3" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ] + }, + "tx": "dHgzPXZhbHVl" + } + } + }, + "events": { + "app.creator": [ + "Cosmoshi Netowoko", + "Cosmoshi" + ], + "app.index_key": [ + "index is working", + "index is working" + ], + "app.key": [ + "tx3", + "value" + ], + "app.noindex_key": [ + "index is working", + "index is working" + ], + "tm.event": [ + "Tx" + ], + "tx.hash": [ + "73117D6A783E4A37C1D9AD48744AD9FCC0D094C48AB8322FA11CD901C5174CFD" + ], + "tx.height": [ + "249" + ] + }, + "query": "tm.event = 'Tx'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_4.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_4.json new file mode 100644 index 000000000..18576c8bd --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_4.json @@ -0,0 +1,97 @@ +{ + "id": "8d385392-918c-4f2e-b848-daa092a8d9b8", + "jsonrpc": "2.0", + "result": { + "data": { + "type": "tendermint/event/Tx", + "value": { + "TxResult": { + "height": "251", + "result": { + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx4" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ] + }, + "tx": "dHg0PXZhbHVl" + } + } + }, + "events": { + "app.creator": [ + "Cosmoshi Netowoko", + "Cosmoshi" + ], + "app.index_key": [ + "index is working", + "index is working" + ], + "app.key": [ + "tx4", + "value" + ], + "app.noindex_key": [ + "index is working", + "index is working" + ], + "tm.event": [ + "Tx" + ], + "tx.hash": [ + "C349F213F04B4E8E749C6656E4C299E3BF22F4FAF141291A5C083336AD1A413B" + ], + "tx.height": [ + "251" + ] + }, + "query": "tm.event = 'Tx'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_0.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_0.json new file mode 100644 index 000000000..86150073a --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_0.json @@ -0,0 +1,11 @@ +{ + "id": "93337e29-026d-48b9-8d0f-051283097d16", + "jsonrpc": "2.0", + "result": { + "code": 0, + "codespace": "", + "data": "", + "hash": "FCB86F71C4EFF43E13C51FA12791F6DD1DDB8600A51131BE2289614D6882F6BE", + "log": "" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_1.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_1.json new file mode 100644 index 000000000..8baffa57a --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_1.json @@ -0,0 +1,11 @@ +{ + "id": "15fb30e6-e2c3-4fe3-8de1-332a8082887d", + "jsonrpc": "2.0", + "result": { + "code": 0, + "codespace": "", + "data": "", + "hash": "9F424A8E634AAF63CFA61151A306AA788C9CC792F16B370F7867ED0BD972476C", + "log": "" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_2.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_2.json new file mode 100644 index 000000000..198b2ddbd --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_2.json @@ -0,0 +1,11 @@ +{ + "id": "f55b7856-6ad1-4553-ba93-ff8acc7eeed5", + "jsonrpc": "2.0", + "result": { + "code": 0, + "codespace": "", + "data": "", + "hash": "C9D123E2CF19B9F0EC3CA1F64CD3BF0735397C84778B40B3EB5C49A752D53BF4", + "log": "" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_3.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_3.json new file mode 100644 index 000000000..5cc6f687c --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_3.json @@ -0,0 +1,11 @@ +{ + "id": "86f86de0-854a-49dc-8b99-d3a0758b081b", + "jsonrpc": "2.0", + "result": { + "code": 0, + "codespace": "", + "data": "", + "hash": "73117D6A783E4A37C1D9AD48744AD9FCC0D094C48AB8322FA11CD901C5174CFD", + "log": "" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_4.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_4.json new file mode 100644 index 000000000..1a94c8c0b --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_4.json @@ -0,0 +1,11 @@ +{ + "id": "2e6b00f6-2eaa-4de2-b5d2-90b44b62d234", + "jsonrpc": "2.0", + "result": { + "code": 0, + "codespace": "", + "data": "", + "hash": "C349F213F04B4E8E749C6656E4C299E3BF22F4FAF141291A5C083336AD1A413B", + "log": "" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_5.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_5.json new file mode 100644 index 000000000..c6bc06930 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/subscribe_txs_broadcast_tx_5.json @@ -0,0 +1,11 @@ +{ + "id": "a2cebdc1-8840-445b-8877-f61e11263eb0", + "jsonrpc": "2.0", + "result": { + "code": 0, + "codespace": "", + "data": "", + "hash": "CC4AC5C231481DD2ED2EA15789483B94565BF41612B6FEDE5BE7694F882CC202", + "log": "" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/tx_search_no_prove.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/tx_search_no_prove.json new file mode 100644 index 000000000..3838148ca --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/tx_search_no_prove.json @@ -0,0 +1,612 @@ +{ + "id": "9bfc78d9-d378-44f4-8e81-5d0cc7933bae", + "jsonrpc": "2.0", + "result": { + "total_count": "9", + "txs": [ + { + "hash": "9F28904F9C0F3AB74A81CBA48E39124DA1C680B47FBFCBA0126870DB722BCC30", + "height": "223", + "index": 0, + "tx": "YXN5bmMta2V5PXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "async-key" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "57018296EE0919C9D351F2FFEA82A8D28DE223724D79965FC8D00A7477ED48BC", + "height": "225", + "index": 0, + "tx": "c3luYy1rZXk9dmFsdWU=", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "sync-key" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "D63F9C23791E610410B576D8C27BB5AEAC93CC1A58522428A7B32A1276085860", + "height": "227", + "index": 0, + "tx": "Y29tbWl0LWtleT12YWx1ZQ==", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "commit-key" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "FCB86F71C4EFF43E13C51FA12791F6DD1DDB8600A51131BE2289614D6882F6BE", + "height": "243", + "index": 0, + "tx": "dHgwPXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx0" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "9F424A8E634AAF63CFA61151A306AA788C9CC792F16B370F7867ED0BD972476C", + "height": "245", + "index": 0, + "tx": "dHgxPXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx1" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "C9D123E2CF19B9F0EC3CA1F64CD3BF0735397C84778B40B3EB5C49A752D53BF4", + "height": "247", + "index": 0, + "tx": "dHgyPXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx2" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "73117D6A783E4A37C1D9AD48744AD9FCC0D094C48AB8322FA11CD901C5174CFD", + "height": "249", + "index": 0, + "tx": "dHgzPXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx3" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "C349F213F04B4E8E749C6656E4C299E3BF22F4FAF141291A5C083336AD1A413B", + "height": "251", + "index": 0, + "tx": "dHg0PXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx4" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "CC4AC5C231481DD2ED2EA15789483B94565BF41612B6FEDE5BE7694F882CC202", + "height": "253", + "index": 0, + "tx": "dHg1PXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx5" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + } + ] + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/incoming/tx_search_with_prove.json b/rpc/tests/kvstore_fixtures/v0_38/incoming/tx_search_with_prove.json new file mode 100644 index 000000000..36ca834cb --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/incoming/tx_search_with_prove.json @@ -0,0 +1,702 @@ +{ + "id": "07480b60-4df3-4a4c-b26c-afb5feb1483b", + "jsonrpc": "2.0", + "result": { + "total_count": "9", + "txs": [ + { + "hash": "9F28904F9C0F3AB74A81CBA48E39124DA1C680B47FBFCBA0126870DB722BCC30", + "height": "223", + "index": 0, + "proof": { + "data": "YXN5bmMta2V5PXZhbHVl", + "proof": { + "aunts": [], + "index": "0", + "leaf_hash": "MIH5kVBA0TizrX+JVzLSdnwp6Ful2EOI0E4XpdgmK3o=", + "total": "1" + }, + "root_hash": "3081F9915040D138B3AD7F895732D2767C29E85BA5D84388D04E17A5D8262B7A" + }, + "tx": "YXN5bmMta2V5PXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "async-key" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "57018296EE0919C9D351F2FFEA82A8D28DE223724D79965FC8D00A7477ED48BC", + "height": "225", + "index": 0, + "proof": { + "data": "c3luYy1rZXk9dmFsdWU=", + "proof": { + "aunts": [], + "index": "0", + "leaf_hash": "oL+OYRo6LtD+lKo0W5A2kcPlbt4Of3c/VN57Ag54iEk=", + "total": "1" + }, + "root_hash": "A0BF8E611A3A2ED0FE94AA345B903691C3E56EDE0E7F773F54DE7B020E788849" + }, + "tx": "c3luYy1rZXk9dmFsdWU=", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "sync-key" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "D63F9C23791E610410B576D8C27BB5AEAC93CC1A58522428A7B32A1276085860", + "height": "227", + "index": 0, + "proof": { + "data": "Y29tbWl0LWtleT12YWx1ZQ==", + "proof": { + "aunts": [], + "index": "0", + "leaf_hash": "wq4Wy/oF+/0xsH+eJq1SqY2BgYS2FVXbLAXNcCLkB74=", + "total": "1" + }, + "root_hash": "C2AE16CBFA05FBFD31B07F9E26AD52A98D818184B61555DB2C05CD7022E407BE" + }, + "tx": "Y29tbWl0LWtleT12YWx1ZQ==", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "commit-key" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "FCB86F71C4EFF43E13C51FA12791F6DD1DDB8600A51131BE2289614D6882F6BE", + "height": "243", + "index": 0, + "proof": { + "data": "dHgwPXZhbHVl", + "proof": { + "aunts": [], + "index": "0", + "leaf_hash": "3UnhxGnCw+sKtov5uD2YZbCP79vHFwLMc1ZPTaVocKQ=", + "total": "1" + }, + "root_hash": "DD49E1C469C2C3EB0AB68BF9B83D9865B08FEFDBC71702CC73564F4DA56870A4" + }, + "tx": "dHgwPXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx0" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "9F424A8E634AAF63CFA61151A306AA788C9CC792F16B370F7867ED0BD972476C", + "height": "245", + "index": 0, + "proof": { + "data": "dHgxPXZhbHVl", + "proof": { + "aunts": [], + "index": "0", + "leaf_hash": "QnwQk7ERU9NjeD1GlLa4H8lscIRFD3evj6SZulKp3T8=", + "total": "1" + }, + "root_hash": "427C1093B11153D363783D4694B6B81FC96C7084450F77AF8FA499BA52A9DD3F" + }, + "tx": "dHgxPXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx1" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "C9D123E2CF19B9F0EC3CA1F64CD3BF0735397C84778B40B3EB5C49A752D53BF4", + "height": "247", + "index": 0, + "proof": { + "data": "dHgyPXZhbHVl", + "proof": { + "aunts": [], + "index": "0", + "leaf_hash": "0eF/BEMF82Y/mIMIM0HX/isU2jI44Z2rAor5MA0PrKM=", + "total": "1" + }, + "root_hash": "D1E17F044305F3663F9883083341D7FE2B14DA3238E19DAB028AF9300D0FACA3" + }, + "tx": "dHgyPXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx2" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "73117D6A783E4A37C1D9AD48744AD9FCC0D094C48AB8322FA11CD901C5174CFD", + "height": "249", + "index": 0, + "proof": { + "data": "dHgzPXZhbHVl", + "proof": { + "aunts": [], + "index": "0", + "leaf_hash": "jt+3kmBnxAUZK7c0gytFbKegUaR38TB3aAlKsIZ0RNU=", + "total": "1" + }, + "root_hash": "8EDFB7926067C405192BB734832B456CA7A051A477F1307768094AB0867444D5" + }, + "tx": "dHgzPXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx3" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "C349F213F04B4E8E749C6656E4C299E3BF22F4FAF141291A5C083336AD1A413B", + "height": "251", + "index": 0, + "proof": { + "data": "dHg0PXZhbHVl", + "proof": { + "aunts": [], + "index": "0", + "leaf_hash": "oZPOdbpVGhDcNY2OaPjybbnfL2SMaDmXm9ufOgruPCA=", + "total": "1" + }, + "root_hash": "A193CE75BA551A10DC358D8E68F8F26DB9DF2F648C6839979BDB9F3A0AEE3C20" + }, + "tx": "dHg0PXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx4" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + }, + { + "hash": "CC4AC5C231481DD2ED2EA15789483B94565BF41612B6FEDE5BE7694F882CC202", + "height": "253", + "index": 0, + "proof": { + "data": "dHg1PXZhbHVl", + "proof": { + "aunts": [], + "index": "0", + "leaf_hash": "53wfU57GnWQ6Q46hc19t7bxY7SaY7WD4T6fy+TOPizM=", + "total": "1" + }, + "root_hash": "E77C1F539EC69D643A438EA1735F6DEDBC58ED2698ED60F84FA7F2F9338F8B33" + }, + "tx": "dHg1PXZhbHVl", + "tx_result": { + "code": 0, + "codespace": "", + "data": null, + "events": [ + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi Netowoko" + }, + { + "index": true, + "key": "key", + "value": "tx5" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + }, + { + "attributes": [ + { + "index": true, + "key": "creator", + "value": "Cosmoshi" + }, + { + "index": true, + "key": "key", + "value": "value" + }, + { + "index": true, + "key": "index_key", + "value": "index is working" + }, + { + "index": false, + "key": "noindex_key", + "value": "index is working" + } + ], + "type": "app" + } + ], + "gas_used": "0", + "gas_wanted": "0", + "info": "", + "log": "" + } + } + ] + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_info.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_info.json new file mode 100644 index 000000000..dd83a40f8 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_info.json @@ -0,0 +1,6 @@ +{ + "id": "3034a148-da51-4039-b8e8-3dc12990b639", + "jsonrpc": "2.0", + "method": "abci_info", + "params": null +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_query_with_existing_key.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_query_with_existing_key.json new file mode 100644 index 000000000..1b54a47fd --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_query_with_existing_key.json @@ -0,0 +1,8 @@ +{ + "id": "e1871729-f0c5-476d-8a66-731c058c8766", + "jsonrpc": "2.0", + "method": "abci_query", + "params": { + "data": "747830" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_query_with_non_existent_key.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_query_with_non_existent_key.json new file mode 100644 index 000000000..c87fec542 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/abci_query_with_non_existent_key.json @@ -0,0 +1,8 @@ +{ + "id": "2e5aec1f-7e0d-4f17-bec5-8c1148fd8253", + "jsonrpc": "2.0", + "method": "abci_query", + "params": { + "data": "6e6f6e5f6578697374656e745f6b6579" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_0.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_0.json new file mode 100644 index 000000000..bbe1698c7 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_0.json @@ -0,0 +1,8 @@ +{ + "id": "0634391f-a6b0-445c-b568-e41a2446849e", + "jsonrpc": "2.0", + "method": "block", + "params": { + "height": "0" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_1.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_1.json new file mode 100644 index 000000000..0fb771c30 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_1.json @@ -0,0 +1,8 @@ +{ + "id": "ac0d2aa0-e54f-415e-9144-79b965b43d18", + "jsonrpc": "2.0", + "method": "block", + "params": { + "height": "1" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_10.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_10.json new file mode 100644 index 000000000..217348d2f --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_at_height_10.json @@ -0,0 +1,8 @@ +{ + "id": "dd6680c9-3da4-4af8-b98b-ba7a540f7274", + "jsonrpc": "2.0", + "method": "block", + "params": { + "height": "10" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_by_hash.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_by_hash.json new file mode 100644 index 000000000..2f807b64c --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_by_hash.json @@ -0,0 +1,8 @@ +{ + "id": "2eb70c44-72a5-49ec-b40a-dcc42c2d9f9c", + "jsonrpc": "2.0", + "method": "block_by_hash", + "params": { + "hash": "R0k7UeECcF9tzOWYHgW3wCW7W/Gc9eS1T+KMr+nSDIo=" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_results_at_height_10.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_results_at_height_10.json new file mode 100644 index 000000000..3c883ec71 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_results_at_height_10.json @@ -0,0 +1,8 @@ +{ + "id": "f9f35bd2-8a8b-48c2-b04c-5c1e1b673ce1", + "jsonrpc": "2.0", + "method": "block_results", + "params": { + "height": "10" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_search.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_search.json new file mode 100644 index 000000000..744c5ea7a --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/block_search.json @@ -0,0 +1,11 @@ +{ + "id": "eb430b0c-df54-4434-817b-9b53000522b1", + "jsonrpc": "2.0", + "method": "block_search", + "params": { + "order_by": "asc", + "page": "1", + "per_page": "100", + "query": "block.height > 1" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/blockchain_from_1_to_10.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/blockchain_from_1_to_10.json new file mode 100644 index 000000000..89aa45250 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/blockchain_from_1_to_10.json @@ -0,0 +1,9 @@ +{ + "id": "6865d6c8-c17f-4149-8d9b-1bfabbe3a97c", + "jsonrpc": "2.0", + "method": "blockchain", + "params": { + "maxHeight": "10", + "minHeight": "1" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_async.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_async.json new file mode 100644 index 000000000..ef939006f --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_async.json @@ -0,0 +1,8 @@ +{ + "id": "619d31c4-5735-45c4-95ca-7dfd8d5af651", + "jsonrpc": "2.0", + "method": "broadcast_tx_async", + "params": { + "tx": "YXN5bmMta2V5PXZhbHVl" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_commit.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_commit.json new file mode 100644 index 000000000..65cb47864 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_commit.json @@ -0,0 +1,8 @@ +{ + "id": "f356464f-dd5c-4b81-a88d-73d5aef4db8d", + "jsonrpc": "2.0", + "method": "broadcast_tx_commit", + "params": { + "tx": "Y29tbWl0LWtleT12YWx1ZQ==" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_sync.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_sync.json new file mode 100644 index 000000000..e3780685e --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/broadcast_tx_sync.json @@ -0,0 +1,8 @@ +{ + "id": "52e1c399-68e0-4fc3-ac35-68cacdb66d49", + "jsonrpc": "2.0", + "method": "broadcast_tx_sync", + "params": { + "tx": "c3luYy1rZXk9dmFsdWU=" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/commit_at_height_10.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/commit_at_height_10.json new file mode 100644 index 000000000..2177ae3f3 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/commit_at_height_10.json @@ -0,0 +1,8 @@ +{ + "id": "ee769e8a-4fa9-4e9a-9019-fc72ef5c3f02", + "jsonrpc": "2.0", + "method": "commit", + "params": { + "height": "10" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/consensus_params.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/consensus_params.json new file mode 100644 index 000000000..f5c89feb1 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/consensus_params.json @@ -0,0 +1,8 @@ +{ + "id": "56d91e8f-1d2e-46b3-8d4d-686860344721", + "jsonrpc": "2.0", + "method": "consensus_params", + "params": { + "height": "10" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/consensus_state.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/consensus_state.json new file mode 100644 index 000000000..c54610d55 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/consensus_state.json @@ -0,0 +1,6 @@ +{ + "id": "11f67985-68c8-4c9c-a2d6-4c9b8167a792", + "jsonrpc": "2.0", + "method": "consensus_state", + "params": null +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/genesis.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/genesis.json new file mode 100644 index 000000000..3c64e9bc1 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/genesis.json @@ -0,0 +1,6 @@ +{ + "id": "30eff052-f14f-4d84-97c0-1d1e464cd55e", + "jsonrpc": "2.0", + "method": "genesis", + "params": null +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/net_info.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/net_info.json new file mode 100644 index 000000000..594396769 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/net_info.json @@ -0,0 +1,6 @@ +{ + "id": "ee138ef6-f083-4746-9ed7-e30d50753308", + "jsonrpc": "2.0", + "method": "net_info", + "params": null +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/status.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/status.json new file mode 100644 index 000000000..dd2f105f7 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/status.json @@ -0,0 +1,6 @@ +{ + "id": "eaef4f0c-184a-4d50-96fa-1268410ddb04", + "jsonrpc": "2.0", + "method": "status", + "params": null +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_malformed.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_malformed.json new file mode 100644 index 000000000..8708420b6 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_malformed.json @@ -0,0 +1,8 @@ +{ + "id": "2cb748a9-0752-4c68-ab5a-2c5099f7e395", + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "query": "malformed query" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_newblock.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_newblock.json new file mode 100644 index 000000000..5a16b533b --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_newblock.json @@ -0,0 +1,8 @@ +{ + "id": "70c4d42d-1ea5-40c4-ae3b-81d1613cec86", + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "query": "tm.event = 'NewBlock'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs.json new file mode 100644 index 000000000..fcbb84dd0 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs.json @@ -0,0 +1,8 @@ +{ + "id": "e936aae3-0706-4f18-952c-a18ec1f4ff87", + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "query": "tm.event = 'Tx'" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_0.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_0.json new file mode 100644 index 000000000..df403cf10 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_0.json @@ -0,0 +1,8 @@ +{ + "id": "93337e29-026d-48b9-8d0f-051283097d16", + "jsonrpc": "2.0", + "method": "broadcast_tx_async", + "params": { + "tx": "dHgwPXZhbHVl" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_1.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_1.json new file mode 100644 index 000000000..4b4bf5bb4 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_1.json @@ -0,0 +1,8 @@ +{ + "id": "15fb30e6-e2c3-4fe3-8de1-332a8082887d", + "jsonrpc": "2.0", + "method": "broadcast_tx_async", + "params": { + "tx": "dHgxPXZhbHVl" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_2.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_2.json new file mode 100644 index 000000000..348bf866f --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_2.json @@ -0,0 +1,8 @@ +{ + "id": "f55b7856-6ad1-4553-ba93-ff8acc7eeed5", + "jsonrpc": "2.0", + "method": "broadcast_tx_async", + "params": { + "tx": "dHgyPXZhbHVl" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_3.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_3.json new file mode 100644 index 000000000..bfe32f212 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_3.json @@ -0,0 +1,8 @@ +{ + "id": "86f86de0-854a-49dc-8b99-d3a0758b081b", + "jsonrpc": "2.0", + "method": "broadcast_tx_async", + "params": { + "tx": "dHgzPXZhbHVl" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_4.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_4.json new file mode 100644 index 000000000..d72a6fa05 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_4.json @@ -0,0 +1,8 @@ +{ + "id": "2e6b00f6-2eaa-4de2-b5d2-90b44b62d234", + "jsonrpc": "2.0", + "method": "broadcast_tx_async", + "params": { + "tx": "dHg0PXZhbHVl" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_5.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_5.json new file mode 100644 index 000000000..043ddd232 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/subscribe_txs_broadcast_tx_5.json @@ -0,0 +1,8 @@ +{ + "id": "a2cebdc1-8840-445b-8877-f61e11263eb0", + "jsonrpc": "2.0", + "method": "broadcast_tx_async", + "params": { + "tx": "dHg1PXZhbHVl" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/tx_search_no_prove.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/tx_search_no_prove.json new file mode 100644 index 000000000..e1de9bc5f --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/tx_search_no_prove.json @@ -0,0 +1,12 @@ +{ + "id": "9bfc78d9-d378-44f4-8e81-5d0cc7933bae", + "jsonrpc": "2.0", + "method": "tx_search", + "params": { + "order_by": "asc", + "page": "1", + "per_page": "10", + "prove": false, + "query": "tx.height > 1" + } +} \ No newline at end of file diff --git a/rpc/tests/kvstore_fixtures/v0_38/outgoing/tx_search_with_prove.json b/rpc/tests/kvstore_fixtures/v0_38/outgoing/tx_search_with_prove.json new file mode 100644 index 000000000..78710f866 --- /dev/null +++ b/rpc/tests/kvstore_fixtures/v0_38/outgoing/tx_search_with_prove.json @@ -0,0 +1,12 @@ +{ + "id": "07480b60-4df3-4a4c-b26c-afb5feb1483b", + "jsonrpc": "2.0", + "method": "tx_search", + "params": { + "order_by": "asc", + "page": "1", + "per_page": "10", + "prove": true, + "query": "tx.height > 1" + } +} \ No newline at end of file From 057f16974ba3259790b72a31978595fb2b1808a9 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 24 May 2023 12:52:44 +0300 Subject: [PATCH 11/27] Derive serde impls for abci responses BeginBlock, EndBlock, FinalizeBlock are used to deserialize RPC responses. --- tendermint/src/abci/response/begin_block.rs | 8 +++++--- tendermint/src/abci/response/end_block.rs | 9 ++++++--- tendermint/src/abci/response/finalize_block.rs | 10 ++++++++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/tendermint/src/abci/response/begin_block.rs b/tendermint/src/abci/response/begin_block.rs index bd35e98cb..71779d715 100644 --- a/tendermint/src/abci/response/begin_block.rs +++ b/tendermint/src/abci/response/begin_block.rs @@ -1,10 +1,12 @@ -use super::super::Event; -use crate::prelude::*; +use serde::{Deserialize, Serialize}; + +use crate::{abci::Event, prelude::*}; #[doc = include_str!("../doc/response-beginblock.md")] -#[derive(Clone, PartialEq, Eq, Debug, Default)] +#[derive(Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize)] pub struct BeginBlock { /// Events that occurred while beginning the block. + #[serde(default)] pub events: Vec, } diff --git a/tendermint/src/abci/response/end_block.rs b/tendermint/src/abci/response/end_block.rs index 044242df1..9e5b4a46b 100644 --- a/tendermint/src/abci/response/end_block.rs +++ b/tendermint/src/abci/response/end_block.rs @@ -1,16 +1,19 @@ -use super::super::Event; -use crate::{consensus, prelude::*, validator}; +use serde::{Deserialize, Serialize}; + +use crate::{abci::Event, consensus, prelude::*, serializers, validator}; #[doc = include_str!("../doc/response-endblock.md")] -#[derive(Clone, PartialEq, Eq, Debug, Default)] +#[derive(Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize)] pub struct EndBlock { /// Changes to the validator set, if any. /// /// Setting the voting power to 0 removes a validator. + #[serde(with = "serializers::nullable")] pub validator_updates: Vec, /// Changes to consensus parameters (optional). pub consensus_param_updates: Option, /// Events that occurred while ending the block. + #[serde(default)] pub events: Vec, } diff --git a/tendermint/src/abci/response/finalize_block.rs b/tendermint/src/abci/response/finalize_block.rs index 5984a8705..48d747139 100644 --- a/tendermint/src/abci/response/finalize_block.rs +++ b/tendermint/src/abci/response/finalize_block.rs @@ -1,20 +1,26 @@ +use serde::{Deserialize, Serialize}; + use crate::abci::{types::ExecTxResult, Event}; use crate::prelude::*; -use crate::{consensus, validator, AppHash}; +use crate::{consensus, serializers, validator, AppHash}; -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct FinalizeBlock { /// Set of block events emitted as part of executing the block + #[serde(default)] pub events: Vec, /// The result of executing each transaction including the events /// the particular transction emitted. This should match the order /// of the transactions delivered in the block itself + #[serde(default)] pub tx_results: Vec, /// A list of updates to the validator set. /// These will reflect the validator set at current height + 2. pub validator_updates: Vec, /// Updates to the consensus params, if any. + #[serde(default)] pub consensus_param_updates: Option, + #[serde(default, with = "serializers::apphash")] pub app_hash: AppHash, } From ce199fa54ef59132e2e8bae0596447a355b93205 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 25 May 2023 17:13:48 +0300 Subject: [PATCH 12/27] rpc: adapt serialization of Event for 0.38 Now that event data can have new fields, distinguish this with a new NewBlock enum variant, renaming the old one to LegacyNewBlock. The dialect serialization helpers for subscription events are separated to v0_34::DialectEvent, that does not recognize the 0.38 fields at all and parses the event attributes as base64-encoded, and latest::DialectEvent, which has provisions for 0.38 fields if they are present, and in this case converts to the NewBlock variant. --- rpc/src/client/bin/main.rs | 12 +- rpc/src/client/transport/mock.rs | 12 +- rpc/src/client/transport/router.rs | 32 +- rpc/src/client/transport/websocket.rs | 22 +- rpc/src/event.rs | 554 +++++++++++++++++--------- rpc/tests/gaia_fixtures.rs | 5 +- rpc/tests/kvstore_fixtures/v0_34.rs | 52 +-- rpc/tests/kvstore_fixtures/v0_37.rs | 52 +-- rpc/tests/kvstore_fixtures/v0_38.rs | 191 ++++----- 9 files changed, 556 insertions(+), 376 deletions(-) diff --git a/rpc/src/client/bin/main.rs b/rpc/src/client/bin/main.rs index 7e2bb578e..3a2e52f4e 100644 --- a/rpc/src/client/bin/main.rs +++ b/rpc/src/client/bin/main.rs @@ -6,12 +6,8 @@ use futures::StreamExt; use structopt::StructOpt; use tendermint::Hash; use tendermint_rpc::{ - client::CompatMode, - dialect::{Dialect, LatestDialect}, - event::DialectEvent, - query::Query, - Client, Error, HttpClient, Order, Paging, Scheme, Subscription, SubscriptionClient, Url, - WebSocketClient, + client::CompatMode, event::latest::DialectEvent, query::Query, Client, Error, HttpClient, + Order, Paging, Scheme, Subscription, SubscriptionClient, Url, WebSocketClient, }; use tokio::{task::JoinHandle, time::Duration}; use tracing::{debug, error, info, level_filters::LevelFilter, warn}; @@ -504,7 +500,7 @@ async fn recv_events_with_timeout( } }; let event = result?; - let event: DialectEvent<::Event> = event.into(); + let event: DialectEvent = event.into(); println!("{}", serde_json::to_string_pretty(&event).map_err(Error::serde)?); event_count += 1; if let Some(me) = max_events { @@ -526,7 +522,7 @@ async fn recv_events(mut subs: Subscription, max_events: Option) -> Result< let mut event_count = 0u64; while let Some(result) = subs.next().await { let event = result?; - let event: DialectEvent<::Event> = event.into(); + let event: DialectEvent = event.into(); println!( "{}", serde_json::to_string_pretty(&event).map_err(Error::serde)? diff --git a/rpc/src/client/transport/mock.rs b/rpc/src/client/transport/mock.rs index 4500baf74..99d6e68a0 100644 --- a/rpc/src/client/transport/mock.rs +++ b/rpc/src/client/transport/mock.rs @@ -264,12 +264,10 @@ mod test { mod v0_34 { use super::*; - use crate::dialect::v0_34::Event as RpcEvent; - use crate::event::DialectEvent; + use crate::event::v0_34::DialectEvent; async fn read_event(name: &str) -> Event { - let msg = DialectEvent::::from_string(read_json_fixture("v0_34", name).await) - .unwrap(); + let msg = DialectEvent::from_string(read_json_fixture("v0_34", name).await).unwrap(); msg.into() } @@ -334,12 +332,10 @@ mod test { mod v0_37 { use super::*; - use crate::event::DialectEvent; - use tendermint::abci::Event as RpcEvent; + use crate::event::latest::DialectEvent; async fn read_event(name: &str) -> Event { - let msg = DialectEvent::::from_string(read_json_fixture("v0_37", name).await) - .unwrap(); + let msg = DialectEvent::from_string(read_json_fixture("v0_37", name).await).unwrap(); msg.into() } diff --git a/rpc/src/client/transport/router.rs b/rpc/src/client/transport/router.rs index 985492069..b5fe98ed2 100644 --- a/rpc/src/client/transport/router.rs +++ b/rpc/src/client/transport/router.rs @@ -144,7 +144,7 @@ mod test { use super::*; use crate::{ client::sync::{unbounded, ChannelRx}, - event::{Event, WrappedEvent}, + event::Event, utils::uuid_str, }; @@ -180,16 +180,15 @@ mod test { mod v0_34 { use super::*; - use crate::dialect::v0_34::Event as RpcEvent; + + type WrappedEvent = crate::response::Wrapper; async fn read_event(name: &str) -> Event { - serde_json::from_str::>( - read_json_fixture("v0_34", name).await.as_str(), - ) - .unwrap() - .into_result() - .unwrap() - .into() + serde_json::from_str::(read_json_fixture("v0_34", name).await.as_str()) + .unwrap() + .into_result() + .unwrap() + .into() } #[tokio::test] @@ -229,16 +228,15 @@ mod test { mod v0_37 { use super::*; - use crate::dialect::v0_37::Event as RpcEvent; + + type WrappedEvent = crate::response::Wrapper; async fn read_event(name: &str) -> Event { - serde_json::from_str::>( - read_json_fixture("v0_37", name).await.as_str(), - ) - .unwrap() - .into_result() - .unwrap() - .into() + serde_json::from_str::(read_json_fixture("v0_37", name).await.as_str()) + .unwrap() + .into_result() + .unwrap() + .into() } #[tokio::test] diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index 0c1a710e6..e7a03c697 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -25,7 +25,7 @@ use tendermint::{block::Height, Hash}; use tendermint_config::net; use super::router::{SubscriptionId, SubscriptionIdRef}; -use crate::dialect::{v0_34, v0_37}; +use crate::dialect::v0_34; use crate::{ client::{ subscription::SubscriptionTx, @@ -35,7 +35,7 @@ use crate::{ }, endpoint::{self, subscribe, unsubscribe}, error::Error, - event::{DialectEvent, Event}, + event::{self, Event}, prelude::*, query::Query, request::Wrapper, @@ -883,8 +883,8 @@ impl WebSocketClientDriver { async fn handle_text_msg(&mut self, msg: String) -> Result<(), Error> { let parse_res = match self.compat { - CompatMode::V0_37 => DialectEvent::::from_string(&msg).map(Into::into), - CompatMode::V0_34 => DialectEvent::::from_string(&msg).map(Into::into), + CompatMode::V0_37 => event::v0_34::DialectEvent::from_string(&msg).map(Into::into), + CompatMode::V0_34 => event::latest::DialectEvent::from_string(&msg).map(Into::into), }; if let Ok(ev) = parse_res { debug!("JSON-RPC event: {}", msg); @@ -1024,7 +1024,7 @@ mod test { }; use super::*; - use crate::{client::sync::unbounded, dialect, query::EventType, request, Id, Method}; + use crate::{client::sync::unbounded, event, query::EventType, request, Id, Method}; // Interface to a driver that manages all incoming WebSocket connections. struct TestServer { @@ -1214,11 +1214,11 @@ mod test { }; match self.compat { CompatMode::V0_37 => { - let ev: DialectEvent = ev.into(); + let ev: event::v0_34::DialectEvent = ev.into(); self.send(subs_id, ev).await; }, CompatMode::V0_34 => { - let ev: DialectEvent = ev.into(); + let ev: event::latest::DialectEvent = ev.into(); self.send(subs_id, ev).await; }, } @@ -1333,10 +1333,10 @@ mod test { mod v0_34 { use super::*; - use crate::dialect::v0_34::Event as RpcEvent; + use crate::event::v0_34::DialectEvent; async fn read_event(name: &str) -> Event { - DialectEvent::::from_string(read_json_fixture("v0_34", name).await) + DialectEvent::from_string(read_json_fixture("v0_34", name).await) .unwrap() .into() } @@ -1400,10 +1400,10 @@ mod test { mod v0_37 { use super::*; - use crate::dialect::v0_37::Event as RpcEvent; + use crate::event::latest::DialectEvent; async fn read_event(name: &str) -> Event { - DialectEvent::::from_string(read_json_fixture("v0_37", name).await) + DialectEvent::from_string(read_json_fixture("v0_37", name).await) .unwrap() .into() } diff --git a/rpc/src/event.rs b/rpc/src/event.rs index 6133c8845..5664f8e80 100644 --- a/rpc/src/event.rs +++ b/rpc/src/event.rs @@ -2,10 +2,9 @@ use alloc::collections::BTreeMap as HashMap; -use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use tendermint::{abci, Block}; +use tendermint::{abci, block, Block}; -use crate::{dialect, prelude::*, query::EventType, response::Wrapper, serializers, Response}; +use crate::{prelude::*, query::EventType}; /// An incoming event produced by a [`Subscription`]. /// @@ -20,23 +19,6 @@ pub struct Event { pub events: Option>>, } -// Serialization helper supporting differences in RPC versions. -#[derive(Serialize, Deserialize, Debug)] -pub struct DialectEvent { - /// The query that produced the event. - pub query: String, - /// The data associated with the event. - pub data: DialectEventData, - /// Event type and attributes map. - pub events: Option>>, -} - -impl Response for DialectEvent where Ev: Serialize + DeserializeOwned {} - -/// A JSON-RPC-wrapped event. -#[allow(dead_code)] -pub(crate) type WrappedEvent = Wrapper>; - impl Event { /// Returns the type associated with this event, if we recognize it. /// @@ -50,38 +32,21 @@ impl Event { } } -impl From> for Event -where - Ev: Into, -{ - fn from(msg: DialectEvent) -> Self { - Event { - query: msg.query, - data: msg.data.into(), - events: msg.events, - } - } -} - -impl From for DialectEvent -where - abci::Event: Into, -{ - fn from(msg: Event) -> Self { - DialectEvent { - query: msg.query, - data: msg.data.into(), - events: msg.events, - } - } -} - #[derive(Debug, Clone, PartialEq, Eq)] -// To be fixed in 0.24 -#[allow(clippy::large_enum_variant)] pub enum EventData { + /// Data of the newly committed block. + /// + /// Used since CometBFT 0.38. NewBlock { - block: Option, + block: Option>, + block_id: block::Id, + result_finalize_block: Option, + }, + /// Data of the newly committed block. + /// + /// Used in CometBFT versions before 0.38. + LegacyNewBlock { + block: Option>, result_begin_block: Option, result_end_block: Option, }, @@ -91,70 +56,6 @@ pub enum EventData { GenericJsonEvent(serde_json::Value), } -#[derive(Serialize, Deserialize, Debug)] -#[serde(tag = "type", content = "value")] -#[allow(clippy::large_enum_variant)] -pub enum DialectEventData { - #[serde(alias = "tendermint/event/NewBlock")] - NewBlock { - block: Option, - result_begin_block: Option>, - result_end_block: Option>, - }, - #[serde(alias = "tendermint/event/Tx")] - Tx { - #[serde(rename = "TxResult")] - tx_result: DialectTxInfo, - }, - GenericJsonEvent(serde_json::Value), -} - -impl From> for EventData -where - Ev: Into, -{ - fn from(msg: DialectEventData) -> Self { - match msg { - DialectEventData::NewBlock { - block, - result_begin_block, - result_end_block, - } => EventData::NewBlock { - block, - result_begin_block: result_begin_block.map(Into::into), - result_end_block: result_end_block.map(Into::into), - }, - DialectEventData::Tx { tx_result } => EventData::Tx { - tx_result: tx_result.into(), - }, - DialectEventData::GenericJsonEvent(v) => EventData::GenericJsonEvent(v), - } - } -} - -impl From for DialectEventData -where - abci::Event: Into, -{ - fn from(msg: EventData) -> Self { - match msg { - EventData::NewBlock { - block, - result_begin_block, - result_end_block, - } => DialectEventData::NewBlock { - block, - result_begin_block: result_begin_block.map(Into::into), - result_end_block: result_end_block.map(Into::into), - }, - EventData::Tx { tx_result } => DialectEventData::Tx { - tx_result: tx_result.into(), - }, - EventData::GenericJsonEvent(v) => DialectEventData::GenericJsonEvent(v), - } - } -} - /// Transaction result info. #[derive(Debug, Clone, PartialEq, Eq)] pub struct TxInfo { @@ -164,44 +65,6 @@ pub struct TxInfo { pub result: TxResult, } -#[derive(Serialize, Deserialize, Debug)] -pub struct DialectTxInfo { - #[serde(with = "serializers::from_str")] - pub height: i64, - pub index: Option, - #[serde(with = "serializers::bytes::base64string")] - pub tx: Vec, - pub result: DialectTxResult, -} - -impl From> for TxInfo -where - Ev: Into, -{ - fn from(msg: DialectTxInfo) -> Self { - TxInfo { - height: msg.height, - index: msg.index, - tx: msg.tx, - result: msg.result.into(), - } - } -} - -impl From for DialectTxInfo -where - abci::Event: Into, -{ - fn from(msg: TxInfo) -> Self { - DialectTxInfo { - height: msg.height, - index: msg.index, - tx: msg.tx, - result: msg.result.into(), - } - } -} - /// Transaction result. #[derive(Debug, Clone, PartialEq, Eq)] pub struct TxResult { @@ -211,38 +74,373 @@ pub struct TxResult { pub events: Vec, } -#[derive(Serialize, Deserialize, Debug)] -pub struct DialectTxResult { - pub log: Option, - pub gas_wanted: Option, - pub gas_used: Option, - pub events: Vec, -} +/// Serialization helpers for CometBFT 0.34 RPC +pub mod v0_34 { + use super::{Event, EventData, TxInfo, TxResult}; + use crate::dialect::v0_34::Event as RpcEvent; + use crate::prelude::*; + use crate::{dialect, serializers, Response}; + use alloc::collections::BTreeMap as HashMap; + use serde::{Deserialize, Serialize}; + use tendermint::Block; + + #[derive(Serialize, Deserialize, Debug)] + pub struct DialectEvent { + /// The query that produced the event. + pub query: String, + /// The data associated with the event. + pub data: DialectEventData, + /// Event type and attributes map. + pub events: Option>>, + } -impl From> for TxResult -where - Ev: Into, -{ - fn from(msg: DialectTxResult) -> Self { - TxResult { - log: msg.log, - gas_wanted: msg.gas_wanted, - gas_used: msg.gas_used, - events: msg.events.into_iter().map(Into::into).collect(), + impl Response for DialectEvent {} + + impl From for Event { + fn from(msg: DialectEvent) -> Self { + Event { + query: msg.query, + data: msg.data.into(), + events: msg.events, + } + } + } + + impl From for DialectEvent { + fn from(msg: Event) -> Self { + DialectEvent { + query: msg.query, + data: msg.data.into(), + events: msg.events, + } + } + } + + #[derive(Serialize, Deserialize, Debug)] + #[serde(tag = "type", content = "value")] + #[allow(clippy::large_enum_variant)] + pub enum DialectEventData { + #[serde(alias = "tendermint/event/NewBlock")] + NewBlock { + block: Option>, + result_begin_block: Option>, + result_end_block: Option>, + }, + #[serde(alias = "tendermint/event/Tx")] + Tx { + #[serde(rename = "TxResult")] + tx_result: DialectTxInfo, + }, + GenericJsonEvent(serde_json::Value), + } + + impl From for EventData { + fn from(msg: DialectEventData) -> Self { + match msg { + DialectEventData::NewBlock { + block, + result_begin_block, + result_end_block, + } => EventData::LegacyNewBlock { + block: block, + result_begin_block: result_begin_block.map(Into::into), + result_end_block: result_end_block.map(Into::into), + }, + DialectEventData::Tx { tx_result } => EventData::Tx { + tx_result: tx_result.into(), + }, + DialectEventData::GenericJsonEvent(v) => EventData::GenericJsonEvent(v), + } + } + } + + impl From for DialectEventData { + fn from(msg: EventData) -> Self { + match msg { + EventData::LegacyNewBlock { + block, + result_begin_block, + result_end_block, + } => DialectEventData::NewBlock { + block, + result_begin_block: result_begin_block.map(Into::into), + result_end_block: result_end_block.map(Into::into), + }, + // This variant should not be used with 0.34, but we're using + // this impl only for the mock server. + EventData::NewBlock { + block, + block_id: _, + result_finalize_block: _, + } => DialectEventData::NewBlock { + block, + result_begin_block: None, + result_end_block: None, + }, + EventData::Tx { tx_result } => DialectEventData::Tx { + tx_result: tx_result.into(), + }, + EventData::GenericJsonEvent(v) => DialectEventData::GenericJsonEvent(v), + } + } + } + + #[derive(Serialize, Deserialize, Debug)] + pub struct DialectTxInfo { + #[serde(with = "serializers::from_str")] + pub height: i64, + pub index: Option, + #[serde(with = "serializers::bytes::base64string")] + pub tx: Vec, + pub result: DialectTxResult, + } + + impl From for TxInfo { + fn from(msg: DialectTxInfo) -> Self { + TxInfo { + height: msg.height, + index: msg.index, + tx: msg.tx, + result: msg.result.into(), + } + } + } + + impl From for DialectTxInfo { + fn from(msg: TxInfo) -> Self { + DialectTxInfo { + height: msg.height, + index: msg.index, + tx: msg.tx, + result: msg.result.into(), + } + } + } + + #[derive(Serialize, Deserialize, Debug)] + pub struct DialectTxResult { + pub log: Option, + pub gas_wanted: Option, + pub gas_used: Option, + pub events: Vec, + } + + impl From for TxResult { + fn from(msg: DialectTxResult) -> Self { + TxResult { + log: msg.log, + gas_wanted: msg.gas_wanted, + gas_used: msg.gas_used, + events: msg.events.into_iter().map(Into::into).collect(), + } + } + } + + impl From for DialectTxResult { + fn from(msg: TxResult) -> Self { + DialectTxResult { + log: msg.log, + gas_wanted: msg.gas_wanted, + gas_used: msg.gas_used, + events: msg.events.into_iter().map(Into::into).collect(), + } } } } -impl From for DialectTxResult -where - abci::Event: Into, -{ - fn from(msg: TxResult) -> Self { - DialectTxResult { - log: msg.log, - gas_wanted: msg.gas_wanted, - gas_used: msg.gas_used, - events: msg.events.into_iter().map(Into::into).collect(), +/// Serialization helpers for the RPC protocol used since CometBFT 0.37 +pub mod latest { + use super::{Event, EventData, TxInfo, TxResult}; + use crate::prelude::*; + use crate::{serializers, Response}; + use alloc::collections::BTreeMap as HashMap; + use serde::{Deserialize, Serialize}; + use tendermint::abci::Event as RpcEvent; + use tendermint::{abci, block, Block}; + + #[derive(Serialize, Deserialize, Debug)] + pub struct DialectEvent { + /// The query that produced the event. + pub query: String, + /// The data associated with the event. + pub data: DialectEventData, + /// Event type and attributes map. + pub events: Option>>, + } + + impl Response for DialectEvent {} + + impl From for Event { + fn from(msg: DialectEvent) -> Self { + Event { + query: msg.query, + data: msg.data.into(), + events: msg.events, + } + } + } + + impl From for DialectEvent { + fn from(msg: Event) -> Self { + DialectEvent { + query: msg.query, + data: msg.data.into(), + events: msg.events, + } + } + } + + #[derive(Serialize, Deserialize, Debug)] + #[serde(tag = "type", content = "value")] + #[allow(clippy::large_enum_variant)] + pub enum DialectEventData { + #[serde(alias = "tendermint/event/NewBlock")] + NewBlock { + block: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + result_begin_block: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + result_end_block: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + block_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + result_finalize_block: Option, + }, + #[serde(alias = "tendermint/event/Tx")] + Tx { + #[serde(rename = "TxResult")] + tx_result: DialectTxInfo, + }, + GenericJsonEvent(serde_json::Value), + } + + impl From for EventData { + fn from(msg: DialectEventData) -> Self { + match msg { + DialectEventData::NewBlock { + block, + block_id: Some(block_id), + result_finalize_block, + result_begin_block: _, + result_end_block: _, + } => EventData::NewBlock { + block, + block_id, + result_finalize_block, + }, + DialectEventData::NewBlock { + block, + result_begin_block, + result_end_block, + block_id: None, + result_finalize_block: _, + } => EventData::LegacyNewBlock { + block, + result_begin_block: result_begin_block.map(Into::into), + result_end_block: result_end_block.map(Into::into), + }, + DialectEventData::Tx { tx_result } => EventData::Tx { + tx_result: tx_result.into(), + }, + DialectEventData::GenericJsonEvent(v) => EventData::GenericJsonEvent(v), + } + } + } + + impl From for DialectEventData { + fn from(msg: EventData) -> Self { + match msg { + EventData::NewBlock { + block, + block_id, + result_finalize_block, + } => DialectEventData::NewBlock { + block, + block_id: Some(block_id), + result_finalize_block, + result_begin_block: None, + result_end_block: None, + }, + // This variant should not be used since 0.38, but we're using + // this impl only for the mock server. + EventData::LegacyNewBlock { + block, + result_begin_block, + result_end_block, + } => DialectEventData::NewBlock { + block, + block_id: None, + result_finalize_block: None, + result_begin_block: result_begin_block.map(Into::into), + result_end_block: result_end_block.map(Into::into), + }, + EventData::Tx { tx_result } => DialectEventData::Tx { + tx_result: tx_result.into(), + }, + EventData::GenericJsonEvent(v) => DialectEventData::GenericJsonEvent(v), + } + } + } + + #[derive(Serialize, Deserialize, Debug)] + pub struct DialectTxInfo { + #[serde(with = "serializers::from_str")] + pub height: i64, + pub index: Option, + #[serde(with = "serializers::bytes::base64string")] + pub tx: Vec, + pub result: DialectTxResult, + } + + impl From for TxInfo { + fn from(msg: DialectTxInfo) -> Self { + TxInfo { + height: msg.height, + index: msg.index, + tx: msg.tx, + result: msg.result.into(), + } + } + } + + impl From for DialectTxInfo { + fn from(msg: TxInfo) -> Self { + DialectTxInfo { + height: msg.height, + index: msg.index, + tx: msg.tx, + result: msg.result.into(), + } + } + } + + #[derive(Serialize, Deserialize, Debug)] + pub struct DialectTxResult { + pub log: Option, + pub gas_wanted: Option, + pub gas_used: Option, + pub events: Vec, + } + + impl From for TxResult { + fn from(msg: DialectTxResult) -> Self { + TxResult { + log: msg.log, + gas_wanted: msg.gas_wanted, + gas_used: msg.gas_used, + events: msg.events.into_iter().map(Into::into).collect(), + } + } + } + + impl From for DialectTxResult { + fn from(msg: TxResult) -> Self { + DialectTxResult { + log: msg.log, + gas_wanted: msg.gas_wanted, + gas_used: msg.gas_used, + events: msg.events.into_iter().map(Into::into).collect(), + } } } } diff --git a/rpc/tests/gaia_fixtures.rs b/rpc/tests/gaia_fixtures.rs index ec71bffd5..7386013f2 100644 --- a/rpc/tests/gaia_fixtures.rs +++ b/rpc/tests/gaia_fixtures.rs @@ -1,8 +1,7 @@ use std::{fs, path::PathBuf}; // TODO: generate fixtures and test with v0_37::dialect as well -use tendermint_rpc::dialect::v0_34::Event as RpcEvent; -use tendermint_rpc::{endpoint, event::DialectEvent, request::RequestMessage, Response}; +use tendermint_rpc::{endpoint, event::v0_34::DialectEvent, request::RequestMessage, Response}; use walkdir::WalkDir; @@ -88,7 +87,7 @@ fn incoming_fixtures() { }, _ => { if file_name.starts_with("subscribe_newblock_") { - let r = DialectEvent::::from_string(content); + let r = DialectEvent::from_string(content); assert!(r.is_ok(), "failed to parse event {file_name}: {r:?}"); } else { panic!("unhandled incoming fixture: {file_name}"); diff --git a/rpc/tests/kvstore_fixtures/v0_34.rs b/rpc/tests/kvstore_fixtures/v0_34.rs index 556b57d4c..00b08854c 100644 --- a/rpc/tests/kvstore_fixtures/v0_34.rs +++ b/rpc/tests/kvstore_fixtures/v0_34.rs @@ -257,7 +257,7 @@ fn outgoing_fixtures() { #[test] fn incoming_fixtures() { - use tendermint_rpc::dialect::v0_34::Event as RpcEvent; + use tendermint_rpc::event::{v0_34::DialectEvent, EventData}; let empty_merkle_root_hash = Some( tendermint::Hash::from_hex_upper( @@ -792,9 +792,8 @@ fn incoming_fixtures() { } }, "subscribe_newblock_0" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -843,14 +842,13 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_1" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -921,14 +919,13 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_2" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -977,14 +974,13 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_3" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -1033,14 +1029,13 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_4" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -1089,7 +1084,7 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, @@ -1097,8 +1092,7 @@ fn incoming_fixtures() { assert!(endpoint::subscribe::Response::from_string(content).is_ok()); }, "subscribe_txs_0" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1130,8 +1124,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_1" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1164,8 +1157,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_2" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1197,8 +1189,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_3" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1230,8 +1221,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_4" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; diff --git a/rpc/tests/kvstore_fixtures/v0_37.rs b/rpc/tests/kvstore_fixtures/v0_37.rs index 5c496ec6c..7a6a9c6ed 100644 --- a/rpc/tests/kvstore_fixtures/v0_37.rs +++ b/rpc/tests/kvstore_fixtures/v0_37.rs @@ -256,7 +256,7 @@ fn outgoing_fixtures() { #[test] fn incoming_fixtures() { - use tendermint_rpc::dialect::v0_37::Event as RpcEvent; + use tendermint_rpc::event::{latest::DialectEvent, EventData}; let empty_merkle_root_hash = Some( tendermint::Hash::from_hex_upper( @@ -786,9 +786,8 @@ fn incoming_fixtures() { } }, "subscribe_newblock_0" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -837,14 +836,13 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_1" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -915,14 +913,13 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_2" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -971,14 +968,13 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_3" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -1027,14 +1023,13 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_4" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::LegacyNewBlock { block, result_begin_block, result_end_block, @@ -1083,7 +1078,7 @@ fn incoming_fixtures() { assert!(reb.consensus_param_updates.is_none()); assert!(reb.events.is_empty()); } else { - panic!("not a newblock"); + panic!("not a LegacyNewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, @@ -1091,8 +1086,7 @@ fn incoming_fixtures() { assert!(endpoint::subscribe::Response::from_string(content).is_ok()); }, "subscribe_txs_0" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1124,8 +1118,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_1" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1158,8 +1151,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_2" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1191,8 +1183,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_3" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1224,8 +1215,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_4" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; diff --git a/rpc/tests/kvstore_fixtures/v0_38.rs b/rpc/tests/kvstore_fixtures/v0_38.rs index 08406a839..87d6c7f29 100644 --- a/rpc/tests/kvstore_fixtures/v0_38.rs +++ b/rpc/tests/kvstore_fixtures/v0_38.rs @@ -256,7 +256,7 @@ fn outgoing_fixtures() { #[test] fn incoming_fixtures() { - use tendermint::abci::Event as RpcEvent; + use tendermint_rpc::event::{latest::DialectEvent, EventData}; let empty_merkle_root_hash = Some( tendermint::Hash::from_hex_upper( @@ -786,12 +786,11 @@ fn incoming_fixtures() { } }, "subscribe_newblock_0" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::NewBlock { block, - result_begin_block, - result_end_block, + block_id, + result_finalize_block, } = result.data.into() { let b = block.unwrap(); @@ -831,23 +830,31 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - assert!(result_begin_block.unwrap().events.is_empty()); - let reb = result_end_block.unwrap(); - assert!(reb.validator_updates.is_empty()); - assert!(reb.consensus_param_updates.is_none()); - assert!(reb.events.is_empty()); + assert_eq!( + block_id.hash.as_bytes(), + b"FA01C08688623731FA4250FB7873FE2049349DAE5352CB823E5BE0F472017C22" + ); + assert_eq!(block_id.part_set_header.total, 1); + assert_eq!( + block_id.part_set_header.hash.as_bytes(), + b"FA665C1C3E2348640E60153A50663E9C99323E096D15DC13AEB1C7B9F84DA8EB" + ); + let rfb = result_finalize_block.unwrap(); + assert!(rfb.validator_updates.is_empty()); + assert!(rfb.consensus_param_updates.is_none()); + assert!(rfb.events.is_empty()); + assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) } else { - panic!("not a newblock"); + panic!("not a NewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_1" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::NewBlock { block, - result_begin_block, - result_end_block, + block_id, + result_finalize_block, } = result.data.into() { let b = block.unwrap(); @@ -887,45 +894,31 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - let rbb = result_begin_block.unwrap(); - assert_eq!(rbb.events.len(), 2); - assert_eq!(rbb.events[0].kind, "transfer"); - assert_eq!(rbb.events[0].attributes.len(), 2); - assert_eq!(rbb.events[0].attributes[0].key, "recipient"); - assert_eq!( - rbb.events[0].attributes[0].value, - "cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta" - ); - assert!(rbb.events[0].attributes[0].index); - assert_eq!(rbb.events[0].attributes[1].key, "sender"); assert_eq!( - rbb.events[0].attributes[1].value, - "cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q" + block_id.hash.as_bytes(), + b"80A660B1AD0E3C8A6393239111174D2FDCE615612055FA7CD61793D9E8351D12" ); - assert!(!rbb.events[0].attributes[1].index); - assert_eq!(rbb.events[1].kind, "message"); - assert_eq!(rbb.events[1].attributes.len(), 1); - assert_eq!(rbb.events[1].attributes[0].key, "sender"); + assert_eq!(block_id.part_set_header.total, 1); assert_eq!( - rbb.events[1].attributes[0].value, - "cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q" + block_id.part_set_header.hash.as_bytes(), + b"051A5E711FA370C706B917FBDC9891D7262F8DA0595A2F09BA5A598D79BCFF4A" ); - let reb = result_end_block.unwrap(); - assert!(reb.validator_updates.is_empty()); - assert!(reb.consensus_param_updates.is_none()); - assert!(reb.events.is_empty()); + let rfb = result_finalize_block.unwrap(); + assert!(rfb.events.is_empty()); + assert!(rfb.validator_updates.is_empty()); + assert!(rfb.consensus_param_updates.is_none()); + assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) } else { - panic!("not a newblock"); + panic!("not a NewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_2" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::NewBlock { block, - result_begin_block, - result_end_block, + block_id, + result_finalize_block, } = result.data.into() { let b = block.unwrap(); @@ -965,23 +958,31 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - assert!(result_begin_block.unwrap().events.is_empty()); - let reb = result_end_block.unwrap(); - assert!(reb.validator_updates.is_empty()); - assert!(reb.consensus_param_updates.is_none()); - assert!(reb.events.is_empty()); + assert_eq!( + block_id.hash.as_bytes(), + b"95590A6F18C7B1D43356D86992F5E3FDFD41508FF3A81918E38F274695E45447" + ); + assert_eq!(block_id.part_set_header.total, 1); + assert_eq!( + block_id.part_set_header.hash.as_bytes(), + b"147DF332018EB6AC5E853EA0126452E81391D0A836B3CE49431D0FEE6BC57A12" + ); + let rfb = result_finalize_block.unwrap(); + assert!(rfb.validator_updates.is_empty()); + assert!(rfb.consensus_param_updates.is_none()); + assert!(rfb.events.is_empty()); + assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) } else { - panic!("not a newblock"); + panic!("not a NewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_3" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::NewBlock { block, - result_begin_block, - result_end_block, + block_id, + result_finalize_block, } = result.data.into() { let b = block.unwrap(); @@ -1021,23 +1022,31 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - assert!(result_begin_block.unwrap().events.is_empty()); - let reb = result_end_block.unwrap(); - assert!(reb.validator_updates.is_empty()); - assert!(reb.consensus_param_updates.is_none()); - assert!(reb.events.is_empty()); + assert_eq!( + block_id.hash.as_bytes(), + b"CA72F4B34DAE4A5367E140334E865162D6B259DD5F04B521524C36C6C0C5A27A" + ); + assert_eq!(block_id.part_set_header.total, 1); + assert_eq!( + block_id.part_set_header.hash.as_bytes(), + b"8386E1C2220C0F042561035FBE7B1CE8967279C1274A6EF18C24DFAA9993A7CC" + ); + let rfb = result_finalize_block.unwrap(); + assert!(rfb.validator_updates.is_empty()); + assert!(rfb.consensus_param_updates.is_none()); + assert!(rfb.events.is_empty()); + assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) } else { - panic!("not a newblock"); + panic!("not a NewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_4" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); - if let tendermint_rpc::event::EventData::NewBlock { + let result = DialectEvent::from_string(content).unwrap(); + if let EventData::NewBlock { block, - result_begin_block, - result_end_block, + block_id, + result_finalize_block, } = result.data.into() { let b = block.unwrap(); @@ -1077,13 +1086,22 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - assert!(result_begin_block.unwrap().events.is_empty()); - let reb = result_end_block.unwrap(); - assert!(reb.validator_updates.is_empty()); - assert!(reb.consensus_param_updates.is_none()); - assert!(reb.events.is_empty()); + assert_eq!( + block_id.hash.as_bytes(), + b"71C6B19C7931F264766AE567D6D17609AD9D257E76EC0E1BA5E9AE9E33934EBD" + ); + assert_eq!(block_id.part_set_header.total, 1); + assert_eq!( + block_id.part_set_header.hash.as_bytes(), + b"CAE5DC225290AECB1C311BDD3E93B28B20D59C0B83669E76E68EDCB8EB383CA7" + ); + let rfb = result_finalize_block.unwrap(); + assert!(rfb.validator_updates.is_empty()); + assert!(rfb.consensus_param_updates.is_none()); + assert!(rfb.events.is_empty()); + assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) } else { - panic!("not a newblock"); + panic!("not a NewBlock event"); } assert_eq!(result.query, "tm.event = 'NewBlock'"); }, @@ -1091,10 +1109,9 @@ fn incoming_fixtures() { assert!(endpoint::subscribe::Response::from_string(content).is_ok()); }, "subscribe_txs_0" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1124,10 +1141,9 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_1" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1158,10 +1174,9 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_2" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1191,10 +1206,9 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_3" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1224,10 +1238,9 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_4" => { - let result = - tendermint_rpc::event::DialectEvent::::from_string(content).unwrap(); + let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); From 07de311f5cef142163c9185ed5e51f709a004778 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 25 May 2023 21:05:22 +0300 Subject: [PATCH 13/27] base64 for app_hash in JSON of FinalizeBlock --- .../src/abci/response/finalize_block.rs | 4 ++- tendermint/src/serializers.rs | 1 + tendermint/src/serializers/apphash_base64.rs | 27 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tendermint/src/serializers/apphash_base64.rs diff --git a/tendermint/src/abci/response/finalize_block.rs b/tendermint/src/abci/response/finalize_block.rs index 48d747139..155e33284 100644 --- a/tendermint/src/abci/response/finalize_block.rs +++ b/tendermint/src/abci/response/finalize_block.rs @@ -20,7 +20,9 @@ pub struct FinalizeBlock { /// Updates to the consensus params, if any. #[serde(default)] pub consensus_param_updates: Option, - #[serde(default, with = "serializers::apphash")] + // FIXME: decide if base64 is the canonical serialization for AppHash, + // and implement Serialize/Deserialize on the type accordingly? + #[serde(default, with = "serializers::apphash_base64")] pub app_hash: AppHash, } diff --git a/tendermint/src/serializers.rs b/tendermint/src/serializers.rs index 8a0efc8b9..458f79c89 100644 --- a/tendermint/src/serializers.rs +++ b/tendermint/src/serializers.rs @@ -8,6 +8,7 @@ pub use tendermint_proto::serializers::*; pub mod apphash; +pub mod apphash_base64; pub mod hash; pub mod option_hash; pub mod time; diff --git a/tendermint/src/serializers/apphash_base64.rs b/tendermint/src/serializers/apphash_base64.rs new file mode 100644 index 000000000..13a791d23 --- /dev/null +++ b/tendermint/src/serializers/apphash_base64.rs @@ -0,0 +1,27 @@ +//! AppHash serialization with validation + +use serde::{Deserialize, Deserializer, Serializer}; +use subtle_encoding::base64; + +use crate::{prelude::*, AppHash}; + +/// Deserialize a base64-encoded string into an [`AppHash`] +pub fn deserialize<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let s = Option::::deserialize(deserializer)?.unwrap_or_default(); + let decoded = base64::decode(s).map_err(serde::de::Error::custom)?; + decoded.try_into().map_err(serde::de::Error::custom) +} + +/// Serialize from [`AppHash`] into a base64-encoded string. +pub fn serialize(value: &AppHash, serializer: S) -> Result +where + S: Serializer, +{ + let base64_bytes = base64::encode(value.as_bytes()); + let base64_string = String::from_utf8(base64_bytes).unwrap(); + // Serialize as Option for symmetry with deserialize + serializer.serialize_some(&base64_string) +} From c37c6c33416960ac0baaa0eafc5e77200d7af039 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 25 May 2023 21:10:45 +0300 Subject: [PATCH 14/27] rpc: adjusted tests for kvstore_fixtures/v0_38 --- rpc/tests/kvstore_fixtures/v0_38.rs | 62 ++++++++--------------------- 1 file changed, 16 insertions(+), 46 deletions(-) diff --git a/rpc/tests/kvstore_fixtures/v0_38.rs b/rpc/tests/kvstore_fixtures/v0_38.rs index 87d6c7f29..e3319ea02 100644 --- a/rpc/tests/kvstore_fixtures/v0_38.rs +++ b/rpc/tests/kvstore_fixtures/v0_38.rs @@ -772,7 +772,7 @@ fn incoming_fixtures() { assert_eq!(response.code(), Code::InternalError); assert_eq!(response.message(), "Internal error"); - assert_eq!(response.data().unwrap(),"failed to parse query: \nparse error near PegText (line 1 symbol 2 - line 1 symbol 11):\n\"malformed\"\n"); + assert_eq!(response.data().unwrap(), "failed to parse query: offset 10: got tag, wanted <= operator, >= operator, < operator, > operator, = operator, CONTAINS operator or EXISTS operator"); }, _ => panic!("expected Response error"), } @@ -830,20 +830,14 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - assert_eq!( - block_id.hash.as_bytes(), - b"FA01C08688623731FA4250FB7873FE2049349DAE5352CB823E5BE0F472017C22" - ); + assert!(!block_id.hash.is_empty()); assert_eq!(block_id.part_set_header.total, 1); - assert_eq!( - block_id.part_set_header.hash.as_bytes(), - b"FA665C1C3E2348640E60153A50663E9C99323E096D15DC13AEB1C7B9F84DA8EB" - ); + assert!(!block_id.part_set_header.hash.is_empty()); let rfb = result_finalize_block.unwrap(); assert!(rfb.validator_updates.is_empty()); assert!(rfb.consensus_param_updates.is_none()); assert!(rfb.events.is_empty()); - assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) + assert_eq!(rfb.app_hash.as_bytes(), &[6u8, 0, 0, 0, 0, 0, 0, 0]) } else { panic!("not a NewBlock event"); } @@ -894,20 +888,14 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - assert_eq!( - block_id.hash.as_bytes(), - b"80A660B1AD0E3C8A6393239111174D2FDCE615612055FA7CD61793D9E8351D12" - ); + assert!(!block_id.hash.is_empty()); assert_eq!(block_id.part_set_header.total, 1); - assert_eq!( - block_id.part_set_header.hash.as_bytes(), - b"051A5E711FA370C706B917FBDC9891D7262F8DA0595A2F09BA5A598D79BCFF4A" - ); + assert!(!block_id.part_set_header.hash.is_empty()); let rfb = result_finalize_block.unwrap(); assert!(rfb.events.is_empty()); assert!(rfb.validator_updates.is_empty()); assert!(rfb.consensus_param_updates.is_none()); - assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) + assert_eq!(rfb.app_hash.as_bytes(), &[6u8, 0, 0, 0, 0, 0, 0, 0]) } else { panic!("not a NewBlock event"); } @@ -958,20 +946,14 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - assert_eq!( - block_id.hash.as_bytes(), - b"95590A6F18C7B1D43356D86992F5E3FDFD41508FF3A81918E38F274695E45447" - ); + assert!(!block_id.hash.is_empty()); assert_eq!(block_id.part_set_header.total, 1); - assert_eq!( - block_id.part_set_header.hash.as_bytes(), - b"147DF332018EB6AC5E853EA0126452E81391D0A836B3CE49431D0FEE6BC57A12" - ); + assert!(!block_id.part_set_header.hash.is_empty()); let rfb = result_finalize_block.unwrap(); assert!(rfb.validator_updates.is_empty()); assert!(rfb.consensus_param_updates.is_none()); assert!(rfb.events.is_empty()); - assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) + assert_eq!(rfb.app_hash.as_bytes(), &[6u8, 0, 0, 0, 0, 0, 0, 0]) } else { panic!("not a NewBlock event"); } @@ -1022,20 +1004,14 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - assert_eq!( - block_id.hash.as_bytes(), - b"CA72F4B34DAE4A5367E140334E865162D6B259DD5F04B521524C36C6C0C5A27A" - ); + assert!(!block_id.hash.is_empty()); assert_eq!(block_id.part_set_header.total, 1); - assert_eq!( - block_id.part_set_header.hash.as_bytes(), - b"8386E1C2220C0F042561035FBE7B1CE8967279C1274A6EF18C24DFAA9993A7CC" - ); + assert!(!block_id.part_set_header.hash.is_empty()); let rfb = result_finalize_block.unwrap(); assert!(rfb.validator_updates.is_empty()); assert!(rfb.consensus_param_updates.is_none()); assert!(rfb.events.is_empty()); - assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) + assert_eq!(rfb.app_hash.as_bytes(), &[6u8, 0, 0, 0, 0, 0, 0, 0]) } else { panic!("not a NewBlock event"); } @@ -1086,20 +1062,14 @@ fn incoming_fixtures() { assert_eq!(last_commit.signatures.len(), 1); assert!(last_commit.signatures[0].is_commit()); assert!(last_commit.signatures[0].validator_address().is_some()); - assert_eq!( - block_id.hash.as_bytes(), - b"71C6B19C7931F264766AE567D6D17609AD9D257E76EC0E1BA5E9AE9E33934EBD" - ); + assert!(!block_id.hash.is_empty()); assert_eq!(block_id.part_set_header.total, 1); - assert_eq!( - block_id.part_set_header.hash.as_bytes(), - b"CAE5DC225290AECB1C311BDD3E93B28B20D59C0B83669E76E68EDCB8EB383CA7" - ); + assert!(!block_id.part_set_header.hash.is_empty()); let rfb = result_finalize_block.unwrap(); assert!(rfb.validator_updates.is_empty()); assert!(rfb.consensus_param_updates.is_none()); assert!(rfb.events.is_empty()); - assert_eq!(rfb.app_hash.as_bytes(), &[0u8; 8]) + assert_eq!(rfb.app_hash.as_bytes(), &[6u8, 0, 0, 0, 0, 0, 0, 0]) } else { panic!("not a NewBlock event"); } From 2cf5d78d6dca0d9f948ed2b42a926b749882337b Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 25 May 2023 21:17:58 +0300 Subject: [PATCH 15/27] clippy fix --- rpc/src/event.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/src/event.rs b/rpc/src/event.rs index 5664f8e80..e134f89e6 100644 --- a/rpc/src/event.rs +++ b/rpc/src/event.rs @@ -142,7 +142,7 @@ pub mod v0_34 { result_begin_block, result_end_block, } => EventData::LegacyNewBlock { - block: block, + block, result_begin_block: result_begin_block.map(Into::into), result_end_block: result_end_block.map(Into::into), }, From 3c12478cc0e81a3bc2a5a2ca87fa824ff4ebc438 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 25 May 2023 21:30:44 +0300 Subject: [PATCH 16/27] Fix up kvstore-test --- tools/kvstore-test/tests/tendermint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvstore-test/tests/tendermint.rs b/tools/kvstore-test/tests/tendermint.rs index 4a13a27e0..0713e37c7 100644 --- a/tools/kvstore-test/tests/tendermint.rs +++ b/tools/kvstore-test/tests/tendermint.rs @@ -410,7 +410,7 @@ mod rpc { let ev: Event = res.unwrap(); println!("Got event: {ev:?}"); match ev.data { - EventData::NewBlock { .. } => { + EventData::LegacyNewBlock { .. } => { println!("Got new block event"); expected_new_blocks -= 1; }, From e85d346f589ca001a0af19da9f9ef47b7a810301 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 29 May 2023 15:30:45 +0300 Subject: [PATCH 17/27] rpc: CometBFT 0.38 compat notes on new fields --- rpc/src/endpoint/block_results.rs | 4 ++++ rpc/src/endpoint/broadcast/tx_commit.rs | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rpc/src/endpoint/block_results.rs b/rpc/src/endpoint/block_results.rs index 7b39ac3ad..a1411072f 100644 --- a/rpc/src/endpoint/block_results.rs +++ b/rpc/src/endpoint/block_results.rs @@ -81,6 +81,10 @@ pub struct Response { pub consensus_param_updates: Option, /// Merkle hash of the application state + /// + /// This field is used since CometBFT version 0.38. It's set to a + /// default value when converting responses from nodes using earlier + /// versions of the protocol. #[serde(default)] #[serde(with = "serializers::apphash")] pub app_hash: AppHash, diff --git a/rpc/src/endpoint/broadcast/tx_commit.rs b/rpc/src/endpoint/broadcast/tx_commit.rs index b82ddccae..6c49ca773 100644 --- a/rpc/src/endpoint/broadcast/tx_commit.rs +++ b/rpc/src/endpoint/broadcast/tx_commit.rs @@ -55,7 +55,10 @@ pub struct Response { /// `CheckTx` result pub check_tx: abci::response::CheckTx, - /// Result of executing the transaction + /// Result of executing the transaction. + /// + /// The JSON field carrying this data is named `deliver_tx` in + /// CometBFT versions before 0.38. #[serde(alias = "deliver_tx")] pub tx_result: abci::types::ExecTxResult, From a2015fb3ce17509bb701f98dc405e1f13ebd6078 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 29 May 2023 16:45:30 +0300 Subject: [PATCH 18/27] rpc: version-alias latest event serde helpers For consistency, define event::v0_37 and event::v0_38, aliasing the public definitions in event::latest. --- rpc/src/event.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rpc/src/event.rs b/rpc/src/event.rs index e134f89e6..aee6bf58e 100644 --- a/rpc/src/event.rs +++ b/rpc/src/event.rs @@ -444,3 +444,11 @@ pub mod latest { } } } + +pub mod v0_37 { + pub use super::latest::*; +} + +pub mod v0_38 { + pub use super::latest::*; +} From fa7d4b12ad2482f57535b8018b69af0b140456c5 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 29 May 2023 17:09:07 +0300 Subject: [PATCH 19/27] Changelog for #1317 --- .../1317-cometbft-rpc-0.38.md | 23 +++++++++++++++++++ .../improvements/1317-cometbft-rpc-0.38.md | 9 ++++++++ 2 files changed, 32 insertions(+) create mode 100644 .changelog/unreleased/breaking-changes/1317-cometbft-rpc-0.38.md create mode 100644 .changelog/unreleased/improvements/1317-cometbft-rpc-0.38.md diff --git a/.changelog/unreleased/breaking-changes/1317-cometbft-rpc-0.38.md b/.changelog/unreleased/breaking-changes/1317-cometbft-rpc-0.38.md new file mode 100644 index 000000000..d50dafa55 --- /dev/null +++ b/.changelog/unreleased/breaking-changes/1317-cometbft-rpc-0.38.md @@ -0,0 +1,23 @@ +- `[tendermint-rpc]` Changes to support the RPC protocol in CometBFT 0.38 + ([\#1317](https://github.com/informalsystems/tendermint-rs/pull/1317)): + * Add `finalize_block_results` and `app_hash` fields to + `endpoint::block_results::Response`. + * The `deliver_tx` field is renamed to `tx_result` in + `endpoint::broadcast::tx_commit::Response`. + * The `tx_result` field type changed to `ExecTxResult` in + `endpoint::tx::Response`. + * The `event::EventData::NewBlock` variant is renamed to `LegacyNewBlock`. + The new `NewBlock` variant only carries fields relevant since CometBFT 0.38. + * Removed `event::DialectEvent`, replaced with `event::v0_34::DialectEvent` + and `event::latest::DialectEvent` as non-generic serialization helpers. + The latter handles the fields added in CometBFT 0.38, `block_id` and + `result_finalize_block`. Same refactoring done for `DialectEventData` + and other types used in the event data structures. + * Changed some of the serialization dialect helpers only be + used by the 0.34 dialect and remove generics. The current dialect's + seralization is switched to the serde impls on the domain types in + `tendermint`. +- `[tendermint]` Changes to support the RPC protocol in CometBFT 0.38 + ([\#1317](https://github.com/informalsystems/tendermint-rs/pull/1317)): + * Due to some attribute changes, the format emitted by `Serialize` is + changed for `abci::response` types `CheckTx` and `FinalizeBlock`. \ No newline at end of file diff --git a/.changelog/unreleased/improvements/1317-cometbft-rpc-0.38.md b/.changelog/unreleased/improvements/1317-cometbft-rpc-0.38.md new file mode 100644 index 000000000..a98fbe988 --- /dev/null +++ b/.changelog/unreleased/improvements/1317-cometbft-rpc-0.38.md @@ -0,0 +1,9 @@ +- `[tendermint-rpc]` Support for CometBFT 0.38 + ([\#1317](https://github.com/informalsystems/tendermint-rs/pull/1317)): + * `Deserialize` implementations on `abci::Event`, `abci::EventAttribute` + that correspond to the current RPC serialization. + * Domain types under `abci::response` also get `Deserialize` implementations + corresponding to the current RPC serialization. + * `Serialize`, `Deserialize` implementations on `abci::types::ExecTxResult` + corresponding to the current RPC serialization. + * Added the `apphash_base64` serializer module. From 2406f5a9e72266973be026958a4ad5b889b82c70 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 29 May 2023 18:18:55 +0300 Subject: [PATCH 20/27] rpc: swap around dialect parsing in websocket --- rpc/src/client/transport/websocket.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index e7a03c697..f76bee589 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -883,8 +883,8 @@ impl WebSocketClientDriver { async fn handle_text_msg(&mut self, msg: String) -> Result<(), Error> { let parse_res = match self.compat { - CompatMode::V0_37 => event::v0_34::DialectEvent::from_string(&msg).map(Into::into), - CompatMode::V0_34 => event::latest::DialectEvent::from_string(&msg).map(Into::into), + CompatMode::V0_37 => event::v0_37::DialectEvent::from_string(&msg).map(Into::into), + CompatMode::V0_34 => event::v0_34::DialectEvent::from_string(&msg).map(Into::into), }; if let Ok(ev) = parse_res { debug!("JSON-RPC event: {}", msg); From 77b5b63cc39df48689d489bdaff22a2bd136e12c Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Tue, 30 May 2023 11:37:21 +0300 Subject: [PATCH 21/27] rpc: swap around dialects in websocket test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤦‍♂️ --- rpc/src/client/transport/websocket.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index f76bee589..05707d777 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -1214,11 +1214,11 @@ mod test { }; match self.compat { CompatMode::V0_37 => { - let ev: event::v0_34::DialectEvent = ev.into(); + let ev: event::v0_37::DialectEvent = ev.into(); self.send(subs_id, ev).await; }, CompatMode::V0_34 => { - let ev: event::latest::DialectEvent = ev.into(); + let ev: event::v0_34::DialectEvent = ev.into(); self.send(subs_id, ev).await; }, } From c00766aac0729eaabb2a50b29ed6a86813bacfdd Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Tue, 30 May 2023 19:53:32 +0300 Subject: [PATCH 22/27] rpc: websocket_client_happy_path test for 0.38 --- rpc/src/client/transport/websocket.rs | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index 05707d777..9279da5b3 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -1465,6 +1465,73 @@ mod test { } } + mod v0_38 { + use super::*; + use crate::event::latest::DialectEvent; + + async fn read_event(name: &str) -> Event { + DialectEvent::from_string(read_json_fixture("v0_38", name).await) + .unwrap() + .into() + } + + #[tokio::test] + async fn websocket_client_happy_path() { + let event1 = read_event("subscribe_newblock_0").await; + let event2 = read_event("subscribe_newblock_1").await; + let event3 = read_event("subscribe_newblock_2").await; + let test_events = vec![event1, event2, event3]; + + println!("Starting WebSocket server..."); + let mut server = TestServer::new("127.0.0.1:0", CompatMode::V0_37).await; + println!("Creating client RPC WebSocket connection..."); + let url = server.node_addr.clone().try_into().unwrap(); + let (client, driver) = WebSocketClient::builder(url) + .compat_mode(CompatMode::V0_37) + .build() + .await + .unwrap(); + let driver_handle = tokio::spawn(async move { driver.run().await }); + + println!("Initiating subscription for new blocks..."); + let mut subs = client.subscribe(EventType::NewBlock.into()).await.unwrap(); + + // Collect all the events from the subscription. + let subs_collector_hdl = tokio::spawn(async move { + let mut results = Vec::new(); + while let Some(res) = subs.next().await { + results.push(res); + if results.len() == 3 { + break; + } + } + results + }); + + println!("Publishing events"); + // Publish the events from this context + for ev in &test_events { + server.publish_event(ev.clone()).unwrap(); + } + + println!("Collecting results from subscription..."); + let collected_results = subs_collector_hdl.await.unwrap(); + + client.close().unwrap(); + server.terminate().await.unwrap(); + let _ = driver_handle.await.unwrap(); + println!("Closed client and terminated server"); + + assert_eq!(3, collected_results.len()); + for i in 0..3 { + assert_eq!( + test_events[i], + collected_results[i].as_ref().unwrap().clone() + ); + } + } + } + fn authorization(req: &http::Request<()>) -> Option<&str> { req.headers() .get(AUTHORIZATION) From a4e38049e70376713222a7b451e7886853d3e61a Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 7 Jun 2023 00:55:20 +0300 Subject: [PATCH 23/27] rpc: split ser/de helpers for Event The Serialize impl needs to be implemented differently for 0.37 and 0.38 in order to emit old or new fields for NewBlock. The Deserialize impl, however, flexibly handles both formats to avoid introducing another dialect where most other helpers would be identical. This means that Event gets two different helpers for each protocol version: DeEvent for Deserialize and SerEvent for Serialize. --- rpc/src/client/bin/main.rs | 34 +++- rpc/src/client/transport/mock.rs | 8 +- rpc/src/client/transport/router.rs | 2 +- rpc/src/client/transport/websocket.rs | 22 +-- rpc/src/event.rs | 239 +++++++++++++++++++------- rpc/src/response.rs | 7 +- rpc/tests/kvstore_fixtures/v0_37.rs | 22 +-- rpc/tests/kvstore_fixtures/v0_38.rs | 22 +-- 8 files changed, 239 insertions(+), 117 deletions(-) diff --git a/rpc/src/client/bin/main.rs b/rpc/src/client/bin/main.rs index 3a2e52f4e..4dd2a504a 100644 --- a/rpc/src/client/bin/main.rs +++ b/rpc/src/client/bin/main.rs @@ -6,8 +6,11 @@ use futures::StreamExt; use structopt::StructOpt; use tendermint::Hash; use tendermint_rpc::{ - client::CompatMode, event::latest::DialectEvent, query::Query, Client, Error, HttpClient, - Order, Paging, Scheme, Subscription, SubscriptionClient, Url, WebSocketClient, + client::CompatMode, + event::{self, Event, EventData}, + query::Query, + Client, Error, HttpClient, Order, Paging, Scheme, Subscription, SubscriptionClient, Url, + WebSocketClient, }; use tokio::{task::JoinHandle, time::Duration}; use tracing::{debug, error, info, level_filters::LevelFilter, warn}; @@ -500,8 +503,7 @@ async fn recv_events_with_timeout( } }; let event = result?; - let event: DialectEvent = event.into(); - println!("{}", serde_json::to_string_pretty(&event).map_err(Error::serde)?); + print_event(event)?; event_count += 1; if let Some(me) = max_events { if event_count >= (me as u64) { @@ -522,11 +524,7 @@ async fn recv_events(mut subs: Subscription, max_events: Option) -> Result< let mut event_count = 0u64; while let Some(result) = subs.next().await { let event = result?; - let event: DialectEvent = event.into(); - println!( - "{}", - serde_json::to_string_pretty(&event).map_err(Error::serde)? - ); + print_event(event)?; event_count += 1; if let Some(me) = max_events { if event_count >= (me as u64) { @@ -538,3 +536,21 @@ async fn recv_events(mut subs: Subscription, max_events: Option) -> Result< info!("The server terminated the subscription"); Ok(()) } + +fn print_event(event: Event) -> Result<(), Error> { + let json = match &event.data { + EventData::LegacyNewBlock { .. } => { + // Print the old field structure in case the event was received + // from a pre-0.38 node. This is the only instance where the + // structure of the dumped event data currently differs. + let ser_event: event::v0_37::SerEvent = event.into(); + serde_json::to_string_pretty(&ser_event).map_err(Error::serde)? + }, + _ => { + let ser_event: event::v0_38::SerEvent = event.into(); + serde_json::to_string_pretty(&ser_event).map_err(Error::serde)? + }, + }; + println!("{}", json); + Ok(()) +} diff --git a/rpc/src/client/transport/mock.rs b/rpc/src/client/transport/mock.rs index 99d6e68a0..bc05e1892 100644 --- a/rpc/src/client/transport/mock.rs +++ b/rpc/src/client/transport/mock.rs @@ -264,10 +264,10 @@ mod test { mod v0_34 { use super::*; - use crate::event::v0_34::DialectEvent; + use crate::event::v0_34::DeEvent; async fn read_event(name: &str) -> Event { - let msg = DialectEvent::from_string(read_json_fixture("v0_34", name).await).unwrap(); + let msg = DeEvent::from_string(read_json_fixture("v0_34", name).await).unwrap(); msg.into() } @@ -332,10 +332,10 @@ mod test { mod v0_37 { use super::*; - use crate::event::latest::DialectEvent; + use crate::event::v0_37::DeEvent; async fn read_event(name: &str) -> Event { - let msg = DialectEvent::from_string(read_json_fixture("v0_37", name).await).unwrap(); + let msg = DeEvent::from_string(read_json_fixture("v0_37", name).await).unwrap(); msg.into() } diff --git a/rpc/src/client/transport/router.rs b/rpc/src/client/transport/router.rs index b5fe98ed2..4a27a606a 100644 --- a/rpc/src/client/transport/router.rs +++ b/rpc/src/client/transport/router.rs @@ -229,7 +229,7 @@ mod test { mod v0_37 { use super::*; - type WrappedEvent = crate::response::Wrapper; + type WrappedEvent = crate::response::Wrapper; async fn read_event(name: &str) -> Event { serde_json::from_str::(read_json_fixture("v0_37", name).await.as_str()) diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index 9279da5b3..b5bd20056 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -883,8 +883,8 @@ impl WebSocketClientDriver { async fn handle_text_msg(&mut self, msg: String) -> Result<(), Error> { let parse_res = match self.compat { - CompatMode::V0_37 => event::v0_37::DialectEvent::from_string(&msg).map(Into::into), - CompatMode::V0_34 => event::v0_34::DialectEvent::from_string(&msg).map(Into::into), + CompatMode::V0_37 => event::v0_37::DeEvent::from_string(&msg).map(Into::into), + CompatMode::V0_34 => event::v0_34::DeEvent::from_string(&msg).map(Into::into), }; if let Ok(ev) = parse_res { debug!("JSON-RPC event: {}", msg); @@ -1214,11 +1214,11 @@ mod test { }; match self.compat { CompatMode::V0_37 => { - let ev: event::v0_37::DialectEvent = ev.into(); + let ev: event::v0_37::SerEvent = ev.into(); self.send(subs_id, ev).await; }, CompatMode::V0_34 => { - let ev: event::v0_34::DialectEvent = ev.into(); + let ev: event::v0_34::SerEvent = ev.into(); self.send(subs_id, ev).await; }, } @@ -1298,7 +1298,7 @@ mod test { async fn send(&mut self, id: Id, res: R) where - R: Response, + R: Serialize, { self.conn .send(Message::Text( @@ -1333,10 +1333,10 @@ mod test { mod v0_34 { use super::*; - use crate::event::v0_34::DialectEvent; + use crate::event::v0_34::DeEvent; async fn read_event(name: &str) -> Event { - DialectEvent::from_string(read_json_fixture("v0_34", name).await) + DeEvent::from_string(read_json_fixture("v0_34", name).await) .unwrap() .into() } @@ -1400,10 +1400,10 @@ mod test { mod v0_37 { use super::*; - use crate::event::latest::DialectEvent; + use crate::event::v0_37::DeEvent; async fn read_event(name: &str) -> Event { - DialectEvent::from_string(read_json_fixture("v0_37", name).await) + DeEvent::from_string(read_json_fixture("v0_37", name).await) .unwrap() .into() } @@ -1467,10 +1467,10 @@ mod test { mod v0_38 { use super::*; - use crate::event::latest::DialectEvent; + use crate::event::v0_38::DeEvent; async fn read_event(name: &str) -> Event { - DialectEvent::from_string(read_json_fixture("v0_38", name).await) + DeEvent::from_string(read_json_fixture("v0_38", name).await) .unwrap() .into() } diff --git a/rpc/src/event.rs b/rpc/src/event.rs index aee6bf58e..dfbfa5ba4 100644 --- a/rpc/src/event.rs +++ b/rpc/src/event.rs @@ -94,6 +94,9 @@ pub mod v0_34 { pub events: Option>>, } + pub type DeEvent = DialectEvent; + pub type SerEvent = DialectEvent; + impl Response for DialectEvent {} impl From for Event { @@ -248,8 +251,8 @@ pub mod v0_34 { } } -/// Serialization helpers for the RPC protocol used since CometBFT 0.37 -pub mod latest { +/// Shared serialization/deserialization helpers for the RPC protocol used since CometBFT 0.37 +mod latest { use super::{Event, EventData, TxInfo, TxResult}; use crate::prelude::*; use crate::{serializers, Response}; @@ -258,20 +261,20 @@ pub mod latest { use tendermint::abci::Event as RpcEvent; use tendermint::{abci, block, Block}; - #[derive(Serialize, Deserialize, Debug)] - pub struct DialectEvent { + #[derive(Deserialize, Debug)] + pub struct DeEvent { /// The query that produced the event. pub query: String, /// The data associated with the event. - pub data: DialectEventData, + pub data: DeEventData, /// Event type and attributes map. pub events: Option>>, } - impl Response for DialectEvent {} + impl Response for DeEvent {} - impl From for Event { - fn from(msg: DialectEvent) -> Self { + impl From for Event { + fn from(msg: DeEvent) -> Self { Event { query: msg.query, data: msg.data.into(), @@ -280,30 +283,21 @@ pub mod latest { } } - impl From for DialectEvent { - fn from(msg: Event) -> Self { - DialectEvent { - query: msg.query, - data: msg.data.into(), - events: msg.events, - } - } - } - - #[derive(Serialize, Deserialize, Debug)] + /// Helper used to deserialize [`EventData`] for CometBFT RPC since 0.37 + #[derive(Deserialize, Debug)] #[serde(tag = "type", content = "value")] #[allow(clippy::large_enum_variant)] - pub enum DialectEventData { + pub enum DeEventData { #[serde(alias = "tendermint/event/NewBlock")] NewBlock { block: Option>, - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(default)] result_begin_block: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(default)] result_end_block: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(default)] block_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(default)] result_finalize_block: Option, }, #[serde(alias = "tendermint/event/Tx")] @@ -314,10 +308,10 @@ pub mod latest { GenericJsonEvent(serde_json::Value), } - impl From for EventData { - fn from(msg: DialectEventData) -> Self { + impl From for EventData { + fn from(msg: DeEventData) -> Self { match msg { - DialectEventData::NewBlock { + DeEventData::NewBlock { block, block_id: Some(block_id), result_finalize_block, @@ -328,7 +322,7 @@ pub mod latest { block_id, result_finalize_block, }, - DialectEventData::NewBlock { + DeEventData::NewBlock { block, result_begin_block, result_end_block, @@ -339,45 +333,10 @@ pub mod latest { result_begin_block: result_begin_block.map(Into::into), result_end_block: result_end_block.map(Into::into), }, - DialectEventData::Tx { tx_result } => EventData::Tx { - tx_result: tx_result.into(), - }, - DialectEventData::GenericJsonEvent(v) => EventData::GenericJsonEvent(v), - } - } - } - - impl From for DialectEventData { - fn from(msg: EventData) -> Self { - match msg { - EventData::NewBlock { - block, - block_id, - result_finalize_block, - } => DialectEventData::NewBlock { - block, - block_id: Some(block_id), - result_finalize_block, - result_begin_block: None, - result_end_block: None, - }, - // This variant should not be used since 0.38, but we're using - // this impl only for the mock server. - EventData::LegacyNewBlock { - block, - result_begin_block, - result_end_block, - } => DialectEventData::NewBlock { - block, - block_id: None, - result_finalize_block: None, - result_begin_block: result_begin_block.map(Into::into), - result_end_block: result_end_block.map(Into::into), - }, - EventData::Tx { tx_result } => DialectEventData::Tx { + DeEventData::Tx { tx_result } => EventData::Tx { tx_result: tx_result.into(), }, - EventData::GenericJsonEvent(v) => DialectEventData::GenericJsonEvent(v), + DeEventData::GenericJsonEvent(v) => EventData::GenericJsonEvent(v), } } } @@ -445,10 +404,160 @@ pub mod latest { } } +/// Serialization helpers for the RPC protocol used in CometBFT 0.37 pub mod v0_37 { + use super::{Event, EventData}; + use crate::prelude::*; + use alloc::collections::BTreeMap as HashMap; + use serde::Serialize; + use tendermint::{abci, Block}; + pub use super::latest::*; + + #[derive(Serialize, Debug)] + pub struct SerEvent { + /// The query that produced the event. + pub query: String, + /// The data associated with the event. + pub data: SerEventData, + /// Event type and attributes map. + pub events: Option>>, + } + + impl From for SerEvent { + fn from(msg: Event) -> Self { + SerEvent { + query: msg.query, + data: msg.data.into(), + events: msg.events, + } + } + } + + #[derive(Serialize, Debug)] + #[serde(tag = "type", content = "value")] + pub enum SerEventData { + #[serde(alias = "tendermint/event/NewBlock")] + NewBlock { + block: Option>, + result_begin_block: Option, + result_end_block: Option, + }, + #[serde(alias = "tendermint/event/Tx")] + Tx { + #[serde(rename = "TxResult")] + tx_result: DialectTxInfo, + }, + GenericJsonEvent(serde_json::Value), + } + + impl From for SerEventData { + fn from(msg: EventData) -> Self { + match msg { + // This variant should not be used in 0.37, but the conversion + // must be infallible. + EventData::NewBlock { + block, + block_id: _, + result_finalize_block: _, + } => SerEventData::NewBlock { + block, + result_begin_block: None, + result_end_block: None, + }, + EventData::LegacyNewBlock { + block, + result_begin_block, + result_end_block, + } => SerEventData::NewBlock { + block, + result_begin_block: result_begin_block.map(Into::into), + result_end_block: result_end_block.map(Into::into), + }, + EventData::Tx { tx_result } => SerEventData::Tx { + tx_result: tx_result.into(), + }, + EventData::GenericJsonEvent(v) => SerEventData::GenericJsonEvent(v), + } + } + } } +/// Serialization helpers for the RPC protocol used in CometBFT 0.38 pub mod v0_38 { + use super::{Event, EventData}; + use crate::prelude::*; + use alloc::collections::BTreeMap as HashMap; + use serde::Serialize; + use tendermint::{abci, block, Block}; + pub use super::latest::*; + + #[derive(Serialize, Debug)] + pub struct SerEvent { + /// The query that produced the event. + pub query: String, + /// The data associated with the event. + pub data: SerEventData, + /// Event type and attributes map. + pub events: Option>>, + } + + impl From for SerEvent { + fn from(msg: Event) -> Self { + SerEvent { + query: msg.query, + data: msg.data.into(), + events: msg.events, + } + } + } + + #[derive(Serialize, Debug)] + #[serde(tag = "type", content = "value")] + pub enum SerEventData { + #[serde(alias = "tendermint/event/NewBlock")] + NewBlock { + block: Option>, + block_id: block::Id, + result_finalize_block: Option, + }, + #[serde(alias = "tendermint/event/Tx")] + Tx { + #[serde(rename = "TxResult")] + tx_result: DialectTxInfo, + }, + GenericJsonEvent(serde_json::Value), + } + + impl From for SerEventData { + fn from(msg: EventData) -> Self { + match msg { + EventData::NewBlock { + block, + block_id, + result_finalize_block, + } => SerEventData::NewBlock { + block, + block_id, + result_finalize_block, + }, + // This variant should not be used in 0.38, but the conversion + // must be infallible. + EventData::LegacyNewBlock { + block, + result_begin_block: _, + result_end_block: _, + } => SerEventData::NewBlock { + block, + block_id: Default::default(), + result_finalize_block: None, + }, + EventData::Tx { tx_result } => SerEventData::Tx { + tx_result: tx_result.into(), + }, + EventData::GenericJsonEvent(v) => SerEventData::GenericJsonEvent(v), + } + } + } } diff --git a/rpc/src/response.rs b/rpc/src/response.rs index 8abfb4d9b..09d234615 100644 --- a/rpc/src/response.rs +++ b/rpc/src/response.rs @@ -7,7 +7,7 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize}; use crate::{response_error::ResponseError, Error, Id, Version}; /// JSON-RPC responses -pub trait Response: Serialize + DeserializeOwned + Sized { +pub trait Response: DeserializeOwned + Sized { /// Parse a JSON-RPC response from a JSON string fn from_string(response: impl AsRef<[u8]>) -> Result { let wrapper: Wrapper = @@ -38,10 +38,7 @@ pub struct Wrapper { error: Option, } -impl Wrapper -where - R: Response, -{ +impl Wrapper { /// Get JSON-RPC version pub fn version(&self) -> &Version { &self.jsonrpc diff --git a/rpc/tests/kvstore_fixtures/v0_37.rs b/rpc/tests/kvstore_fixtures/v0_37.rs index 7a6a9c6ed..71f8f1078 100644 --- a/rpc/tests/kvstore_fixtures/v0_37.rs +++ b/rpc/tests/kvstore_fixtures/v0_37.rs @@ -256,7 +256,7 @@ fn outgoing_fixtures() { #[test] fn incoming_fixtures() { - use tendermint_rpc::event::{latest::DialectEvent, EventData}; + use tendermint_rpc::event::{v0_37::DeEvent, EventData}; let empty_merkle_root_hash = Some( tendermint::Hash::from_hex_upper( @@ -786,7 +786,7 @@ fn incoming_fixtures() { } }, "subscribe_newblock_0" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::LegacyNewBlock { block, result_begin_block, @@ -841,7 +841,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_1" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::LegacyNewBlock { block, result_begin_block, @@ -918,7 +918,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_2" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::LegacyNewBlock { block, result_begin_block, @@ -973,7 +973,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_3" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::LegacyNewBlock { block, result_begin_block, @@ -1028,7 +1028,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_4" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::LegacyNewBlock { block, result_begin_block, @@ -1086,7 +1086,7 @@ fn incoming_fixtures() { assert!(endpoint::subscribe::Response::from_string(content).is_ok()); }, "subscribe_txs_0" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1118,7 +1118,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_1" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1151,7 +1151,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_2" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1183,7 +1183,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_3" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1215,7 +1215,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_4" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; diff --git a/rpc/tests/kvstore_fixtures/v0_38.rs b/rpc/tests/kvstore_fixtures/v0_38.rs index e3319ea02..e1d314390 100644 --- a/rpc/tests/kvstore_fixtures/v0_38.rs +++ b/rpc/tests/kvstore_fixtures/v0_38.rs @@ -256,7 +256,7 @@ fn outgoing_fixtures() { #[test] fn incoming_fixtures() { - use tendermint_rpc::event::{latest::DialectEvent, EventData}; + use tendermint_rpc::event::{v0_38::DeEvent, EventData}; let empty_merkle_root_hash = Some( tendermint::Hash::from_hex_upper( @@ -786,7 +786,7 @@ fn incoming_fixtures() { } }, "subscribe_newblock_0" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::NewBlock { block, block_id, @@ -844,7 +844,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_1" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::NewBlock { block, block_id, @@ -902,7 +902,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_2" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::NewBlock { block, block_id, @@ -960,7 +960,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_3" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::NewBlock { block, block_id, @@ -1018,7 +1018,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'NewBlock'"); }, "subscribe_newblock_4" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); if let EventData::NewBlock { block, block_id, @@ -1079,7 +1079,7 @@ fn incoming_fixtures() { assert!(endpoint::subscribe::Response::from_string(content).is_ok()); }, "subscribe_txs_0" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1111,7 +1111,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_1" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1144,7 +1144,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_2" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1176,7 +1176,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_3" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; @@ -1208,7 +1208,7 @@ fn incoming_fixtures() { assert_eq!(result.query, "tm.event = 'Tx'"); }, "subscribe_txs_4" => { - let result = DialectEvent::from_string(content).unwrap(); + let result = DeEvent::from_string(content).unwrap(); let height; if let EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; From 569db8c7bfb69fe7bde2e42248a723b3addac92a Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 7 Jun 2023 01:10:36 +0300 Subject: [PATCH 24/27] rpc: 0.37 serialization for /broadcast_tx_commit Provide v0_37::DialectResponse as a way to serialize responses in the 0.37 JSON format. --- rpc/src/client/bin/main.rs | 2 ++ rpc/src/endpoint/broadcast/tx_commit.rs | 37 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/rpc/src/client/bin/main.rs b/rpc/src/client/bin/main.rs index 4dd2a504a..d53de8602 100644 --- a/rpc/src/client/bin/main.rs +++ b/rpc/src/client/bin/main.rs @@ -376,6 +376,8 @@ where .map_err(Error::serde)? }, ClientRequest::BroadcastTxCommit { tx } => { + // NOTE: this prints out the response in the 0.38+ format, + // regardless of the actual protocol version. serde_json::to_string_pretty(&client.broadcast_tx_commit(tx).await?) .map_err(Error::serde)? }, diff --git a/rpc/src/endpoint/broadcast/tx_commit.rs b/rpc/src/endpoint/broadcast/tx_commit.rs index 6c49ca773..a1ffd5ee7 100644 --- a/rpc/src/endpoint/broadcast/tx_commit.rs +++ b/rpc/src/endpoint/broadcast/tx_commit.rs @@ -108,3 +108,40 @@ pub mod v0_34 { } } } + +/// Serialization for /broadcast_tx_commit endpoint format in CometBFT 0.37 +pub mod v0_37 { + use super::Response; + use crate::dialect; + use serde::{Deserialize, Serialize}; + use tendermint::{abci::Event, block, Hash}; + + /// RPC dialect helper for serialization of the response. + #[derive(Debug, Deserialize, Serialize)] + pub struct DialectResponse { + /// `CheckTx` result + pub check_tx: dialect::CheckTx, + + /// `DeliverTx` result + pub deliver_tx: dialect::DeliverTx, + + /// Transaction + pub hash: Hash, + + /// Height + pub height: block::Height, + } + + impl crate::Response for DialectResponse {} + + impl From for Response { + fn from(msg: DialectResponse) -> Self { + Self { + check_tx: msg.check_tx.into(), + tx_result: msg.deliver_tx.into(), + hash: msg.hash, + height: msg.height, + } + } + } +} From 8d58a1deedf3c97a76ac112339b65a0c037e656f Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 7 Jun 2023 12:16:36 +0300 Subject: [PATCH 25/27] rpc: Fix 0.38 websocket test by proper emulation Use the exact protocol version to serialize test server responses as appropriate. No new variant is added to CompatMode, as that is a client-side setting and the client is able to cope with both versions dynamically. --- rpc/src/client/transport/websocket.rs | 47 +++++++++++++++++---------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index b5bd20056..ebc270f06 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -1034,8 +1034,17 @@ mod test { event_tx: ChannelTx, } + // A setting telling which of the CometBFT server versions to emulate + // with the test server. + #[derive(Copy, Clone)] + enum TestRpcVersion { + V0_34, + V0_37, + V0_38, + } + impl TestServer { - async fn new(addr: &str, compat: CompatMode) -> Self { + async fn new(addr: &str, version: TestRpcVersion) -> Self { let listener = TcpListener::bind(addr).await.unwrap(); let local_addr = listener.local_addr().unwrap(); let node_addr = net::Address::Tcp { @@ -1045,7 +1054,7 @@ mod test { }; let (terminate_tx, terminate_rx) = unbounded(); let (event_tx, event_rx) = unbounded(); - let driver = TestServerDriver::new(listener, compat, event_rx, terminate_rx); + let driver = TestServerDriver::new(listener, version, event_rx, terminate_rx); let driver_hdl = tokio::spawn(async move { driver.run().await }); Self { node_addr, @@ -1068,7 +1077,7 @@ mod test { // Manages all incoming WebSocket connections. struct TestServerDriver { listener: TcpListener, - compat: CompatMode, + version: TestRpcVersion, event_rx: ChannelRx, terminate_rx: ChannelRx>, handlers: Vec, @@ -1077,13 +1086,13 @@ mod test { impl TestServerDriver { fn new( listener: TcpListener, - compat: CompatMode, + version: TestRpcVersion, event_rx: ChannelRx, terminate_rx: ChannelRx>, ) -> Self { Self { listener, - compat, + version, event_rx, terminate_rx, handlers: Vec::new(), @@ -1116,7 +1125,7 @@ mod test { async fn handle_incoming(&mut self, stream: TcpStream) { self.handlers - .push(TestServerHandler::new(stream, self.compat).await); + .push(TestServerHandler::new(stream, self.version).await); } async fn terminate(&mut self) { @@ -1139,12 +1148,12 @@ mod test { } impl TestServerHandler { - async fn new(stream: TcpStream, compat: CompatMode) -> Self { + async fn new(stream: TcpStream, version: TestRpcVersion) -> Self { let conn: WebSocketStream> = accept_async(stream).await.unwrap(); let (terminate_tx, terminate_rx) = unbounded(); let (event_tx, event_rx) = unbounded(); - let driver = TestServerHandlerDriver::new(conn, compat, event_rx, terminate_rx); + let driver = TestServerHandlerDriver::new(conn, version, event_rx, terminate_rx); let driver_hdl = tokio::spawn(async move { driver.run().await }); Self { driver_hdl, @@ -1166,7 +1175,7 @@ mod test { // Manages interaction with a single incoming WebSocket connection. struct TestServerHandlerDriver { conn: WebSocketStream>, - compat: CompatMode, + version: TestRpcVersion, event_rx: ChannelRx, terminate_rx: ChannelRx>, // A mapping of subscription queries to subscription IDs for this @@ -1177,13 +1186,13 @@ mod test { impl TestServerHandlerDriver { fn new( conn: WebSocketStream>, - compat: CompatMode, + version: TestRpcVersion, event_rx: ChannelRx, terminate_rx: ChannelRx>, ) -> Self { Self { conn, - compat, + version, event_rx, terminate_rx, subscriptions: HashMap::new(), @@ -1212,12 +1221,16 @@ mod test { Some(id) => Id::Str(id.clone()), None => return, }; - match self.compat { - CompatMode::V0_37 => { + match self.version { + TestRpcVersion::V0_38 => { + let ev: event::v0_38::SerEvent = ev.into(); + self.send(subs_id, ev).await; + }, + TestRpcVersion::V0_37 => { let ev: event::v0_37::SerEvent = ev.into(); self.send(subs_id, ev).await; }, - CompatMode::V0_34 => { + TestRpcVersion::V0_34 => { let ev: event::v0_34::SerEvent = ev.into(); self.send(subs_id, ev).await; }, @@ -1349,7 +1362,7 @@ mod test { let test_events = vec![event1, event2, event3]; println!("Starting WebSocket server..."); - let mut server = TestServer::new("127.0.0.1:0", CompatMode::V0_34).await; + let mut server = TestServer::new("127.0.0.1:0", TestRpcVersion::V0_34).await; println!("Creating client RPC WebSocket connection..."); let url = server.node_addr.clone().try_into().unwrap(); let (client, driver) = WebSocketClient::builder(url) @@ -1416,7 +1429,7 @@ mod test { let test_events = vec![event1, event2, event3]; println!("Starting WebSocket server..."); - let mut server = TestServer::new("127.0.0.1:0", CompatMode::V0_37).await; + let mut server = TestServer::new("127.0.0.1:0", TestRpcVersion::V0_37).await; println!("Creating client RPC WebSocket connection..."); let url = server.node_addr.clone().try_into().unwrap(); let (client, driver) = WebSocketClient::builder(url) @@ -1483,7 +1496,7 @@ mod test { let test_events = vec![event1, event2, event3]; println!("Starting WebSocket server..."); - let mut server = TestServer::new("127.0.0.1:0", CompatMode::V0_37).await; + let mut server = TestServer::new("127.0.0.1:0", TestRpcVersion::V0_38).await; println!("Creating client RPC WebSocket connection..."); let url = server.node_addr.clone().try_into().unwrap(); let (client, driver) = WebSocketClient::builder(url) From 51e47d00219d43e3334e6c0b0ecca6c1d2356b2d Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 12 Jun 2023 14:42:13 +0300 Subject: [PATCH 26/27] Remove a FIXME comment No opinions have been expressed about any canonical way to serialize app hashes, so the explicit serializer helper should be there for now. --- tendermint/src/abci/response/finalize_block.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tendermint/src/abci/response/finalize_block.rs b/tendermint/src/abci/response/finalize_block.rs index 155e33284..124ce1aca 100644 --- a/tendermint/src/abci/response/finalize_block.rs +++ b/tendermint/src/abci/response/finalize_block.rs @@ -20,8 +20,7 @@ pub struct FinalizeBlock { /// Updates to the consensus params, if any. #[serde(default)] pub consensus_param_updates: Option, - // FIXME: decide if base64 is the canonical serialization for AppHash, - // and implement Serialize/Deserialize on the type accordingly? + /// The hash of the application's state. #[serde(default, with = "serializers::apphash_base64")] pub app_hash: AppHash, } From 18ccbccaedd8c356d44afeb6da166b3ee7f54717 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 14 Jun 2023 13:35:11 +0300 Subject: [PATCH 27/27] rpc: add new fields to 0.38 fixture test --- rpc/tests/kvstore_fixtures/v0_38.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rpc/tests/kvstore_fixtures/v0_38.rs b/rpc/tests/kvstore_fixtures/v0_38.rs index e1d314390..b2e39b8a6 100644 --- a/rpc/tests/kvstore_fixtures/v0_38.rs +++ b/rpc/tests/kvstore_fixtures/v0_38.rs @@ -699,6 +699,18 @@ fn incoming_fixtures() { ); assert_eq!(result.node_info.version.to_string(), "0.38.0-alpha.1"); assert!(!result.sync_info.catching_up); + assert_eq!(result.sync_info.earliest_app_hash.as_bytes(), &[0u8; 8]); + assert!(!result.sync_info.earliest_block_hash.is_empty()); + assert_eq!(result.sync_info.earliest_block_height.value(), 1); + assert!( + result + .sync_info + .earliest_block_time + .duration_since(informal_epoch) + .unwrap() + .as_secs() + > 0 + ); assert_eq!( result.sync_info.latest_app_hash.as_bytes(), [6, 0, 0, 0, 0, 0, 0, 0]