mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 10:31:04 +00:00
Value lifetime is returned from blockchain cache (#3403)
* value range in blockchain cache * revert me (testing for spurious failure) * Revert "revert me (testing for spurious failure)" This reverts commit 21a4a3cf5ee14e003541b779c41351e4f5e1122a.
This commit is contained in:
committed by
Gavin Wood
parent
68fd94028f
commit
6fb721e861
@@ -582,7 +582,7 @@ fn initialize_authorities_cache<A, B, C>(client: &C) -> Result<(), ConsensusErro
|
||||
let genesis_id = BlockId::Number(Zero::zero());
|
||||
let genesis_authorities: Option<Vec<A>> = cache
|
||||
.get_at(&well_known_cache_keys::AUTHORITIES, &genesis_id)
|
||||
.and_then(|v| Decode::decode(&mut &v[..]).ok());
|
||||
.and_then(|(_, _, v)| Decode::decode(&mut &v[..]).ok());
|
||||
if genesis_authorities.is_some() {
|
||||
return Ok(());
|
||||
}
|
||||
@@ -610,7 +610,7 @@ fn authorities<A, B, C>(client: &C, at: &BlockId<B>) -> Result<Vec<A>, Consensus
|
||||
.cache()
|
||||
.and_then(|cache| cache
|
||||
.get_at(&well_known_cache_keys::AUTHORITIES, at)
|
||||
.and_then(|v| Decode::decode(&mut &v[..]).ok())
|
||||
.and_then(|(_, _, v)| Decode::decode(&mut &v[..]).ok())
|
||||
)
|
||||
.or_else(|| AuraApi::authorities(&*client.runtime_api(), at).ok())
|
||||
.ok_or_else(|| consensus_common::Error::InvalidAuthoritiesSet.into())
|
||||
|
||||
Reference in New Issue
Block a user