Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
cuteolaf committed Feb 25, 2023
1 parent fa9aad8 commit 21cedd6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions pallets/asset_management/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,10 @@ pub mod pallet {
AssetOutOfControl,
/// The candidate is not a tenant
NotATenant,
/// An asset is already linked to the provided account
/// An asset is already linked with the representative
RepresentativeAlreadyLinkedWithAsset,
/// An asset is already linked with the tenant
TenantAlreadyLinkedWithAsset,
/// The tenant is not linked to the asset
TenantAssetNotLinked,
/// Errors should have helpful documentation associated with them.
Expand Down Expand Up @@ -615,7 +617,7 @@ pub mod pallet {
// Ensure that the tenant is not linked to an asset
ensure!(
tenant0.asset_account.is_none(),
Error::<T>::RepresentativeAlreadyLinkedWithAsset
Error::<T>::TenantAlreadyLinkedWithAsset
);
//Ensure there is no existing payment request for this asset
ensure!(
Expand Down
2 changes: 1 addition & 1 deletion pallets/asset_management/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl pallet_sudo::Config for Test {
}

parameter_types! {
pub const MaxMembers:u32 =7;
pub const MaxMembers:u32 =8;
}
impl pallet_roles::Config for Test {
type Event = Event;
Expand Down
5 changes: 3 additions & 2 deletions pallets/asset_management/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,11 @@ fn test_integration_test() {
VoteProposals::Election,
Ident::Judgement::Reasonable,
),
Error::<Test>::RepresentativeAlreadyLinkedWithAsset
Error::<Test>::TenantAlreadyLinkedWithAsset
);
println!("\n\nlaunch_tenant_session - : THE TENANT IS ALREADY LINKED WITH AN ASSET");

assert!(Roles::TenantLog::<Test>::contains_key(PEGGY));
//change PEGGY to a RegisteredTenant
Roles::TenantLog::<Test>::mutate(PEGGY, |val| {
let mut val0 = val.clone().unwrap();
Expand All @@ -509,7 +510,7 @@ fn test_integration_test() {
),
Error::<Test>::NotEnoughTenantFunds
);
println!("\n\nlaunch_tenant_session - : THE TENANT IS ALREADY LINKED WITH AN ASSET");
println!("\n\nlaunch_tenant_session - : THE TENANT DOESN'T HAVE ENOUGH FUNDS");

//change HUNTER to a RegisteredTenant
Roles::TenantLog::<Test>::mutate(HUNTER, |val| {
Expand Down

0 comments on commit 21cedd6

Please sign in to comment.