Struct clone_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. When particular properties are not explicitly set, then default values are used.

Implementations§

source§

impl AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, StakeKeeper, DistributionKeeper, IbcFailingModule, GovFailingModule>

source

pub fn new() -> Self

Creates builder with default components working with empty exec and query messages.

source§

impl<ExecC, QueryC> AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<ExecC, QueryC, Empty>, WasmKeeper<ExecC, QueryC>, StakeKeeper, DistributionKeeper, IbcFailingModule, GovFailingModule>
where ExecC: CustomMsg + DeserializeOwned + 'static, QueryC: Debug + CustomQuery + DeserializeOwned + 'static,

source

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>
where CustomT: Module, WasmT: Wasm<CustomT::ExecT, CustomT::QueryT>, CustomT::QueryT: CustomQuery,

source

pub fn with_wasm<NewWasm: Wasm<CustomT::ExecT, CustomT::QueryT>>( self, wasm: NewWasm, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, NewWasm, StakingT, DistrT, IbcT, GovT>

Overwrites the 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.

source

pub fn with_bank<NewBank: Bank>( self, bank: NewBank, ) -> AppBuilder<NewBank, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>

Overwrites the default bank interface.

source

pub fn with_api<NewApi: Api>( self, api: NewApi, ) -> AppBuilder<BankT, NewApi, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>

Overwrites the default api interface.

source

pub fn with_storage<NewStorage: Storage>( self, storage: NewStorage, ) -> AppBuilder<BankT, ApiT, NewStorage, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>

Overwrites the default storage interface.

source

pub fn with_custom<NewCustom: Module>( self, custom: NewCustom, ) -> AppBuilder<BankT, ApiT, StorageT, NewCustom, WasmT, StakingT, DistrT, IbcT, GovT>

Overwrites the 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.

source

pub fn with_staking<NewStaking: Staking>( self, staking: NewStaking, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, NewStaking, DistrT, IbcT, GovT>

Overwrites the default staking interface.

source

pub fn with_distribution<NewDistribution: Distribution>( self, distribution: NewDistribution, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, NewDistribution, IbcT, GovT>

Overwrites the default distribution interface.

source

pub fn with_ibc<NewIbc: Ibc>( self, ibc: NewIbc, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, NewIbc, GovT>

Overwrites the 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())
source

pub fn with_gov<NewGov: Gov>( self, gov: NewGov, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, NewGov>

Overwrites the default gov interface.

source

pub fn with_remote( self, remote: RemoteChannel, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT>

Sets the chain of the app

source

pub fn with_block(self, block: BlockInfo) -> Self

Overwrites the initial block.

source

pub fn build<F>( self, init_fn: F, ) -> AnyResult<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 errors, make sure that all components are properly relating to each other.

Trait Implementations§

Auto Trait Implementations§

§

impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov> Freeze for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov>
where Api: Freeze, Storage: Freeze, Bank: Freeze, Wasm: Freeze, Custom: Freeze, Staking: Freeze, Distr: Freeze, Ibc: Freeze, Gov: Freeze,

§

impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov> !RefUnwindSafe for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov>

§

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, Storage: Send, Bank: Send, Wasm: Send, Custom: Send, Staking: Send, Distr: Send, Ibc: Send, Gov: 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, Storage: Sync, Bank: Sync, Wasm: Sync, Custom: Sync, Staking: Sync, Distr: Sync, Ibc: Sync, Gov: 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, Storage: Unpin, Bank: Unpin, Wasm: Unpin, Custom: Unpin, Staking: Unpin, Distr: Unpin, Ibc: Unpin, Gov: Unpin,

§

impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov> !UnwindSafe for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> ArchivePointee for T

source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<U> As for U

source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts 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
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> LayoutRaw for T

source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Pointee for T

source§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
source§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more