File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -449,7 +449,27 @@ pub struct Envs {
449
449
last_time : Timestamp ,
450
450
}
451
451
452
+ /// Options to create an `Envs` instance.
453
+ ///
454
+ /// ## Examples
455
+ ///
456
+ /// Must be constructed with the help of `Default` since new options might be added later.
457
+ ///
458
+ /// ```
459
+ /// # use cosmwasm_std::Timestamp;
460
+ /// use cosmwasm_std::testing::{Envs, EnvsOptions};
461
+ ///
462
+ /// let mut options = EnvsOptions::default();
463
+ /// options.chain_id = "megachain".to_string();
464
+ /// options.bech32_prefix = "mega";
465
+ /// let mut envs = Envs::with_options(options);
466
+ ///
467
+ /// let env = envs.make();
468
+ /// assert_eq!(env.block.chain_id, "megachain");
469
+ /// assert_eq!(env.contract.address.as_str(), "mega1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts7vnj8h");
470
+ /// ```
452
471
#[ derive( Clone ) ]
472
+ #[ non_exhaustive]
453
473
pub struct EnvsOptions {
454
474
pub bech32_prefix : & ' static str , /* static due to MockApi's Copy requirement. No better idea for now. */
455
475
pub block_time : u64 ,
You can’t perform that action at this time.
0 commit comments