Skip to content

Commit

Permalink
test: more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurdavid committed Jun 13, 2024
1 parent 82c2d4a commit 66760b8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/endpoints/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,24 @@ fn add_remove_token_from_whitelist() {
Some(TxExpect::user_error("str:Not privileged")),
);

state.add_token_to_whitelist(
ADMIN_BRIDGE_CONTRACT_ADDRESS_EXPR,
ANOTHER_TOKEN_IDENTIFIER,
None,
);

state.add_token_to_whitelist(
ADMIN_BRIDGE_CONTRACT_ADDRESS_EXPR,
ITHEUM_TOKEN_IDENTIFIER,
None,
);

state.add_token_to_whitelist(
ADMIN_BRIDGE_CONTRACT_ADDRESS_EXPR,
ITHEUM_TOKEN_IDENTIFIER,
Some(TxExpect::user_error("str:Token already in whitelist")),
);

state.world.sc_query(
ScQueryStep::new()
.call(state.contract.token_whitelist())
Expand Down
4 changes: 4 additions & 0 deletions tests/endpoints/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ fn send_to_bridge_test() {

state.add_to_whitelist(ADMIN_BRIDGE_CONTRACT_ADDRESS_EXPR, first_user.clone(), None);

state.remove_from_whitelist(ADMIN_BRIDGE_CONTRACT_ADDRESS_EXPR, first_user.clone(), None);

state.add_to_whitelist(ADMIN_BRIDGE_CONTRACT_ADDRESS_EXPR, first_user.clone(), None);

state.send_to_liquidity(
FIRST_USER_ADDRESS_EXPR,
(ITHEUM_TOKEN_IDENTIFIER_EXPR, 0u64, "1_000"),
Expand Down
2 changes: 2 additions & 0 deletions tests/endpoints/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ fn relayer_test() {

state
.default_deploy_and_set()
.set_relayer_state_active(OWNER_BRIDGE_CONTRACT_ADDRESS_EXPR, None)
.set_relayer_state_inactive(OWNER_BRIDGE_CONTRACT_ADDRESS_EXPR, None)
.set_relayer_state_active(OWNER_BRIDGE_CONTRACT_ADDRESS_EXPR, None);

state.send_from_liquidity(
Expand Down

0 comments on commit 66760b8

Please sign in to comment.