Skip to content

Commit

Permalink
Use tendermint proto from tendermint_proto instead of `tendermint_p…
Browse files Browse the repository at this point in the history
…roto::v0_34`
  • Loading branch information
romac committed Aug 15, 2024
1 parent e94cc1b commit f349533
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct TxResponse {
///
/// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45
#[prost(message, repeated, tag = "13")]
pub events: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::Event>,
pub events: ::prost::alloc::vec::Vec<::tendermint_proto::abci::Event>,
}
impl ::prost::Name for TxResponse {
const NAME: &'static str = "TxResponse";
Expand Down Expand Up @@ -148,7 +148,7 @@ pub struct Result {
/// Events contains a slice of Event objects that were emitted during message
/// or handler execution.
#[prost(message, repeated, tag = "3")]
pub events: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::Event>,
pub events: ::prost::alloc::vec::Vec<::tendermint_proto::abci::Event>,
/// msg_responses contains the Msg handler responses type packed in Anys.
///
/// Since: cosmos-sdk 0.46
Expand Down Expand Up @@ -269,7 +269,7 @@ pub struct SearchBlocksResult {
pub limit: i64,
/// List of blocks in current page
#[prost(message, repeated, tag = "6")]
pub blocks: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::types::Block>,
pub blocks: ::prost::alloc::vec::Vec<::tendermint_proto::types::Block>,
}
impl ::prost::Name for SearchBlocksResult {
const NAME: &'static str = "SearchBlocksResult";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ pub struct Block {
#[prost(message, optional, tag = "1")]
pub header: ::core::option::Option<Header>,
#[prost(message, optional, tag = "2")]
pub data: ::core::option::Option<::tendermint_proto::v0_34::types::Data>,
pub data: ::core::option::Option<::tendermint_proto::types::Data>,
#[prost(message, optional, tag = "3")]
pub evidence: ::core::option::Option<::tendermint_proto::v0_34::types::EvidenceList>,
pub evidence: ::core::option::Option<::tendermint_proto::types::EvidenceList>,
#[prost(message, optional, tag = "4")]
pub last_commit: ::core::option::Option<::tendermint_proto::v0_34::types::Commit>,
pub last_commit: ::core::option::Option<::tendermint_proto::types::Commit>,
}
impl ::prost::Name for Block {
const NAME: &'static str = "Block";
Expand All @@ -26,7 +26,7 @@ impl ::prost::Name for Block {
pub struct Header {
/// basic block info
#[prost(message, optional, tag = "1")]
pub version: ::core::option::Option<::tendermint_proto::v0_34::version::Consensus>,
pub version: ::core::option::Option<::tendermint_proto::version::Consensus>,
#[prost(string, tag = "2")]
pub chain_id: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
Expand All @@ -35,7 +35,7 @@ pub struct Header {
pub time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>,
/// prev block info
#[prost(message, optional, tag = "5")]
pub last_block_id: ::core::option::Option<::tendermint_proto::v0_34::types::BlockId>,
pub last_block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
/// hashes of block data
///
/// commit from validators from the last block
Expand Down Expand Up @@ -190,10 +190,10 @@ impl ::prost::Name for GetBlockByHeightRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBlockByHeightResponse {
#[prost(message, optional, tag = "1")]
pub block_id: ::core::option::Option<::tendermint_proto::v0_34::types::BlockId>,
pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
/// Deprecated: please use `sdk_block` instead
#[prost(message, optional, tag = "2")]
pub block: ::core::option::Option<::tendermint_proto::v0_34::types::Block>,
pub block: ::core::option::Option<::tendermint_proto::types::Block>,
/// Since: cosmos-sdk 0.47
#[prost(message, optional, tag = "3")]
pub sdk_block: ::core::option::Option<Block>,
Expand Down Expand Up @@ -221,10 +221,10 @@ impl ::prost::Name for GetLatestBlockRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLatestBlockResponse {
#[prost(message, optional, tag = "1")]
pub block_id: ::core::option::Option<::tendermint_proto::v0_34::types::BlockId>,
pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
/// Deprecated: please use `sdk_block` instead
#[prost(message, optional, tag = "2")]
pub block: ::core::option::Option<::tendermint_proto::v0_34::types::Block>,
pub block: ::core::option::Option<::tendermint_proto::types::Block>,
/// Since: cosmos-sdk 0.47
#[prost(message, optional, tag = "3")]
pub sdk_block: ::core::option::Option<Block>,
Expand Down Expand Up @@ -277,7 +277,7 @@ impl ::prost::Name for GetNodeInfoRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNodeInfoResponse {
#[prost(message, optional, tag = "1")]
pub default_node_info: ::core::option::Option<::tendermint_proto::v0_34::p2p::DefaultNodeInfo>,
pub default_node_info: ::core::option::Option<::tendermint_proto::p2p::DefaultNodeInfo>,
#[prost(message, optional, tag = "2")]
pub application_version: ::core::option::Option<VersionInfo>,
}
Expand Down
10 changes: 5 additions & 5 deletions cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct QueryParamsResponse {
/// Please note that `params.version` is not populated in this response, it is
/// tracked separately in the x/upgrade module.
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<::tendermint_proto::v0_34::types::ConsensusParams>,
pub params: ::core::option::Option<::tendermint_proto::types::ConsensusParams>,
}
impl ::prost::Name for QueryParamsResponse {
const NAME: &'static str = "QueryParamsResponse";
Expand All @@ -40,14 +40,14 @@ pub struct MsgUpdateParams {
///
/// NOTE: All parameters must be supplied.
#[prost(message, optional, tag = "2")]
pub block: ::core::option::Option<::tendermint_proto::v0_34::types::BlockParams>,
pub block: ::core::option::Option<::tendermint_proto::types::BlockParams>,
#[prost(message, optional, tag = "3")]
pub evidence: ::core::option::Option<::tendermint_proto::v0_34::types::EvidenceParams>,
pub evidence: ::core::option::Option<::tendermint_proto::types::EvidenceParams>,
#[prost(message, optional, tag = "4")]
pub validator: ::core::option::Option<::tendermint_proto::v0_34::types::ValidatorParams>,
pub validator: ::core::option::Option<::tendermint_proto::types::ValidatorParams>,
/// Since: cosmos-sdk 0.50
#[prost(message, optional, tag = "5")]
pub abci: ::core::option::Option<::tendermint_proto::v0_34::types::AbciParams>,
pub abci: ::core::option::Option<::tendermint_proto::types::AbciParams>,
}
impl ::prost::Name for MsgUpdateParams {
const NAME: &'static str = "MsgUpdateParams";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl AuthorizationType {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HistoricalInfo {
#[prost(message, optional, tag = "1")]
pub header: ::core::option::Option<::tendermint_proto::v0_34::types::Header>,
pub header: ::core::option::Option<::tendermint_proto::types::Header>,
#[prost(message, repeated, tag = "2")]
pub valset: ::prost::alloc::vec::Vec<Validator>,
}
Expand Down Expand Up @@ -566,7 +566,7 @@ impl ::prost::Name for Pool {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidatorUpdates {
#[prost(message, repeated, tag = "1")]
pub updates: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::ValidatorUpdate>,
pub updates: ::prost::alloc::vec::Vec<::tendermint_proto::abci::ValidatorUpdate>,
}
impl ::prost::Name for ValidatorUpdates {
const NAME: &'static str = "ValidatorUpdates";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListenFinalizeBlockRequest {
#[prost(message, optional, tag = "1")]
pub req: ::core::option::Option<::tendermint_proto::v0_34::abci::RequestFinalizeBlock>,
pub req: ::core::option::Option<::tendermint_proto::abci::RequestFinalizeBlock>,
#[prost(message, optional, tag = "2")]
pub res: ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseFinalizeBlock>,
pub res: ::core::option::Option<::tendermint_proto::abci::ResponseFinalizeBlock>,
}
impl ::prost::Name for ListenFinalizeBlockRequest {
const NAME: &'static str = "ListenFinalizeBlockRequest";
Expand Down Expand Up @@ -34,7 +34,7 @@ pub struct ListenCommitRequest {
#[prost(int64, tag = "1")]
pub block_height: i64,
#[prost(message, optional, tag = "2")]
pub res: ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseCommit>,
pub res: ::core::option::Option<::tendermint_proto::abci::ResponseCommit>,
#[prost(message, repeated, tag = "3")]
pub change_set: ::prost::alloc::vec::Vec<super::super::v1beta1::StoreKvPair>,
}
Expand Down
6 changes: 3 additions & 3 deletions cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ impl ::prost::Name for StoreKvPair {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockMetadata {
#[prost(message, optional, tag = "6")]
pub response_commit: ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseCommit>,
pub response_commit: ::core::option::Option<::tendermint_proto::abci::ResponseCommit>,
#[prost(message, optional, tag = "7")]
pub request_finalize_block:
::core::option::Option<::tendermint_proto::v0_34::abci::RequestFinalizeBlock>,
::core::option::Option<::tendermint_proto::abci::RequestFinalizeBlock>,
/// TODO: should we renumber this?
#[prost(message, optional, tag = "8")]
pub response_finalize_block:
::core::option::Option<::tendermint_proto::v0_34::abci::ResponseFinalizeBlock>,
::core::option::Option<::tendermint_proto::abci::ResponseFinalizeBlock>,
}
impl ::prost::Name for BlockMetadata {
const NAME: &'static str = "BlockMetadata";
Expand Down
4 changes: 2 additions & 2 deletions cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,9 @@ pub struct GetBlockWithTxsResponse {
#[prost(message, repeated, tag = "1")]
pub txs: ::prost::alloc::vec::Vec<Tx>,
#[prost(message, optional, tag = "2")]
pub block_id: ::core::option::Option<::tendermint_proto::v0_34::types::BlockId>,
pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
#[prost(message, optional, tag = "3")]
pub block: ::core::option::Option<::tendermint_proto::v0_34::types::Block>,
pub block: ::core::option::Option<::tendermint_proto::types::Block>,
/// pagination defines a pagination for the response.
#[prost(message, optional, tag = "4")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
Expand Down
2 changes: 1 addition & 1 deletion proto-build/buf.sdk.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:
- compile_well_known_types
- enable_type_names
- extern_path=.google.protobuf=::tendermint_proto::google::protobuf
- extern_path=.tendermint=::tendermint_proto::v0_34
- extern_path=.tendermint=::tendermint_proto
- plugin: buf.build/community/neoeinstein-prost-serde:v0.3.0
out: .
- plugin: buf.build/community/neoeinstein-tonic:v0.3.0
Expand Down
5 changes: 0 additions & 5 deletions proto-build/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ fn copy_and_patch(src: impl AsRef<Path>, dest: impl AsRef<Path>) -> io::Result<(
/// Regex substitutions to apply to the prost-generated output
// TODO(tarcieri): use prost-build/tonic-build config for this instead
const REPLACEMENTS: &[(&str, &str)] = &[
// Use `tendermint-proto` proto definitions
("(super::)+tendermint", "tendermint_proto"),
// Feature-gate gRPC client modules
(
"/// Generated client implementations.",
Expand All @@ -300,9 +298,6 @@ fn copy_and_patch(src: impl AsRef<Path>, dest: impl AsRef<Path>) -> io::Result<(
"/// Generated server implementations.\n\
#[cfg(feature = \"grpc\")]",
),
// Use `tendermint_proto` as source of `google.protobuf` types
// TODO(tarcieri): figure out what's wrong with our `buf` config and do it there
("::prost_types::", "::tendermint_proto::google::protobuf::"),
// add the feature flag to the serde definitions
(
"impl serde::Serialize for",
Expand Down

0 comments on commit f349533

Please sign in to comment.