Skip to content

Commit

Permalink
fix: align importing of celestia_tendermint_proto in celestia_tendermint
Browse files Browse the repository at this point in the history
  • Loading branch information
zvolin committed Jan 9, 2024
1 parent 5d4a4b7 commit 99b3051
Show file tree
Hide file tree
Showing 45 changed files with 84 additions and 87 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test-all-features
args: -p tendermint
args: -p celestia-tendermint

# tendermint-rpc:
# runs-on: ubuntu-latest
Expand All @@ -70,7 +70,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test-all-features
args: -p tendermint-proto
args: -p celestia-tendermint-proto

# tendermint-light-client:
# runs-on: ubuntu-latest
Expand Down
3 changes: 0 additions & 3 deletions proto/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// Re-export according to alloc::prelude::v1 because it is not yet stabilized
// https://doc.rust-lang.org/src/alloc/prelude/v1.rs.html
pub use alloc::{
borrow::ToOwned,
boxed::Box,
format,
string::{String, ToString},
vec,
vec::Vec,
};
pub use core::prelude::v1::*;
8 changes: 4 additions & 4 deletions tendermint/src/abci/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ mod v0_34 {
use crate::prelude::*;
use core::convert::{TryFrom, TryInto};

use tendermint_proto::v0_34::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<EventAttribute> for pb::EventAttribute {
fn from(event: EventAttribute) -> Self {
Expand Down Expand Up @@ -264,8 +264,8 @@ mod v0_37 {
use crate::prelude::*;
use core::convert::{TryFrom, TryInto};

use tendermint_proto::v0_37::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_37::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<EventAttribute> for pb::EventAttribute {
fn from(event: EventAttribute) -> Self {
Expand Down
8 changes: 4 additions & 4 deletions tendermint/src/abci/request/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pub struct Info {

mod v0_34 {
use super::Info;
use tendermint_proto::v0_34::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<Info> for pb::RequestInfo {
fn from(info: Info) -> Self {
Expand Down Expand Up @@ -50,8 +50,8 @@ mod v0_34 {

mod v0_37 {
use super::Info;
use tendermint_proto::v0_37::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_37::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<Info> for pb::RequestInfo {
fn from(info: Info) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/abci/request/prepare_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub struct PrepareProposal {
mod v0_34 {
use super::PrepareProposal;
use crate::{prelude::*, Error};
use tendermint_proto::v0_34::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<PrepareProposal> for pb::RequestPrepareProposal {
fn from(value: PrepareProposal) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/abci/request/process_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub struct ProcessProposal {
mod v0_34 {
use super::ProcessProposal;
use crate::{prelude::*, Error};
use tendermint_proto::v0_34::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<ProcessProposal> for pb::RequestProcessProposal {
fn from(value: ProcessProposal) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/abci/request/set_option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pub struct SetOption {

// The SetOption request has been removed after 0.34.

use tendermint_proto::v0_34::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<SetOption> for pb::RequestSetOption {
fn from(message: SetOption) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/abci/response/info.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{block, prelude::*, AppHash};
use tendermint_proto::v0_37::abci as pb;
use celestia_tendermint_proto::v0_37::abci as pb;

use serde::{Deserialize, Serialize};

Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/abci/response/prepare_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pub struct PrepareProposal {
mod v0_34 {
use super::PrepareProposal;
use crate::{prelude::*, Error};
use tendermint_proto::v0_34::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<PrepareProposal> for pb::ResponsePrepareProposal {
fn from(value: PrepareProposal) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/abci/response/process_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub enum ProcessProposalResult {
mod v0_34 {
use super::{ProcessProposal, ProcessProposalResult};
use crate::Error;
use tendermint_proto::v0_34::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<ProcessProposal> for pb::ResponseProcessProposal {
fn from(value: ProcessProposal) -> pb::ResponseProcessProposal {
Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/abci/response/set_option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub struct SetOption {

// The SetOption request has been removed after 0.34.

use tendermint_proto::v0_34::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::abci as pb;
use celestia_tendermint_proto::Protobuf;

impl From<SetOption> for pb::ResponseSetOption {
fn from(message: SetOption) -> Self {
Expand Down
8 changes: 4 additions & 4 deletions tendermint/src/abci/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ pub struct Snapshot {
mod v0_34 {
use super::{CommitInfo, Misbehavior, MisbehaviorKind, Snapshot, Validator, VoteInfo};
use crate::{prelude::*, Error};
use tendermint_proto::v0_34::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::abci as pb;
use celestia_tendermint_proto::Protobuf;

use bytes::Bytes;

Expand Down Expand Up @@ -280,8 +280,8 @@ mod v0_34 {
mod v0_37 {
use super::{CommitInfo, Misbehavior, MisbehaviorKind, Snapshot, Validator, VoteInfo};
use crate::{prelude::*, Error};
use tendermint_proto::v0_37::abci as pb;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_37::abci as pb;
use celestia_tendermint_proto::Protobuf;

use bytes::Bytes;

Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use subtle::{self, ConstantTimeEq};
use subtle_encoding::hex;

use tendermint_proto::Protobuf;
use celestia_tendermint_proto::Protobuf;

use crate::serializers::cow_str::CowStr;
use crate::{error::Error, prelude::*};
Expand Down
6 changes: 3 additions & 3 deletions tendermint/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub mod signed_header;
mod size;

use serde::{Deserialize, Serialize};
use tendermint_proto::v0_34::types::Block as RawBlock;
use celestia_tendermint_proto::v0_34::types::Block as RawBlock;

pub use self::{
commit::*,
Expand Down Expand Up @@ -53,8 +53,8 @@ pub struct Block {
mod v0_34 {
use super::{Block, Commit, Header};
use crate::{prelude::*, Error};
use tendermint_proto::v0_34::types::Block as RawBlock;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::types::Block as RawBlock;
use celestia_tendermint_proto::Protobuf;

impl Protobuf<RawBlock> for Block {}

Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/block/commit.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Commits to a Tendermint blockchain
use serde::{Deserialize, Serialize};
use tendermint_proto::v0_37::types::Commit as RawCommit;
use celestia_tendermint_proto::v0_37::types::Commit as RawCommit;

use crate::{
block::{commit_sig::CommitSig, Height, Id, Round},
Expand Down
6 changes: 3 additions & 3 deletions tendermint/src/block/data.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use tendermint_proto::v0_34::types::Data as RawData;
use celestia_tendermint_proto::v0_34::types::Data as RawData;

use crate::prelude::*;

Expand All @@ -15,8 +15,8 @@ pub struct Data {
mod v0_34 {
use super::Data;
use crate::{prelude::*, Error};
use tendermint_proto::v0_34::types::Data as RawData;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_34::types::Data as RawData;
use celestia_tendermint_proto::Protobuf;

impl Protobuf<RawData> for Data {}

Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/block/header.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! Block headers
use serde::{Deserialize, Serialize};
use tendermint_proto::v0_37::{
use celestia_tendermint_proto::v0_37::{
types::{BlockId as RawBlockId, Header as RawHeader},
version::Consensus as RawConsensusVersion,
};
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::Protobuf;

use crate::{
account, block, chain,
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/block/height.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::{
};

use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer};
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::Protobuf;

use crate::serializers::cow_str::CowStr;
use crate::{error::Error, prelude::*};
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/block/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use core::{
};

use serde::{Deserialize, Serialize};
use tendermint_proto::v0_37::types::BlockId as RawBlockId;
use celestia_tendermint_proto::v0_37::types::BlockId as RawBlockId;

use crate::{
block::parts::Header as PartSetHeader,
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/block/meta.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Block metadata
use serde::{Deserialize, Serialize};
use tendermint_proto::v0_37::types::BlockMeta as RawMeta;
use celestia_tendermint_proto::v0_37::types::BlockMeta as RawMeta;

use super::{Header, Id};
use crate::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/block/parts.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Block parts
use serde::{Deserialize, Serialize};
use tendermint_proto::v0_37::types::PartSetHeader as RawPartSetHeader;
use celestia_tendermint_proto::v0_37::types::PartSetHeader as RawPartSetHeader;

use crate::{error::Error, prelude::*, Hash};

Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/block/signed_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! light client.
use serde::{Deserialize, Serialize};
use tendermint_proto::v0_37::types::SignedHeader as RawSignedHeader;
use celestia_tendermint_proto::v0_37::types::SignedHeader as RawSignedHeader;

use crate::{block, Error};

Expand Down
8 changes: 4 additions & 4 deletions tendermint/src/block/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ impl Size {
mod v0_34 {
use super::Size;
use crate::error::Error;
use tendermint_proto::v0_34::{
use celestia_tendermint_proto::v0_34::{
abci::BlockParams as RawAbciSize, types::BlockParams as RawSize,
};
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::Protobuf;

impl Protobuf<RawSize> for Size {}

Expand Down Expand Up @@ -94,8 +94,8 @@ mod v0_34 {
mod v0_37 {
use super::Size;
use crate::error::Error;
use tendermint_proto::v0_37::types::BlockParams as RawSize;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::v0_37::types::BlockParams as RawSize;
use celestia_tendermint_proto::Protobuf;

impl Protobuf<RawSize> for Size {}

Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/chain/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use core::{
};

use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer};
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::Protobuf;

use crate::serializers::cow_str::CowStr;
use crate::{error::Error, prelude::*};
Expand Down
8 changes: 4 additions & 4 deletions tendermint/src/consensus/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ fn key_type(s: &str) -> public_key::Algorithm {
}

mod v0_34 {
use tendermint_proto::v0_34::{
use celestia_tendermint_proto::v0_34::{
abci::ConsensusParams as RawAbciParams,
types::{
ConsensusParams as RawParams, ValidatorParams as RawValidatorParams,
VersionParams as RawVersionParams,
},
};
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::Protobuf;

use super::{key_type, Params, ValidatorParams, VersionParams};
use crate::{error::Error, prelude::*, public_key};
Expand Down Expand Up @@ -186,11 +186,11 @@ mod v0_34 {
}

mod v0_37 {
use tendermint_proto::v0_37::types::{
use celestia_tendermint_proto::v0_37::types::{
ConsensusParams as RawParams, ValidatorParams as RawValidatorParams,
VersionParams as RawVersionParams,
};
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::Protobuf;

use super::{key_type, Params, ValidatorParams, VersionParams};
use crate::{error::Error, prelude::*, public_key};
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/consensus/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct State {
pub step: i8,

/// Block ID being proposed (if available)
#[serde(with = "tendermint_proto::serializers::optional")]
#[serde(with = "celestia_tendermint_proto::serializers::optional")]
pub block_id: Option<block::Id>,
}

Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/evidence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use core::{
};

use serde::{Deserialize, Serialize};
use tendermint_proto::google::protobuf::Duration as RawDuration;
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::google::protobuf::Duration as RawDuration;
use celestia_tendermint_proto::Protobuf;

use crate::{
block::{signed_header::SignedHeader, Height},
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use core::{
use bytes::Bytes;
use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer};
use subtle_encoding::{Encoding, Hex};
use tendermint_proto::Protobuf;
use celestia_tendermint_proto::Protobuf;

use crate::serializers::cow_str::CowStr;
use crate::{error::Error, prelude::*};
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/merkle/proof.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Merkle proofs
use serde::{Deserialize, Serialize};
use tendermint_proto::v0_37::crypto::Proof as RawProof;
use celestia_tendermint_proto::v0_37::crypto::Proof as RawProof;

use crate::{prelude::*, serializers, Hash};

Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use core::convert::Infallible;
use bytes::BufMut;
pub use msg_type::Type;
pub use sign_proposal::{SignProposalRequest, SignedProposalResponse};
use tendermint_proto::v0_37::types::CanonicalProposal as RawCanonicalProposal;
use tendermint_proto::{Error as ProtobufError, Protobuf};
use celestia_tendermint_proto::v0_37::types::CanonicalProposal as RawCanonicalProposal;
use celestia_tendermint_proto::{Error as ProtobufError, Protobuf};

pub use self::canonical_proposal::CanonicalProposal;
use crate::{
Expand Down
Loading

0 comments on commit 99b3051

Please sign in to comment.