Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed May 31, 2024
1 parent 14727a4 commit 32ccc74
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions rpc/src/event.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//! RPC subscription event-related data structures.
use alloc::collections::BTreeMap as HashMap;
use alloc::collections::BTreeMap;

use tendermint::{abci, block, Block};
use tendermint::abci;
use tendermint::{block, Block};

use crate::{prelude::*, query::EventType};
use crate::prelude::*;
use crate::query::EventType;

/// An incoming event produced by a [`Subscription`].
///
Expand All @@ -16,7 +18,7 @@ pub struct Event {
/// The data associated with the event.
pub data: EventData,
/// Event type and attributes map.
pub events: Option<HashMap<String, Vec<String>>>,
pub events: Option<BTreeMap<String, Vec<String>>>,
}

impl Event {
Expand Down Expand Up @@ -80,7 +82,7 @@ pub mod v0_34 {
use crate::dialect::v0_34::Event as RpcEvent;
use crate::prelude::*;
use crate::{dialect, serializers, Response};
use alloc::collections::BTreeMap as HashMap;
use alloc::collections::BTreeMap;
use serde::{Deserialize, Serialize};
use tendermint::Block;

Expand All @@ -91,7 +93,7 @@ pub mod v0_34 {
/// The data associated with the event.
pub data: DialectEventData,
/// Event type and attributes map.
pub events: Option<HashMap<String, Vec<String>>>,
pub events: Option<BTreeMap<String, Vec<String>>>,
}

pub type DeEvent = DialectEvent;
Expand Down Expand Up @@ -256,7 +258,7 @@ mod latest {
use super::{Event, EventData, TxInfo, TxResult};
use crate::prelude::*;
use crate::{serializers, Response};
use alloc::collections::BTreeMap as HashMap;
use alloc::collections::BTreeMap;
use serde::{Deserialize, Serialize};
use tendermint::abci::Event as RpcEvent;
use tendermint::{abci, block, Block};
Expand All @@ -268,7 +270,7 @@ mod latest {
/// The data associated with the event.
pub data: DeEventData,
/// Event type and attributes map.
pub events: Option<HashMap<String, Vec<String>>>,
pub events: Option<BTreeMap<String, Vec<String>>>,
}

impl Response for DeEvent {}
Expand Down Expand Up @@ -408,7 +410,7 @@ mod latest {
pub mod v0_37 {
use super::{Event, EventData};
use crate::prelude::*;
use alloc::collections::BTreeMap as HashMap;
use alloc::collections::BTreeMap;
use serde::Serialize;
use tendermint::{abci, Block};

Expand All @@ -421,7 +423,7 @@ pub mod v0_37 {
/// The data associated with the event.
pub data: SerEventData,
/// Event type and attributes map.
pub events: Option<HashMap<String, Vec<String>>>,
pub events: Option<BTreeMap<String, Vec<String>>>,
}

impl From<Event> for SerEvent {
Expand Down Expand Up @@ -487,7 +489,7 @@ pub mod v0_37 {
pub mod v0_38 {
use super::{Event, EventData};
use crate::prelude::*;
use alloc::collections::BTreeMap as HashMap;
use alloc::collections::BTreeMap;
use serde::Serialize;
use tendermint::{abci, block, Block};

Expand All @@ -500,7 +502,7 @@ pub mod v0_38 {
/// The data associated with the event.
pub data: SerEventData,
/// Event type and attributes map.
pub events: Option<HashMap<String, Vec<String>>>,
pub events: Option<BTreeMap<String, Vec<String>>>,
}

impl From<Event> for SerEvent {
Expand Down

0 comments on commit 32ccc74

Please sign in to comment.