mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 22:11:06 +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
@@ -952,7 +952,7 @@ fn epoch_from_cache<B, C>(client: &C, at: &BlockId<B>) -> Option<MaybeSpanEpoch>
|
||||
client.cache()
|
||||
.and_then(|cache| cache
|
||||
.get_at(&well_known_cache_keys::EPOCH, at)
|
||||
.and_then(|v| Decode::decode(&mut &v[..]).ok()))
|
||||
.and_then(|(_, _, v)| Decode::decode(&mut &v[..]).ok()))
|
||||
}
|
||||
|
||||
/// Extract current epoch from runtime.
|
||||
@@ -1202,7 +1202,7 @@ fn initialize_authorities_cache<B, C>(client: &C) -> Result<(), ConsensusError>
|
||||
let genesis_id = BlockId::Number(Zero::zero());
|
||||
let genesis_epoch: Option<MaybeSpanEpoch> = cache
|
||||
.get_at(&well_known_cache_keys::EPOCH, &genesis_id)
|
||||
.and_then(|v| Decode::decode(&mut &v[..]).ok());
|
||||
.and_then(|(_, _, v)| Decode::decode(&mut &v[..]).ok());
|
||||
if genesis_epoch.is_some() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user