Skip to content

Commit 6f25116

Browse files
committed
Test all values of mock_env
1 parent 56157cf commit 6f25116

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

packages/std/src/testing/mock.rs

+16-3
Original file line numberDiff line numberDiff line change
@@ -1267,9 +1267,22 @@ mod tests {
12671267
include_bytes!("../../../crypto/testdata/eth-headers/1699693797.394876721s.json");
12681268

12691269
#[test]
1270-
fn mock_env_matches_mock_contract_addr() {
1271-
let contract_address = mock_env().contract.address;
1272-
assert_eq!(contract_address, Addr::unchecked(MOCK_CONTRACT_ADDR));
1270+
fn mock_env_works() {
1271+
let env = mock_env();
1272+
assert_eq!(
1273+
env,
1274+
Env {
1275+
block: BlockInfo {
1276+
height: 12345,
1277+
time: Timestamp::from_nanos(1571797419879305533),
1278+
chain_id: "cosmos-testnet-14002".to_string()
1279+
},
1280+
transaction: Some(TransactionInfo { index: 3 }),
1281+
contract: ContractInfo {
1282+
address: Addr::unchecked(MOCK_CONTRACT_ADDR)
1283+
}
1284+
}
1285+
)
12731286
}
12741287

12751288
#[test]

0 commit comments

Comments
 (0)