Skip to content
Snippets Groups Projects
Unverified Commit 0b78960c authored by bgallois's avatar bgallois
Browse files

add reviews

parent a1085864
No related branches found
No related tags found
1 merge request!319Fix #291
Pipeline #40178 passed
...@@ -173,8 +173,7 @@ where ...@@ -173,8 +173,7 @@ where
/// Runtime handler OwnerKeyChangePermission. /// Runtime handler OwnerKeyChangePermission.
pub struct KeyChangeHandler<Runtime, ReportLongevity>( pub struct KeyChangeHandler<Runtime, ReportLongevity>(
core::marker::PhantomData<Runtime>, core::marker::PhantomData<(Runtime, ReportLongevity)>,
core::marker::PhantomData<ReportLongevity>,
); );
impl< impl<
Runtime: frame_system::Config<AccountId = AccountId> Runtime: frame_system::Config<AccountId = AccountId>
...@@ -220,8 +219,7 @@ impl< ...@@ -220,8 +219,7 @@ impl<
/// Runtime handler for managing fee handling by transferring unbalanced amounts to a treasury account. /// Runtime handler for managing fee handling by transferring unbalanced amounts to a treasury account.
pub struct HandleFees<TreasuryAccount, Balances>( pub struct HandleFees<TreasuryAccount, Balances>(
frame_support::pallet_prelude::PhantomData<TreasuryAccount>, frame_support::pallet_prelude::PhantomData<(TreasuryAccount, Balances)>,
frame_support::pallet_prelude::PhantomData<Balances>,
); );
type CreditOf<Balances> = frame_support::traits::tokens::fungible::Credit<AccountId, Balances>; type CreditOf<Balances> = frame_support::traits::tokens::fungible::Credit<AccountId, Balances>;
impl<TreasuryAccount, Balances> frame_support::traits::OnUnbalanced<CreditOf<Balances>> impl<TreasuryAccount, Balances> frame_support::traits::OnUnbalanced<CreditOf<Balances>>
......
...@@ -1603,6 +1603,7 @@ fn test_change_owner_key_offline() { ...@@ -1603,6 +1603,7 @@ fn test_change_owner_key_offline() {
} }
}); });
} }
pallet_certification::CertsRemovableOn::<Runtime>::take(ValidityPeriod::get());
run_to_block(ReportLongevity::get() + 1); run_to_block(ReportLongevity::get() + 1);
// Charlie can set its session_keys // Charlie can set its session_keys
...@@ -1689,6 +1690,7 @@ fn test_change_owner_key() { ...@@ -1689,6 +1690,7 @@ fn test_change_owner_key() {
// We run after the bound period // We run after the bound period
// Keeping members intact // Keeping members intact
let smith_expire_on = ReportLongevity::get() * 2;
for i in 1..4 { for i in 1..4 {
let expiration = pallet_membership::Membership::<Runtime>::get(i) let expiration = pallet_membership::Membership::<Runtime>::get(i)
.unwrap() .unwrap()
...@@ -1696,10 +1698,14 @@ fn test_change_owner_key() { ...@@ -1696,10 +1698,14 @@ fn test_change_owner_key() {
pallet_membership::MembershipsExpireOn::<Runtime>::take(expiration); pallet_membership::MembershipsExpireOn::<Runtime>::take(expiration);
pallet_smith_members::Smiths::<Runtime>::mutate(i, |data| { pallet_smith_members::Smiths::<Runtime>::mutate(i, |data| {
if let Some(ref mut data) = data { if let Some(ref mut data) = data {
data.expires_on = Some(ReportLongevity::get() * 2); data.expires_on = Some(smith_expire_on);
} }
}); });
} }
pallet_certification::CertsRemovableOn::<Runtime>::take(ValidityPeriod::get());
pallet_smith_members::ExpiresOn::<Runtime>::take(SmithInactivityMaxDuration::get() + 1);
run_to_block(SmithInactivityMaxDuration::get() * 25);
pallet_smith_members::ExpiresOn::<Runtime>::take(SmithInactivityMaxDuration::get() + 2);
run_to_block(ReportLongevity::get() + 1); run_to_block(ReportLongevity::get() + 1);
// Charlie can change his owner key to Ferdie's // Charlie can change his owner key to Ferdie's
...@@ -1718,7 +1724,7 @@ fn test_change_owner_key() { ...@@ -1718,7 +1724,7 @@ fn test_change_owner_key() {
SmithMembers::smiths(3), SmithMembers::smiths(3),
Some(SmithMeta { Some(SmithMeta {
status: SmithStatus::Smith, status: SmithStatus::Smith,
expires_on: Some(ReportLongevity::get() * 2), expires_on: Some(smith_expire_on),
issued_certs: vec![1, 2], issued_certs: vec![1, 2],
received_certs: vec![1, 2], received_certs: vec![1, 2],
last_online: Some(1), last_online: Some(1),
...@@ -1740,7 +1746,7 @@ fn test_change_owner_key() { ...@@ -1740,7 +1746,7 @@ fn test_change_owner_key() {
SmithMembers::smiths(3), SmithMembers::smiths(3),
Some(SmithMeta { Some(SmithMeta {
status: SmithStatus::Smith, status: SmithStatus::Smith,
expires_on: Some(ReportLongevity::get() * 2), expires_on: Some(smith_expire_on),
issued_certs: vec![1, 2], issued_certs: vec![1, 2],
received_certs: vec![1, 2], received_certs: vec![1, 2],
last_online: Some(1), last_online: Some(1),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment