From 7a1d3645433e7e06ba163cd5768cb1e30edf1318 Mon Sep 17 00:00:00 2001 From: Aten Jin Date: Wed, 12 Jul 2023 15:32:43 +0800 Subject: [PATCH] let initialize function in pallet-grandpa/pallet-babe and other session managed pallets be pub --- frame/authority-discovery/src/lib.rs | 2 +- frame/babe/src/lib.rs | 2 +- frame/grandpa/src/lib.rs | 2 +- frame/im-online/src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frame/authority-discovery/src/lib.rs b/frame/authority-discovery/src/lib.rs index 6365c95359472..4ca45d8cdba4a 100644 --- a/frame/authority-discovery/src/lib.rs +++ b/frame/authority-discovery/src/lib.rs @@ -97,7 +97,7 @@ impl Pallet { NextKeys::::get() } - fn initialize_keys(keys: &Vec) { + pub fn initialize_keys(keys: &Vec) { if !keys.is_empty() { assert!(Keys::::get().is_empty(), "Keys are already initialized!"); diff --git a/frame/babe/src/lib.rs b/frame/babe/src/lib.rs index 8001450b43583..e3ed60437c2b2 100644 --- a/frame/babe/src/lib.rs +++ b/frame/babe/src/lib.rs @@ -750,7 +750,7 @@ impl Pallet { } } - fn initialize_genesis_authorities(authorities: &[(AuthorityId, BabeAuthorityWeight)]) { + pub fn initialize_genesis_authorities(authorities: &[(AuthorityId, BabeAuthorityWeight)]) { if !authorities.is_empty() { assert!(Authorities::::get().is_empty(), "Authorities are already initialized!"); let bounded_authorities = diff --git a/frame/grandpa/src/lib.rs b/frame/grandpa/src/lib.rs index 8311131e97347..2276bc5179f6d 100644 --- a/frame/grandpa/src/lib.rs +++ b/frame/grandpa/src/lib.rs @@ -511,7 +511,7 @@ impl Pallet { // Perform module initialization, abstracted so that it can be called either through genesis // config builder or through `on_genesis_session`. - fn initialize(authorities: &AuthorityList) { + pub fn initialize(authorities: &AuthorityList) { if !authorities.is_empty() { assert!(Self::grandpa_authorities().is_empty(), "Authorities are already initialized!"); Self::set_grandpa_authorities(authorities); diff --git a/frame/im-online/src/lib.rs b/frame/im-online/src/lib.rs index e1adbc062424f..945a3b4a86766 100644 --- a/frame/im-online/src/lib.rs +++ b/frame/im-online/src/lib.rs @@ -719,7 +719,7 @@ impl Pallet { res } - fn initialize_keys(keys: &[T::AuthorityId]) { + pub fn initialize_keys(keys: &[T::AuthorityId]) { if !keys.is_empty() { assert!(Keys::::get().is_empty(), "Keys are already initialized!"); let bounded_keys = >::try_from(keys)