Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
chore: Rename cosmos-rpc and cosmos-runtime-api packages
Browse files Browse the repository at this point in the history
  • Loading branch information
code0xff committed Sep 9, 2024
1 parent 5f1b30f commit e238c19
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ pallet-cosmos = { path = "frame/cosmos", default-features = false }
pallet-cosmos-accounts = { path = "frame/accounts", default-features = false }
horizon-template-runtime = { path = "template/runtime", default-features = false }

pallet-cosmos-rpc = { path = "frame/cosmos/rpc" }
pallet-cosmos-runtime-api = { path = "frame/cosmos/runtime-api", default-features = false }
cosmos-rpc = { path = "frame/cosmos/rpc" }
cosmos-runtime-api = { path = "frame/cosmos/runtime-api", default-features = false }
pallet-cosmos-types = { path = "frame/cosmos/types", default-features = false }
pallet-cosmos-x-auth = { path = "frame/cosmos/x/auth", default-features = false }
pallet-cosmos-x-auth-migrations = { path = "frame/cosmos/x/auth/migrations", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions frame/cosmos/rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "pallet-cosmos-rpc"
name = "cosmos-rpc"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
Expand All @@ -21,4 +21,4 @@ sp-core = { workspace = true, features = ["std"] }
sp-runtime = { workspace = true, features = ["std"] }

# Horizon
pallet-cosmos-runtime-api = { workspace = true, features = ["std"] }
cosmos-runtime-api = { workspace = true, features = ["std"] }
4 changes: 2 additions & 2 deletions frame/cosmos/rpc/src/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use crate::internal_error;
use cosmos_runtime_api::{CosmosRuntimeApi, SimulateError, SimulateResponse};
use futures::future::TryFutureExt;
use jsonrpsee::{
core::{async_trait, RpcResult},
proc_macros::rpc,
};
use pallet_cosmos_runtime_api::{CosmosRuntimeApi, SimulateError, SimulateResponse};
use sc_transaction_pool_api::TransactionPool;
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
Expand Down Expand Up @@ -59,7 +59,7 @@ where
C: Send + Sync + 'static,
C: ProvideRuntimeApi<Block>,
C: HeaderBackend<Block> + 'static,
C::Api: pallet_cosmos_runtime_api::CosmosRuntimeApi<Block>,
C::Api: cosmos_runtime_api::CosmosRuntimeApi<Block>,
P: TransactionPool<Block = Block> + 'static,
{
async fn broadcast_tx(&self, tx_bytes: Bytes) -> RpcResult<H256> {
Expand Down
2 changes: 1 addition & 1 deletion frame/cosmos/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "pallet-cosmos-runtime-api"
name = "cosmos-runtime-api"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ substrate-frame-rpc-system = { workspace = true }
hp-account = { workspace = true, features = ["std"] }
hp-io = { workspace = true, features = ["std"] }
horizon-template-runtime = { workspace = true, features = ["std"] }
pallet-cosmos-rpc = { workspace = true }
pallet-cosmos-runtime-api = { workspace = true, features = ["std"] }
cosmos-rpc = { workspace = true }
cosmos-runtime-api = { workspace = true, features = ["std"] }
pallet-cosmos-types = { workspace = true, features = ["std", "with-codec"] }
pallet-cosmos-x-bank-types = { workspace = true, features = [
"std",
Expand Down
4 changes: 2 additions & 2 deletions template/node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ where
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: BlockBuilder<Block>,
P: TransactionPool<Block = Block> + 'static,
C::Api: pallet_cosmos_runtime_api::CosmosRuntimeApi<Block>,
C::Api: cosmos_runtime_api::CosmosRuntimeApi<Block>,
C::Api: cosmwasm_runtime_api::CosmwasmRuntimeApi<Block, Vec<u8>>,
{
use cosmos_rpc::{Cosmos, CosmosApiServer};
use cosmwasm_rpc::{Cosmwasm, CosmwasmApiServer};
use pallet_cosmos_rpc::{Cosmos, CosmosApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use substrate_frame_rpc_system::{System, SystemApiServer};

Expand Down
4 changes: 2 additions & 2 deletions template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ hp-crypto = { workspace = true, default-features = false }
hp-io = { workspace = true, default-features = false }
pallet-cosmos = { workspace = true, default-features = false }
pallet-cosmos-accounts = { workspace = true, default-features = false }
pallet-cosmos-runtime-api = { workspace = true, default-features = false }
cosmos-runtime-api = { workspace = true, default-features = false }
pallet-cosmos-types = { workspace = true, default-features = false, features = [
"with-codec",
] }
Expand Down Expand Up @@ -115,7 +115,7 @@ std = [
"hp-io/std",
"pallet-cosmos/std",
"pallet-cosmos-accounts/std",
"pallet-cosmos-runtime-api/std",
"cosmos-runtime-api/std",
"pallet-cosmos-types/std",
"pallet-cosmos-x-auth/std",
"pallet-cosmos-x-auth-migrations/std",
Expand Down
4 changes: 2 additions & 2 deletions template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ mod msgs;

use alloc::{boxed::Box, string::String, vec::Vec};
use core::marker::PhantomData;
use cosmos_runtime_api::{GasInfo, SimulateError, SimulateResponse};
use cosmos_sdk_proto::{cosmos::tx::v1beta1::Tx, prost::Message};
use frame_support::{
construct_runtime, derive_impl,
Expand All @@ -62,7 +63,6 @@ use pallet_cosmos::{
},
AddressMapping,
};
use pallet_cosmos_runtime_api::{GasInfo, SimulateError, SimulateResponse};
use pallet_cosmos_x_auth::sigverify::SECP256K1_TYPE_URL;
use pallet_cosmos_x_auth_signing::{
sign_mode_handler::SignModeHandler, sign_verifiable_tx::SigVerifiableTx,
Expand Down Expand Up @@ -655,7 +655,7 @@ impl Runtime {
}

impl_runtime_apis! {
impl pallet_cosmos_runtime_api::CosmosRuntimeApi<Block> for Runtime {
impl cosmos_runtime_api::CosmosRuntimeApi<Block> for Runtime {
fn convert_tx(tx_bytes: Vec<u8>) -> <Block as BlockT>::Extrinsic {
UncheckedExtrinsic::new_unsigned(
pallet_cosmos::Call::<Runtime>::transact { tx_bytes }.into(),
Expand Down

0 comments on commit e238c19

Please sign in to comment.