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:
Svyatoslav Nikolsky
2019-08-19 14:44:16 +03:00
committed by Gavin Wood
parent 68fd94028f
commit 6fb721e861
6 changed files with 50 additions and 20 deletions
+2 -2
View File
@@ -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(());
}