Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuszDepta committed Oct 20, 2023
1 parent ccc48ac commit 22a1b8c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::gov::Gov;
use crate::ibc::Ibc;
use crate::module::{FailingModule, Module};
use crate::staking::{Distribution, DistributionKeeper, StakeKeeper, Staking, StakingSudo};
use crate::stargate::{FailingStargate, Stargate, StargateMsg, StargateQuery};
use crate::stargate::{Stargate, StargateFailingModule, StargateMsg, StargateQuery};
use crate::transactions::transactional;
use crate::wasm::{ContractData, Wasm, WasmKeeper, WasmSudo};
use crate::AppBuilder;
Expand Down Expand Up @@ -37,7 +37,7 @@ pub type BasicApp<ExecC = Empty, QueryC = Empty> = App<
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
FailingStargate,
StargateFailingModule,
>;

/// Router is a persisted state. You can query this.
Expand All @@ -54,7 +54,7 @@ pub struct App<
Distr = DistributionKeeper,
Ibc = FailingModule<IbcMsg, IbcQuery, Empty>,
Gov = FailingModule<GovMsg, Empty, Empty>,
Stargate = FailingStargate,
Stargate = StargateFailingModule,
> {
pub(crate) router: Router<Bank, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate>,
pub(crate) api: Api,
Expand Down Expand Up @@ -88,7 +88,7 @@ impl BasicApp {
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
FailingStargate,
StargateFailingModule,
>,
&dyn Api,
&mut dyn Storage,
Expand All @@ -114,7 +114,7 @@ where
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
FailingStargate,
StargateFailingModule,
>,
&dyn Api,
&mut dyn Storage,
Expand Down
10 changes: 5 additions & 5 deletions src/app_builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Implementation of the builder for [App].
use crate::stargate::{FailingStargate, Stargate};
use crate::stargate::{Stargate, StargateFailingModule};
use crate::{
App, Bank, BankKeeper, Distribution, DistributionKeeper, FailingModule, Gov, Ibc, Module,
Router, StakeKeeper, Staking, Wasm, WasmKeeper,
Expand Down Expand Up @@ -36,7 +36,7 @@ pub type BasicAppBuilder<ExecC, QueryC> = AppBuilder<
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
FailingStargate,
StargateFailingModule,
>;

/// Utility to build [App] in stages.
Expand Down Expand Up @@ -66,7 +66,7 @@ impl Default
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
FailingStargate,
StargateFailingModule,
>
{
fn default() -> Self {
Expand All @@ -85,7 +85,7 @@ impl
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
FailingStargate,
StargateFailingModule,
>
{
/// Creates builder with default components working with empty exec and query messages.
Expand Down Expand Up @@ -117,7 +117,7 @@ impl<ExecC, QueryC>
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
FailingStargate,
StargateFailingModule,
>
where
ExecC: Debug + Clone + PartialEq + JsonSchema + DeserializeOwned + 'static,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ pub use crate::module::{FailingModule, Module};
pub use crate::staking::{
Distribution, DistributionKeeper, StakeKeeper, Staking, StakingInfo, StakingSudo,
};
pub use crate::stargate::{FailingStargate, Stargate, StargateMsg, StargateQuery};
pub use crate::stargate::{Stargate, StargateFailingModule, StargateMsg, StargateQuery};
pub use crate::wasm::{ContractData, Wasm, WasmKeeper, WasmSudo};
4 changes: 2 additions & 2 deletions src/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ mod test {

use super::*;

use crate::stargate::FailingStargate;
use crate::stargate::StargateFailingModule;
use cosmwasm_std::{
from_slice,
testing::{mock_env, MockApi, MockStorage},
Expand All @@ -1007,7 +1007,7 @@ mod test {
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
FailingStargate,
StargateFailingModule,
>;

fn mock_router() -> BasicRouter {
Expand Down
4 changes: 2 additions & 2 deletions src/stargate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ pub struct StargateQuery {

pub trait Stargate: Module<ExecT = StargateMsg, QueryT = StargateQuery, SudoT = Empty> {}

pub type FailingStargate = FailingModule<StargateMsg, StargateQuery, Empty>;
pub type StargateFailingModule = FailingModule<StargateMsg, StargateQuery, Empty>;

impl Stargate for FailingStargate {}
impl Stargate for StargateFailingModule {}

impl<T> From<StargateMsg> for CosmosMsg<T> {
fn from(msg: StargateMsg) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ mod test {
use crate::bank::BankKeeper;
use crate::module::FailingModule;
use crate::staking::{DistributionKeeper, StakeKeeper};
use crate::stargate::FailingStargate;
use crate::stargate::StargateFailingModule;
use crate::test_helpers::{caller, error, payout};
use crate::transactions::StorageTransaction;
use cosmwasm_std::testing::{mock_env, mock_info, MockApi, MockQuerier, MockStorage};
Expand All @@ -1135,7 +1135,7 @@ mod test {
DistributionKeeper,
FailingModule<IbcMsg, IbcQuery, Empty>,
FailingModule<GovMsg, Empty, Empty>,
FailingStargate,
StargateFailingModule,
>;

fn wasm_keeper() -> WasmKeeper<Empty, Empty> {
Expand Down

0 comments on commit 22a1b8c

Please sign in to comment.