Skip to content

Commit

Permalink
Make tests in ibc_calls specific to the function we test
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Jan 20, 2021
1 parent 1699dd6 commit bd47be5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/vm/src/ibc_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,15 @@ mod tests {
const ACCOUNT: &str = "account-456";

#[test]
fn handshake_works() {
fn call_ibc_channel_open_and_connect_works() {
let mut instance = mock_instance(&CONTRACT, &[]);

setup(&mut instance, CHANNEL_ID, ACCOUNT);
}

#[test]
fn close_channel_works() {
fn call_ibc_channel_close_works() {
let mut instance = mock_instance(&CONTRACT, &[]);

setup(&mut instance, CHANNEL_ID, ACCOUNT);

let handshake_close = mock_ibc_channel(CHANNEL_ID, IbcOrder::Ordered, IBC_VERSION);
Expand All @@ -300,28 +299,33 @@ mod tests {
}

#[test]
fn packet_ack_timeout_work() {
fn call_ibc_packet_ack_works() {
let mut instance = mock_instance(&CONTRACT, &[]);

setup(&mut instance, CHANNEL_ID, ACCOUNT);

let packet = mock_ibc_packet_ack(CHANNEL_ID, br#"{}"#).unwrap();
let ack = IbcAcknowledgement {
acknowledgement: br#"{}"#.into(),
original_packet: packet.clone(),
};

call_ibc_packet_ack::<_, _, _, Empty>(&mut instance, &mock_env(), &ack)
.unwrap()
.unwrap();
}

#[test]
fn call_ibc_packet_timeout_works() {
let mut instance = mock_instance(&CONTRACT, &[]);
setup(&mut instance, CHANNEL_ID, ACCOUNT);

let packet = mock_ibc_packet_ack(CHANNEL_ID, br#"{}"#).unwrap();
call_ibc_packet_timeout::<_, _, _, Empty>(&mut instance, &mock_env(), &packet)
.unwrap()
.unwrap();
}

#[test]
fn packet_receive_timeout_work() {
fn call_ibc_packet_receive_works() {
let mut instance = mock_instance(&CONTRACT, &[]);

setup(&mut instance, CHANNEL_ID, ACCOUNT);
Expand Down

0 comments on commit bd47be5

Please sign in to comment.