Struct rhaki_cw_multi_test::AppBuilder
source · pub struct AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov> { /* private fields */ }
Expand description
Utility to build App in stages. If particular items wont be set, defaults would be used
Implementations§
source§impl AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>>
impl AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>>
source§impl<ExecC, QueryC> AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<ExecC, QueryC, Empty>, WasmKeeper<ExecC, QueryC>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>>where
ExecC: Debug + Clone + PartialEq + JsonSchema + DeserializeOwned + 'static,
QueryC: Debug + CustomQuery + DeserializeOwned + 'static,
impl<ExecC, QueryC> AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<ExecC, QueryC, Empty>, WasmKeeper<ExecC, QueryC>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>>where ExecC: Debug + Clone + PartialEq + JsonSchema + DeserializeOwned + 'static, QueryC: Debug + CustomQuery + DeserializeOwned + 'static,
sourcepub fn new_custom() -> Self
pub fn new_custom() -> Self
Creates builder with default components designed to work with custom exec and query messages.
source§impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>
impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>
sourcepub fn with_wasm<C: Module, NewWasm: Wasm<C::ExecT, C::QueryT>>(
self,
wasm: NewWasm
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, NewWasm, StakingT, DistrT, IbcT, GovT>
pub fn with_wasm<C: Module, NewWasm: Wasm<C::ExecT, C::QueryT>>( self, wasm: NewWasm ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, NewWasm, StakingT, DistrT, IbcT, GovT>
Overwrites default wasm executor.
At this point it is needed that new wasm implements some Wasm
trait, but it doesn’t need
to be bound to Bank or Custom yet - as those may change. The cross-components validation is
done on final building.
Also it is possible to completely abandon trait bounding here which would not be bad idea,
however it might make the message on build creepy in many cases, so as for properly build
App
we always want Wasm
to be Wasm
, some checks are done early.
sourcepub fn with_bank<NewBank: Bank>(
self,
bank: NewBank
) -> AppBuilder<NewBank, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>
pub fn with_bank<NewBank: Bank>( self, bank: NewBank ) -> AppBuilder<NewBank, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>
Overwrites default bank interface
sourcepub fn with_api<NewApi: Api>(
self,
api: NewApi
) -> AppBuilder<BankT, NewApi, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>
pub fn with_api<NewApi: Api>( self, api: NewApi ) -> AppBuilder<BankT, NewApi, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>
Overwrites default api interface
sourcepub fn with_storage<NewStorage: Storage>(
self,
storage: NewStorage
) -> AppBuilder<BankT, ApiT, NewStorage, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>
pub fn with_storage<NewStorage: Storage>( self, storage: NewStorage ) -> AppBuilder<BankT, ApiT, NewStorage, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>
Overwrites default storage interface
sourcepub fn with_custom<NewCustom: Module>(
self,
custom: NewCustom
) -> AppBuilder<BankT, ApiT, StorageT, NewCustom, WasmT, StakingT, DistrT, IbcT, GovT>
pub fn with_custom<NewCustom: Module>( self, custom: NewCustom ) -> AppBuilder<BankT, ApiT, StorageT, NewCustom, WasmT, StakingT, DistrT, IbcT, GovT>
Overwrites default custom messages handler
At this point it is needed that new custom implements some Module
trait, but it doesn’t need
to be bound to ExecC or QueryC yet - as those may change. The cross-components validation is
done on final building.
Also it is possible to completely abandon trait bounding here which would not be bad idea,
however it might make the message on build creepy in many cases, so as for properly build
App
we always want Wasm
to be Wasm
, some checks are done early.
sourcepub fn with_staking<NewStaking: Staking>(
self,
staking: NewStaking
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, NewStaking, DistrT, IbcT, GovT>
pub fn with_staking<NewStaking: Staking>( self, staking: NewStaking ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, NewStaking, DistrT, IbcT, GovT>
Overwrites default bank interface
sourcepub fn with_distribution<NewDistribution: Distribution>(
self,
distribution: NewDistribution
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, NewDistribution, IbcT, GovT>
pub fn with_distribution<NewDistribution: Distribution>( self, distribution: NewDistribution ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, NewDistribution, IbcT, GovT>
Overwrites default distribution interface
sourcepub fn with_ibc<NewIbc: Ibc>(
self,
ibc: NewIbc
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, NewIbc, GovT>
pub fn with_ibc<NewIbc: Ibc>( self, ibc: NewIbc ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, NewIbc, GovT>
Overwrites default ibc interface.
If you wish to simply ignore/drop all returned IBC Messages, you can use the IbcAcceptingModule
type.
builder.with_ibc(IbcAcceptingModule::new())
sourcepub fn with_gov<NewGov: Gov>(
self,
gov: NewGov
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, NewGov>
pub fn with_gov<NewGov: Gov>( self, gov: NewGov ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, NewGov>
Overwrites default gov interface
sourcepub fn with_block(self, block: BlockInfo) -> Self
pub fn with_block(self, block: BlockInfo) -> Self
Overwrites default initial block
sourcepub fn build<F>(
self,
init_fn: F
) -> App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>where
BankT: Bank,
ApiT: Api,
StorageT: Storage,
CustomT: Module,
WasmT: Wasm<CustomT::ExecT, CustomT::QueryT>,
StakingT: Staking,
DistrT: Distribution,
IbcT: Ibc,
GovT: Gov,
F: FnOnce(&mut Router<BankT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>, &dyn Api, &mut dyn Storage),
pub fn build<F>( self, init_fn: F ) -> App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>where BankT: Bank, ApiT: Api, StorageT: Storage, CustomT: Module, WasmT: Wasm<CustomT::ExecT, CustomT::QueryT>, StakingT: Staking, DistrT: Distribution, IbcT: Ibc, GovT: Gov, F: FnOnce(&mut Router<BankT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>, &dyn Api, &mut dyn Storage),
Builds final App
. At this point all components type have to be properly related to each
other. If there are some generics related compilation error make sure, that all components
are properly relating to each other.
Trait Implementations§
source§impl Default for AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>>
impl Default for AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>>
Auto Trait Implementations§
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov> RefUnwindSafe for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov>where Api: RefUnwindSafe, Bank: RefUnwindSafe, Custom: RefUnwindSafe, Distr: RefUnwindSafe, Gov: RefUnwindSafe, Ibc: RefUnwindSafe, Staking: RefUnwindSafe, Storage: RefUnwindSafe, Wasm: RefUnwindSafe,
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov> Send for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov>where Api: Send, Bank: Send, Custom: Send, Distr: Send, Gov: Send, Ibc: Send, Staking: Send, Storage: Send, Wasm: Send,
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov> Sync for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov>where Api: Sync, Bank: Sync, Custom: Sync, Distr: Sync, Gov: Sync, Ibc: Sync, Staking: Sync, Storage: Sync, Wasm: Sync,
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov> Unpin for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov>where Api: Unpin, Bank: Unpin, Custom: Unpin, Distr: Unpin, Gov: Unpin, Ibc: Unpin, Staking: Unpin, Storage: Unpin, Wasm: Unpin,
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov> UnwindSafe for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov>where Api: UnwindSafe, Bank: UnwindSafe, Custom: UnwindSafe, Distr: UnwindSafe, Gov: UnwindSafe, Ibc: UnwindSafe, Staking: UnwindSafe, Storage: UnwindSafe, Wasm: UnwindSafe,
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read more