Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add repatriate reserved error test
  • Loading branch information
dharjeezy committed Oct 13, 2022
commit 74d8c38bea90c1fb22da819b9e70f45abc9501e0
25 changes: 25 additions & 0 deletions frame/identity/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,31 @@ fn requesting_judgement_should_work() {
});
}

#[test]
fn provide_judgement_should_return_repatriate_reserved_error() {
new_test_ext().execute_with(|| {
assert_ok!(Identity::add_registrar(RuntimeOrigin::signed(1), 3));
assert_ok!(Identity::set_fee(RuntimeOrigin::signed(3), 0, 10));
assert_ok!(Identity::set_identity(RuntimeOrigin::signed(10), Box::new(ten())));
assert_ok!(Identity::request_judgement(RuntimeOrigin::signed(10), 0, 10));
// 10 for the judgement request, 10 for the identity.
assert_eq!(Balances::free_balance(10), 80);

// This forces repatriate reserved error
Balances::make_free_balance_be(&3, 0);
assert_noop!(
Identity::provide_judgement(
RuntimeOrigin::signed(3),
0,
10,
Judgement::Erroneous,
BlakeTwo256::hash_of(&ten())
),
Error::<Test>::RepatriateReservedError
);
});
}

#[test]
fn field_deposit_should_work() {
new_test_ext().execute_with(|| {
Expand Down