#[non_exhaustive]pub struct EnvsOptions {
pub bech32_prefix: &'static str,
pub block_time: u64,
pub initial_height: u64,
pub initial_time: Timestamp,
pub chain_id: String,
}
Expand description
Options to create an Envs
instance.
§Examples
Must be constructed with the help of Default
since new options might be added later.
use cosmwasm_std::testing::{Envs, EnvsOptions};
let mut options = EnvsOptions::default();
options.chain_id = "megachain".to_string();
options.bech32_prefix = "mega";
let mut envs = Envs::with_options(options);
let env = envs.make();
assert_eq!(env.block.chain_id, "megachain");
assert_eq!(env.contract.address.as_str(), "mega1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts7vnj8h");
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.bech32_prefix: &'static str
§block_time: u64
§initial_height: u64
§initial_time: Timestamp
§chain_id: String
Trait Implementations§
Source§impl Clone for EnvsOptions
impl Clone for EnvsOptions
Source§fn clone(&self) -> EnvsOptions
fn clone(&self) -> EnvsOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EnvsOptions
impl Debug for EnvsOptions
Auto Trait Implementations§
impl Freeze for EnvsOptions
impl RefUnwindSafe for EnvsOptions
impl Send for EnvsOptions
impl Sync for EnvsOptions
impl Unpin for EnvsOptions
impl UnwindSafe for EnvsOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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