Skip to content

Commit

Permalink
failing path for batch_balance_of
Browse files Browse the repository at this point in the history
  • Loading branch information
gangov committed Aug 15, 2024
1 parent 2222893 commit 7f1e3ab
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions contracts/collections/src/test/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,21 @@ fn test_uri() {

assert_eq!(collections_client.uri(&1), URIValue { uri: secret_uri });
}

#[test]
fn balance_of_batch_should_fail_when_different_sizes_for_accounts_and_ids() {
let env = Env::default();
env.mock_all_auths();

let admin = Address::generate(&env);
let user = Address::generate(&env);

let collections_client = initialize_collection_contract(&env, Some(&admin), None, None);

// not neceserally to mint, as we expect the test to fali

assert_eq!(
collections_client.try_balance_of_batch(&vec![&env, user], &vec![&env, 1, 2, 3]),
Err(Ok(ContractError::AccountsIdsLengthMissmatch))
)
}

0 comments on commit 7f1e3ab

Please sign in to comment.