-
Notifications
You must be signed in to change notification settings - Fork 809
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
Remove pallet::getter
usage from bridges/modules
#7120
base: master
Are you sure you want to change the base?
Changes from 9 commits
72ac9bf
c4a68d3
91e6411
0d4e93b
a7abd92
d6d2c49
dfce5dc
b91db67
5637d8e
25f5d8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -62,6 +62,7 @@ use frame_support::{ | |||||
construct_runtime, derive_impl, | ||||||
dispatch::DispatchClass, | ||||||
genesis_builder_helper::{build_state, get_preset}, | ||||||
instances::{Instance3, Instance4}, | ||||||
parameter_types, | ||||||
traits::{ConstBool, ConstU32, ConstU64, ConstU8, Get, TransformOrigin}, | ||||||
weights::{ConstantMultiplier, Weight, WeightToFee as _}, | ||||||
|
@@ -917,7 +918,7 @@ impl_runtime_apis! { | |||||
|
||||||
impl bp_westend::WestendFinalityApi<Block> for Runtime { | ||||||
fn best_finalized() -> Option<HeaderId<bp_westend::Hash, bp_westend::BlockNumber>> { | ||||||
BridgeWestendGrandpa::best_finalized() | ||||||
pallet_bridge_grandpa::BestFinalized::<Runtime, Instance3>::get() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huh that is a bit unfortunate that we have to pull in the Instances... first time that I see a downside of this migration. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, I agree. It would also be less error-prone to avoid accidentally using an invalid There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll update the PR with a manual getter implementation and revert the changes on the runtimes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
fn free_headers_interval() -> Option<bp_westend::BlockNumber> { | ||||||
<Runtime as pallet_bridge_grandpa::Config< | ||||||
|
@@ -971,7 +972,7 @@ impl_runtime_apis! { | |||||
|
||||||
impl bp_polkadot_bulletin::PolkadotBulletinFinalityApi<Block> for Runtime { | ||||||
fn best_finalized() -> Option<bp_runtime::HeaderId<bp_polkadot_bulletin::Hash, bp_polkadot_bulletin::BlockNumber>> { | ||||||
BridgePolkadotBulletinGrandpa::best_finalized() | ||||||
pallet_bridge_grandpa::BestFinalized::<Runtime, Instance4>::get() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
fn free_headers_interval() -> Option<bp_polkadot_bulletin::BlockNumber> { | ||||||
|
@@ -1344,7 +1345,7 @@ impl_runtime_apis! { | |||||
let bench_lane_id = <Self as BridgeMessagesConfig<bridge_to_westend_config::WithBridgeHubWestendMessagesInstance>>::bench_lane_id(); | ||||||
use bp_runtime::Chain; | ||||||
let bridged_chain_id =<Self as pallet_bridge_messages::Config<bridge_to_westend_config::WithBridgeHubWestendMessagesInstance>>::BridgedChain::ID; | ||||||
pallet_bridge_relayers::Pallet::<Runtime>::relayer_reward( | ||||||
pallet_bridge_relayers::RelayerRewards::<Runtime>::get( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
relayer, | ||||||
bp_relayers::RewardsAccountParams::new( | ||||||
bench_lane_id, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -63,6 +63,7 @@ use frame_support::{ | |||||
construct_runtime, derive_impl, | ||||||
dispatch::DispatchClass, | ||||||
genesis_builder_helper::{build_state, get_preset}, | ||||||
instances::Instance1, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
parameter_types, | ||||||
traits::{ConstBool, ConstU32, ConstU64, ConstU8, Get, TransformOrigin}, | ||||||
weights::{ConstantMultiplier, Weight, WeightToFee as _}, | ||||||
|
@@ -850,7 +851,7 @@ impl_runtime_apis! { | |||||
|
||||||
impl bp_rococo::RococoFinalityApi<Block> for Runtime { | ||||||
fn best_finalized() -> Option<HeaderId<bp_rococo::Hash, bp_rococo::BlockNumber>> { | ||||||
BridgeRococoGrandpa::best_finalized() | ||||||
pallet_bridge_grandpa::BestFinalized::<Runtime, Instance1>::get() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
fn free_headers_interval() -> Option<bp_rococo::BlockNumber> { | ||||||
<Runtime as pallet_bridge_grandpa::Config< | ||||||
|
@@ -1225,7 +1226,7 @@ impl_runtime_apis! { | |||||
let bench_lane_id = <Self as BridgeMessagesConfig<bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance>>::bench_lane_id(); | ||||||
use bp_runtime::Chain; | ||||||
let bridged_chain_id =<Self as pallet_bridge_messages::Config<bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance>>::BridgedChain::ID; | ||||||
pallet_bridge_relayers::Pallet::<Runtime>::relayer_reward( | ||||||
pallet_bridge_relayers::RelayerRewards::<Runtime>::get( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
relayer, | ||||||
bp_relayers::RewardsAccountParams::new( | ||||||
bench_lane_id, | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
title: Remove pallet::getter from bridges/modules | ||
doc: | ||
- audience: Runtime Dev | ||
description: | | ||
This PR removes all pallet::getter occurrences from pallet-bridge-grandpa, pallet-bridge-messages and pallet-bridge-relayers and replaces them with explicit implementations. | ||
|
||
crates: | ||
- name: pallet-bridge-grandpa | ||
bump: patch | ||
- name: pallet-bridge-messages | ||
bump: patch | ||
- name: pallet-bridge-relayers | ||
bump: patch | ||
muraca marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: bridge-hub-rococo-runtime | ||
bump: patch | ||
- name: bridge-hub-westend-runtime | ||
bump: patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.