-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: split out tm lc, bera lc, cometbft rpc, and galois rpc types
- Loading branch information
Showing
133 changed files
with
3,226 additions
and
3,265 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[package] | ||
edition.workspace = true | ||
license-file.workspace = true | ||
name = "cometbft-types" | ||
repository.workspace = true | ||
version = "0.1.0" | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
prost = { workspace = true, optional = true } | ||
protos = { workspace = true, features = ["tendermint+abci", "tendermint+blocksync", "tendermint+consensus", "tendermint+crypto", "tendermint+p2p", "tendermint+privval", "tendermint+statesync", "tendermint+store", "tendermint+types", "tendermint+version"], optional = true } | ||
serde-utils.workspace = true | ||
serde.workspace = true | ||
sha2 = { workspace = true, optional = true } | ||
thiserror.workspace = true | ||
unionlabs = { workspace = true } | ||
|
||
[dev-dependencies] | ||
cometbft-types = { workspace = true, features = ["proto"] } | ||
hex-literal.workspace = true | ||
serde_json = { workspace = true } | ||
unionlabs = { workspace = true, features = ["test_utils"] } | ||
|
||
[features] | ||
default = ["proto", "hash"] | ||
hash = ["dep:sha2", "dep:prost"] | ||
proto = ["dep:protos"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use crate::abci::event_attribute::EventAttribute; | ||
|
||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
pub struct Event { | ||
pub ty: String, | ||
pub attributes: Vec<EventAttribute>, | ||
} | ||
|
||
#[cfg(feature = "proto")] | ||
pub mod proto { | ||
use crate::abci::event::Event; | ||
|
||
impl From<protos::tendermint::abci::Event> for Event { | ||
fn from(value: protos::tendermint::abci::Event) -> Self { | ||
Self { | ||
ty: value.r#type, | ||
attributes: value.attributes.into_iter().map(Into::into).collect(), | ||
} | ||
} | ||
} | ||
|
||
impl From<Event> for protos::tendermint::abci::Event { | ||
fn from(value: Event) -> Self { | ||
Self { | ||
r#type: value.ty, | ||
attributes: value.attributes.into_iter().map(Into::into).collect(), | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
pub struct EventAttribute { | ||
pub key: String, | ||
pub value: String, | ||
/// nondeterministic | ||
pub index: bool, | ||
} | ||
|
||
#[cfg(feature = "proto")] | ||
pub mod proto { | ||
use crate::abci::event_attribute::EventAttribute; | ||
|
||
impl From<protos::tendermint::abci::EventAttribute> for EventAttribute { | ||
fn from(value: protos::tendermint::abci::EventAttribute) -> Self { | ||
Self { | ||
key: value.key, | ||
value: value.value, | ||
index: value.index, | ||
} | ||
} | ||
} | ||
|
||
impl From<EventAttribute> for protos::tendermint::abci::EventAttribute { | ||
fn from(value: EventAttribute) -> Self { | ||
Self { | ||
key: value.key, | ||
value: value.value, | ||
index: value.index, | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.