diff --git a/tendermint/src/rpc.rs b/tendermint/src/rpc.rs index 79fa16e85..175c52bfc 100644 --- a/tendermint/src/rpc.rs +++ b/tendermint/src/rpc.rs @@ -5,6 +5,8 @@ mod client; pub mod endpoint; pub mod error; +// TODO(ismail): document fields or re-use the abci types +#[allow(missing_docs)] pub mod event_listener; mod id; mod method; diff --git a/tendermint/src/rpc/event_listener.rs b/tendermint/src/rpc/event_listener.rs index 9462a8543..858f37e23 100644 --- a/tendermint/src/rpc/event_listener.rs +++ b/tendermint/src/rpc/event_listener.rs @@ -101,7 +101,8 @@ impl EventListener { dbg!(&msg.to_string()); return Ok(None); } - + dbg!("received neither event nor generic string message:"); + dbg!(&msg.to_string()); Err(RPCError::new( Code::Other(-1), Some("received neither event nor generic string message".to_string()), @@ -151,26 +152,27 @@ pub type WrappedResultEvent = Wrapper; /// TX value #[derive(Serialize, Deserialize, Debug, Clone)] pub struct EventDataTx { + /// The actual TxResult #[serde(rename = "TxResult")] - tx_result: TxResult, + pub tx_result: TxResult, } /// Tx Result #[derive(Serialize, Deserialize, Debug, Clone)] pub struct TxResult { - height: String, - index: i64, - tx: String, - result: TxResultResult, + pub height: String, + pub index: i64, + pub tx: String, + pub result: TxResultResult, } /// TX Results Results #[derive(Serialize, Deserialize, Debug, Clone)] pub struct TxResultResult { - log: String, - gas_wanted: String, - gas_used: String, - events: Vec, + pub log: String, + pub gas_wanted: String, + pub gas_used: String, + pub events: Vec, } impl response::Response for TxResultResult {} @@ -178,34 +180,34 @@ impl response::Response for TxResultResult {} #[derive(Serialize, Deserialize, Debug, Clone)] pub struct TmEvent { #[serde(rename = "type")] - event_type: String, - attributes: Vec, + pub event_type: String, + pub attributes: Vec, } /// Event Attributes #[derive(Serialize, Deserialize, Debug, Clone)] pub struct Attribute { - key: String, - value: String, + pub key: String, + pub value: String, } ///Block Value #[derive(Serialize, Deserialize, Debug, Clone)] pub struct EventDataNewBlock { - block: Option, + pub block: Option, // TODO(ismail): these should be the same as abci::responses::BeginBlock // and abci::responses::EndBlock - result_begin_block: Option, - result_end_block: Option, + pub result_begin_block: Option, + pub result_end_block: Option, } /// Begin Block Events #[derive(Serialize, Deserialize, Debug, Clone)] pub struct ResultBeginBlock { - events: Option>, + pub events: Option>, } ///End Block Events #[derive(Serialize, Deserialize, Debug, Clone)] pub struct ResultEndBlock { - validator_updates: Option>>, + pub validator_updates: Option>>, }