Pallet AURA: remove pallet::getter macro and write the corresponding code (#3350)

Removed the `pallet::getter` macro call from storage type definitions
and added the corresponding implementations directly.
fixes #3330  

polkadot address: 14JzTPPUd8x8phKi8qLxHgNTnTMg6DUukCLXoWprejkaHXPz

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
K Gunjan
2024-03-18 15:57:48 +05:30
committed by GitHub
parent 1b5f4243d1
commit 816c072abd
21 changed files with 62 additions and 30 deletions
+4 -3
View File
@@ -19,7 +19,8 @@
#![cfg(test)]
use crate::mock::{build_ext_and_execute_test, Aura, MockDisabledValidators, System};
use super::pallet;
use crate::mock::{build_ext_and_execute_test, Aura, MockDisabledValidators, System, Test};
use codec::Encode;
use frame_support::traits::OnInitialize;
use sp_consensus_aura::{Slot, AURA_ENGINE_ID};
@@ -28,8 +29,8 @@ use sp_runtime::{Digest, DigestItem};
#[test]
fn initial_values() {
build_ext_and_execute_test(vec![0, 1, 2, 3], || {
assert_eq!(Aura::current_slot(), 0u64);
assert_eq!(Aura::authorities().len(), Aura::authorities_len());
assert_eq!(pallet::CurrentSlot::<Test>::get(), 0u64);
assert_eq!(pallet::Authorities::<Test>::get().len(), Aura::authorities_len());
assert_eq!(Aura::authorities_len(), 4);
});
}