state/block_sim: spec version in filename (#1171)
* genesim_{const_preset}_{validators}_{SPEC_VERSION}.ssz
This commit is contained in:
parent
044ced53be
commit
f7731b1be2
|
@ -41,7 +41,7 @@ func verifyConsensus*(state: BeaconState, attesterRatio: auto) =
|
||||||
doAssert state.finalized_checkpoint.epoch + 2 >= current_epoch
|
doAssert state.finalized_checkpoint.epoch + 2 >= current_epoch
|
||||||
|
|
||||||
proc loadGenesis*(validators: int, validate: bool): ref HashedBeaconState =
|
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)()
|
let res = (ref HashedBeaconState)()
|
||||||
if fileExists(fn):
|
if fileExists(fn):
|
||||||
res.data = SSZ.loadFile(fn, BeaconState)
|
res.data = SSZ.loadFile(fn, BeaconState)
|
||||||
|
@ -72,6 +72,7 @@ proc loadGenesis*(validators: int, validate: bool): ref HashedBeaconState =
|
||||||
|
|
||||||
echo &"Saving to {fn}..."
|
echo &"Saving to {fn}..."
|
||||||
SSZ.saveFile(fn, res.data)
|
SSZ.saveFile(fn, res.data)
|
||||||
|
|
||||||
res
|
res
|
||||||
|
|
||||||
proc printTimers*[Timers: enum](
|
proc printTimers*[Timers: enum](
|
||||||
|
|
Loading…
Reference in New Issue