mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 16:21:06 +00:00
Remove Default bound for AccountId (#10403)
* Remove Default for AccountId * More removals of default * Update frame/authorship/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update frame/authorship/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update frame/authorship/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update frame/authorship/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * More work * More work * Remove old code * More work * pallet-asset-tx-payment * tips * sc-consensus-babe * sc-finality-grandpa * sc-consensus-babe-rpc * sc-cli * make npos crates accept non-default account (#10420) * minimal changes to make npos pallets all work * make this pesky reduce.rs a bit cleaner * more work * more work * Tests build * Fix imonline tests * Formatting * Fixes * Fixes * Fix bench * Fixes * Fixes * Fixes * Fixes * Fixes * Formatting * Fixes * Formatting * Fixes * Formatting * Fixes * Formatting * Fixes * Formatting * Update client/keystore/src/local.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update client/finality-grandpa/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update client/keystore/src/local.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update client/keystore/src/local.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update frame/staking/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update frame/staking/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update primitives/runtime/src/traits.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Formatting Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: kianenigma <kian@parity.io>
This commit is contained in:
@@ -1089,8 +1089,13 @@ where
|
||||
fn note_author(author: T::AccountId) {
|
||||
Self::reward_by_ids(vec![(author, 20)])
|
||||
}
|
||||
fn note_uncle(author: T::AccountId, _age: T::BlockNumber) {
|
||||
Self::reward_by_ids(vec![(<pallet_authorship::Pallet<T>>::author(), 2), (author, 1)])
|
||||
fn note_uncle(uncle_author: T::AccountId, _age: T::BlockNumber) {
|
||||
// defensive-only: block author must exist.
|
||||
if let Some(block_author) = <pallet_authorship::Pallet<T>>::author() {
|
||||
Self::reward_by_ids(vec![(block_author, 2), (uncle_author, 1)])
|
||||
} else {
|
||||
crate::log!(warn, "block author not set, this should never happen");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1238,8 +1243,13 @@ impl<T: Config> VoteWeightProvider<T::AccountId> for Pallet<T> {
|
||||
// this will clearly results in an inconsistent state, but it should not matter for a
|
||||
// benchmark.
|
||||
let active: BalanceOf<T> = weight.try_into().map_err(|_| ()).unwrap();
|
||||
let mut ledger = Self::ledger(who).unwrap_or_default();
|
||||
ledger.active = active;
|
||||
let ledger = match Self::ledger(who) {
|
||||
None => StakingLedger::default_from(who.clone()),
|
||||
Some(mut l) => {
|
||||
l.active = active;
|
||||
l
|
||||
},
|
||||
};
|
||||
<Ledger<T>>::insert(who, ledger);
|
||||
<Bonded<T>>::insert(who, who);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user