Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Apr 28, 2021
1 parent 2de36ee commit 8bbcbae
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions contracts/cw20-ics20/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,11 @@ mod test {
if let CosmosMsg::Ibc(IbcMsg::SendPacket {
channel_id,
data,
timeout_timestamp,
timeout_block,
timeout,
}) = &res.messages[0]
{
assert!(timeout_block.is_none());
assert!(timeout_timestamp.is_some());
assert_eq!(
timeout_timestamp.unwrap() / 1_000_000_000,
mock_env().block.time + DEFAULT_TIMEOUT
);
let expected_timeout = mock_env().block.timestamp().plus_seconds(DEFAULT_TIMEOUT);
assert_eq!(timeout, &expected_timeout.into());
assert_eq!(channel_id.as_str(), send_channel);
let msg: Ics20Packet = from_binary(data).unwrap();
assert_eq!(msg.amount, Uint128(1234567));
Expand Down Expand Up @@ -323,16 +318,11 @@ mod test {
if let CosmosMsg::Ibc(IbcMsg::SendPacket {
channel_id,
data,
timeout_timestamp,
timeout_block,
timeout,
}) = &res.messages[0]
{
assert!(timeout_block.is_none());
assert!(timeout_timestamp.is_some());
assert_eq!(
timeout_timestamp.unwrap() / 1_000_000_000,
mock_env().block.time + 7777
);
let expected_timeout = mock_env().block.timestamp().plus_seconds(7777);
assert_eq!(timeout, &expected_timeout.into());
assert_eq!(channel_id.as_str(), send_channel);
let msg: Ics20Packet = from_binary(data).unwrap();
assert_eq!(msg.amount, Uint128(888777666));
Expand Down

0 comments on commit 8bbcbae

Please sign in to comment.