diff --git a/node/tests/utils/mod.rs b/node/tests/utils/mod.rs index 67449486..63676e98 100644 --- a/node/tests/utils/mod.rs +++ b/node/tests/utils/mod.rs @@ -4,8 +4,8 @@ use std::env; use std::sync::OnceLock; use std::time::Duration; -use celestia_rpc::{prelude::*, Client}; -use celestia_types::{Blob, TxConfig}; +use celestia_rpc::{prelude::*, Client, TxConfig}; +use celestia_types::Blob; use libp2p::{multiaddr::Protocol, Multiaddr, PeerId}; use lumina_node::blockstore::InMemoryBlockstore; use lumina_node::events::EventSubscriber; diff --git a/rpc/README.md b/rpc/README.md index 0e5b22bb..3d0d4b74 100644 --- a/rpc/README.md +++ b/rpc/README.md @@ -5,8 +5,8 @@ A collection of traits for interacting with Celestia data availability nodes RPC This crate builds on top of the [`jsonrpsee`](https://docs.rs/jsonrpsee) clients. ```rust,no_run -use celestia_rpc::{BlobClient, Client}; -use celestia_types::{AppVersion, Blob, TxConfig, nmt::Namespace}; +use celestia_rpc::{BlobClient, Client, TxConfig}; +use celestia_types::{AppVersion, Blob, nmt::Namespace}; async fn submit_blob() { // create a client to the celestia node diff --git a/rpc/src/blob.rs b/rpc/src/blob.rs index dc3fa5c0..068f62c0 100644 --- a/rpc/src/blob.rs +++ b/rpc/src/blob.rs @@ -1,10 +1,12 @@ //! celestia-node rpc types and methods related to blobs use celestia_types::nmt::{Namespace, NamespaceProof}; -use celestia_types::{Blob, Commitment, TxConfig}; +use celestia_types::{Blob, Commitment}; use jsonrpsee::proc_macros::rpc; use serde::{Deserialize, Serialize}; +use crate::TxConfig; + /// Response type for [`BlobClient::blob_subscribe`]. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "PascalCase")] diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index bf02329a..852be0d4 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -9,6 +9,7 @@ mod header; mod p2p; pub mod share; mod state; +mod tx_config; pub use crate::blob::BlobClient; #[cfg(any( @@ -30,6 +31,7 @@ pub use crate::header::HeaderClient; pub use crate::p2p::P2PClient; pub use crate::share::ShareClient; pub use crate::state::StateClient; +pub use crate::tx_config::TxConfig; /// Re-exports of all the RPC traits. pub mod prelude { diff --git a/rpc/src/state.rs b/rpc/src/state.rs index 2ab58350..fe9bf4eb 100644 --- a/rpc/src/state.rs +++ b/rpc/src/state.rs @@ -1,10 +1,12 @@ +use celestia_types::blob::RawBlob; use celestia_types::state::{ AccAddress, Address, Balance, QueryDelegationResponse, QueryRedelegationsResponse, QueryUnbondingDelegationResponse, RawTxResponse, Uint, ValAddress, }; -use celestia_types::{blob::RawBlob, TxConfig}; use jsonrpsee::proc_macros::rpc; +use crate::TxConfig; + #[rpc(client)] pub trait State { /// AccountAddress retrieves the address of the node's account/signer diff --git a/types/src/tx_config.rs b/rpc/src/tx_config.rs similarity index 98% rename from types/src/tx_config.rs rename to rpc/src/tx_config.rs index 7b019441..29e16c56 100644 --- a/types/src/tx_config.rs +++ b/rpc/src/tx_config.rs @@ -1,10 +1,9 @@ +use celestia_types::state::AccAddress; use serde::{ ser::{SerializeStruct, Serializer}, Serialize, }; -use crate::state::AccAddress; - /// [`TxConfig`] specifies additional options that are be applied to the Tx. /// /// If no options are provided, then the default ones will be used. diff --git a/rpc/tests/state.rs b/rpc/tests/state.rs index 9e535914..b1e40352 100644 --- a/rpc/tests/state.rs +++ b/rpc/tests/state.rs @@ -2,7 +2,8 @@ use crate::utils::{random_bytes, random_ns}; use celestia_rpc::prelude::*; -use celestia_types::{AppVersion, Blob, TxConfig}; +use celestia_rpc::TxConfig; +use celestia_types::{AppVersion, Blob}; pub mod utils; diff --git a/rpc/tests/utils/client.rs b/rpc/tests/utils/client.rs index 7bd91250..178d63b3 100644 --- a/rpc/tests/utils/client.rs +++ b/rpc/tests/utils/client.rs @@ -3,9 +3,8 @@ use std::sync::OnceLock; use anyhow::Result; use celestia_rpc::prelude::*; -use celestia_rpc::Client; +use celestia_rpc::{Client, TxConfig}; use celestia_types::Blob; -use celestia_types::TxConfig; use jsonrpsee::core::client::SubscriptionClientT; use jsonrpsee::core::ClientError; use tokio::sync::{Mutex, MutexGuard}; diff --git a/types/src/lib.rs b/types/src/lib.rs index 4beeb4f9..44ee9d61 100644 --- a/types/src/lib.rs +++ b/types/src/lib.rs @@ -27,7 +27,6 @@ mod sync; #[cfg_attr(docsrs, doc(cfg(feature = "test-utils")))] pub mod test_utils; pub mod trust_level; -mod tx_config; mod validate; mod validator_set; @@ -42,5 +41,4 @@ pub use crate::fraud_proof::FraudProof; pub use crate::merkle_proof::MerkleProof; pub use crate::share::*; pub use crate::sync::*; -pub use crate::tx_config::TxConfig; pub use crate::validate::*;