Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contracts/stream_contract/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ fn test_create_multiple_streams_increments_counter() {

assert_eq!(stream_id1, 1);
assert_eq!(stream_id2, 2);
assert!(client.get_stream(&stream_id1).is_some());
assert!(client.get_stream(&stream_id2).is_some());
}

#[test]
Expand Down Expand Up @@ -158,6 +160,8 @@ fn test_top_up_stream_invalid_amount() {

let contract_id = env.register(StreamContract, ());
let client = StreamContractClient::new(&env, &contract_id);
let token_client = token::Client::new(&env, &token_address);
token_client.approve(&sender, &contract_id, &20_000, &1_000_000);

let stream_id = client.create_stream(&sender, &recipient, &token_address, &10_000, &100);

Expand Down Expand Up @@ -219,6 +223,8 @@ fn test_top_up_stream_inactive() {

let contract_id = env.register(StreamContract, ());
let client = StreamContractClient::new(&env, &contract_id);
let token_client = token::Client::new(&env, &token_address);
token_client.approve(&sender, &contract_id, &20_000, &1_000_000);

let stream_id = client.create_stream(&sender, &recipient, &token_address, &10_000, &100);
client.cancel_stream(&sender, &stream_id);
Expand Down
Loading
Loading