Skip to content

Commit 6129f4c

Browse files
committed
cleanup
1 parent 1301be1 commit 6129f4c

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git
224224
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }
225225

226226
polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }
227+
227228
runtime-common = { package = "polkadot-runtime-common", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }
228229

229230
# Frontier

runtime/src/lib.rs

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,6 @@ parameter_types! {
604604
// this is an unbounded number. We just set it to a reasonably high value, 1 full page
605605
// of nominators.
606606
pub const MaxNominators: u32 = 512;
607-
// pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);
608-
// 16
609607
pub const MaxNominations: u32 = <NposCompactSolution16 as frame_election_provider_support::NposSolution>::LIMIT as u32;
610608
}
611609

@@ -672,7 +670,6 @@ impl pallet_staking::Config for Runtime {
672670
type MaxControllersInDeprecationBatch = ConstU32<5314>;
673671
type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig;
674672
type RuntimeHoldReason = RuntimeHoldReason;
675-
// type EventListeners = NominationPools;
676673
type EventListeners = ();
677674
type WeightInfo = ();
678675
type Filter = StakingBlacklistFilter;
@@ -1792,7 +1789,6 @@ impl pallet_evm::Config for Runtime {
17921789
type OnChargeTransaction = ();
17931790
type OnCreate = ();
17941791
type FindAuthor = FindAuthorTruncated<Babe>;
1795-
// type FindAuthor = FindAuthorTruncated<Aura>;
17961792
type GasLimitPovSizeRatio = GasLimitPovSizeRatio;
17971793
type Timestamp = Timestamp;
17981794
type WeightInfo = pallet_evm::weights::SubstrateWeight<Self>;
@@ -2258,13 +2254,12 @@ impl_runtime_apis! {
22582254

22592255
fn generate_key_ownership_proof(
22602256
_set_id: fg_primitives::SetId,
2261-
authority_id: fg_primitives::AuthorityId,
2257+
_authority_id: fg_primitives::AuthorityId,
22622258
) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {
2263-
use codec::Encode;
2264-
2265-
Historical::prove((fg_primitives::KEY_TYPE, authority_id))
2266-
.map(|p| p.encode())
2267-
.map(fg_primitives::OpaqueKeyOwnershipProof::new)
2259+
// NOTE: this is the only implementation possible since we've
2260+
// defined our key owner proof type as a bottom type (i.e. a type
2261+
// with no values).
2262+
None
22682263
}
22692264
}
22702265

@@ -2768,20 +2763,6 @@ impl_runtime_apis! {
27682763
}
27692764
}
27702765

2771-
impl pallet_staking_runtime_api::StakingApi<Block, Balance, AccountId> for Runtime {
2772-
fn nominations_quota(balance: Balance) -> u32 {
2773-
Staking::api_nominations_quota(balance)
2774-
}
2775-
2776-
fn eras_stakers_page_count(era: sp_staking::EraIndex, account: AccountId) -> sp_staking::Page {
2777-
Staking::api_eras_stakers_page_count(era, account)
2778-
}
2779-
2780-
fn pending_rewards(era: sp_staking::EraIndex, account: AccountId) -> bool {
2781-
Staking::api_pending_rewards(era, account)
2782-
}
2783-
}
2784-
27852766
impl sp_consensus_babe::BabeApi<Block> for Runtime {
27862767
fn configuration() -> sp_consensus_babe::BabeConfiguration {
27872768
let epoch_config = Babe::epoch_config().unwrap_or(BABE_GENESIS_EPOCH_CONFIG);
@@ -2831,6 +2812,20 @@ impl_runtime_apis! {
28312812
}
28322813
}
28332814

2815+
impl pallet_staking_runtime_api::StakingApi<Block, Balance, AccountId> for Runtime {
2816+
fn nominations_quota(balance: Balance) -> u32 {
2817+
Staking::api_nominations_quota(balance)
2818+
}
2819+
2820+
fn eras_stakers_page_count(era: sp_staking::EraIndex, account: AccountId) -> sp_staking::Page {
2821+
Staking::api_eras_stakers_page_count(era, account)
2822+
}
2823+
2824+
fn pending_rewards(era: sp_staking::EraIndex, account: AccountId) -> bool {
2825+
Staking::api_pending_rewards(era, account)
2826+
}
2827+
}
2828+
28342829
impl pallet_subtensor_swap_runtime_api::SwapRuntimeApi<Block> for Runtime {
28352830
fn current_alpha_price(netuid: NetUid) -> u64 {
28362831
use substrate_fixed::types::U96F32;

0 commit comments

Comments
 (0)