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

Commit

Permalink
refactor: Move any_match to pallet-cosmos-types
Browse files Browse the repository at this point in the history
  • Loading branch information
code0xff committed Sep 10, 2024
1 parent b9be697 commit 02c5b95
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions frame/cosmos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ use pallet_cosmos_types::{
tx::Account,
};
use pallet_cosmos_x_auth_signing::{
any_match, sign_mode_handler::traits::SignModeHandler,
sign_verifiable_tx::traits::SigVerifiableTx,
sign_mode_handler::traits::SignModeHandler, sign_verifiable_tx::traits::SigVerifiableTx,
};
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
Expand Down Expand Up @@ -185,6 +184,7 @@ pub mod pallet {
pub mod config_preludes {
use super::*;
use frame_support::{derive_impl, parameter_types};
use pallet_cosmos_types::any_match;

pub struct TestDefaultConfig;

Expand Down
4 changes: 2 additions & 2 deletions frame/cosmos/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ use frame_support::{derive_impl, parameter_types, traits::AsEnsureOriginWithArg,
use hp_account::CosmosSigner;
use hp_crypto::EcdsaExt;
use pallet_cosmos::{config_preludes::ChainId, AddressMapping};
use pallet_cosmos_types::msgservice::MsgHandler;
use pallet_cosmos_types::{any_match, msgservice::MsgHandler};
use pallet_cosmos_x_auth_signing::{
any_match, sign_mode_handler::SignModeHandler, sign_verifiable_tx::SigVerifiableTx,
sign_mode_handler::SignModeHandler, sign_verifiable_tx::SigVerifiableTx,
};
use pallet_cosmos_x_bank::msgs::MsgSendHandler;
use pallet_cosmos_x_wasm::msgs::{
Expand Down
1 change: 1 addition & 0 deletions frame/cosmos/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub mod errors;
pub mod events;
pub mod gas;
pub mod handler;
pub mod macros;
pub mod msgservice;
pub mod tx;
pub mod tx_msgs;
1 change: 0 additions & 1 deletion frame/cosmos/x/auth/signing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@

extern crate alloc;

pub mod macros;
pub mod sign_mode_handler;
pub mod sign_verifiable_tx;
2 changes: 1 addition & 1 deletion frame/cosmos/x/auth/signing/src/sign_mode_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

pub mod traits;

use crate::any_match;
use alloc::{
string::{String, ToString},
vec::Vec,
Expand All @@ -35,6 +34,7 @@ use cosmos_sdk_proto::{
traits::Message,
Any,
};
use pallet_cosmos_types::any_match;
use pallet_cosmos_x_auth_migrations::legacytx::stdsign::{LegacyMsg, StdSignDoc};
use pallet_cosmos_x_bank_types::msgs::msg_send::MsgSend;
use pallet_cosmos_x_wasm_types::tx::{
Expand Down
3 changes: 1 addition & 2 deletions frame/cosmos/x/auth/signing/src/sign_verifiable_tx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@

pub mod traits;

use crate::any_match;
use alloc::{string::String, vec::Vec};
use cosmos_sdk_proto::{
cosmos::{bank, tx::v1beta1::Tx},
cosmwasm::wasm,
};
use pallet_cosmos_types::tx_msgs::Msg;
use pallet_cosmos_types::{any_match, tx_msgs::Msg};
use pallet_cosmos_x_bank_types::msgs::msg_send::MsgSend;
use pallet_cosmos_x_wasm_types::tx::{
msg_execute_contract::MsgExecuteContract, msg_instantiate_contract2::MsgInstantiateContract2,
Expand Down
3 changes: 1 addition & 2 deletions frame/cosmos/x/auth/src/sigverify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ use cosmos_sdk_proto::{
};
use hp_io::cosmos::secp256k1_ecdsa_verify;
use pallet_cosmos::AddressMapping;
use pallet_cosmos_types::{address::acc_address_from_bech32, handler::AnteDecorator};
use pallet_cosmos_types::{address::acc_address_from_bech32, any_match, handler::AnteDecorator};
use pallet_cosmos_x_auth_signing::{
any_match,
sign_mode_handler::{traits::SignModeHandler, SignerData},
sign_verifiable_tx::traits::SigVerifiableTx,
};
Expand Down
3 changes: 2 additions & 1 deletion template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ use pallet_cosmos::{
},
AddressMapping,
};
use pallet_cosmos_types::any_match;
use pallet_cosmos_x_auth_signing::{
any_match, sign_mode_handler::SignModeHandler, sign_verifiable_tx::SigVerifiableTx,
sign_mode_handler::SignModeHandler, sign_verifiable_tx::SigVerifiableTx,
};
use pallet_cosmwasm::instrument::CostRules;
use pallet_grandpa::{
Expand Down
3 changes: 1 addition & 2 deletions template/runtime/src/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ use cosmos_sdk_proto::{
Any,
};
use hp_crypto::EcdsaExt;
use pallet_cosmos_types::{context, msgservice::MsgHandler};
use pallet_cosmos_x_auth_signing::any_match;
use pallet_cosmos_types::{any_match, context, msgservice::MsgHandler};
use pallet_cosmos_x_bank::msgs::MsgSendHandler;
use pallet_cosmos_x_wasm::msgs::{
MsgExecuteContractHandler, MsgInstantiateContract2Handler, MsgMigrateContractHandler,
Expand Down

0 comments on commit 02c5b95

Please sign in to comment.