diff --git a/cometbft/src/abci/event.rs b/cometbft/src/abci/event.rs index 06e88642..08f659e0 100644 --- a/cometbft/src/abci/event.rs +++ b/cometbft/src/abci/event.rs @@ -32,7 +32,7 @@ impl Event { /// trait allow ergonomic event construction, as in this example: /// /// ``` - /// use tendermint::abci::{Event, EventAttributeIndexExt}; + /// use cometbft::abci::{Event, EventAttributeIndexExt}; /// /// let event = Event::new( /// "app", @@ -206,8 +206,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 cometbft_proto::v0_34::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::EventAttribute { fn from(event: EventAttribute) -> Self { @@ -268,8 +268,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 cometbft_proto::v0_37::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::EventAttribute { fn from(event: EventAttribute) -> Self { @@ -327,8 +327,8 @@ mod v0_38 { use crate::prelude::*; use core::convert::{TryFrom, TryInto}; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::EventAttribute { fn from(event: EventAttribute) -> Self { diff --git a/cometbft/src/abci/request/begin_block.rs b/cometbft/src/abci/request/begin_block.rs index 8b152645..760de181 100644 --- a/cometbft/src/abci/request/begin_block.rs +++ b/cometbft/src/abci/request/begin_block.rs @@ -33,8 +33,8 @@ pub struct BeginBlock { mod v0_34 { use super::BeginBlock; use crate::Error; - use tendermint_proto::v0_34 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::RequestBeginBlock { fn from(begin_block: BeginBlock) -> Self { @@ -80,8 +80,8 @@ mod v0_34 { mod v0_37 { use super::BeginBlock; use crate::Error; - use tendermint_proto::v0_37 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::RequestBeginBlock { fn from(begin_block: BeginBlock) -> Self { diff --git a/cometbft/src/abci/request/deliver_tx.rs b/cometbft/src/abci/request/deliver_tx.rs index 3e85ef06..152b9e88 100644 --- a/cometbft/src/abci/request/deliver_tx.rs +++ b/cometbft/src/abci/request/deliver_tx.rs @@ -15,8 +15,8 @@ pub struct DeliverTx { mod v0_34 { use super::DeliverTx; - use tendermint_proto::v0_34 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::RequestDeliverTx { fn from(deliver_tx: DeliverTx) -> Self { @@ -37,8 +37,8 @@ mod v0_34 { mod v0_37 { use super::DeliverTx; - use tendermint_proto::v0_37 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::RequestDeliverTx { fn from(deliver_tx: DeliverTx) -> Self { diff --git a/cometbft/src/abci/request/end_block.rs b/cometbft/src/abci/request/end_block.rs index 879e1849..1425b961 100644 --- a/cometbft/src/abci/request/end_block.rs +++ b/cometbft/src/abci/request/end_block.rs @@ -13,8 +13,8 @@ pub struct EndBlock { mod v0_34 { use super::EndBlock; - use tendermint_proto::v0_34 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::RequestEndBlock { fn from(end_block: EndBlock) -> Self { @@ -39,8 +39,8 @@ mod v0_34 { mod v0_37 { use super::EndBlock; - use tendermint_proto::v0_37 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::RequestEndBlock { fn from(end_block: EndBlock) -> Self { diff --git a/cometbft/src/abci/request/extend_vote.rs b/cometbft/src/abci/request/extend_vote.rs index 02201cef..fb94baf9 100644 --- a/cometbft/src/abci/request/extend_vote.rs +++ b/cometbft/src/abci/request/extend_vote.rs @@ -24,8 +24,8 @@ pub struct ExtendVote { mod v0_38 { use super::ExtendVote; use crate::{prelude::*, Error}; - use tendermint_proto::v0_38 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::RequestExtendVote { fn from(extend_vote: ExtendVote) -> Self { diff --git a/cometbft/src/abci/request/finalize_block.rs b/cometbft/src/abci/request/finalize_block.rs index 9bc829a9..25cb9199 100644 --- a/cometbft/src/abci/request/finalize_block.rs +++ b/cometbft/src/abci/request/finalize_block.rs @@ -36,8 +36,8 @@ pub struct FinalizeBlock { mod v0_38 { use super::FinalizeBlock; use crate::Error; - use tendermint_proto::v0_38 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::RequestFinalizeBlock { fn from(value: FinalizeBlock) -> Self { diff --git a/cometbft/src/abci/request/info.rs b/cometbft/src/abci/request/info.rs index abd68dc6..5b06908d 100644 --- a/cometbft/src/abci/request/info.rs +++ b/cometbft/src/abci/request/info.rs @@ -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 cometbft_proto::v0_34::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::RequestInfo { fn from(info: Info) -> Self { @@ -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 cometbft_proto::v0_37::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::RequestInfo { fn from(info: Info) -> Self { @@ -82,8 +82,8 @@ mod v0_37 { mod v0_38 { use super::Info; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::RequestInfo { fn from(info: Info) -> Self { diff --git a/cometbft/src/abci/request/prepare_proposal.rs b/cometbft/src/abci/request/prepare_proposal.rs index 577b1bb0..d72aba34 100644 --- a/cometbft/src/abci/request/prepare_proposal.rs +++ b/cometbft/src/abci/request/prepare_proposal.rs @@ -30,8 +30,8 @@ pub struct PrepareProposal { mod v0_37 { use super::PrepareProposal; use crate::{prelude::*, Error}; - use tendermint_proto::v0_37::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::RequestPrepareProposal { fn from(value: PrepareProposal) -> Self { @@ -82,8 +82,8 @@ mod v0_37 { mod v0_38 { use super::PrepareProposal; use crate::{prelude::*, Error}; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::RequestPrepareProposal { fn from(value: PrepareProposal) -> Self { diff --git a/cometbft/src/abci/request/process_proposal.rs b/cometbft/src/abci/request/process_proposal.rs index 2eafa293..67ab6dc1 100644 --- a/cometbft/src/abci/request/process_proposal.rs +++ b/cometbft/src/abci/request/process_proposal.rs @@ -29,8 +29,8 @@ pub struct ProcessProposal { mod v0_37 { use super::ProcessProposal; use crate::{prelude::*, Error}; - use tendermint_proto::v0_37::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::RequestProcessProposal { fn from(value: ProcessProposal) -> Self { @@ -81,8 +81,8 @@ mod v0_37 { mod v0_38 { use super::ProcessProposal; use crate::{prelude::*, Error}; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::RequestProcessProposal { fn from(value: ProcessProposal) -> Self { diff --git a/cometbft/src/abci/request/set_option.rs b/cometbft/src/abci/request/set_option.rs index 3f2f5397..e40a5a4c 100644 --- a/cometbft/src/abci/request/set_option.rs +++ b/cometbft/src/abci/request/set_option.rs @@ -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 cometbft_proto::v0_34::abci as pb; +use cometbft_proto::Protobuf; impl From for pb::RequestSetOption { fn from(message: SetOption) -> Self { diff --git a/cometbft/src/abci/request/verify_vote_extension.rs b/cometbft/src/abci/request/verify_vote_extension.rs index 031cb3b8..7ea3223d 100644 --- a/cometbft/src/abci/request/verify_vote_extension.rs +++ b/cometbft/src/abci/request/verify_vote_extension.rs @@ -16,8 +16,8 @@ pub struct VerifyVoteExtension { mod v0_38 { use super::VerifyVoteExtension; - use tendermint_proto::v0_38 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::RequestVerifyVoteExtension { fn from(value: VerifyVoteExtension) -> Self { diff --git a/cometbft/src/abci/response/begin_block.rs b/cometbft/src/abci/response/begin_block.rs index 71779d71..1ad9f899 100644 --- a/cometbft/src/abci/response/begin_block.rs +++ b/cometbft/src/abci/response/begin_block.rs @@ -16,8 +16,8 @@ pub struct BeginBlock { mod v0_34 { use super::BeginBlock; - use tendermint_proto::v0_34 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseBeginBlock { fn from(begin_block: BeginBlock) -> Self { @@ -46,8 +46,8 @@ mod v0_34 { mod v0_37 { use super::BeginBlock; - use tendermint_proto::v0_37 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseBeginBlock { fn from(begin_block: BeginBlock) -> Self { diff --git a/cometbft/src/abci/response/check_tx.rs b/cometbft/src/abci/response/check_tx.rs index 7786b273..d17c2b94 100644 --- a/cometbft/src/abci/response/check_tx.rs +++ b/cometbft/src/abci/response/check_tx.rs @@ -53,8 +53,8 @@ pub struct CheckTx { mod v0_34 { use super::CheckTx; - use tendermint_proto::v0_34 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseCheckTx { fn from(check_tx: CheckTx) -> Self { @@ -103,8 +103,8 @@ mod v0_34 { mod v0_37 { use super::CheckTx; - use tendermint_proto::v0_37 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseCheckTx { fn from(check_tx: CheckTx) -> Self { @@ -153,8 +153,8 @@ mod v0_37 { mod v0_38 { use super::CheckTx; - use tendermint_proto::v0_38 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseCheckTx { fn from(check_tx: CheckTx) -> Self { diff --git a/cometbft/src/abci/response/commit.rs b/cometbft/src/abci/response/commit.rs index f564e40c..af7f81a2 100644 --- a/cometbft/src/abci/response/commit.rs +++ b/cometbft/src/abci/response/commit.rs @@ -18,8 +18,8 @@ pub struct Commit { mod v0_34 { use super::Commit; - use tendermint_proto::v0_34 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseCommit { fn from(commit: Commit) -> Self { @@ -46,8 +46,8 @@ mod v0_34 { mod v0_37 { use super::Commit; - use tendermint_proto::v0_37 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseCommit { fn from(commit: Commit) -> Self { @@ -74,8 +74,8 @@ mod v0_37 { mod v0_38 { use super::Commit; - use tendermint_proto::v0_38 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseCommit { fn from(commit: Commit) -> Self { diff --git a/cometbft/src/abci/response/deliver_tx.rs b/cometbft/src/abci/response/deliver_tx.rs index dcefcc9a..e26a6948 100644 --- a/cometbft/src/abci/response/deliver_tx.rs +++ b/cometbft/src/abci/response/deliver_tx.rs @@ -39,8 +39,8 @@ pub struct DeliverTx { mod v0_34 { use super::DeliverTx; - use tendermint_proto::v0_34 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseDeliverTx { fn from(deliver_tx: DeliverTx) -> Self { @@ -83,8 +83,8 @@ mod v0_34 { mod v0_37 { use super::DeliverTx; - use tendermint_proto::v0_37 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseDeliverTx { fn from(deliver_tx: DeliverTx) -> Self { diff --git a/cometbft/src/abci/response/end_block.rs b/cometbft/src/abci/response/end_block.rs index 9e5b4a46..fcfe0cd8 100644 --- a/cometbft/src/abci/response/end_block.rs +++ b/cometbft/src/abci/response/end_block.rs @@ -23,8 +23,8 @@ pub struct EndBlock { mod v0_34 { use super::EndBlock; - use tendermint_proto::v0_34 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseEndBlock { fn from(end_block: EndBlock) -> Self { @@ -68,8 +68,8 @@ mod v0_34 { mod v0_37 { use super::EndBlock; - use tendermint_proto::v0_37 as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37 as pb; + use cometbft_proto::Protobuf; impl From for pb::abci::ResponseEndBlock { fn from(end_block: EndBlock) -> Self { diff --git a/cometbft/src/abci/response/extend_vote.rs b/cometbft/src/abci/response/extend_vote.rs index fe2d8913..e0b62fea 100644 --- a/cometbft/src/abci/response/extend_vote.rs +++ b/cometbft/src/abci/response/extend_vote.rs @@ -12,8 +12,8 @@ pub struct ExtendVote { mod v0_38 { use super::ExtendVote; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::ResponseExtendVote { fn from(value: ExtendVote) -> Self { diff --git a/cometbft/src/abci/response/finalize_block.rs b/cometbft/src/abci/response/finalize_block.rs index 124ce1ac..f66036f7 100644 --- a/cometbft/src/abci/response/finalize_block.rs +++ b/cometbft/src/abci/response/finalize_block.rs @@ -31,8 +31,8 @@ pub struct FinalizeBlock { mod v0_38 { use super::FinalizeBlock; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::ResponseFinalizeBlock { fn from(value: FinalizeBlock) -> Self { diff --git a/cometbft/src/abci/response/info.rs b/cometbft/src/abci/response/info.rs index af2b98ce..6ce02908 100644 --- a/cometbft/src/abci/response/info.rs +++ b/cometbft/src/abci/response/info.rs @@ -1,5 +1,5 @@ use crate::{block, prelude::*, AppHash}; -use tendermint_proto::v0_37::abci as pb; +use cometbft_proto::v0_37::abci as pb; use serde::{Deserialize, Serialize}; diff --git a/cometbft/src/abci/response/prepare_proposal.rs b/cometbft/src/abci/response/prepare_proposal.rs index 89d277ba..a16adf77 100644 --- a/cometbft/src/abci/response/prepare_proposal.rs +++ b/cometbft/src/abci/response/prepare_proposal.rs @@ -14,8 +14,8 @@ pub struct PrepareProposal { mod v0_37 { use super::PrepareProposal; - use tendermint_proto::v0_37::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::ResponsePrepareProposal { fn from(value: PrepareProposal) -> Self { @@ -36,8 +36,8 @@ mod v0_37 { mod v0_38 { use super::PrepareProposal; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::ResponsePrepareProposal { fn from(value: PrepareProposal) -> Self { diff --git a/cometbft/src/abci/response/process_proposal.rs b/cometbft/src/abci/response/process_proposal.rs index 83a031bf..63885ec4 100644 --- a/cometbft/src/abci/response/process_proposal.rs +++ b/cometbft/src/abci/response/process_proposal.rs @@ -18,8 +18,8 @@ pub enum ProcessProposal { mod v0_37 { use super::ProcessProposal; use crate::Error; - use tendermint_proto::v0_37::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::ResponseProcessProposal { fn from(value: ProcessProposal) -> Self { @@ -55,8 +55,8 @@ mod v0_37 { mod v0_38 { use super::ProcessProposal; use crate::Error; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::ResponseProcessProposal { fn from(value: ProcessProposal) -> Self { diff --git a/cometbft/src/abci/response/set_option.rs b/cometbft/src/abci/response/set_option.rs index 98399dbb..f80fee01 100644 --- a/cometbft/src/abci/response/set_option.rs +++ b/cometbft/src/abci/response/set_option.rs @@ -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 cometbft_proto::v0_34::abci as pb; +use cometbft_proto::Protobuf; impl From for pb::ResponseSetOption { fn from(message: SetOption) -> Self { diff --git a/cometbft/src/abci/response/verify_vote_extension.rs b/cometbft/src/abci/response/verify_vote_extension.rs index 292f6d2e..08cfaf8a 100644 --- a/cometbft/src/abci/response/verify_vote_extension.rs +++ b/cometbft/src/abci/response/verify_vote_extension.rs @@ -14,8 +14,8 @@ pub enum VerifyVoteExtension { mod v0_38 { use super::VerifyVoteExtension; use crate::Error; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::Protobuf; impl From for pb::ResponseVerifyVoteExtension { fn from(value: VerifyVoteExtension) -> Self { diff --git a/cometbft/src/abci/types.rs b/cometbft/src/abci/types.rs index c892e095..f4dbc8ff 100644 --- a/cometbft/src/abci/types.rs +++ b/cometbft/src/abci/types.rs @@ -236,8 +236,8 @@ mod v0_34 { BlockSignatureInfo, CommitInfo, Misbehavior, MisbehaviorKind, Snapshot, Validator, VoteInfo, }; use crate::{block::BlockIdFlag, prelude::*, Error}; - use tendermint_proto::v0_34::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34::abci as pb; + use cometbft_proto::Protobuf; use bytes::Bytes; @@ -403,8 +403,8 @@ mod v0_37 { MisbehaviorKind, Snapshot, Validator, VoteInfo, }; use crate::{block::BlockIdFlag, prelude::*, Error}; - use tendermint_proto::v0_37::abci as pb; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37::abci as pb; + use cometbft_proto::Protobuf; use bytes::Bytes; @@ -632,9 +632,9 @@ mod v0_38 { Misbehavior, MisbehaviorKind, Snapshot, Validator, VoteInfo, }; use crate::{prelude::*, Error, Signature}; - use tendermint_proto::v0_38::abci as pb; - use tendermint_proto::v0_38::types::BlockIdFlag as RawBlockIdFlag; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::abci as pb; + use cometbft_proto::v0_38::types::BlockIdFlag as RawBlockIdFlag; + use cometbft_proto::Protobuf; use bytes::Bytes; diff --git a/cometbft/src/account.rs b/cometbft/src/account.rs index 774dbae0..97ec4860 100644 --- a/cometbft/src/account.rs +++ b/cometbft/src/account.rs @@ -11,7 +11,7 @@ use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use subtle::{self, ConstantTimeEq}; use subtle_encoding::hex; -use tendermint_proto::Protobuf; +use cometbft_proto::Protobuf; use crate::{error::Error, prelude::*}; diff --git a/cometbft/src/block.rs b/cometbft/src/block.rs index 6ad8d6e0..47f67179 100644 --- a/cometbft/src/block.rs +++ b/cometbft/src/block.rs @@ -12,8 +12,8 @@ mod round; pub mod signed_header; mod size; +use cometbft_proto::v0_37::types::Block as RawBlock; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::types::Block as RawBlock; pub use self::{ block_id_flag::BlockIdFlag, diff --git a/cometbft/src/block/commit.rs b/cometbft/src/block/commit.rs index 2a14e5bc..0d28b9db 100644 --- a/cometbft/src/block/commit.rs +++ b/cometbft/src/block/commit.rs @@ -1,7 +1,7 @@ //! Commits to a Tendermint blockchain +use cometbft_proto::v0_37::types::Commit as RawCommit; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::types::Commit as RawCommit; use crate::{ block::{commit_sig::CommitSig, Height, Id, Round}, diff --git a/cometbft/src/block/commit_sig.rs b/cometbft/src/block/commit_sig.rs index d239e630..c9ecedcb 100644 --- a/cometbft/src/block/commit_sig.rs +++ b/cometbft/src/block/commit_sig.rs @@ -1,6 +1,6 @@ //! CommitSig within Commit -use tendermint_proto::google::protobuf::Timestamp; +use cometbft_proto::google::protobuf::Timestamp; use crate::{account, prelude::*, Signature, Time}; diff --git a/cometbft/src/block/header.rs b/cometbft/src/block/header.rs index 99e3df00..db84aad4 100644 --- a/cometbft/src/block/header.rs +++ b/cometbft/src/block/header.rs @@ -1,11 +1,11 @@ //! Block headers -use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::{ +use cometbft_proto::v0_37::{ types::{BlockId as RawBlockId, Header as RawHeader}, version::Consensus as RawConsensusVersion, }; -use tendermint_proto::Protobuf; +use cometbft_proto::Protobuf; +use serde::{Deserialize, Serialize}; use crate::{ account, block, chain, diff --git a/cometbft/src/block/height.rs b/cometbft/src/block/height.rs index eb7762ad..2d6a454a 100644 --- a/cometbft/src/block/height.rs +++ b/cometbft/src/block/height.rs @@ -4,8 +4,8 @@ use core::{ str::FromStr, }; +use cometbft_proto::Protobuf; use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; -use tendermint_proto::Protobuf; use crate::{error::Error, prelude::*}; diff --git a/cometbft/src/block/id.rs b/cometbft/src/block/id.rs index c88f7a1a..b7714f21 100644 --- a/cometbft/src/block/id.rs +++ b/cometbft/src/block/id.rs @@ -3,8 +3,8 @@ use core::{ str::{self, FromStr}, }; +use cometbft_proto::v0_37::types::BlockId as RawBlockId; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::types::BlockId as RawBlockId; use crate::{ block::parts::Header as PartSetHeader, diff --git a/cometbft/src/block/meta.rs b/cometbft/src/block/meta.rs index 4dbed2cd..fe2204da 100644 --- a/cometbft/src/block/meta.rs +++ b/cometbft/src/block/meta.rs @@ -1,7 +1,7 @@ //! Block metadata +use cometbft_proto::v0_37::types::BlockMeta as RawMeta; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::types::BlockMeta as RawMeta; use super::{Header, Id}; use crate::prelude::*; diff --git a/cometbft/src/block/parts.rs b/cometbft/src/block/parts.rs index 7635034f..7682a77e 100644 --- a/cometbft/src/block/parts.rs +++ b/cometbft/src/block/parts.rs @@ -1,7 +1,7 @@ //! Block parts +use cometbft_proto::v0_37::types::PartSetHeader as RawPartSetHeader; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::types::PartSetHeader as RawPartSetHeader; use crate::{error::Error, prelude::*, Hash}; diff --git a/cometbft/src/block/signed_header.rs b/cometbft/src/block/signed_header.rs index 4cd85292..b8c342ae 100644 --- a/cometbft/src/block/signed_header.rs +++ b/cometbft/src/block/signed_header.rs @@ -2,8 +2,8 @@ //! It is what the rpc endpoint /commit returns and hence can be used by a //! light client. +use cometbft_proto::v0_37::types::SignedHeader as RawSignedHeader; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::types::SignedHeader as RawSignedHeader; use crate::{block, Error}; diff --git a/cometbft/src/block/size.rs b/cometbft/src/block/size.rs index 4df3f4ba..a5a9e6cf 100644 --- a/cometbft/src/block/size.rs +++ b/cometbft/src/block/size.rs @@ -30,10 +30,8 @@ impl Size { mod v0_34 { use super::Size; use crate::error::Error; - use tendermint_proto::v0_34::{ - abci::BlockParams as RawAbciSize, types::BlockParams as RawSize, - }; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34::{abci::BlockParams as RawAbciSize, types::BlockParams as RawSize}; + use cometbft_proto::Protobuf; impl Protobuf for Size {} @@ -94,8 +92,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 cometbft_proto::v0_37::types::BlockParams as RawSize; + use cometbft_proto::Protobuf; impl Protobuf for Size {} @@ -128,8 +126,8 @@ mod v0_37 { mod v0_38 { use super::Size; use crate::error::Error; - use tendermint_proto::v0_38::types::BlockParams as RawSize; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::types::BlockParams as RawSize; + use cometbft_proto::Protobuf; impl Protobuf for Size {} diff --git a/cometbft/src/chain/id.rs b/cometbft/src/chain/id.rs index 5ea31d8d..024da75f 100644 --- a/cometbft/src/chain/id.rs +++ b/cometbft/src/chain/id.rs @@ -8,8 +8,8 @@ use core::{ str::{self, FromStr}, }; +use cometbft_proto::Protobuf; use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; -use tendermint_proto::Protobuf; use crate::{error::Error, prelude::*}; diff --git a/cometbft/src/consensus/params.rs b/cometbft/src/consensus/params.rs index ea1a1e19..2e2688e3 100644 --- a/cometbft/src/consensus/params.rs +++ b/cometbft/src/consensus/params.rs @@ -73,14 +73,14 @@ fn key_type(s: &str) -> public_key::Algorithm { } mod v0_34 { - use tendermint_proto::v0_34::{ + use cometbft_proto::v0_34::{ abci::ConsensusParams as RawAbciConsensusParams, types::{ ConsensusParams as RawParams, ValidatorParams as RawValidatorParams, VersionParams as RawVersionParams, }, }; - use tendermint_proto::Protobuf; + use cometbft_proto::Protobuf; use super::{key_type, Params, ValidatorParams, VersionParams}; use crate::{error::Error, prelude::*, public_key}; @@ -206,11 +206,11 @@ mod v0_34 { } mod v0_37 { - use tendermint_proto::v0_37::types::{ + use cometbft_proto::v0_37::types::{ ConsensusParams as RawParams, ValidatorParams as RawValidatorParams, VersionParams as RawVersionParams, }; - use tendermint_proto::Protobuf; + use cometbft_proto::Protobuf; use super::{key_type, Params, ValidatorParams, VersionParams}; use crate::{error::Error, prelude::*, public_key}; @@ -296,11 +296,11 @@ mod v0_37 { } mod v0_38 { - use tendermint_proto::v0_38::types::{ + use cometbft_proto::v0_38::types::{ AbciParams as RawAbciParams, ConsensusParams as RawParams, ValidatorParams as RawValidatorParams, VersionParams as RawVersionParams, }; - use tendermint_proto::Protobuf; + use cometbft_proto::Protobuf; use super::{key_type, AbciParams, Params, ValidatorParams, VersionParams}; use crate::{error::Error, prelude::*, public_key}; diff --git a/cometbft/src/consensus/state.rs b/cometbft/src/consensus/state.rs index 658f99ba..e05fd1eb 100644 --- a/cometbft/src/consensus/state.rs +++ b/cometbft/src/consensus/state.rs @@ -6,6 +6,7 @@ use serde::{Deserialize, Serialize}; pub use crate::block; use crate::prelude::*; +use crate::serializers; /// Placeholder string to show when block ID is absent. Syntax from: /// @@ -26,7 +27,7 @@ pub struct State { pub step: i8, /// Block ID being proposed (if available) - #[serde(with = "tendermint_proto::serializers::optional")] + #[serde(with = "serializers::optional")] pub block_id: Option, } diff --git a/cometbft/src/evidence.rs b/cometbft/src/evidence.rs index 8476fc7a..e09998b2 100644 --- a/cometbft/src/evidence.rs +++ b/cometbft/src/evidence.rs @@ -5,9 +5,9 @@ use core::{ slice, }; +use cometbft_proto::google::protobuf::Duration as RawDuration; +use cometbft_proto::Protobuf; use serde::{Deserialize, Serialize}; -use tendermint_proto::google::protobuf::Duration as RawDuration; -use tendermint_proto::Protobuf; use crate::{ block::{signed_header::SignedHeader, Height}, diff --git a/cometbft/src/hash.rs b/cometbft/src/hash.rs index f210ee09..fcaccda1 100644 --- a/cometbft/src/hash.rs +++ b/cometbft/src/hash.rs @@ -7,9 +7,9 @@ use core::{ }; use bytes::Bytes; +use cometbft_proto::Protobuf; use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; use subtle_encoding::{Encoding, Hex}; -use tendermint_proto::Protobuf; use crate::{error::Error, prelude::*}; diff --git a/cometbft/src/merkle/proof.rs b/cometbft/src/merkle/proof.rs index 903c1471..36d09b5c 100644 --- a/cometbft/src/merkle/proof.rs +++ b/cometbft/src/merkle/proof.rs @@ -1,7 +1,7 @@ //! Merkle proofs +use cometbft_proto::v0_37::crypto::Proof as RawProof; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::crypto::Proof as RawProof; use crate::{prelude::*, serializers, Hash}; diff --git a/cometbft/src/proposal.rs b/cometbft/src/proposal.rs index f6acca69..b434f6fa 100644 --- a/cometbft/src/proposal.rs +++ b/cometbft/src/proposal.rs @@ -5,10 +5,10 @@ mod msg_type; mod sign_proposal; use bytes::BufMut; +use cometbft_proto::v0_37::types::CanonicalProposal as RawCanonicalProposal; +use cometbft_proto::{Error as ProtobufError, Protobuf}; 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}; pub use self::canonical_proposal::CanonicalProposal; use crate::{ diff --git a/cometbft/src/proposal/msg_type.rs b/cometbft/src/proposal/msg_type.rs index 08ff88ef..e294254f 100644 --- a/cometbft/src/proposal/msg_type.rs +++ b/cometbft/src/proposal/msg_type.rs @@ -1,7 +1,7 @@ use core::convert::TryFrom; +use cometbft_proto::Protobuf; use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; -use tendermint_proto::Protobuf; use crate::{error::Error, prelude::*}; diff --git a/cometbft/src/proposal/sign_proposal.rs b/cometbft/src/proposal/sign_proposal.rs index 4ed4f67b..646ad8fa 100644 --- a/cometbft/src/proposal/sign_proposal.rs +++ b/cometbft/src/proposal/sign_proposal.rs @@ -1,5 +1,5 @@ use bytes::BufMut; -use tendermint_proto::Error as ProtobufError; +use cometbft_proto::Error as ProtobufError; use super::Proposal; use crate::{chain::Id as ChainId, prelude::*, privval::RemoteSignerError}; diff --git a/cometbft/src/proto_macros.rs b/cometbft/src/proto_macros.rs index 2fdc8bee..807745e8 100644 --- a/cometbft/src/proto_macros.rs +++ b/cometbft/src/proto_macros.rs @@ -5,23 +5,23 @@ macro_rules! tendermint_pb_modules { $($contents:item)* } => { mod v0_34 { - use tendermint_proto::v0_34 as pb; + use cometbft_proto::v0_34 as pb; #[allow(unused_imports)] - use tendermint_proto::Protobuf; + use cometbft_proto::Protobuf; $($contents)* } mod v0_37 { - use tendermint_proto::v0_37 as pb; + use cometbft_proto::v0_37 as pb; #[allow(unused_imports)] - use tendermint_proto::Protobuf; + use cometbft_proto::Protobuf; $($contents)* } mod v0_38 { - use tendermint_proto::v0_38 as pb; + use cometbft_proto::v0_38 as pb; #[allow(unused_imports)] - use tendermint_proto::Protobuf; + use cometbft_proto::Protobuf; $($contents)* } diff --git a/cometbft/src/serializers.rs b/cometbft/src/serializers.rs index 458f79c8..70a724c7 100644 --- a/cometbft/src/serializers.rs +++ b/cometbft/src/serializers.rs @@ -5,7 +5,7 @@ //! CAUTION: There are no guarantees for backwards compatibility, this module should be considered //! an internal implementation detail which can vanish without further warning. Use at your own //! risk. -pub use tendermint_proto::serializers::*; +pub use cometbft_proto::serializers::*; pub mod apphash; pub mod apphash_base64; diff --git a/cometbft/src/signature.rs b/cometbft/src/signature.rs index 6c70afad..ae8c4691 100644 --- a/cometbft/src/signature.rs +++ b/cometbft/src/signature.rs @@ -6,7 +6,7 @@ pub use k256::ecdsa::Signature as Secp256k1Signature; use bytes::Bytes; -use tendermint_proto::Protobuf; +use cometbft_proto::Protobuf; use crate::{error::Error, prelude::*}; diff --git a/cometbft/src/time.rs b/cometbft/src/time.rs index c3739e0d..73bc32cc 100644 --- a/cometbft/src/time.rs +++ b/cometbft/src/time.rs @@ -8,8 +8,8 @@ use core::{ time::Duration, }; +use cometbft_proto::{google::protobuf::Timestamp, serializers::timestamp, Protobuf}; use serde::{Deserialize, Serialize}; -use tendermint_proto::{google::protobuf::Timestamp, serializers::timestamp, Protobuf}; use time::{ format_description::well_known::Rfc3339, macros::{datetime, offset}, @@ -215,8 +215,8 @@ pub trait ParseTimestamp { #[cfg(test)] mod tests { + use cometbft_pbt_gen as pbt; use proptest::{prelude::*, sample::select}; - use tendermint_pbt_gen as pbt; use time::{Date, Month::*}; use super::*; diff --git a/cometbft/src/tx/proof.rs b/cometbft/src/tx/proof.rs index 98af5459..9d411bc9 100644 --- a/cometbft/src/tx/proof.rs +++ b/cometbft/src/tx/proof.rs @@ -1,6 +1,6 @@ +use cometbft_proto::v0_37::types::TxProof as RawTxProof; +use cometbft_proto::Protobuf; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::types::TxProof as RawTxProof; -use tendermint_proto::Protobuf; use crate::{merkle, prelude::*, Error, Hash}; diff --git a/cometbft/src/v0_34/abci/request.rs b/cometbft/src/v0_34/abci/request.rs index 09036178..dc521ef5 100644 --- a/cometbft/src/v0_34/abci/request.rs +++ b/cometbft/src/v0_34/abci/request.rs @@ -1,5 +1,5 @@ -use tendermint_proto::v0_34::abci as pb; -use tendermint_proto::Protobuf; +use cometbft_proto::v0_34::abci as pb; +use cometbft_proto::Protobuf; use crate::abci::MethodKind; use crate::Error; diff --git a/cometbft/src/v0_34/abci/response.rs b/cometbft/src/v0_34/abci/response.rs index aef9fb5e..8aa6c3b4 100644 --- a/cometbft/src/v0_34/abci/response.rs +++ b/cometbft/src/v0_34/abci/response.rs @@ -185,8 +185,8 @@ impl TryFrom for SnapshotResponse { // Protobuf conversions // ============================================================================= -use tendermint_proto::v0_34::abci as pb; -use tendermint_proto::Protobuf; +use cometbft_proto::v0_34::abci as pb; +use cometbft_proto::Protobuf; impl From for pb::Response { fn from(response: Response) -> pb::Response { diff --git a/cometbft/src/v0_37/abci/request.rs b/cometbft/src/v0_37/abci/request.rs index 036889cf..3658a58c 100644 --- a/cometbft/src/v0_37/abci/request.rs +++ b/cometbft/src/v0_37/abci/request.rs @@ -1,5 +1,5 @@ -use tendermint_proto::v0_37::abci as pb; -use tendermint_proto::Protobuf; +use cometbft_proto::v0_37::abci as pb; +use cometbft_proto::Protobuf; use crate::abci::MethodKind; use crate::Error; diff --git a/cometbft/src/v0_37/abci/response.rs b/cometbft/src/v0_37/abci/response.rs index b233222d..bfd392cc 100644 --- a/cometbft/src/v0_37/abci/response.rs +++ b/cometbft/src/v0_37/abci/response.rs @@ -192,8 +192,8 @@ impl TryFrom for SnapshotResponse { // Protobuf conversions // ============================================================================= -use tendermint_proto::v0_37::abci as pb; -use tendermint_proto::Protobuf; +use cometbft_proto::v0_37::abci as pb; +use cometbft_proto::Protobuf; impl From for pb::Response { fn from(response: Response) -> pb::Response { diff --git a/cometbft/src/v0_38/abci/request.rs b/cometbft/src/v0_38/abci/request.rs index 6cdc9c45..31720f6d 100644 --- a/cometbft/src/v0_38/abci/request.rs +++ b/cometbft/src/v0_38/abci/request.rs @@ -1,5 +1,5 @@ -use tendermint_proto::v0_38::abci as pb; -use tendermint_proto::Protobuf; +use cometbft_proto::v0_38::abci as pb; +use cometbft_proto::Protobuf; use crate::abci::MethodKind; use crate::Error; diff --git a/cometbft/src/v0_38/abci/response.rs b/cometbft/src/v0_38/abci/response.rs index 2b8015d6..46ad35dd 100644 --- a/cometbft/src/v0_38/abci/response.rs +++ b/cometbft/src/v0_38/abci/response.rs @@ -192,8 +192,8 @@ impl TryFrom for SnapshotResponse { // Protobuf conversions // ============================================================================= -use tendermint_proto::v0_38::abci as pb; -use tendermint_proto::Protobuf; +use cometbft_proto::v0_38::abci as pb; +use cometbft_proto::Protobuf; impl From for pb::Response { fn from(response: Response) -> pb::Response { diff --git a/cometbft/src/validator.rs b/cometbft/src/validator.rs index 7db1a7ce..66c4fe70 100644 --- a/cometbft/src/validator.rs +++ b/cometbft/src/validator.rs @@ -1,10 +1,10 @@ //! Tendermint validators -use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_38::types::{ +use cometbft_proto::v0_38::types::{ SimpleValidator as RawSimpleValidator, ValidatorSet as RawValidatorSet, }; -use tendermint_proto::Protobuf; +use cometbft_proto::Protobuf; +use serde::{Deserialize, Serialize}; use crate::{ account, diff --git a/cometbft/src/vote.rs b/cometbft/src/vote.rs index cd37c728..a5c4b5a9 100644 --- a/cometbft/src/vote.rs +++ b/cometbft/src/vote.rs @@ -8,9 +8,9 @@ mod validator_index; use core::{fmt, str::FromStr}; use bytes::BufMut; +use cometbft_proto::v0_38::types::{CanonicalVote as RawCanonicalVote, Vote as RawVote}; +use cometbft_proto::{Error as ProtobufError, Protobuf}; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_38::types::{CanonicalVote as RawCanonicalVote, Vote as RawVote}; -use tendermint_proto::{Error as ProtobufError, Protobuf}; pub use self::{ canonical_vote::CanonicalVote, power::Power, sign_vote::*, validator_index::ValidatorIndex, @@ -73,8 +73,8 @@ pub struct Vote { mod v0_34 { use super::Vote; use crate::{block, prelude::*, Error, Signature}; - use tendermint_proto::v0_34::types::Vote as RawVote; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_34::types::Vote as RawVote; + use cometbft_proto::Protobuf; impl Protobuf for Vote {} @@ -124,8 +124,8 @@ mod v0_34 { mod v0_37 { use super::Vote; use crate::{block, prelude::*, Error, Signature}; - use tendermint_proto::v0_37::types::Vote as RawVote; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_37::types::Vote as RawVote; + use cometbft_proto::Protobuf; impl Protobuf for Vote {} @@ -175,8 +175,8 @@ mod v0_37 { mod v0_38 { use super::Vote; use crate::{block, prelude::*, Error, Signature}; - use tendermint_proto::v0_38::types::Vote as RawVote; - use tendermint_proto::Protobuf; + use cometbft_proto::v0_38::types::Vote as RawVote; + use cometbft_proto::Protobuf; impl Protobuf for Vote {} diff --git a/cometbft/src/vote/canonical_vote.rs b/cometbft/src/vote/canonical_vote.rs index c3afd918..9c6d803b 100644 --- a/cometbft/src/vote/canonical_vote.rs +++ b/cometbft/src/vote/canonical_vote.rs @@ -1,5 +1,5 @@ +use cometbft_proto::v0_37::types::CanonicalVote as RawCanonicalVote; use serde::{Deserialize, Serialize}; -use tendermint_proto::v0_37::types::CanonicalVote as RawCanonicalVote; use crate::{block, chain::Id as ChainId, prelude::*, Time}; @@ -93,7 +93,7 @@ impl CanonicalVote { mod tests { tendermint_pb_modules! { - use tendermint_proto::google::protobuf::Timestamp; + use cometbft_proto::google::protobuf::Timestamp; use pb::types::{ CanonicalBlockId as RawCanonicalBlockId, CanonicalPartSetHeader as RawCanonicalPartSetHeader, diff --git a/cometbft/src/vote/sign_vote.rs b/cometbft/src/vote/sign_vote.rs index f4a48fa2..5af49e46 100644 --- a/cometbft/src/vote/sign_vote.rs +++ b/cometbft/src/vote/sign_vote.rs @@ -1,5 +1,5 @@ use bytes::BufMut; -use tendermint_proto::Error as ProtobufError; +use cometbft_proto::Error as ProtobufError; use crate::{chain, prelude::*, privval::RemoteSignerError, Vote}; diff --git a/cometbft/tests/alt_crypto.rs b/cometbft/tests/alt_crypto.rs index b6b1cc1b..0e33104b 100644 --- a/cometbft/tests/alt_crypto.rs +++ b/cometbft/tests/alt_crypto.rs @@ -5,9 +5,9 @@ use ::signature::DigestVerifier; use digest::Digest; -use tendermint::crypto::signature::{self, Verifier}; -use tendermint::crypto::{sha256::HASH_SIZE, Sha256}; -use tendermint::{PublicKey, Signature}; +use cometbft::crypto::signature::{self, Verifier}; +use cometbft::crypto::{sha256::HASH_SIZE, Sha256}; +use cometbft::{PublicKey, Signature}; #[derive(Debug, Default)] struct SubstrateSha256(sha2::Sha256); @@ -43,9 +43,9 @@ impl Sha256 for SubstrateSha256 { mod tests { use super::{SubstrateSha256, SubstrateSignatureVerifier}; - use tendermint::crypto::signature::Verifier; - use tendermint::crypto::Sha256; - use tendermint::{PublicKey, Signature}; + use cometbft::crypto::signature::Verifier; + use cometbft::crypto::Sha256; + use cometbft::{PublicKey, Signature}; use subtle_encoding::hex; diff --git a/config/src/config.rs b/config/src/config.rs index 3ea21fe5..2f1cea8d 100644 --- a/config/src/config.rs +++ b/config/src/config.rs @@ -13,8 +13,8 @@ use std::{ path::{Path, PathBuf}, }; +use cometbft::{genesis::Genesis, node, Moniker, Timeout}; use serde::{de, de::Error as _, ser, Deserialize, Serialize}; -use tendermint::{genesis::Genesis, node, Moniker, Timeout}; use crate::{net, node_key::NodeKey, prelude::*, Error}; @@ -633,7 +633,7 @@ pub struct InstrumentationConfig { pub prometheus: bool, /// Address to listen for Prometheus collector(s) connections - // TODO(tarcieri): parse to `tendermint::net::Addr` + // TODO(tarcieri): parse to `cometbft::net::Addr` pub prometheus_listen_addr: String, /// Maximum number of simultaneous connections. diff --git a/config/src/error.rs b/config/src/error.rs index 4340b235..e66c3b10 100644 --- a/config/src/error.rs +++ b/config/src/error.rs @@ -1,7 +1,7 @@ use std::io::Error as IoError; +use cometbft::Error as TendermintError; use flex_error::{define_error, DisplayOnly}; -use tendermint::Error as TendermintError; define_error! { #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/config/src/net.rs b/config/src/net.rs index 258787e2..ab300062 100644 --- a/config/src/net.rs +++ b/config/src/net.rs @@ -5,8 +5,8 @@ use core::{ str::{self, FromStr}, }; +use cometbft::node::{self, info::ListenAddress}; use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; -use tendermint::node::{self, info::ListenAddress}; use url::Url; use crate::{error::Error, prelude::*}; @@ -135,7 +135,7 @@ impl Serialize for Address { #[cfg(test)] mod tests { - use tendermint::node; + use cometbft::node; use super::*; diff --git a/config/src/node_key.rs b/config/src/node_key.rs index ba66fb2c..3521bd63 100644 --- a/config/src/node_key.rs +++ b/config/src/node_key.rs @@ -2,8 +2,8 @@ use std::{fs, path::Path}; +use cometbft::{node, private_key::PrivateKey, public_key::PublicKey}; use serde::{Deserialize, Serialize}; -use tendermint::{node, private_key::PrivateKey, public_key::PublicKey}; use crate::{error::Error, prelude::*}; diff --git a/config/src/priv_validator_key.rs b/config/src/priv_validator_key.rs index fd527494..446d1750 100644 --- a/config/src/priv_validator_key.rs +++ b/config/src/priv_validator_key.rs @@ -2,12 +2,12 @@ use std::{fs, path::Path}; -use serde::{Deserialize, Serialize}; -use tendermint::{ +use cometbft::{ account, private_key::PrivateKey, public_key::{PublicKey, TendermintKey}, }; +use serde::{Deserialize, Serialize}; use crate::{error::Error, prelude::*}; diff --git a/config/tests/mod.rs b/config/tests/mod.rs index c333c2b8..9b3a150f 100644 --- a/config/tests/mod.rs +++ b/config/tests/mod.rs @@ -4,10 +4,10 @@ use std::{fs, path::PathBuf, time::Duration}; +use cometbft::node; +use cometbft_config::*; #[cfg(test)] use pretty_assertions::assert_eq; -use tendermint::node; -use tendermint_config::*; /// Read a fixture file from the `support/config` directory fn read_fixture(name: &str) -> String { diff --git a/light-client-cli/src/main.rs b/light-client-cli/src/main.rs index e269d2f8..0d000caf 100644 --- a/light-client-cli/src/main.rs +++ b/light-client-cli/src/main.rs @@ -7,20 +7,20 @@ use color_eyre::{ eyre::{eyre, Result}, Report, }; -use futures::future::join_all; -use tendermint::{crypto::default::Sha256, evidence::Evidence, Time}; -use tendermint_light_client::{ +use cometbft::{crypto::default::Sha256, evidence::Evidence, Time}; +use cometbft_light_client::{ builder::LightClientBuilder, instance::Instance, light_client::Options, store::memory::MemoryStore, types::{Hash, Height, LightBlock, TrustThreshold}, }; -use tendermint_light_client_detector::{ +use cometbft_light_client_detector::{ compare_new_header_with_witness, detect_divergence, gather_evidence_from_conflicting_headers, CompareError, Error, ErrorDetail, Provider, Trace, }; -use tendermint_rpc::{Client, HttpClient, HttpClientUrl, Url}; +use cometbft_rpc::{Client, HttpClient, HttpClientUrl, Url}; +use futures::future::join_all; use tracing::{debug, error, info, metadata::LevelFilter, warn}; use tracing_subscriber::{util::SubscriberInitExt, EnvFilter}; @@ -266,7 +266,7 @@ async fn make_provider( trusted_hash: Hash, options: Options, ) -> Result { - use tendermint_rpc::client::CompatMode; + use cometbft_rpc::client::CompatMode; let rpc_client = HttpClient::builder(rpc_addr) .compat_mode(CompatMode::V0_34) diff --git a/light-client-detector/src/conflict.rs b/light-client-detector/src/conflict.rs index 465a77db..5d3e29dc 100644 --- a/light-client-detector/src/conflict.rs +++ b/light-client-detector/src/conflict.rs @@ -1,5 +1,5 @@ -use tendermint::{crypto::Sha256, evidence::LightClientAttackEvidence, merkle::MerkleHash}; -use tendermint_light_client::verifier::types::LightBlock; +use cometbft::{crypto::Sha256, evidence::LightClientAttackEvidence, merkle::MerkleHash}; +use cometbft_light_client::verifier::types::LightBlock; use tracing::{error, error_span, warn}; use super::{ diff --git a/light-client-detector/src/detect.rs b/light-client-detector/src/detect.rs index 6f4e7c03..f286af4f 100644 --- a/light-client-detector/src/detect.rs +++ b/light-client-detector/src/detect.rs @@ -2,10 +2,10 @@ use std::{thread, time::Duration}; use tracing::{debug, warn}; -use tendermint::{block::signed_header::SignedHeader, crypto::Sha256, merkle::MerkleHash}; -use tendermint_light_client::light_client::TargetOrLatest; -use tendermint_light_client::verifier::errors::ErrorExt; -use tendermint_light_client::verifier::types::LightBlock; +use cometbft::{block::signed_header::SignedHeader, crypto::Sha256, merkle::MerkleHash}; +use cometbft_light_client::light_client::TargetOrLatest; +use cometbft_light_client::verifier::errors::ErrorExt; +use cometbft_light_client::verifier::types::LightBlock; use crate::conflict::GatheredEvidence; @@ -120,7 +120,7 @@ pub enum CompareError { /// The witness has either not responded, doesn't have the header or has given us an invalid one BadWitness, /// Some other error has occurred, this is likely a benign error - Other(tendermint_light_client::errors::Error), + Other(cometbft_light_client::errors::Error), } /// Takes the verified header from the primary and compares it with a diff --git a/light-client-detector/src/error.rs b/light-client-detector/src/error.rs index 1cb876cc..bf2b7e1f 100644 --- a/light-client-detector/src/error.rs +++ b/light-client-detector/src/error.rs @@ -1,7 +1,7 @@ -use tendermint::{block::Height, Hash, Time}; -use tendermint_light_client::components::io::IoError; -use tendermint_light_client::errors::Error as LightClientError; -use tendermint_light_client::verifier::types::LightBlock; +use cometbft::{block::Height, Hash, Time}; +use cometbft_light_client::components::io::IoError; +use cometbft_light_client::errors::Error as LightClientError; +use cometbft_light_client::verifier::types::LightBlock; use crate::conflict::GatheredEvidence; diff --git a/light-client-detector/src/evidence.rs b/light-client-detector/src/evidence.rs index 717bc71b..dd87192a 100644 --- a/light-client-detector/src/evidence.rs +++ b/light-client-detector/src/evidence.rs @@ -1,12 +1,12 @@ use std::cmp::Ordering; -use tendermint::{ +use cometbft::{ block::{signed_header::SignedHeader, Header}, evidence::{ConflictingBlock, LightClientAttackEvidence}, validator, }; -use tendermint_light_client::verifier::types::LightBlock; +use cometbft_light_client::verifier::types::LightBlock; /// Determines the type of attack and then forms the evidence filling out /// all the fields such that it is ready to be sent to a full node. diff --git a/light-client-detector/src/examine.rs b/light-client-detector/src/examine.rs index 84cddbdf..5e4ebbf6 100644 --- a/light-client-detector/src/examine.rs +++ b/light-client-detector/src/examine.rs @@ -1,5 +1,5 @@ -use tendermint::{crypto::Sha256, merkle::MerkleHash}; -use tendermint_light_client::{ +use cometbft::{crypto::Sha256, merkle::MerkleHash}; +use cometbft_light_client::{ state::State, store::{memory::MemoryStore, LightStore}, verifier::types::{LightBlock, Status}, diff --git a/light-client-detector/src/lib.rs b/light-client-detector/src/lib.rs index 2d8216a9..030ba529 100644 --- a/light-client-detector/src/lib.rs +++ b/light-client-detector/src/lib.rs @@ -10,9 +10,9 @@ mod examine; mod provider; mod trace; +pub use cometbft::evidence::{Evidence, LightClientAttackEvidence}; pub use conflict::gather_evidence_from_conflicting_headers; pub use detect::{compare_new_header_with_witness, detect_divergence, CompareError, Divergence}; pub use error::{Error, ErrorDetail}; pub use provider::Provider; -pub use tendermint::evidence::{Evidence, LightClientAttackEvidence}; pub use trace::Trace; diff --git a/light-client-detector/src/provider.rs b/light-client-detector/src/provider.rs index 8abb5359..f9452bc3 100644 --- a/light-client-detector/src/provider.rs +++ b/light-client-detector/src/provider.rs @@ -1,13 +1,13 @@ -use tendermint::block::Height; -use tendermint::evidence::Evidence; -use tendermint::hash::Hash; -use tendermint_light_client::errors::Error; -use tendermint_light_client::instance::Instance; -use tendermint_light_client::light_client::TargetOrLatest; -use tendermint_light_client::state::State; -use tendermint_light_client::store::memory::MemoryStore; -use tendermint_light_client::verifier::types::LightBlock; -use tendermint_rpc::{Client, Error as RpcError, HttpClient}; +use cometbft::block::Height; +use cometbft::evidence::Evidence; +use cometbft::hash::Hash; +use cometbft_light_client::errors::Error; +use cometbft_light_client::instance::Instance; +use cometbft_light_client::light_client::TargetOrLatest; +use cometbft_light_client::state::State; +use cometbft_light_client::store::memory::MemoryStore; +use cometbft_light_client::verifier::types::LightBlock; +use cometbft_rpc::{Client, Error as RpcError, HttpClient}; /// A interface over a light client instance and its RPC client. #[derive(Debug)] @@ -30,7 +30,7 @@ impl Provider { &self.chain_id } - pub fn peer_id(&self) -> &tendermint::node::Id { + pub fn peer_id(&self) -> &cometbft::node::Id { self.instance.peer_id() } diff --git a/light-client-detector/src/trace.rs b/light-client-detector/src/trace.rs index f528ba0d..ecb422c3 100644 --- a/light-client-detector/src/trace.rs +++ b/light-client-detector/src/trace.rs @@ -1,4 +1,4 @@ -use tendermint_light_client::verifier::types::LightBlock; +use cometbft_light_client::verifier::types::LightBlock; use super::Error; diff --git a/light-client-js/src/lib.rs b/light-client-js/src/lib.rs index 38068f39..5482488f 100644 --- a/light-client-js/src/lib.rs +++ b/light-client-js/src/lib.rs @@ -13,18 +13,18 @@ mod utils; use std::time::Duration; -use serde::{Deserialize, Serialize}; -use tendermint::Time; -use tendermint_light_client_verifier::{ +use cometbft::Time; +use cometbft_light_client_verifier::{ options::Options, types::{LightBlock, TrustThreshold}, Verifier, }; +use serde::{Deserialize, Serialize}; use wasm_bindgen::{prelude::*, JsValue}; // TODO: Use Web Crypto API for cryptographic routines. // https://github.com/informalsystems/tendermint-rs/issues/1241 -use tendermint_light_client_verifier::ProdVerifier; +use cometbft_light_client_verifier::ProdVerifier; /// Check whether a given untrusted block can be trusted. #[wasm_bindgen] diff --git a/light-client-js/tests/web.rs b/light-client-js/tests/web.rs index 503a862b..7dbedc53 100644 --- a/light-client-js/tests/web.rs +++ b/light-client-js/tests/web.rs @@ -3,9 +3,9 @@ #![cfg(target_arch = "wasm32")] extern crate wasm_bindgen_test; -use tendermint::Time; -use tendermint_light_client_js::{verify, Error, JsOptions}; -use tendermint_light_client_verifier::{types::LightBlock, Verdict}; +use cometbft::Time; +use cometbft_light_client_js::{verify, Error, JsOptions}; +use cometbft_light_client_verifier::{types::LightBlock, Verdict}; use wasm_bindgen::JsValue; use wasm_bindgen_test::*; diff --git a/light-client-verifier/src/errors.rs b/light-client-verifier/src/errors.rs index 24f6b09c..415930a3 100644 --- a/light-client-verifier/src/errors.rs +++ b/light-client-verifier/src/errors.rs @@ -2,9 +2,9 @@ use core::time::Duration; +use cometbft::{account::Id, Error as TendermintError}; use flex_error::define_error; use serde::{Deserialize, Serialize}; -use tendermint::{account::Id, Error as TendermintError}; use crate::{ operations::voting_power::VotingPowerTally, diff --git a/light-client-verifier/src/operations/commit_validator.rs b/light-client-verifier/src/operations/commit_validator.rs index 24908b74..a90c8295 100644 --- a/light-client-verifier/src/operations/commit_validator.rs +++ b/light-client-verifier/src/operations/commit_validator.rs @@ -1,6 +1,6 @@ //! Provides an interface and default implementation for the `CommitValidator` operation -use tendermint::block::CommitSig; +use cometbft::block::CommitSig; use crate::{ errors::VerificationError, diff --git a/light-client-verifier/src/operations/voting_power.rs b/light-client-verifier/src/operations/voting_power.rs index 73d39516..65e3ddb8 100644 --- a/light-client-verifier/src/operations/voting_power.rs +++ b/light-client-verifier/src/operations/voting_power.rs @@ -3,13 +3,13 @@ use alloc::collections::BTreeSet as HashSet; use core::{convert::TryFrom, fmt, marker::PhantomData}; -use serde::{Deserialize, Serialize}; -use tendermint::{ +use cometbft::{ block::CommitSig, crypto::signature, trust_threshold::TrustThreshold as _, vote::{SignedVote, ValidatorIndex, Vote}, }; +use serde::{Deserialize, Serialize}; use crate::{ errors::VerificationError, @@ -121,7 +121,7 @@ impl Default for ProvidedVotingPowerCalculator { /// Default implementation of a `VotingPowerCalculator`. #[cfg(feature = "rust-crypto")] pub type ProdVotingPowerCalculator = - ProvidedVotingPowerCalculator; + ProvidedVotingPowerCalculator; impl VotingPowerCalculator for ProvidedVotingPowerCalculator { fn voting_power_in( @@ -224,7 +224,7 @@ fn non_absent_vote( }; Some(Vote { - vote_type: tendermint::vote::Type::Precommit, + vote_type: cometbft::vote::Type::Precommit, height: commit.height, round: commit.round, block_id, @@ -243,8 +243,8 @@ fn non_absent_vote( // TODO: We plan to add Lightweight MBT for `voting_power_in` in the near future #[cfg(test)] mod tests { - use tendermint::trust_threshold::TrustThresholdFraction; - use tendermint_testgen::{ + use cometbft::trust_threshold::TrustThresholdFraction; + use cometbft_testgen::{ light_block::generate_signed_header, Commit, Generator, Header, LightBlock as TestgenLightBlock, ValidatorSet, Vote as TestgenVote, }; diff --git a/light-client-verifier/src/predicates.rs b/light-client-verifier/src/predicates.rs index 8383ff48..33ecf4dc 100644 --- a/light-client-verifier/src/predicates.rs +++ b/light-client-verifier/src/predicates.rs @@ -2,7 +2,7 @@ use core::time::Duration; -use tendermint::{ +use cometbft::{ block::Height, chain::Id as ChainId, crypto::Sha256, hash::Hash, merkle::MerkleHash, }; @@ -21,7 +21,7 @@ pub struct ProdPredicates; #[cfg(feature = "rust-crypto")] impl VerificationPredicates for ProdPredicates { - type Sha256 = tendermint::crypto::default::Sha256; + type Sha256 = cometbft::crypto::default::Sha256; } /// Defines the various predicates used to validate and verify light blocks. @@ -231,8 +231,8 @@ pub trait VerificationPredicates: Send + Sync { mod tests { use core::{convert::TryInto, time::Duration}; - use tendermint::{block::CommitSig, validator::Set}; - use tendermint_testgen::{ + use cometbft::{block::CommitSig, validator::Set}; + use cometbft_testgen::{ light_block::{LightBlock as TestgenLightBlock, TmLightBlock}, Commit, Generator, Header, Validator, ValidatorSet, }; diff --git a/light-client-verifier/src/types.rs b/light-client-verifier/src/types.rs index 2942509b..c480a42b 100644 --- a/light-client-verifier/src/types.rs +++ b/light-client-verifier/src/types.rs @@ -1,8 +1,6 @@ //! Defines or just re-exports the main datatypes used by the light client. -use derive_more::Display; -use serde::{Deserialize, Serialize}; -use tendermint::{ +use cometbft::{ account::Id as TMAccountId, block::{ header::Header as TMHeader, signed_header::SignedHeader as TMSignedHeader, @@ -12,12 +10,14 @@ use tendermint::{ trust_threshold::TrustThresholdFraction, validator::{Info as TMValidatorInfo, Set as TMValidatorSet}, }; -pub use tendermint::{block::Height, hash::Hash, time::Time}; +pub use cometbft::{block::Height, hash::Hash, time::Time}; +use derive_more::Display; +use serde::{Deserialize, Serialize}; use crate::prelude::*; /// Peer ID (public key) of a full node -pub type PeerId = tendermint::node::Id; +pub type PeerId = cometbft::node::Id; /// defines what fraction of the total voting power of a known /// and trusted validator set is sufficient for a commit to be @@ -180,11 +180,11 @@ pub struct LatestStatus { /// The latest height we are trusting. pub height: Option, /// The latest block hash we are trusting. - #[serde(with = "tendermint::serializers::option_hash")] + #[serde(with = "cometbft::serializers::option_hash")] pub block_hash: Option, /// The latest validator set we are trusting. /// Note that this potentially did not yet sign a header yet. - #[serde(with = "tendermint::serializers::option_hash")] + #[serde(with = "cometbft::serializers::option_hash")] pub valset_hash: Option, /// The list of fullnodes we are connected to, primary and witnesses. pub connected_nodes: Vec, diff --git a/light-client-verifier/src/verifier.rs b/light-client-verifier/src/verifier.rs index fd2e8826..e70e627c 100644 --- a/light-client-verifier/src/verifier.rs +++ b/light-client-verifier/src/verifier.rs @@ -322,8 +322,8 @@ mod tests { use alloc::{borrow::ToOwned, string::ToString}; use core::{ops::Sub, time::Duration}; - use tendermint::Time; - use tendermint_testgen::{light_block::LightBlock as TestgenLightBlock, Generator}; + use cometbft::Time; + use cometbft_testgen::{light_block::LightBlock as TestgenLightBlock, Generator}; use crate::{ errors::VerificationErrorDetail, options::Options, types::LightBlock, ProdVerifier, diff --git a/light-client/src/builder/error.rs b/light-client/src/builder/error.rs index be2a541b..4b271fe4 100644 --- a/light-client/src/builder/error.rs +++ b/light-client/src/builder/error.rs @@ -1,7 +1,7 @@ //! Errors raised by the builder DSL +use cometbft::{block::Height, Hash}; use flex_error::define_error; -use tendermint::{block::Height, Hash}; use crate::{components::io::IoError, verifier::errors::VerificationError}; diff --git a/light-client/src/builder/light_client.rs b/light-client/src/builder/light_client.rs index 8aaf9d9f..07c0863e 100644 --- a/light-client/src/builder/light_client.rs +++ b/light-client/src/builder/light_client.rs @@ -1,6 +1,6 @@ //! DSL for building a light client [`Instance`] -use tendermint::{block::Height, crypto::Sha256, merkle::MerkleHash, Hash}; +use cometbft::{block::Height, crypto::Sha256, merkle::MerkleHash, Hash}; #[cfg(feature = "rpc-client")] use { @@ -8,8 +8,8 @@ use { crate::components::io::ProdIo, crate::components::scheduler, crate::verifier::{predicates::ProdPredicates, ProdVerifier}, + cometbft_rpc as rpc, core::time::Duration, - tendermint_rpc as rpc, }; use crate::{ @@ -74,7 +74,7 @@ where } #[cfg(feature = "rpc-client")] -impl LightClientBuilder { +impl LightClientBuilder { /// Initialize a builder for a production (non-mock) light client. pub fn prod( peer_id: PeerId, diff --git a/light-client/src/components.rs b/light-client/src/components.rs index 2b30995c..cf1b5828 100644 --- a/light-client/src/components.rs +++ b/light-client/src/components.rs @@ -5,4 +5,4 @@ pub mod io; pub mod scheduler; // Re-export for backward compatibility -pub use tendermint_light_client_verifier as verifier; +pub use cometbft_light_client_verifier as verifier; diff --git a/light-client/src/components/io.rs b/light-client/src/components/io.rs index 4b2f559e..6f2e7ced 100644 --- a/light-client/src/components/io.rs +++ b/light-client/src/components/io.rs @@ -2,10 +2,10 @@ use std::time::Duration; -use flex_error::{define_error, TraceError}; -use tendermint_rpc as rpc; +use cometbft_rpc as rpc; #[cfg(feature = "rpc-client")] -use tendermint_rpc::Client; +use cometbft_rpc::Client; +use flex_error::{define_error, TraceError}; use crate::verifier::types::{Height, LightBlock}; @@ -56,7 +56,7 @@ define_error! { }, InvalidValidatorSet - [ tendermint::Error ] + [ cometbft::Error ] | _ | { "fetched validator set is invalid" }, Timeout @@ -133,11 +133,11 @@ pub use self::prod::ProdIo; mod prod { use std::time::Duration; - use tendermint::{ + use cometbft::{ account::Id as TMAccountId, block::signed_header::SignedHeader as TMSignedHeader, validator::Set as TMValidatorSet, }; - use tendermint_rpc::Paging; + use cometbft_rpc::Paging; use super::*; use crate::{utils::block_on, verifier::types::PeerId}; diff --git a/light-client/src/instance.rs b/light-client/src/instance.rs index 7a3d141f..a975784e 100644 --- a/light-client/src/instance.rs +++ b/light-client/src/instance.rs @@ -1,6 +1,6 @@ //! Supervisor and Handle implementation. -use tendermint::block::Height; +use cometbft::block::Height; use crate::{ errors::Error, @@ -29,7 +29,7 @@ impl Instance { } /// Return the peer id of this instance. - pub fn peer_id(&self) -> &tendermint::node::Id { + pub fn peer_id(&self) -> &cometbft::node::Id { &self.light_client.peer } diff --git a/light-client/src/lib.rs b/light-client/src/lib.rs index a2f25d33..a4c05e01 100644 --- a/light-client/src/lib.rs +++ b/light-client/src/lib.rs @@ -27,7 +27,7 @@ pub mod store; pub(crate) mod utils; // Re-export `tendermint-light-client-verifier` crate. -pub use tendermint_light_client_verifier as verifier; +pub use cometbft_light_client_verifier as verifier; // Re-export for backward compatibility pub use verifier::{operations, predicates, types}; diff --git a/light-client/src/light_client.rs b/light-client/src/light_client.rs index eabca175..39b78670 100644 --- a/light-client/src/light_client.rs +++ b/light-client/src/light_client.rs @@ -296,7 +296,7 @@ impl LightClient { target_height: Height, state: &mut State, ) -> Result { - use tendermint::crypto::default::Sha256; + use cometbft::crypto::default::Sha256; let root = state .light_store diff --git a/light-client/src/store/sled.rs b/light-client/src/store/sled.rs index 8a6be662..ff824f8c 100644 --- a/light-client/src/store/sled.rs +++ b/light-client/src/store/sled.rs @@ -94,8 +94,8 @@ impl LightStore for SledStore { #[cfg(test)] mod tests { + use cometbft_testgen::{light_block::TmLightBlock as TGLightBlock, Generator, LightChain}; use tempfile::tempdir; - use tendermint_testgen::{light_block::TmLightBlock as TGLightBlock, Generator, LightChain}; use super::*; diff --git a/light-client/src/tests.rs b/light-client/src/tests.rs index c4ac4885..15152cff 100644 --- a/light-client/src/tests.rs +++ b/light-client/src/tests.rs @@ -5,9 +5,9 @@ use std::collections::HashMap; #[cfg(feature = "rust-crypto")] use std::time::Duration; +use cometbft::{block::Height as HeightStr, evidence::Duration as DurationStr}; +use cometbft_rpc as rpc; use serde::{Deserialize, Serialize}; -use tendermint::{block::Height as HeightStr, evidence::Duration as DurationStr}; -use tendermint_rpc as rpc; use crate::{ components::{ diff --git a/light-client/tests/backward.rs b/light-client/tests/backward.rs index 2cdb774b..52ead164 100644 --- a/light-client/tests/backward.rs +++ b/light-client/tests/backward.rs @@ -2,9 +2,8 @@ use std::{collections::HashMap, time::Duration}; -use proptest::{prelude::*, test_runner::TestRng}; -use tendermint::{hash::Algorithm, Hash, Time}; -use tendermint_light_client::{ +use cometbft::{hash::Algorithm, Hash, Time}; +use cometbft_light_client::{ components::{ io::{AtHeight, Io}, scheduler, @@ -20,10 +19,11 @@ use tendermint_light_client::{ ProdVerifier, }, }; -use tendermint_testgen::{ +use cometbft_testgen::{ light_block::{default_peer_id, TmLightBlock as TGLightBlock}, Generator, LightChain, }; +use proptest::{prelude::*, test_runner::TestRng}; fn testgen_to_lb(tm_lb: TGLightBlock) -> LightBlock { LightBlock { @@ -47,7 +47,7 @@ fn make(chain: LightChain, trusted_height: Height) -> (LightClient, State) { let clock = MockClock { /// Set the current time to be ahead of the latest block in the chain - now: tendermint_testgen::helpers::get_time(chain.light_blocks.len() as u64 + 1).unwrap(), + now: cometbft_testgen::helpers::get_time(chain.light_blocks.len() as u64 + 1).unwrap(), }; let options = Options { diff --git a/light-client/tests/light_client.rs b/light-client/tests/light_client.rs index 0ad03c2b..b194cc61 100644 --- a/light-client/tests/light_client.rs +++ b/light-client/tests/light_client.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, time::Duration}; -use tendermint_light_client::{ +use cometbft_light_client::{ components::{ io::{AtHeight, Io}, scheduler, @@ -16,7 +16,7 @@ use tendermint_light_client::{ ProdVerifier, }, }; -use tendermint_testgen::{light_block::default_peer_id, Tester}; +use cometbft_testgen::{light_block::default_peer_id, Tester}; // Link to JSON test files repo: // https://github.com/informalsystems/conformance-tests diff --git a/light-client/tests/model_based.rs b/light-client/tests/model_based.rs index 64cad1db..5460f7ce 100644 --- a/light-client/tests/model_based.rs +++ b/light-client/tests/model_based.rs @@ -6,24 +6,24 @@ mod mbt { time::Duration, }; - use rand::Rng; - use serde::{de::DeserializeOwned, Deserialize, Serialize}; - use serde_json::Error; - use tendermint::validator::Set; - use tendermint_light_client::{ + use cometbft::validator::Set; + use cometbft_light_client::{ tests::*, verifier::{ types::{LightBlock, Time, TrustThreshold, ValidatorSet}, Verdict, }, }; - use tendermint_testgen::{ + use cometbft_testgen::{ apalache::*, jsonatr::*, light_block::{default_peer_id, TmLightBlock}, validator::generate_validators, Command, Generator, LightBlock as TestgenLightBlock, TestEnv, Tester, Validator, Vote, }; + use rand::Rng; + use serde::{de::DeserializeOwned, Deserialize, Serialize}; + use serde_json::Error; use time::OffsetDateTime; fn testgen_to_lb(tm_lb: TmLightBlock) -> LightBlock { @@ -100,9 +100,9 @@ mod mbt { fn fuzz_input(input: &mut BlockVerdict) -> (String, LiteVerdict); /// Get a random hash value - fn random_hash() -> tendermint::hash::Hash { + fn random_hash() -> cometbft::hash::Hash { // not really random, but should be different from whatever hash is there - tendermint::hash::Hash::from_str( + cometbft::hash::Hash::from_str( "AAAAAAAAAA1BA22917BBE036BA9D58A40918E93983B57BD0DC465301E10B5419", ) .unwrap() @@ -147,7 +147,7 @@ mod mbt { } input.block.signed_header.header.version = - tendermint::block::header::Version { block, app }; + cometbft::block::header::Version { block, app }; (String::from("header version"), LiteVerdict::Invalid) } } @@ -159,7 +159,7 @@ mod mbt { // TODO: this would fail on `header_matches_commit` because header isn't rehashed fn fuzz_input(input: &mut BlockVerdict) -> (String, LiteVerdict) { input.block.signed_header.header.chain_id = - tendermint::chain::Id::from_str("AAAAAAAAAAAAAAAAAA").unwrap(); + cometbft::chain::Id::from_str("AAAAAAAAAAAAAAAAAA").unwrap(); (String::from("header chain_id"), LiteVerdict::Invalid) } } @@ -175,7 +175,7 @@ mod mbt { height = rng.gen(); } input.block.signed_header.header.height = - tendermint::block::Height::try_from(height).unwrap(); + cometbft::block::Height::try_from(height).unwrap(); (String::from("header height"), LiteVerdict::ParseError) } } @@ -187,20 +187,19 @@ mod mbt { let mut rng = rand::thread_rng(); let now: Time = OffsetDateTime::now_utc().try_into().unwrap(); let secs = now - .duration_since(tendermint::Time::unix_epoch()) + .duration_since(cometbft::Time::unix_epoch()) .unwrap() .as_secs(); let rand_secs = rng.gen_range(1, secs); - input.block.signed_header.header.time = (tendermint::Time::unix_epoch() - + std::time::Duration::from_secs(rand_secs)) - .unwrap(); + input.block.signed_header.header.time = + (cometbft::Time::unix_epoch() + std::time::Duration::from_secs(rand_secs)).unwrap(); // TODO: the fuzzing below fails with one of: // - 'overflow when adding duration to instant', src/libstd/time.rs:549:31 // - 'No such local time', // /home/andrey/.cargo/registry/src/github.com-1ecc6299db9ec823/chrono-0.4.11/src/ // offset/mod.rs:173:34 // let secs: u64 = rng.gen(); - // input.block.signed_header.header.time = tendermint::Time::unix_epoch() + + // input.block.signed_header.header.time = cometbft::Time::unix_epoch() + // std::time::Duration::from_secs(secs); (String::from("header time"), LiteVerdict::Invalid) } @@ -215,7 +214,7 @@ mod mbt { // don't match. And so, this always fails on "header_matches_commit" predicate // For better testing of the actual fuzzed value, we need to do better here :) // TODO! - input.block.signed_header.header.last_block_id = Some(tendermint::block::Id { + input.block.signed_header.header.last_block_id = Some(cometbft::block::Id { hash: Self::random_hash(), part_set_header: Default::default(), }); @@ -297,7 +296,7 @@ mod mbt { // TODO: Do we need this? because we don't even validate `app_hash` fn fuzz_input(input: &mut BlockVerdict) -> (String, LiteVerdict) { input.block.signed_header.header.app_hash = - tendermint::hash::AppHash::try_from(vec![0, 1, 2, 3, 4, 5]).unwrap(); + cometbft::hash::AppHash::try_from(vec![0, 1, 2, 3, 4, 5]).unwrap(); (String::from("header app_hash"), LiteVerdict::Invalid) } } @@ -350,7 +349,7 @@ mod mbt { height = rng.gen(); } input.block.signed_header.commit.height = - tendermint::block::Height::try_from(height).unwrap(); + cometbft::block::Height::try_from(height).unwrap(); (String::from("commit height"), LiteVerdict::ParseError) } } @@ -394,7 +393,7 @@ mod mbt { impl SingleStepTestFuzzer for CommitBlockIdFuzzer { fn fuzz_input(input: &mut BlockVerdict) -> (String, LiteVerdict) { - input.block.signed_header.commit.block_id = tendermint::block::Id { + input.block.signed_header.commit.block_id = cometbft::block::Id { hash: Self::random_hash(), part_set_header: Default::default(), }; diff --git a/p2p/src/secret_connection.rs b/p2p/src/secret_connection.rs index 80731808..ded1fd47 100644 --- a/p2p/src/secret_connection.rs +++ b/p2p/src/secret_connection.rs @@ -16,6 +16,8 @@ use chacha20poly1305::{ aead::{generic_array::GenericArray, AeadInPlace, KeyInit}, ChaCha20Poly1305, }; +use cometbft_proto::v0_38 as proto; +use cometbft_std_ext::TryClone; use curve25519_dalek_ng::{ constants::X25519_BASEPOINT, montgomery::MontgomeryPoint as EphemeralPublic, scalar::Scalar as EphemeralSecret, @@ -23,8 +25,6 @@ use curve25519_dalek_ng::{ use merlin::Transcript; use rand_core::OsRng; use subtle::ConstantTimeEq; -use tendermint_proto::v0_38 as proto; -use tendermint_std_ext::TryClone; pub use self::{ kdf::Kdf, @@ -247,7 +247,7 @@ macro_rules! checked_io { /// not both simultaneously). /// /// If, however, the underlying I/O handler class implements -/// [`tendermint_std_ext::TryClone`], then you can use +/// [`cometbft_std_ext::TryClone`], then you can use /// [`SecretConnection::split`] to split the `SecretConnection` into its /// sending and receiving halves. Each of these halves can then be used in a /// separate thread to facilitate full-duplex communication. @@ -334,7 +334,7 @@ where ::Error: std::error::Error + Send + Sync + 'static, { /// For secret connections whose underlying I/O layer implements - /// [`tendermint_std_ext::TryClone`], this attempts to split such a + /// [`cometbft_std_ext::TryClone`], this attempts to split such a /// connection into its sending and receiving halves. /// /// This facilitates full-duplex communications when each half is used in diff --git a/p2p/src/secret_connection/amino_types.rs b/p2p/src/secret_connection/amino_types.rs index 79912e0e..31e660e2 100644 --- a/p2p/src/secret_connection/amino_types.rs +++ b/p2p/src/secret_connection/amino_types.rs @@ -1,8 +1,8 @@ //! Amino types used by Secret Connection +use cometbft_proto::v0_38 as proto; use core::convert::TryFrom; use prost_derive::Message; -use tendermint_proto::v0_38 as proto; use crate::error::Error; diff --git a/p2p/src/secret_connection/protocol.rs b/p2p/src/secret_connection/protocol.rs index b5d9febb..bd1baf48 100644 --- a/p2p/src/secret_connection/protocol.rs +++ b/p2p/src/secret_connection/protocol.rs @@ -2,9 +2,9 @@ use std::convert::TryInto; +use cometbft_proto::v0_38 as proto; use curve25519_dalek_ng::montgomery::MontgomeryPoint as EphemeralPublic; use prost::Message as _; -use tendermint_proto::v0_38 as proto; #[cfg(feature = "amino")] use super::amino_types; diff --git a/p2p/src/secret_connection/public_key.rs b/p2p/src/secret_connection/public_key.rs index 8e64c8dd..5698a82a 100644 --- a/p2p/src/secret_connection/public_key.rs +++ b/p2p/src/secret_connection/public_key.rs @@ -2,8 +2,8 @@ use std::fmt::{self, Display}; +use cometbft::{error::Error, node}; use sha2::{digest::Digest, Sha256}; -use tendermint::{error::Error, node}; /// Secret Connection peer public keys (signing, presently Ed25519-only) #[derive(Copy, Clone, Debug, Eq, PartialEq)] @@ -37,7 +37,7 @@ impl PublicKey { pub fn peer_id(self) -> node::Id { match self { Self::Ed25519(pk) => { - // TODO(tarcieri): use `tendermint::node::Id::from` + // TODO(tarcieri): use `cometbft::node::Id::from` let digest = Sha256::digest(pk.as_bytes()); let mut bytes = [0_u8; 20]; bytes.copy_from_slice(&digest[..20]); diff --git a/p2p/src/transport.rs b/p2p/src/transport.rs index ae3c5c7e..114cd5e9 100644 --- a/p2p/src/transport.rs +++ b/p2p/src/transport.rs @@ -3,8 +3,8 @@ use std::net::{SocketAddr, ToSocketAddrs}; +use cometbft::{node, public_key::PublicKey}; use eyre::Result; -use tendermint::{node, public_key::PublicKey}; /// Information which resources to bind to and how to identify on the network. pub struct BindInfo diff --git a/pbt-gen/src/time.rs b/pbt-gen/src/time.rs index a22c8990..851bc53a 100644 --- a/pbt-gen/src/time.rs +++ b/pbt-gen/src/time.rs @@ -17,7 +17,7 @@ pub const MAX_NANO_SECS: u32 = 999_999_999u32; /// times with [`OffsetDateTime::from_unix_timestamp`]. /// /// ``` -/// use tendermint_pbt_gen as pbt_gen; +/// use cometbft_pbt_gen as pbt_gen; /// use time::OffsetDateTime; /// /// let timestamp = pbt_gen::time::min_time().unix_timestamp_nanos(); @@ -32,7 +32,7 @@ pub fn min_time() -> OffsetDateTime { /// times with [`OffsetDateTime::from_unix_timestamp`]. /// /// ``` -/// use tendermint_pbt_gen as pbt_gen; +/// use cometbft_pbt_gen as pbt_gen; /// use time::OffsetDateTime; /// /// let timestamp = pbt_gen::time::max_time().unix_timestamp_nanos(); @@ -75,7 +75,7 @@ prop_compose! { /// /// ``` /// use time::macros::datetime; - /// use tendermint_pbt_gen as pbt_gen; + /// use cometbft_pbt_gen as pbt_gen; /// use proptest::prelude::*; /// /// proptest!{ diff --git a/proto/src/lib.rs b/proto/src/lib.rs index 15fdd2cb..be546930 100644 --- a/proto/src/lib.rs +++ b/proto/src/lib.rs @@ -42,7 +42,7 @@ use prelude::*; /// use bytes::BufMut; /// use prost::Message; /// use core::convert::TryFrom; -/// use tendermint_proto::Protobuf; +/// use cometbft_proto::Protobuf; /// /// // This struct would ordinarily be automatically generated by prost. /// #[derive(Clone, PartialEq, Message)] diff --git a/proto/tests/unit.rs b/proto/tests/unit.rs index fc3c67b7..4456d4d7 100644 --- a/proto/tests/unit.rs +++ b/proto/tests/unit.rs @@ -1,7 +1,7 @@ use core::convert::TryFrom; -use tendermint_proto::v0_38::types::{BlockId as RawBlockId, PartSetHeader as RawPartSetHeader}; -use tendermint_proto::Protobuf; +use cometbft_proto::v0_38::types::{BlockId as RawBlockId, PartSetHeader as RawPartSetHeader}; +use cometbft_proto::Protobuf; impl Protobuf for BlockId {} diff --git a/rpc/src/client.rs b/rpc/src/client.rs index 523a32d1..f3084357 100644 --- a/rpc/src/client.rs +++ b/rpc/src/client.rs @@ -27,8 +27,8 @@ pub use transport::mock::{MockClient, MockRequestMatcher, MockRequestMethodMatch use core::fmt; use async_trait::async_trait; +use cometbft::{abci, block::Height, evidence::Evidence, Genesis, Hash}; use serde::{de::DeserializeOwned, Serialize}; -use tendermint::{abci, block::Height, evidence::Evidence, Genesis, Hash}; use crate::{ endpoint::{validators::DEFAULT_VALIDATORS_PER_PAGE, *}, @@ -78,10 +78,7 @@ pub trait Client { } /// `/block_by_hash`: get block by hash. - async fn block_by_hash( - &self, - hash: tendermint::Hash, - ) -> Result { + async fn block_by_hash(&self, hash: cometbft::Hash) -> Result { self.perform(block_by_hash::Request::new(hash)).await } @@ -101,7 +98,7 @@ pub trait Client { /// `/header_by_hash`: get block by hash. async fn header_by_hash( &self, - hash: tendermint::Hash, + hash: cometbft::Hash, ) -> Result { self.perform(header_by_hash::Request::new(hash)).await } diff --git a/rpc/src/client/bin/main.rs b/rpc/src/client/bin/main.rs index d53de860..6a7d3bca 100644 --- a/rpc/src/client/bin/main.rs +++ b/rpc/src/client/bin/main.rs @@ -2,16 +2,16 @@ use core::str::FromStr; -use futures::StreamExt; -use structopt::StructOpt; -use tendermint::Hash; -use tendermint_rpc::{ +use cometbft::Hash; +use cometbft_rpc::{ client::CompatMode, event::{self, Event, EventData}, query::Query, Client, Error, HttpClient, Order, Paging, Scheme, Subscription, SubscriptionClient, Url, WebSocketClient, }; +use futures::StreamExt; +use structopt::StructOpt; use tokio::{task::JoinHandle, time::Duration}; use tracing::{debug, error, info, level_filters::LevelFilter, warn}; @@ -349,7 +349,7 @@ where ClientRequest::BlockByHash { hash } => serde_json::to_string_pretty( &client .block_by_hash( - tendermint::Hash::from_str(&hash).map_err(|e| Error::parse(e.to_string()))?, + cometbft::Hash::from_str(&hash).map_err(|e| Error::parse(e.to_string()))?, ) .await?, ) diff --git a/rpc/src/client/compat.rs b/rpc/src/client/compat.rs index 05824d87..ed99e0ce 100644 --- a/rpc/src/client/compat.rs +++ b/rpc/src/client/compat.rs @@ -2,7 +2,7 @@ use core::fmt; -use tendermint::Version; +use cometbft::Version; use crate::prelude::*; use crate::Error; @@ -68,7 +68,7 @@ impl fmt::Display for CompatMode { mod tests { use super::CompatMode; use crate::prelude::*; - use tendermint::Version; + use cometbft::Version; fn parse_version(s: &str) -> Version { let json = format!("\"{s}\""); diff --git a/rpc/src/client/subscription.rs b/rpc/src/client/subscription.rs index d530adf4..baeb0c02 100644 --- a/rpc/src/client/subscription.rs +++ b/rpc/src/client/subscription.rs @@ -49,7 +49,7 @@ pub(crate) type SubscriptionRx = ChannelRx>; /// ## Examples /// /// ``` -/// use tendermint_rpc::Subscription; +/// use cometbft_rpc::Subscription; /// use futures::StreamExt; /// /// /// Prints `count` events from the given subscription. diff --git a/rpc/src/client/transport/http.rs b/rpc/src/client/transport/http.rs index d6d2135d..71fecaae 100644 --- a/rpc/src/client/transport/http.rs +++ b/rpc/src/client/transport/http.rs @@ -8,8 +8,8 @@ use core::{ use async_trait::async_trait; use reqwest::{header, Proxy}; -use tendermint::{block::Height, evidence::Evidence, Hash}; -use tendermint_config::net; +use cometbft::{block::Height, evidence::Evidence, Hash}; +use cometbft_config::net; use super::auth; use crate::prelude::*; @@ -37,7 +37,7 @@ const USER_AGENT: &str = concat!("tendermint.rs/", env!("CARGO_PKG_VERSION")); /// ## Examples /// /// ```rust,ignore -/// use tendermint_rpc::{HttpClient, Client}; +/// use cometbft_rpc::{HttpClient, Client}; /// /// #[tokio::main] /// async fn main() { diff --git a/rpc/src/client/transport/mock.rs b/rpc/src/client/transport/mock.rs index bc05e189..29dc96bb 100644 --- a/rpc/src/client/transport/mock.rs +++ b/rpc/src/client/transport/mock.rs @@ -25,7 +25,7 @@ use crate::{ /// ## Examples /// /// ```rust -/// use tendermint_rpc::{Client, Method, MockClient, MockRequestMatcher, MockRequestMethodMatcher}; +/// use cometbft_rpc::{Client, Method, MockClient, MockRequestMatcher, MockRequestMethodMatcher}; /// /// const ABCI_INFO_RESPONSE: &str = r#"{ /// "jsonrpc": "2.0", @@ -244,8 +244,8 @@ impl MockRequestMethodMatcher { mod test { use std::path::PathBuf; + use cometbft::{block::Height, chain::Id}; use futures::StreamExt; - use tendermint::{block::Height, chain::Id}; use tokio::fs; use super::*; diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index ce3738f6..6fbd8ae5 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -21,8 +21,8 @@ use serde::{Deserialize, Serialize}; use tokio::time::{Duration, Instant}; use tracing::{debug, error}; -use tendermint::{block::Height, Hash}; -use tendermint_config::net; +use cometbft::{block::Height, Hash}; +use cometbft_config::net; use super::router::{SubscriptionId, SubscriptionIdRef}; use crate::{ @@ -97,9 +97,9 @@ pub use async_tungstenite::tungstenite::protocol::WebSocketConfig; /// ## Examples /// /// ```rust,ignore -/// use tendermint::abci::Transaction; -/// use tendermint_rpc::{WebSocketClient, SubscriptionClient, Client}; -/// use tendermint_rpc::query::EventType; +/// use cometbft::abci::Transaction; +/// use cometbft_rpc::{WebSocketClient, SubscriptionClient, Client}; +/// use cometbft_rpc::query::EventType; /// use futures::StreamExt; /// /// #[tokio::main] @@ -1020,9 +1020,9 @@ mod test { tokio::{accept_async, TokioAdapter}, tungstenite::client::IntoClientRequest, }; + use cometbft_config::net; use futures::StreamExt; use http::{header::AUTHORIZATION, Uri}; - use tendermint_config::net; use tokio::{ fs, net::{TcpListener, TcpStream}, diff --git a/rpc/src/dialect.rs b/rpc/src/dialect.rs index 4d33a409..bf867fca 100644 --- a/rpc/src/dialect.rs +++ b/rpc/src/dialect.rs @@ -17,7 +17,7 @@ pub use end_block::EndBlock; use serde::{de::DeserializeOwned, Serialize}; -use tendermint::{abci, evidence}; +use cometbft::{abci, evidence}; pub trait Dialect: sealed::Sealed + Default + Clone + Send + Sync { type Event: Into + Serialize + DeserializeOwned; diff --git a/rpc/src/dialect/begin_block.rs b/rpc/src/dialect/begin_block.rs index fdb5a2a2..a860846c 100644 --- a/rpc/src/dialect/begin_block.rs +++ b/rpc/src/dialect/begin_block.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use tendermint::abci; +use cometbft::abci; use crate::prelude::*; diff --git a/rpc/src/dialect/check_tx.rs b/rpc/src/dialect/check_tx.rs index 47b8d17c..875e80ca 100644 --- a/rpc/src/dialect/check_tx.rs +++ b/rpc/src/dialect/check_tx.rs @@ -1,7 +1,7 @@ use bytes::Bytes; use serde::{Deserialize, Serialize}; -use tendermint::abci::{self, Code}; +use cometbft::abci::{self, Code}; use crate::prelude::*; use crate::serializers; diff --git a/rpc/src/dialect/deliver_tx.rs b/rpc/src/dialect/deliver_tx.rs index 0aa83bab..4d07bcf1 100644 --- a/rpc/src/dialect/deliver_tx.rs +++ b/rpc/src/dialect/deliver_tx.rs @@ -1,7 +1,7 @@ use bytes::Bytes; use serde::{Deserialize, Serialize}; -use tendermint::abci::{self, Code}; +use cometbft::abci::{self, Code}; use crate::prelude::*; use crate::serializers; diff --git a/rpc/src/dialect/end_block.rs b/rpc/src/dialect/end_block.rs index 89f556a1..a5b24505 100644 --- a/rpc/src/dialect/end_block.rs +++ b/rpc/src/dialect/end_block.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use tendermint::{abci, consensus, validator}; +use cometbft::{abci, consensus, validator}; use crate::prelude::*; use crate::serializers; diff --git a/rpc/src/dialect/v0_34.rs b/rpc/src/dialect/v0_34.rs index 2102b71f..b0001e86 100644 --- a/rpc/src/dialect/v0_34.rs +++ b/rpc/src/dialect/v0_34.rs @@ -1,5 +1,5 @@ -use tendermint::{abci, evidence}; -use tendermint_proto::v0_34::types::Evidence as RawEvidence; +use cometbft::{abci, evidence}; +use cometbft_proto::v0_34::types::Evidence as RawEvidence; use crate::prelude::*; use crate::serializers::bytes::base64string; diff --git a/rpc/src/dialect/v0_37.rs b/rpc/src/dialect/v0_37.rs index e3f3317a..8ebcb411 100644 --- a/rpc/src/dialect/v0_37.rs +++ b/rpc/src/dialect/v0_37.rs @@ -1,12 +1,12 @@ -use tendermint::evidence; -use tendermint_proto::v0_37 as raw; +use cometbft::evidence; +use cometbft_proto::v0_37 as raw; use crate::prelude::*; use serde::{Deserialize, Serialize}; /// The Event serialization in the latest RPC dialect is the canonical /// serialization for the ABCI domain type. -pub use tendermint::abci::Event; +pub use cometbft::abci::Event; #[derive(Default, Clone)] pub struct Dialect; diff --git a/rpc/src/endpoint/abci_info.rs b/rpc/src/endpoint/abci_info.rs index 1d174aa1..547e8127 100644 --- a/rpc/src/endpoint/abci_info.rs +++ b/rpc/src/endpoint/abci_info.rs @@ -27,7 +27,7 @@ impl crate::SimpleRequest for Request { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Response { /// ABCI info - pub response: tendermint::abci::response::Info, + pub response: cometbft::abci::response::Info, } impl crate::Response for Response {} diff --git a/rpc/src/endpoint/abci_query.rs b/rpc/src/endpoint/abci_query.rs index 4a025cf2..cc61eebf 100644 --- a/rpc/src/endpoint/abci_query.rs +++ b/rpc/src/endpoint/abci_query.rs @@ -1,7 +1,7 @@ //! `/abci_query` endpoint JSON-RPC wrapper +use cometbft::{abci::Code, block, merkle::proof::ProofOps, serializers}; use serde::{Deserialize, Serialize}; -use tendermint::{abci::Code, block, merkle::proof::ProofOps, serializers}; use crate::prelude::*; use crate::{dialect::Dialect, request::RequestMessage}; diff --git a/rpc/src/endpoint/block.rs b/rpc/src/endpoint/block.rs index 558f7dc0..b3e7189c 100644 --- a/rpc/src/endpoint/block.rs +++ b/rpc/src/endpoint/block.rs @@ -1,7 +1,7 @@ //! `/block` endpoint JSON-RPC wrapper +use cometbft::block::{self, Block}; use serde::{Deserialize, Serialize}; -use tendermint::block::{self, Block}; use crate::{dialect::Dialect, request::RequestMessage}; diff --git a/rpc/src/endpoint/block_by_hash.rs b/rpc/src/endpoint/block_by_hash.rs index 84a16e21..e3cab515 100644 --- a/rpc/src/endpoint/block_by_hash.rs +++ b/rpc/src/endpoint/block_by_hash.rs @@ -1,10 +1,10 @@ //! `/block_by_hash` endpoint JSON-RPC wrapper -use serde::{Deserialize, Serialize}; -use tendermint::{ +use cometbft::{ block::{self, Block}, Hash, }; +use serde::{Deserialize, Serialize}; use crate::{dialect::Dialect, request::RequestMessage}; diff --git a/rpc/src/endpoint/block_results.rs b/rpc/src/endpoint/block_results.rs index a1411072..4094545c 100644 --- a/rpc/src/endpoint/block_results.rs +++ b/rpc/src/endpoint/block_results.rs @@ -1,7 +1,7 @@ //! `/block_results` endpoint JSON-RPC wrapper +use cometbft::{abci, block, consensus, serializers, validator, AppHash}; use serde::{Deserialize, Serialize}; -use tendermint::{abci, block, consensus, serializers, validator, AppHash}; use crate::dialect::{self, Dialect}; use crate::prelude::*; @@ -98,8 +98,8 @@ pub mod v0_34 { use crate::dialect::v0_34::Event; use crate::prelude::*; use crate::{dialect, serializers}; + use cometbft::{block, consensus, validator}; use serde::{Deserialize, Serialize}; - use tendermint::{block, consensus, validator}; /// RPC dialect helper for serialization of the response. #[derive(Debug, Serialize, Deserialize)] diff --git a/rpc/src/endpoint/blockchain.rs b/rpc/src/endpoint/blockchain.rs index 76883ab1..1036c0d5 100644 --- a/rpc/src/endpoint/blockchain.rs +++ b/rpc/src/endpoint/blockchain.rs @@ -2,8 +2,8 @@ use core::ops::Range; +use cometbft::block; use serde::{Deserialize, Serialize}; -use tendermint::block; use crate::prelude::*; use crate::{dialect::Dialect, request::RequestMessage}; diff --git a/rpc/src/endpoint/broadcast/tx_async.rs b/rpc/src/endpoint/broadcast/tx_async.rs index 3880d3e2..d3432563 100644 --- a/rpc/src/endpoint/broadcast/tx_async.rs +++ b/rpc/src/endpoint/broadcast/tx_async.rs @@ -1,8 +1,8 @@ //! `/broadcast_tx_async`: broadcast a transaction and return immediately. use bytes::Bytes; +use cometbft::{abci::Code, Hash}; use serde::{Deserialize, Serialize}; -use tendermint::{abci::Code, Hash}; use crate::{dialect::Dialect, prelude::*, request::RequestMessage, serializers}; diff --git a/rpc/src/endpoint/broadcast/tx_commit.rs b/rpc/src/endpoint/broadcast/tx_commit.rs index a1ffd5ee..e8e839ad 100644 --- a/rpc/src/endpoint/broadcast/tx_commit.rs +++ b/rpc/src/endpoint/broadcast/tx_commit.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; -use tendermint::{abci, block, Hash}; +use cometbft::{abci, block, Hash}; use crate::dialect::{self, Dialect}; use crate::{prelude::*, request::RequestMessage, serializers}; @@ -76,8 +76,8 @@ pub mod v0_34 { use super::Response; use crate::dialect; use crate::dialect::v0_34::Event; + use cometbft::{block, Hash}; use serde::{Deserialize, Serialize}; - use tendermint::{block, Hash}; /// RPC dialect helper for serialization of the response. #[derive(Debug, Deserialize, Serialize)] @@ -113,8 +113,8 @@ pub mod v0_34 { pub mod v0_37 { use super::Response; use crate::dialect; + use cometbft::{abci::Event, block, Hash}; use serde::{Deserialize, Serialize}; - use tendermint::{abci::Event, block, Hash}; /// RPC dialect helper for serialization of the response. #[derive(Debug, Deserialize, Serialize)] diff --git a/rpc/src/endpoint/broadcast/tx_sync.rs b/rpc/src/endpoint/broadcast/tx_sync.rs index 8bd0a629..bd876647 100644 --- a/rpc/src/endpoint/broadcast/tx_sync.rs +++ b/rpc/src/endpoint/broadcast/tx_sync.rs @@ -1,8 +1,8 @@ //! `/broadcast_tx_sync`: returns with the response from `CheckTx`. use bytes::Bytes; +use cometbft::{abci::Code, Hash}; use serde::{Deserialize, Serialize}; -use tendermint::{abci::Code, Hash}; use crate::{dialect::Dialect, prelude::*, request::RequestMessage, serializers}; diff --git a/rpc/src/endpoint/commit.rs b/rpc/src/endpoint/commit.rs index b65635fd..f50eac11 100644 --- a/rpc/src/endpoint/commit.rs +++ b/rpc/src/endpoint/commit.rs @@ -1,7 +1,7 @@ //! `/commit` endpoint JSON-RPC wrapper +use cometbft::{block, block::signed_header::SignedHeader}; use serde::{Deserialize, Serialize}; -use tendermint::{block, block::signed_header::SignedHeader}; use crate::{dialect::Dialect, request::RequestMessage}; diff --git a/rpc/src/endpoint/consensus_params.rs b/rpc/src/endpoint/consensus_params.rs index 5f20b2b8..6bcee5bb 100644 --- a/rpc/src/endpoint/consensus_params.rs +++ b/rpc/src/endpoint/consensus_params.rs @@ -1,7 +1,7 @@ //! `/consensus_params` endpoint JSON-RPC wrapper +use cometbft::block::Height; use serde::{Deserialize, Serialize}; -use tendermint::block::Height; use crate::{dialect::Dialect, request::RequestMessage}; @@ -40,7 +40,7 @@ impl crate::SimpleRequest for Request { #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] pub struct Response { pub block_height: Height, - pub consensus_params: tendermint::consensus::Params, + pub consensus_params: cometbft::consensus::Params, } impl crate::Response for Response {} diff --git a/rpc/src/endpoint/consensus_state.rs b/rpc/src/endpoint/consensus_state.rs index 0186e69a..a9cc837c 100644 --- a/rpc/src/endpoint/consensus_state.rs +++ b/rpc/src/endpoint/consensus_state.rs @@ -2,13 +2,13 @@ use core::{fmt, str::FromStr}; -use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use subtle_encoding::hex; -use tendermint::{ +use cometbft::{ account, block::{Height, Round}, hash, vote, Hash, Time, }; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use subtle_encoding::hex; use crate::{dialect::Dialect, prelude::*, request::RequestMessage, Error, Method}; @@ -55,7 +55,7 @@ pub struct RoundState { #[serde(alias = "height/round/step")] pub height_round_step: HeightRoundStep, - #[serde(with = "tendermint::serializers::time")] + #[serde(with = "cometbft::serializers::time")] pub start_time: Time, #[serde(with = "hash::allow_empty")] diff --git a/rpc/src/endpoint/evidence.rs b/rpc/src/endpoint/evidence.rs index 2be30042..bd59a53f 100644 --- a/rpc/src/endpoint/evidence.rs +++ b/rpc/src/endpoint/evidence.rs @@ -1,7 +1,7 @@ //! `/broadcast_evidence`: broadcast an evidence. +use cometbft::{evidence, Hash}; use serde::{Deserialize, Serialize}; -use tendermint::{evidence, Hash}; use crate::{dialect::Dialect, request::RequestMessage, Method}; diff --git a/rpc/src/endpoint/genesis.rs b/rpc/src/endpoint/genesis.rs index 698fb3dd..57a9b3ff 100644 --- a/rpc/src/endpoint/genesis.rs +++ b/rpc/src/endpoint/genesis.rs @@ -2,8 +2,8 @@ use core::{fmt, marker::PhantomData}; +use cometbft::Genesis; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use tendermint::Genesis; use crate::{dialect::Dialect, request::RequestMessage}; diff --git a/rpc/src/endpoint/header.rs b/rpc/src/endpoint/header.rs index ad150620..33dd32f2 100644 --- a/rpc/src/endpoint/header.rs +++ b/rpc/src/endpoint/header.rs @@ -1,7 +1,7 @@ //! `/header` endpoint JSON-RPC wrapper +use cometbft::block::{self, Header}; use serde::{Deserialize, Serialize}; -use tendermint::block::{self, Header}; use crate::dialect::v0_37; use crate::request::RequestMessage; diff --git a/rpc/src/endpoint/header_by_hash.rs b/rpc/src/endpoint/header_by_hash.rs index e887944e..76437cc5 100644 --- a/rpc/src/endpoint/header_by_hash.rs +++ b/rpc/src/endpoint/header_by_hash.rs @@ -1,7 +1,7 @@ //! `/header_by_hash` endpoint JSON-RPC wrapper +use cometbft::{block::Header, Hash}; use serde::{Deserialize, Serialize}; -use tendermint::{block::Header, Hash}; use crate::dialect::v0_37; use crate::request::RequestMessage; diff --git a/rpc/src/endpoint/net_info.rs b/rpc/src/endpoint/net_info.rs index f7f4fe6c..65c00896 100644 --- a/rpc/src/endpoint/net_info.rs +++ b/rpc/src/endpoint/net_info.rs @@ -6,8 +6,8 @@ use core::{ }; use std::net::IpAddr; +use cometbft::{channel::Channel, node, serializers, Time}; use serde::{Deserialize, Serialize}; -use tendermint::{channel::Channel, node, serializers, Time}; use crate::prelude::*; use crate::{dialect::Dialect, request::RequestMessage}; diff --git a/rpc/src/endpoint/status.rs b/rpc/src/endpoint/status.rs index 409efb37..32de2021 100644 --- a/rpc/src/endpoint/status.rs +++ b/rpc/src/endpoint/status.rs @@ -1,7 +1,7 @@ //! `/status` endpoint JSON-RPC wrapper +use cometbft::{block, node, validator, AppHash, Hash, Time}; use serde::{Deserialize, Serialize}; -use tendermint::{block, node, validator, AppHash, Hash, Time}; use crate::{dialect::Dialect, request::RequestMessage}; @@ -42,11 +42,11 @@ impl crate::Response for Response {} #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SyncInfo { /// Earliest block hash - #[serde(with = "tendermint::serializers::hash")] + #[serde(with = "cometbft::serializers::hash")] pub earliest_block_hash: Hash, /// Earliest app hash - #[serde(with = "tendermint::serializers::apphash")] + #[serde(with = "cometbft::serializers::apphash")] pub earliest_app_hash: AppHash, /// Earliest block height @@ -56,11 +56,11 @@ pub struct SyncInfo { pub earliest_block_time: Time, /// Latest block hash - #[serde(with = "tendermint::serializers::hash")] + #[serde(with = "cometbft::serializers::hash")] pub latest_block_hash: Hash, /// Latest app hash - #[serde(with = "tendermint::serializers::apphash")] + #[serde(with = "cometbft::serializers::apphash")] pub latest_app_hash: AppHash, /// Latest block height diff --git a/rpc/src/endpoint/tx.rs b/rpc/src/endpoint/tx.rs index d5bc7630..1e6e963a 100644 --- a/rpc/src/endpoint/tx.rs +++ b/rpc/src/endpoint/tx.rs @@ -1,7 +1,7 @@ //! `/tx` endpoint JSON-RPC wrapper +use cometbft::{abci, block, tx, Hash}; use serde::{Deserialize, Serialize}; -use tendermint::{abci, block, tx, Hash}; use crate::dialect::{self, Dialect}; use crate::{prelude::*, request::RequestMessage, serializers, Method}; @@ -74,8 +74,8 @@ pub mod v0_34 { use crate::dialect::v0_34::Event; use crate::prelude::*; use crate::{dialect, serializers}; + use cometbft::{block, tx, Hash}; use serde::{Deserialize, Serialize}; - use tendermint::{block, tx, Hash}; /// RPC dialect helper for serialization of the response. #[derive(Debug, Deserialize, Serialize)] diff --git a/rpc/src/endpoint/validators.rs b/rpc/src/endpoint/validators.rs index c4bded01..a9bb0bd4 100644 --- a/rpc/src/endpoint/validators.rs +++ b/rpc/src/endpoint/validators.rs @@ -1,7 +1,7 @@ //! `/validators` endpoint JSON-RPC wrapper +use cometbft::{block, validator}; use serde::{Deserialize, Serialize}; -use tendermint::{block, validator}; use crate::{ dialect::Dialect, prelude::*, request::RequestMessage, serializers, PageNumber, PerPage, diff --git a/rpc/src/error.rs b/rpc/src/error.rs index 1e42e461..51a257b1 100644 --- a/rpc/src/error.rs +++ b/rpc/src/error.rs @@ -139,7 +139,7 @@ define_error! { }, Tendermint - [ tendermint::Error ] + [ cometbft::Error ] | _ | { "tendermint error" }, ParseInt diff --git a/rpc/src/event.rs b/rpc/src/event.rs index dfbfa5ba..05579d50 100644 --- a/rpc/src/event.rs +++ b/rpc/src/event.rs @@ -2,7 +2,7 @@ use alloc::collections::BTreeMap as HashMap; -use tendermint::{abci, block, Block}; +use cometbft::{abci, block, Block}; use crate::{prelude::*, query::EventType}; @@ -81,8 +81,8 @@ pub mod v0_34 { use crate::prelude::*; use crate::{dialect, serializers, Response}; use alloc::collections::BTreeMap as HashMap; + use cometbft::Block; use serde::{Deserialize, Serialize}; - use tendermint::Block; #[derive(Serialize, Deserialize, Debug)] pub struct DialectEvent { @@ -257,9 +257,9 @@ mod latest { use crate::prelude::*; use crate::{serializers, Response}; use alloc::collections::BTreeMap as HashMap; + use cometbft::abci::Event as RpcEvent; + use cometbft::{abci, block, Block}; use serde::{Deserialize, Serialize}; - use tendermint::abci::Event as RpcEvent; - use tendermint::{abci, block, Block}; #[derive(Deserialize, Debug)] pub struct DeEvent { @@ -409,8 +409,8 @@ pub mod v0_37 { use super::{Event, EventData}; use crate::prelude::*; use alloc::collections::BTreeMap as HashMap; + use cometbft::{abci, Block}; use serde::Serialize; - use tendermint::{abci, Block}; pub use super::latest::*; @@ -488,8 +488,8 @@ pub mod v0_38 { use super::{Event, EventData}; use crate::prelude::*; use alloc::collections::BTreeMap as HashMap; + use cometbft::{abci, block, Block}; use serde::Serialize; - use tendermint::{abci, block, Block}; pub use super::latest::*; diff --git a/rpc/src/query.rs b/rpc/src/query.rs index 0e7d61e7..47571374 100644 --- a/rpc/src/query.rs +++ b/rpc/src/query.rs @@ -26,7 +26,7 @@ use crate::{prelude::*, serializers::timestamp, Error}; /// ### Direct construction of queries /// /// ```rust -/// use tendermint_rpc::query::{Query, EventType}; +/// use cometbft_rpc::query::{Query, EventType}; /// /// let query = Query::from(EventType::NewBlock); /// assert_eq!("tm.event = 'NewBlock'", query.to_string()); @@ -41,7 +41,7 @@ use crate::{prelude::*, serializers::timestamp, Error}; /// ### Query parsing /// /// ```rust -/// use tendermint_rpc::query::{Query, EventType}; +/// use cometbft_rpc::query::{Query, EventType}; /// /// let query: Query = "tm.event = 'NewBlock'".parse().unwrap(); /// assert_eq!(query, Query::from(EventType::NewBlock)); diff --git a/rpc/src/serializers.rs b/rpc/src/serializers.rs index dd8ae81b..2d4d25f2 100644 --- a/rpc/src/serializers.rs +++ b/rpc/src/serializers.rs @@ -5,7 +5,7 @@ //! CAUTION: There are no guarantees for backwards compatibility, this module should be considered //! an internal implementation detail which can vanish without further warning. Use at your own //! risk. -pub use tendermint::serializers::*; +pub use cometbft::serializers::*; pub mod opt_tm_hash_base64; pub mod tm_hash_base64; diff --git a/rpc/src/serializers/opt_tm_hash_base64.rs b/rpc/src/serializers/opt_tm_hash_base64.rs index 3491ec64..31053f17 100644 --- a/rpc/src/serializers/opt_tm_hash_base64.rs +++ b/rpc/src/serializers/opt_tm_hash_base64.rs @@ -1,13 +1,13 @@ //! Encoding/decoding Option Tendermint hashes to/from base64. +use cometbft::hash::Hash; use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use tendermint::hash::Hash; use crate::prelude::*; #[derive(Serialize, Deserialize)] struct Helper(#[serde(with = "crate::serializers::tm_hash_base64")] Hash); -/// Deserialize base64-encoded string into an Option +/// Deserialize base64-encoded string into an Option pub fn deserialize<'de, D>(deserializer: D) -> Result, D::Error> where D: Deserializer<'de>, @@ -16,7 +16,7 @@ where Ok(helper.map(|Helper(hash)| hash)) } -/// Serialize from an Option into a base64-encoded string +/// Serialize from an Option into a base64-encoded string pub fn serialize(value: &Option, serializer: S) -> Result where S: Serializer, diff --git a/rpc/src/serializers/tm_hash_base64.rs b/rpc/src/serializers/tm_hash_base64.rs index b57e33c3..d194b38a 100644 --- a/rpc/src/serializers/tm_hash_base64.rs +++ b/rpc/src/serializers/tm_hash_base64.rs @@ -1,12 +1,12 @@ //! Encoding/decoding Tendermint hashes to/from base64. +use cometbft::hash::{Algorithm::Sha256, Hash, SHA256_HASH_SIZE}; use serde::{Deserialize, Deserializer, Serializer}; use subtle_encoding::base64; -use tendermint::hash::{Algorithm::Sha256, Hash, SHA256_HASH_SIZE}; use crate::prelude::*; -/// Deserialize a base64-encoded string into an tendermint::Hash +/// Deserialize a base64-encoded string into an cometbft::Hash pub fn deserialize<'de, D>(deserializer: D) -> Result where D: Deserializer<'de>, @@ -23,7 +23,7 @@ where Hash::from_bytes(Sha256, &decoded_bytes).map_err(serde::de::Error::custom) } -/// Serialize from a tendermint::Hash into a base64-encoded string +/// Serialize from a cometbft::Hash into a base64-encoded string pub fn serialize(value: &Hash, serializer: S) -> Result where S: Serializer, diff --git a/rpc/src/serializers/tx_hash_base64.rs b/rpc/src/serializers/tx_hash_base64.rs index aa289fd0..7a9be062 100644 --- a/rpc/src/serializers/tx_hash_base64.rs +++ b/rpc/src/serializers/tx_hash_base64.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Deserializer, Serializer}; use subtle_encoding::base64; use crate::prelude::*; -use tendermint::{hash::Algorithm, Hash}; +use cometbft::{hash::Algorithm, Hash}; /// Deserialize a base64-encoded string into an abci::transaction::Hash pub fn deserialize<'de, D>(deserializer: D) -> Result diff --git a/rpc/tests/gaia_fixtures.rs b/rpc/tests/gaia_fixtures.rs index 7386013f..e441d16b 100644 --- a/rpc/tests/gaia_fixtures.rs +++ b/rpc/tests/gaia_fixtures.rs @@ -1,7 +1,7 @@ use std::{fs, path::PathBuf}; // TODO: generate fixtures and test with v0_37::dialect as well -use tendermint_rpc::{endpoint, event::v0_34::DialectEvent, request::RequestMessage, Response}; +use cometbft_rpc::{endpoint, event::v0_34::DialectEvent, request::RequestMessage, Response}; use walkdir::WalkDir; diff --git a/rpc/tests/kvstore_fixtures.rs b/rpc/tests/kvstore_fixtures.rs index 837bbb9a..dfad920c 100644 --- a/rpc/tests/kvstore_fixtures.rs +++ b/rpc/tests/kvstore_fixtures.rs @@ -3,8 +3,7 @@ use core::str::FromStr; use std::{collections::BTreeMap as HashMap, fs, path::PathBuf}; -use subtle_encoding::{base64, hex}; -use tendermint::{ +use cometbft::{ abci, evidence::{Duration, Evidence}, hash::Algorithm, @@ -12,13 +11,14 @@ use tendermint::{ vote::Vote, Hash, }; -use tendermint_config::net::Address; -use tendermint_rpc::{ +use cometbft_config::net::Address; +use cometbft_rpc::{ endpoint, error::{Error, ErrorDetail}, request::Wrapper as RequestWrapper, Code, Order, Response, }; +use subtle_encoding::{base64, hex}; use walkdir::WalkDir; const CHAIN_ID: &str = "dockerchain"; diff --git a/rpc/tests/kvstore_fixtures/v0_34.rs b/rpc/tests/kvstore_fixtures/v0_34.rs index ca38a836..82ead339 100644 --- a/rpc/tests/kvstore_fixtures/v0_34.rs +++ b/rpc/tests/kvstore_fixtures/v0_34.rs @@ -257,17 +257,17 @@ fn outgoing_fixtures() { #[test] fn incoming_fixtures() { - use tendermint_rpc::event::{v0_34::DialectEvent, EventData}; + use cometbft_rpc::event::{v0_34::DialectEvent, EventData}; let empty_merkle_root_hash = Some( - tendermint::Hash::from_hex_upper( - tendermint::hash::Algorithm::Sha256, + cometbft::Hash::from_hex_upper( + cometbft::hash::Algorithm::Sha256, "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", ) .unwrap(), ); let informal_epoch = - tendermint::Time::parse_from_rfc3339("2020-01-01T00:00:00.000000000Z").unwrap(); + cometbft::Time::parse_from_rfc3339("2020-01-01T00:00:00.000000000Z").unwrap(); for json_file in find_fixtures("v0_34", "incoming") { let file_name = json_file @@ -349,7 +349,7 @@ fn incoming_fixtures() { assert!(!result.block.header.next_validators_hash.is_empty()); assert_ne!( result.block.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( result @@ -364,7 +364,7 @@ fn incoming_fixtures() { assert!(!result.block.header.validators_hash.is_empty()); assert_eq!( result.block.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); assert!(result.block.last_commit.is_none()); assert!(!result.block_id.hash.is_empty()); @@ -387,7 +387,7 @@ fn incoming_fixtures() { assert!(!result.block.header.next_validators_hash.is_empty()); assert_ne!( result.block.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( result @@ -402,7 +402,7 @@ fn incoming_fixtures() { assert!(!result.block.header.validators_hash.is_empty()); assert_eq!( result.block.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = result.block.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -452,7 +452,7 @@ fn incoming_fixtures() { for block in result.blocks { let evidence = block.block.evidence.iter().next().unwrap(); - use tendermint::vote; + use cometbft::vote; fn check_vote(vote: &Vote) { assert_eq!(vote.vote_type, vote::Type::Precommit); @@ -574,7 +574,7 @@ fn incoming_fixtures() { assert!(!result.signed_header.header.next_validators_hash.is_empty()); assert_ne!( result.signed_header.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( result @@ -589,7 +589,7 @@ fn incoming_fixtures() { assert!(!result.signed_header.header.validators_hash.is_empty()); assert_eq!( result.signed_header.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); }, "consensus_params" => { @@ -649,7 +649,7 @@ fn incoming_fixtures() { ); assert_eq!( result.genesis.consensus_params.validator.pub_key_types[0], - tendermint::public_key::Algorithm::Ed25519 + cometbft::public_key::Algorithm::Ed25519 ); assert!(result.genesis.consensus_params.version.is_none()); assert!( @@ -664,7 +664,7 @@ fn incoming_fixtures() { assert_eq!(result.genesis.validators.len(), 1); assert_ne!( result.genesis.validators[0].address.as_bytes(), - [0; tendermint::account::LENGTH] + [0; cometbft::account::LENGTH] ); assert_eq!(result.genesis.validators[0].power(), 10); assert!(result.genesis.validators[0].pub_key.ed25519().is_some()); @@ -693,11 +693,11 @@ fn incoming_fixtures() { ); assert_eq!( result.node_info.other.tx_index, - tendermint::node::info::TxIndexStatus::On + cometbft::node::info::TxIndexStatus::On ); assert_eq!( result.node_info.protocol_version, - tendermint::node::info::ProtocolVersionInfo { + cometbft::node::info::ProtocolVersionInfo { p2p: 8, block: 11, app: 1 @@ -763,7 +763,7 @@ fn incoming_fixtures() { assert!(!block_meta.header.next_validators_hash.is_empty()); assert_ne!( block_meta.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( block_meta @@ -777,7 +777,7 @@ fn incoming_fixtures() { assert!(!block_meta.header.validators_hash.is_empty()); assert_eq!( block_meta.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); assert_eq!(block_meta.num_txs, 0); } @@ -826,7 +826,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -839,7 +839,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -881,7 +881,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -894,7 +894,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -958,7 +958,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -971,7 +971,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -1013,7 +1013,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -1026,7 +1026,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -1068,7 +1068,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -1081,7 +1081,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -1107,7 +1107,7 @@ fn incoming_fixtures() { "subscribe_txs_0" => { let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1139,7 +1139,7 @@ fn incoming_fixtures() { "subscribe_txs_1" => { let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1172,7 +1172,7 @@ fn incoming_fixtures() { "subscribe_txs_2" => { let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1204,7 +1204,7 @@ fn incoming_fixtures() { "subscribe_txs_3" => { let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1236,7 +1236,7 @@ fn incoming_fixtures() { "subscribe_txs_4" => { let result = DialectEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); diff --git a/rpc/tests/kvstore_fixtures/v0_37.rs b/rpc/tests/kvstore_fixtures/v0_37.rs index 200f3f15..8c10e92d 100644 --- a/rpc/tests/kvstore_fixtures/v0_37.rs +++ b/rpc/tests/kvstore_fixtures/v0_37.rs @@ -256,17 +256,17 @@ fn outgoing_fixtures() { #[test] fn incoming_fixtures() { - use tendermint_rpc::event::{v0_37::DeEvent, EventData}; + use cometbft_rpc::event::{v0_37::DeEvent, EventData}; let empty_merkle_root_hash = Some( - tendermint::Hash::from_hex_upper( - tendermint::hash::Algorithm::Sha256, + cometbft::Hash::from_hex_upper( + cometbft::hash::Algorithm::Sha256, "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", ) .unwrap(), ); let informal_epoch = - tendermint::Time::parse_from_rfc3339("2020-01-01T00:00:00.000000000Z").unwrap(); + cometbft::Time::parse_from_rfc3339("2020-01-01T00:00:00.000000000Z").unwrap(); for json_file in find_fixtures("v0_37", "incoming") { let file_name = json_file @@ -348,7 +348,7 @@ fn incoming_fixtures() { assert!(!result.block.header.next_validators_hash.is_empty()); assert_ne!( result.block.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( result @@ -363,7 +363,7 @@ fn incoming_fixtures() { assert!(!result.block.header.validators_hash.is_empty()); assert_eq!( result.block.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); assert!(result.block.last_commit.is_none()); assert!(!result.block_id.hash.is_empty()); @@ -386,7 +386,7 @@ fn incoming_fixtures() { assert!(!result.block.header.next_validators_hash.is_empty()); assert_ne!( result.block.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( result @@ -401,7 +401,7 @@ fn incoming_fixtures() { assert!(!result.block.header.validators_hash.is_empty()); assert_eq!( result.block.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = result.block.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -448,7 +448,7 @@ fn incoming_fixtures() { for block in result.blocks { let evidence = block.block.evidence.iter().next().unwrap(); - use tendermint::vote; + use cometbft::vote; fn check_vote(vote: &Vote) { assert_eq!(vote.vote_type, vote::Type::Precommit); @@ -568,7 +568,7 @@ fn incoming_fixtures() { assert!(!result.signed_header.header.next_validators_hash.is_empty()); assert_ne!( result.signed_header.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( result @@ -583,7 +583,7 @@ fn incoming_fixtures() { assert!(!result.signed_header.header.validators_hash.is_empty()); assert_eq!( result.signed_header.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); }, "consensus_params" => { @@ -643,7 +643,7 @@ fn incoming_fixtures() { ); assert_eq!( result.genesis.consensus_params.validator.pub_key_types[0], - tendermint::public_key::Algorithm::Ed25519 + cometbft::public_key::Algorithm::Ed25519 ); assert!(result.genesis.consensus_params.version.is_none()); assert!( @@ -658,7 +658,7 @@ fn incoming_fixtures() { assert_eq!(result.genesis.validators.len(), 1); assert_ne!( result.genesis.validators[0].address.as_bytes(), - [0; tendermint::account::LENGTH] + [0; cometbft::account::LENGTH] ); assert_eq!(result.genesis.validators[0].power(), 10); assert!(result.genesis.validators[0].pub_key.ed25519().is_some()); @@ -687,11 +687,11 @@ fn incoming_fixtures() { ); assert_eq!( result.node_info.other.tx_index, - tendermint::node::info::TxIndexStatus::On + cometbft::node::info::TxIndexStatus::On ); assert_eq!( result.node_info.protocol_version, - tendermint::node::info::ProtocolVersionInfo { + cometbft::node::info::ProtocolVersionInfo { p2p: 8, block: 11, app: 1 @@ -757,7 +757,7 @@ fn incoming_fixtures() { assert!(!block_meta.header.next_validators_hash.is_empty()); assert_ne!( block_meta.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( block_meta @@ -771,7 +771,7 @@ fn incoming_fixtures() { assert!(!block_meta.header.validators_hash.is_empty()); assert_eq!( block_meta.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); assert_eq!(block_meta.num_txs, 0); } @@ -820,7 +820,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -833,7 +833,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -875,7 +875,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -888,7 +888,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -952,7 +952,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -965,7 +965,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -1007,7 +1007,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -1020,7 +1020,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -1062,7 +1062,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -1075,7 +1075,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -1101,7 +1101,7 @@ fn incoming_fixtures() { "subscribe_txs_0" => { let result = DeEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1133,7 +1133,7 @@ fn incoming_fixtures() { "subscribe_txs_1" => { let result = DeEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1166,7 +1166,7 @@ fn incoming_fixtures() { "subscribe_txs_2" => { let result = DeEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1198,7 +1198,7 @@ fn incoming_fixtures() { "subscribe_txs_3" => { let result = DeEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); @@ -1230,7 +1230,7 @@ fn incoming_fixtures() { "subscribe_txs_4" => { let result = DeEvent::from_string(content).unwrap(); let height; - if let tendermint_rpc::event::EventData::Tx { tx_result } = result.data.into() { + if let cometbft_rpc::event::EventData::Tx { tx_result } = result.data.into() { height = tx_result.height; assert!(tx_result.result.log.is_none()); assert!(tx_result.result.gas_wanted.is_none()); diff --git a/rpc/tests/kvstore_fixtures/v0_38.rs b/rpc/tests/kvstore_fixtures/v0_38.rs index b2e39b8a..90dcd2cc 100644 --- a/rpc/tests/kvstore_fixtures/v0_38.rs +++ b/rpc/tests/kvstore_fixtures/v0_38.rs @@ -256,17 +256,17 @@ fn outgoing_fixtures() { #[test] fn incoming_fixtures() { - use tendermint_rpc::event::{v0_38::DeEvent, EventData}; + use cometbft_rpc::event::{v0_38::DeEvent, EventData}; let empty_merkle_root_hash = Some( - tendermint::Hash::from_hex_upper( - tendermint::hash::Algorithm::Sha256, + cometbft::Hash::from_hex_upper( + cometbft::hash::Algorithm::Sha256, "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", ) .unwrap(), ); let informal_epoch = - tendermint::Time::parse_from_rfc3339("2020-01-01T00:00:00.000000000Z").unwrap(); + cometbft::Time::parse_from_rfc3339("2020-01-01T00:00:00.000000000Z").unwrap(); for json_file in find_fixtures("v0_38", "incoming") { let file_name = json_file @@ -348,7 +348,7 @@ fn incoming_fixtures() { assert!(!result.block.header.next_validators_hash.is_empty()); assert_ne!( result.block.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( result @@ -363,7 +363,7 @@ fn incoming_fixtures() { assert!(!result.block.header.validators_hash.is_empty()); assert_eq!( result.block.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); assert!(result.block.last_commit.is_none()); assert!(!result.block_id.hash.is_empty()); @@ -386,7 +386,7 @@ fn incoming_fixtures() { assert!(!result.block.header.next_validators_hash.is_empty()); assert_ne!( result.block.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( result @@ -401,7 +401,7 @@ fn incoming_fixtures() { assert!(!result.block.header.validators_hash.is_empty()); assert_eq!( result.block.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = result.block.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -448,7 +448,7 @@ fn incoming_fixtures() { for block in result.blocks { let evidence = block.block.evidence.iter().next().unwrap(); - use tendermint::vote; + use cometbft::vote; fn check_vote(vote: &Vote) { assert_eq!(vote.vote_type, vote::Type::Precommit); @@ -568,7 +568,7 @@ fn incoming_fixtures() { assert!(!result.signed_header.header.next_validators_hash.is_empty()); assert_ne!( result.signed_header.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( result @@ -583,7 +583,7 @@ fn incoming_fixtures() { assert!(!result.signed_header.header.validators_hash.is_empty()); assert_eq!( result.signed_header.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); }, "consensus_params" => { @@ -643,7 +643,7 @@ fn incoming_fixtures() { ); assert_eq!( result.genesis.consensus_params.validator.pub_key_types[0], - tendermint::public_key::Algorithm::Ed25519 + cometbft::public_key::Algorithm::Ed25519 ); assert!(result.genesis.consensus_params.version.is_none()); assert!( @@ -658,7 +658,7 @@ fn incoming_fixtures() { assert_eq!(result.genesis.validators.len(), 1); assert_ne!( result.genesis.validators[0].address.as_bytes(), - [0; tendermint::account::LENGTH] + [0; cometbft::account::LENGTH] ); assert_eq!(result.genesis.validators[0].power(), 10); assert!(result.genesis.validators[0].pub_key.ed25519().is_some()); @@ -687,11 +687,11 @@ fn incoming_fixtures() { ); assert_eq!( result.node_info.other.tx_index, - tendermint::node::info::TxIndexStatus::On + cometbft::node::info::TxIndexStatus::On ); assert_eq!( result.node_info.protocol_version, - tendermint::node::info::ProtocolVersionInfo { + cometbft::node::info::ProtocolVersionInfo { p2p: 8, block: 11, app: 1 @@ -756,7 +756,7 @@ fn incoming_fixtures() { assert!(!block_meta.header.next_validators_hash.is_empty()); assert_ne!( block_meta.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( block_meta @@ -770,7 +770,7 @@ fn incoming_fixtures() { assert!(!block_meta.header.validators_hash.is_empty()); assert_eq!( block_meta.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); assert_eq!(block_meta.num_txs, 0); } @@ -819,7 +819,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -832,7 +832,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -877,7 +877,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -890,7 +890,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -935,7 +935,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -948,7 +948,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -993,7 +993,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -1006,7 +1006,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); @@ -1051,7 +1051,7 @@ fn incoming_fixtures() { assert!(!b.header.next_validators_hash.is_empty()); assert_ne!( b.header.proposer_address.as_bytes(), - [0u8; tendermint::account::LENGTH] + [0u8; cometbft::account::LENGTH] ); assert!( b.header @@ -1064,7 +1064,7 @@ fn incoming_fixtures() { assert!(!b.header.validators_hash.is_empty()); assert_eq!( b.header.version, - tendermint::block::header::Version { block: 11, app: 1 } + cometbft::block::header::Version { block: 11, app: 1 } ); let last_commit = b.last_commit.unwrap(); assert!(!last_commit.block_id.hash.is_empty()); diff --git a/rpc/tests/osmosis_fixtures.rs b/rpc/tests/osmosis_fixtures.rs index 877a5fb8..5f632282 100644 --- a/rpc/tests/osmosis_fixtures.rs +++ b/rpc/tests/osmosis_fixtures.rs @@ -1,6 +1,6 @@ use std::{fs, path::PathBuf}; -use tendermint_rpc::{endpoint, Response}; +use cometbft_rpc::{endpoint, Response}; use walkdir::WalkDir; diff --git a/test/src/test/unit/p2p/secret_connection.rs b/test/src/test/unit/p2p/secret_connection.rs index 410e78ac..9c59a7a4 100644 --- a/test/src/test/unit/p2p/secret_connection.rs +++ b/test/src/test/unit/p2p/secret_connection.rs @@ -4,12 +4,12 @@ use std::{ thread, }; +use cometbft_p2p::secret_connection::{sort32, Handshake, SecretConnection, Version}; +use cometbft_proto::v0_38 as proto; use curve25519_dalek_ng::{ constants::X25519_BASEPOINT, montgomery::MontgomeryPoint as EphemeralPublic, }; use rand_core::OsRng; -use tendermint_p2p::secret_connection::{sort32, Handshake, SecretConnection, Version}; -use tendermint_proto::v0_38 as proto; use crate::pipe; @@ -182,7 +182,7 @@ fn test_split_secret_connection() { fn new_peer_conn( io_handler: IoHandler, -) -> Result, tendermint_p2p::error::Error> +) -> Result, cometbft_p2p::error::Error> where IoHandler: std::io::Read + std::io::Write + Send + Sync, { diff --git a/test/src/test/unit/p2p/secret_connection/nonce.rs b/test/src/test/unit/p2p/secret_connection/nonce.rs index fff7851c..76c27973 100644 --- a/test/src/test/unit/p2p/secret_connection/nonce.rs +++ b/test/src/test/unit/p2p/secret_connection/nonce.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use tendermint_p2p::secret_connection::{Nonce, NONCE_SIZE}; +use cometbft_p2p::secret_connection::{Nonce, NONCE_SIZE}; #[test] fn test_incr_nonce() { diff --git a/test/src/test/unit/p2p/secret_connection/public_key.rs b/test/src/test/unit/p2p/secret_connection/public_key.rs index 4908ffec..b8a4c07a 100644 --- a/test/src/test/unit/p2p/secret_connection/public_key.rs +++ b/test/src/test/unit/p2p/secret_connection/public_key.rs @@ -1,5 +1,5 @@ +use cometbft_p2p::secret_connection::PublicKey; use subtle_encoding::hex; -use tendermint_p2p::secret_connection::PublicKey; const EXAMPLE_SECRET_CONN_KEY: &str = "F7FEB0B5BA0760B2C58893E329475D1EA81781DD636E37144B6D599AD38AA825"; diff --git a/testgen/bin/tendermint-testgen.rs b/testgen/bin/tendermint-testgen.rs index f7397d43..2ca6403f 100644 --- a/testgen/bin/tendermint-testgen.rs +++ b/testgen/bin/tendermint-testgen.rs @@ -1,6 +1,6 @@ +use cometbft_testgen::{helpers::*, Commit, Generator, Header, Time, Validator, Vote}; use gumdrop::Options; use simple_error::SimpleError; -use tendermint_testgen::{helpers::*, Commit, Generator, Header, Time, Validator, Vote}; const USAGE: &str = r#" This is a small utility for producing tendermint datastructures diff --git a/testgen/src/commit.rs b/testgen/src/commit.rs index 0a2e4460..a2b760a2 100644 --- a/testgen/src/commit.rs +++ b/testgen/src/commit.rs @@ -1,9 +1,9 @@ use std::{collections::BTreeSet, convert::TryFrom, iter::FromIterator}; +use cometbft::block::{self, parts::Header as PartSetHeader, Round}; use gumdrop::Options; use serde::{Deserialize, Serialize}; use simple_error::*; -use tendermint::block::{self, parts::Header as PartSetHeader, Round}; use crate::{helpers::*, validator::sort_validators, Generator, Header, Validator, Vote}; @@ -166,7 +166,7 @@ impl Generator for Commit { #[cfg(test)] mod tests { - use tendermint::Time; + use cometbft::Time; use super::*; diff --git a/testgen/src/consensus.rs b/testgen/src/consensus.rs index 204f5c0b..ccf81599 100644 --- a/testgen/src/consensus.rs +++ b/testgen/src/consensus.rs @@ -1,4 +1,4 @@ -use tendermint::{ +use cometbft::{ block, consensus, consensus::params::VersionParams, evidence, public_key::Algorithm, }; diff --git a/testgen/src/header.rs b/testgen/src/header.rs index 95e9edf1..6faf6d29 100644 --- a/testgen/src/header.rs +++ b/testgen/src/header.rs @@ -4,10 +4,10 @@ use std::{ str::FromStr, }; +use cometbft::{block, chain, validator, AppHash, Hash, Time}; use gumdrop::Options; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use simple_error::*; -use tendermint::{block, chain, validator, AppHash, Hash, Time}; use time::OffsetDateTime; use crate::{helpers::*, validator::generate_validators, Generator, Validator}; @@ -76,14 +76,14 @@ mod app_hash_serde { where D: Deserializer<'de>, { - tendermint::serializers::apphash::deserialize(deserializer).map(Some) + cometbft::serializers::apphash::deserialize(deserializer).map(Some) } pub fn serialize(value: &Option, serializer: S) -> Result where S: Serializer, { - tendermint::serializers::apphash::serialize(value.as_ref().unwrap(), serializer) + cometbft::serializers::apphash::serialize(value.as_ref().unwrap(), serializer) } } @@ -225,7 +225,7 @@ impl Generator for Header { mod tests { use core::time::Duration; - use tendermint::Time; + use cometbft::Time; use super::*; diff --git a/testgen/src/helpers.rs b/testgen/src/helpers.rs index aba04238..0a79bc93 100644 --- a/testgen/src/helpers.rs +++ b/testgen/src/helpers.rs @@ -2,9 +2,9 @@ use std::io::{self, Read}; +use cometbft::{chain, public_key, signature::Signature, vote, Time}; use serde::de::DeserializeOwned; use simple_error::*; -use tendermint::{chain, public_key, signature::Signature, vote, Time}; /// A macro that generates a complete setter method from a one-liner with necessary information #[macro_export] diff --git a/testgen/src/light_block.rs b/testgen/src/light_block.rs index 7dab3991..eab000a4 100644 --- a/testgen/src/light_block.rs +++ b/testgen/src/light_block.rs @@ -1,10 +1,10 @@ -use gumdrop::Options; -use serde::{Deserialize, Serialize}; -use simple_error::*; -use tendermint::{ +use cometbft::{ block::signed_header::SignedHeader, node::Id as PeerId, validator, validator::Set as ValidatorSet, Hash, Time, }; +use gumdrop::Options; +use serde::{Deserialize, Serialize}; +use simple_error::*; use crate::{ helpers::parse_as, validator::generate_validators, Commit, Generator, Header, Validator, diff --git a/testgen/src/light_chain.rs b/testgen/src/light_chain.rs index 7997e106..b40f118f 100644 --- a/testgen/src/light_chain.rs +++ b/testgen/src/light_chain.rs @@ -1,6 +1,6 @@ use std::convert::{TryFrom, TryInto}; -use tendermint::{ +use cometbft::{ block::{self, Height}, chain::Info, }; diff --git a/testgen/src/time.rs b/testgen/src/time.rs index e4ef1574..4753ea72 100644 --- a/testgen/src/time.rs +++ b/testgen/src/time.rs @@ -28,14 +28,14 @@ impl std::str::FromStr for Time { } } -impl Generator for Time { +impl Generator for Time { fn merge_with_default(self, default: Self) -> Self { Time { secs: self.secs.or(default.secs), } } - fn generate(&self) -> Result { + fn generate(&self) -> Result { let time = match &self.secs { None => bail!("time is missing"), Some(secs) => *secs, @@ -51,6 +51,6 @@ mod tests { #[test] fn test_time() { let time = Time::new(0); - assert_eq!(time.generate().unwrap(), tendermint::Time::unix_epoch()); + assert_eq!(time.generate().unwrap(), cometbft::Time::unix_epoch()); } } diff --git a/testgen/src/validator.rs b/testgen/src/validator.rs index 9a9f6517..663852bf 100644 --- a/testgen/src/validator.rs +++ b/testgen/src/validator.rs @@ -1,10 +1,10 @@ -use gumdrop::Options; -use serde::{Deserialize, Serialize}; -use simple_error::*; -use tendermint::{ +use cometbft::{ account, consensus::state::Ordering, private_key, public_key, public_key::PublicKey, validator, vote, }; +use gumdrop::Options; +use serde::{Deserialize, Serialize}; +use simple_error::*; use crate::{helpers::*, Generator}; diff --git a/testgen/src/validator_set.rs b/testgen/src/validator_set.rs index 9a2a4b16..47ec197f 100644 --- a/testgen/src/validator_set.rs +++ b/testgen/src/validator_set.rs @@ -1,7 +1,7 @@ +use cometbft::validator; use gumdrop::Options; use serde::{Deserialize, Serialize}; use simple_error::*; -use tendermint::validator; use crate::{ helpers::*, diff --git a/testgen/src/vote.rs b/testgen/src/vote.rs index 0555d4f8..3a15b3f1 100644 --- a/testgen/src/vote.rs +++ b/testgen/src/vote.rs @@ -1,14 +1,14 @@ use std::convert::TryFrom; -use gumdrop::Options; -use serde::{Deserialize, Serialize}; -use simple_error::*; -use tendermint::{ +use cometbft::{ block::{self, parts::Header as PartSetHeader}, signature::{Ed25519Signature, Signature}, vote, vote::ValidatorIndex, }; +use gumdrop::Options; +use serde::{Deserialize, Serialize}; +use simple_error::*; use crate::{helpers::*, Generator, Header, Validator}; @@ -168,7 +168,7 @@ mod tests { let header = Header::new(&valset1) .next_validators(&valset2) .height(10) - .time(tendermint::Time::from_unix_timestamp(10, 0).unwrap()); + .time(cometbft::Time::from_unix_timestamp(10, 0).unwrap()); let val = &valset1[1]; let vote = Vote::new(val.clone(), header.clone()).round(2); diff --git a/tools/abci-test/src/main.rs b/tools/abci-test/src/main.rs index a7633de2..305b80d9 100644 --- a/tools/abci-test/src/main.rs +++ b/tools/abci-test/src/main.rs @@ -2,10 +2,10 @@ use futures::StreamExt; use structopt::StructOpt; -use tendermint_config::net::Address; -use tendermint_rpc::event::EventData; -use tendermint_rpc::query::EventType; -use tendermint_rpc::{Client, SubscriptionClient, WebSocketClient}; +use cometbft_config::net::Address; +use cometbft_rpc::event::EventData; +use cometbft_rpc::query::EventType; +use cometbft_rpc::{Client, SubscriptionClient, WebSocketClient}; use tokio::time::Duration; use tracing::{debug, error, info, level_filters::LevelFilter}; diff --git a/tools/kvstore-test/tests/light-client.rs b/tools/kvstore-test/tests/light-client.rs index d7be78e4..48b99858 100644 --- a/tools/kvstore-test/tests/light-client.rs +++ b/tools/kvstore-test/tests/light-client.rs @@ -14,7 +14,7 @@ use std::{convert::TryFrom, time::Duration}; -use tendermint_light_client::{ +use cometbft_light_client::{ builder::LightClientBuilder, components::io::{AtHeight, Io, ProdIo}, errors::Error, @@ -25,7 +25,7 @@ use tendermint_light_client::{ types::{Height, PeerId, Status, TrustThreshold}, }, }; -use tendermint_rpc as rpc; +use cometbft_rpc as rpc; fn make_instance(peer_id: PeerId, options: LightClientOptions, address: rpc::Url) -> Instance { let rpc_client = rpc::HttpClient::new(address).unwrap(); diff --git a/tools/kvstore-test/tests/tendermint.rs b/tools/kvstore-test/tests/tendermint.rs index de817a0d..24336814 100644 --- a/tools/kvstore-test/tests/tendermint.rs +++ b/tools/kvstore-test/tests/tendermint.rs @@ -23,8 +23,8 @@ mod rpc { use futures::StreamExt; use sha2::Sha256; - use tendermint::{abci::Code, block::Height, merkle::simple_hash_from_byte_vectors, Hash}; - use tendermint_rpc::{ + use cometbft::{abci::Code, block::Height, merkle::simple_hash_from_byte_vectors, Hash}; + use cometbft_rpc::{ event::{Event, EventData, TxInfo}, query::{EventType, Query}, Client, HttpClient, Id, Order, SubscriptionClient, WebSocketClient, WebSocketClientDriver, @@ -122,7 +122,7 @@ mod rpc { async fn block_by_hash() { let res = localhost_http_client() .block_by_hash( - tendermint::Hash::from_str( + cometbft::Hash::from_str( "0000000000000000000000000000000000000000000000000000000000000000", ) .unwrap(), @@ -488,7 +488,7 @@ mod rpc { http_client: &HttpClient, websocket_client: &mut WebSocketClient, tx: impl Into>, - ) -> Result<(Hash, TxInfo), tendermint_rpc::Error> { + ) -> Result<(Hash, TxInfo), cometbft_rpc::Error> { let tx = tx.into(); let mut subs = websocket_client.subscribe(EventType::Tx.into()).await?; let r = http_client.broadcast_tx_async(tx.clone()).await?; diff --git a/tools/no-std-check/src/lib.rs b/tools/no-std-check/src/lib.rs index dc0f5c1c..54faa390 100644 --- a/tools/no-std-check/src/lib.rs +++ b/tools/no-std-check/src/lib.rs @@ -6,9 +6,9 @@ extern crate alloc; // Import the crates that we want to check if they are fully no-std compliance -use tendermint; -use tendermint_light_client_verifier; -use tendermint_proto; +use cometbft; +use cometbft_light_client_verifier; +use cometbft_proto; #[cfg(feature = "sp-core")] use sp_core;