mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 10:27:59 +00:00
babe: minor rpc nits (#5974)
* babe: fix formatting * babe: re-use same epoch data in epoch_authorship rpc method
This commit is contained in:
@@ -118,15 +118,18 @@ impl<B, C, SC> BabeApi for BabeRPCHandler<B, C, SC>
|
||||
|
||||
let key_pairs = {
|
||||
let keystore = keystore.read();
|
||||
epoch.authorities.iter().enumerate()
|
||||
.flat_map(|(i, a)| {
|
||||
keystore.key_pair::<sp_consensus_babe::AuthorityPair>(&a.0).ok().map(|kp| (kp, i))
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
epoch.authorities.iter()
|
||||
.enumerate()
|
||||
.flat_map(|(i, a)| {
|
||||
keystore
|
||||
.key_pair::<sp_consensus_babe::AuthorityPair>(&a.0)
|
||||
.ok()
|
||||
.map(|kp| (kp, i))
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
};
|
||||
|
||||
for slot_number in epoch_start..epoch_end {
|
||||
let epoch = epoch_data(&shared_epoch, &client, &babe_config, slot_number, &select_chain)?;
|
||||
if let Some((claim, key)) =
|
||||
authorship::claim_slot_using_key_pairs(slot_number, &epoch, &key_pairs)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user