1
1
#![ cfg_attr( not( feature = "std" ) , no_std) ]
2
2
3
+ // extern crate alloc;
4
+
3
5
pub use pallet:: * ;
4
6
pub mod weights;
5
7
pub use weights:: WeightInfo ;
6
8
7
9
use frame_system:: pallet_prelude:: BlockNumberFor ;
8
- use sp_consensus_grandpa:: AuthorityId as GrandpaId ;
10
+ // - we could replace it with Vec<(AuthorityId, u64)>, but we would need
11
+ // `sp_consensus_grandpa` for `AuthorityId` anyway
12
+ // - we could use a type parameter for `AuthorityId`, but there is
13
+ // no sense for this as GRANDPA's `AuthorityId` is not a parameter -- it's always the same
14
+ use sp_consensus_grandpa:: AuthorityList ;
9
15
use sp_runtime:: { traits:: Member , DispatchResult , RuntimeAppPublic } ;
10
16
11
17
mod benchmarking;
@@ -1263,7 +1269,7 @@ pub mod pallet {
1263
1269
pub fn schedule_grandpa_change (
1264
1270
origin : OriginFor < T > ,
1265
1271
// grandpa ID is always the same type, so we don't need to parametrize it via `Config`
1266
- next_authorities : Vec < ( GrandpaId , u64 ) > ,
1272
+ next_authorities : AuthorityList ,
1267
1273
in_blocks : BlockNumberFor < T > ,
1268
1274
forced : Option < BlockNumberFor < T > > ,
1269
1275
) -> DispatchResult {
@@ -1288,12 +1294,14 @@ impl<A, M> AuraInterface<A, M> for () {
1288
1294
fn change_authorities ( _: BoundedVec < A , M > ) { }
1289
1295
}
1290
1296
1297
+
1298
+
1291
1299
pub trait GrandpaInterface < Runtime >
1292
1300
where
1293
1301
Runtime : frame_system:: Config ,
1294
1302
{
1295
1303
fn schedule_change (
1296
- next_authorities : Vec < ( GrandpaId , u64 ) > ,
1304
+ next_authorities : AuthorityList ,
1297
1305
in_blocks : BlockNumberFor < Runtime > ,
1298
1306
forced : Option < BlockNumberFor < Runtime > > ,
1299
1307
) -> DispatchResult ;
@@ -1304,7 +1312,7 @@ where
1304
1312
R : frame_system:: Config ,
1305
1313
{
1306
1314
fn schedule_change (
1307
- _next_authorities : Vec < ( GrandpaId , u64 ) > ,
1315
+ _next_authorities : AuthorityList ,
1308
1316
_in_blocks : BlockNumberFor < R > ,
1309
1317
_forced : Option < BlockNumberFor < R > > ,
1310
1318
) -> DispatchResult {
0 commit comments