Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed pallet:getter from Snowbridge pallets #7914

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions bridges/snowbridge/pallets/ethereum-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,14 @@

/// Latest imported checkpoint root
#[pallet::storage]
#[pallet::getter(fn initial_checkpoint_root)]
pub type InitialCheckpointRoot<T: Config> = StorageValue<_, H256, ValueQuery>;

/// Latest imported finalized block root
#[pallet::storage]
#[pallet::getter(fn latest_finalized_block_root)]
pub type LatestFinalizedBlockRoot<T: Config> = StorageValue<_, H256, ValueQuery>;

/// Beacon state by finalized block root
#[pallet::storage]
#[pallet::getter(fn finalized_beacon_state)]
pub type FinalizedBeaconState<T: Config> =
StorageMap<_, Identity, H256, CompactBeaconState, OptionQuery>;

Expand All @@ -176,7 +173,6 @@
StorageMap<_, Identity, u32, H256, ValueQuery>;

#[pallet::storage]
#[pallet::getter(fn validators_root)]
pub type ValidatorsRoot<T: Config> = StorageValue<_, H256, ValueQuery>;

/// Sync committee for current period
Expand All @@ -193,7 +189,6 @@

/// The current operating mode of the pallet.
#[pallet::storage]
#[pallet::getter(fn operating_mode)]
pub type OperatingMode<T: Config> = StorageValue<_, BasicOperatingMode, ValueQuery>;

#[pallet::call]
Expand Down Expand Up @@ -224,7 +219,7 @@
/// sync committee.
pub fn submit(origin: OriginFor<T>, update: Box<Update>) -> DispatchResultWithPostInfo {
ensure_signed(origin)?;
ensure!(!Self::operating_mode().is_halted(), Error::<T>::Halted);

Check failure on line 222 in bridges/snowbridge/pallets/ethereum-client/src/lib.rs

View workflow job for this annotation

GitHub Actions / cargo-check-all-crate-macos

no function or associated item named `operating_mode` found for struct `pallet::Pallet` in the current scope
Self::process_update(&update)
}

Expand Down Expand Up @@ -448,7 +443,7 @@
Self::find_pubkeys(&participation, (*sync_committee.pubkeys).as_ref(), false);
let signing_root = Self::signing_root(
&update.attested_header,
Self::validators_root(),

Check failure on line 446 in bridges/snowbridge/pallets/ethereum-client/src/lib.rs

View workflow job for this annotation

GitHub Actions / cargo-check-all-crate-macos

no function or associated item named `validators_root` found for struct `pallet::Pallet` in the current scope
update.signature_slot,
)?;
// Improvement here per <https://eth2book.info/capella/part2/building_blocks/signatures/#sync-aggregates>
Expand Down
1 change: 0 additions & 1 deletion bridges/snowbridge/pallets/inbound-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ pub mod pallet {

/// The current operating mode of the pallet.
#[pallet::storage]
#[pallet::getter(fn operating_mode)]
pub type OperatingMode<T: Config> = StorageValue<_, BasicOperatingMode, ValueQuery>;

#[pallet::call]
Expand Down
2 changes: 0 additions & 2 deletions bridges/snowbridge/pallets/outbound-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ pub mod pallet {
/// `on_initialize`, so should never go into block PoV.
#[pallet::storage]
#[pallet::unbounded]
#[pallet::getter(fn message_leaves)]
pub(super) type MessageLeaves<T: Config> = StorageValue<_, Vec<H256>, ValueQuery>;

/// The current nonce for each message origin
Expand All @@ -236,7 +235,6 @@ pub mod pallet {

/// The current operating mode of the pallet.
#[pallet::storage]
#[pallet::getter(fn operating_mode)]
pub type OperatingMode<T: Config> = StorageValue<_, BasicOperatingMode, ValueQuery>;

#[pallet::hooks]
Expand Down
3 changes: 0 additions & 3 deletions bridges/snowbridge/pallets/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,13 @@ pub mod pallet {

/// The set of registered agents
#[pallet::storage]
#[pallet::getter(fn agents)]
pub type Agents<T: Config> = StorageMap<_, Twox64Concat, AgentId, (), OptionQuery>;

/// The set of registered channels
#[pallet::storage]
#[pallet::getter(fn channels)]
pub type Channels<T: Config> = StorageMap<_, Twox64Concat, ChannelId, Channel, OptionQuery>;

#[pallet::storage]
#[pallet::getter(fn parameters)]
pub type PricingParameters<T: Config> =
StorageValue<_, PricingParametersOf<T>, ValueQuery, T::DefaultPricingParameters>;

Expand Down
16 changes: 16 additions & 0 deletions prdoc/pr_7914.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
title: Removed pallet::getter from Snowbridge pallets
doc:
- audience: Runtime Dev
description: |
This pr removes all pallet::getter occurrences from Snowbridge pallets.

crates:
- name: snowbridge-pallet-ethereum-client
bump: patch
- name: snowbridge-pallet-inbound-queue
bump: patch
- name: snowbridge-pallet-outbound-queue
bump: patch
- name: snowbridge-pallet-system
bump: patch

Loading