1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use crate::;
/// A constructor function for [`MessageInfo`].
///
/// This is designed for writing contract tests.
/// It lives in `cosmwasm_std::testing` because constructing MessageInfo
/// objects is not something that you usually need in contract code.
///
/// ## Examples
///
/// ```
/// # use cosmwasm_std::{DepsMut, Env, Response, MessageInfo, StdResult};
/// # struct InstantiateMsg {
/// # pub verifier: String,
/// # pub beneficiary: String,
/// # }
/// # pub fn instantiate(
/// # _deps: DepsMut,
/// # _env: Env,
/// # _info: MessageInfo,
/// # _msg: InstantiateMsg,
/// # ) -> StdResult<Response> {
/// # Ok(Response::new().add_attribute("action", "instantiate"))
/// # }
/// use cosmwasm_std::coins;
/// use cosmwasm_std::testing::{message_info, mock_dependencies, mock_env};
///
/// let mut deps = mock_dependencies();
///
/// // Create some Addr instances for testing
/// let creator = deps.api.addr_make("creator");
/// let verifier = deps.api.addr_make("verifies");
/// let beneficiary = deps.api.addr_make("benefits");
///
/// let msg = InstantiateMsg {
/// verifier: verifier.to_string(),
/// beneficiary: beneficiary.to_string(),
/// };
/// let info = message_info(&creator, &coins(1000, "earth"));
/// let response = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap();
/// assert_eq!(response.messages.len(), 0);
/// ```