Skip to content
Snippets Groups Projects
Commit 7a438471 authored by Éloïs's avatar Éloïs
Browse files

tests(runtime): use assert_noop instead of assert_err

parent 2f97bbaf
Branches
Tags
No related merge requests found
......@@ -17,7 +17,7 @@
use super::*;
use crate::mock::*;
use crate::MemberData;
use frame_support::{assert_err, assert_ok};
use frame_support::{assert_noop, assert_ok};
use sp_runtime::testing::UintAuthorityId;
const EMPTY: Vec<u64> = Vec::new();
......@@ -249,7 +249,7 @@ fn test_too_many_authorities() {
UintAuthorityId(15).into(),
));
assert_eq!(AuthorityMembers::authorities_counter(), 4);
assert_err!(
assert_noop!(
AuthorityMembers::go_online(Origin::signed(15)),
Error::<Test>::TooManyAuthorities,
);
......
......@@ -16,7 +16,7 @@
use crate::mock::Identity;
use crate::mock::*;
use frame_support::assert_err;
use frame_support::assert_noop;
use frame_support::assert_ok;
use frame_support::instances::Instance1;
use frame_system::{EventRecord, Phase};
......@@ -43,7 +43,7 @@ fn test_creator_not_allowed_to_create_idty() {
// Alice should not be able to create an identity before block #2
// because Alice.next_issuable_on = 2
assert_err!(
assert_noop!(
Identity::create_identity(Origin::signed(1), 4),
pallet_identity::Error::<Test>::CreatorNotAllowedToCreateIdty
);
......@@ -81,7 +81,7 @@ fn test_revoke_smiths_them_rejoin() {
// Dave should not be able to re-request membership before the RevocationPeriod end
run_to_block(3);
assert_err!(
assert_noop!(
SmithsMembership::request_membership(Origin::signed(4), crate::MembershipMetaData(4)),
pallet_membership::Error::<Test, crate::Instance2>::MembershipRevokedRecently
);
......@@ -281,7 +281,7 @@ fn test_idty_membership_expire_them_requested() {
assert!(Identity::identity(3).is_none());
// Alice can't renew her cert to Charlie
assert_err!(
assert_noop!(
Cert::add_cert(Origin::signed(1), 3),
pallet_certification::Error::<Test, Instance1>::ReceiverNotFound
);
......
......@@ -17,7 +17,7 @@
use crate::mock::*;
use crate::{Error, GenesisIdty, IdtyName, IdtyValue, RevocationPayload};
use codec::Encode;
//use frame_support::assert_err;
//use frame_support::assert_noop;
use frame_support::assert_ok;
use frame_system::{EventRecord, Phase};
use sp_runtime::testing::TestSignature;
......
......@@ -18,7 +18,7 @@ mod common;
use common::*;
use frame_support::traits::{PalletInfo, StorageInfo, StorageInfoTrait};
use frame_support::{assert_err, assert_ok};
use frame_support::{assert_noop, assert_ok};
use frame_support::{StorageHasher, Twox128};
use gdev_runtime::*;
use sp_keyring::AccountKeyring;
......@@ -295,7 +295,7 @@ fn test_create_new_account() {
// We can't remove the account until the random id is assigned
run_to_block(4);
assert_err!(
assert_noop!(
Balances::transfer(
frame_system::RawOrigin::Signed(AccountKeyring::Eve.to_account_id()).into(),
MultiAddress::Id(AccountKeyring::Alice.to_account_id()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment