fix `mockBlock` for current slot (#2915)
In #2867 a regression was introduced that broke `mockBlock` when used to compute a block for the current state. This patch fixes the regression.
This commit is contained in:
parent
ca4c6b4c5c
commit
a0e7463732
|
@ -52,9 +52,11 @@ proc mockBlock*(
|
|||
## TODO don't do this gradual construction, for exception safety
|
||||
## Mock a BeaconBlock for the specific slot
|
||||
|
||||
var cache = StateCache()
|
||||
var
|
||||
cache = StateCache()
|
||||
tmpState = assignClone(state)
|
||||
if getStateField(state, slot) != slot:
|
||||
var rewards = RewardInfo()
|
||||
var tmpState = assignClone(state)
|
||||
doAssert process_slots(cfg, tmpState[], slot, cache, rewards, flags = {})
|
||||
|
||||
var previous_block_header = getStateField(tmpState[], latest_block_header)
|
||||
|
|
Loading…
Reference in New Issue