state/block_sim: spec version in filename (#1171)

* genesim_{const_preset}_{validators}_{SPEC_VERSION}.ssz
This commit is contained in:
Ștefan Talpalaru 2020-06-16 22:34:34 +02:00 committed by GitHub
parent 044ced53be
commit f7731b1be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -41,7 +41,7 @@ func verifyConsensus*(state: BeaconState, attesterRatio: auto) =
doAssert state.finalized_checkpoint.epoch + 2 >= current_epoch
proc loadGenesis*(validators: int, validate: bool): ref HashedBeaconState =
let fn = &"genesim_{const_preset}_{validators}.ssz"
let fn = &"genesim_{const_preset}_{validators}_{SPEC_VERSION}.ssz"
let res = (ref HashedBeaconState)()
if fileExists(fn):
res.data = SSZ.loadFile(fn, BeaconState)
@ -72,6 +72,7 @@ proc loadGenesis*(validators: int, validate: bool): ref HashedBeaconState =
echo &"Saving to {fn}..."
SSZ.saveFile(fn, res.data)
res
proc printTimers*[Timers: enum](