mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 16:05:41 +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 key_pairs = {
|
||||||
let keystore = keystore.read();
|
let keystore = keystore.read();
|
||||||
epoch.authorities.iter().enumerate()
|
epoch.authorities.iter()
|
||||||
.flat_map(|(i, a)| {
|
.enumerate()
|
||||||
keystore.key_pair::<sp_consensus_babe::AuthorityPair>(&a.0).ok().map(|kp| (kp, i))
|
.flat_map(|(i, a)| {
|
||||||
})
|
keystore
|
||||||
.collect::<Vec<_>>()
|
.key_pair::<sp_consensus_babe::AuthorityPair>(&a.0)
|
||||||
|
.ok()
|
||||||
|
.map(|kp| (kp, i))
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>()
|
||||||
};
|
};
|
||||||
|
|
||||||
for slot_number in epoch_start..epoch_end {
|
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)) =
|
if let Some((claim, key)) =
|
||||||
authorship::claim_slot_using_key_pairs(slot_number, &epoch, &key_pairs)
|
authorship::claim_slot_using_key_pairs(slot_number, &epoch, &key_pairs)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user