cw_blob::interface

Struct CwBlob

source
pub struct CwBlob<Chain>(/* private fields */);

Implementations§

source§

impl<Chain> CwBlob<Chain>

source

pub fn new(contract_id: impl ToString, chain: Chain) -> Self

Trait Implementations§

source§

impl<Chain: Clone> Clone for CwBlob<Chain>

source§

fn clone(&self) -> CwBlob<Chain>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Chain: ChainState> ContractInstance<Chain> for CwBlob<Chain>

source§

fn as_instance(&self) -> &Contract<Chain>

Return a reference to the underlying contract instance.
source§

fn as_instance_mut(&mut self) -> &mut Contract<Chain>

Return a mutable reference to the underlying contract instance.
source§

fn id(&self) -> String

Returns the contract id.
source§

fn address(&self) -> Result<Addr, CwEnvError>

Returns the contract address for this instance.
source§

fn addr_str(&self) -> Result<String, CwEnvError>

Returns the contract address as a String.
source§

fn code_id(&self) -> Result<u64, CwEnvError>

Returns contract code_id.
source§

fn set_address(&self, address: &Addr)

Sets the address for the contract. Useful when the contract is already initialized and not registered in the configured state file.
source§

fn remove_address(&self)

Removes the address for the contract
source§

fn set_default_address(&mut self, address: &Addr)

Sets a default address for the contract. If the contract already has an address registered in the state, this won’t be used. This is mostly used to ship address with a cw-orch package.
source§

fn set_code_id(&self, code_id: u64)

Sets the code_id for the contract. Useful when the contract is already initialized and not registered in the configured state file.
source§

fn remove_code_id(&self)

Removes the code_id for the contract
source§

fn set_default_code_id(&mut self, code_id: u64)

Sets a default address for the contract. If the contract already has an address registered in the state, this won’t be used. This is mostly used to ship address with a cw-orch package.
source§

impl<T: CwEnv> Uploadable for CwBlob<T>

source§

fn wasm(_chain: &ChainInfoOwned) -> WasmPath

Return an object that can be used to upload the contract to a WASM-supported environment.
source§

fn wrapper() -> Box<dyn MockContract<Empty, Empty>>

Return the wrapper object for the contract, only works for non-custom mock environments

Auto Trait Implementations§

§

impl<Chain> Freeze for CwBlob<Chain>
where Chain: Freeze,

§

impl<Chain> RefUnwindSafe for CwBlob<Chain>
where Chain: RefUnwindSafe,

§

impl<Chain> Send for CwBlob<Chain>
where Chain: Send,

§

impl<Chain> Sync for CwBlob<Chain>
where Chain: Sync,

§

impl<Chain> Unpin for CwBlob<Chain>
where Chain: Unpin,

§

impl<Chain> UnwindSafe for CwBlob<Chain>
where Chain: UnwindSafe,

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<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<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T, Chain> ConditionalUpload<Chain> for T
where Chain: CwEnv, T: CwOrchUpload<Chain>,

source§

fn upload_if_needed( &self, ) -> Result<Option<<Chain as TxHandler>::Response>, CwEnvError>

Only upload the contract if it is not uploaded yet (checksum does not match)
source§

fn latest_is_uploaded(&self) -> Result<bool, CwEnvError>

Returns whether the checksum of the WASM file matches the checksum of the latest uploaded code for this contract.
source§

fn is_running_latest(&self) -> Result<bool, CwEnvError>

Returns whether the contract is running the latest uploaded code for it
source§

impl<T, Chain> CwOrchUpload<Chain> for T
where T: ContractInstance<Chain> + Uploadable, Chain: TxHandler,

source§

fn upload(&self) -> Result<<Chain as TxHandler>::Response, CwEnvError>

upload the contract to the configured environment.
source§

fn upload_with_access_config( &self, access_config: Option<AccessConfig>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>

upload the contract to the configured environment and specify the permissions for instantiating
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<Chain, T> Environment<Chain> for T
where Chain: ChainState, T: ContractInstance<Chain> + ?Sized,

source§

fn environment(&self) -> &Chain

Returns the chain that this structure executes on
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V