Skip to content

Commit b3c75d8

Browse files
committed
revert get ptc to func
1 parent b677dca commit b3c75d8

5 files changed

Lines changed: 9 additions & 6 deletions

File tree

beacon_chain/spec/beaconstate.nim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,7 +2316,8 @@ iterator compute_ptc*(state: gloas.BeaconState, slot: Slot, cache: var StateCach
23162316
yield candidate_index
23172317

23182318
# https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.4/specs/gloas/beacon-chain.md#new-get_ptc
2319-
iterator get_ptc*(state: gloas.BeaconState, slot: Slot): ValidatorIndex =
2319+
func get_ptc*(state: gloas.BeaconState, slot: Slot):
2320+
seq[ValidatorIndex] =
23202321
## Get the payload timeliness committee for the given ``slot``
23212322
let
23222323
epoch = slot.epoch()
@@ -2330,8 +2331,10 @@ iterator get_ptc*(state: gloas.BeaconState, slot: Slot): ValidatorIndex =
23302331
doAssert epoch <= state_epoch + MIN_SEED_LOOKAHEAD
23312332
(epoch - state_epoch + 1).Epoch.start_slot.uint64 + slot_in_epoch
23322333

2334+
var res: seq[ValidatorIndex]
23332335
for idx in state.ptc_window[index]:
2334-
yield ValidatorIndex(idx)
2336+
res.add(ValidatorIndex(idx))
2337+
res
23352338

23362339
# https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.4/specs/gloas/fork.md#new-initialize_ptc_window
23372340
proc initialize_ptc_window(

vendor/nim-chronos

vendor/nim-lsquic

0 commit comments

Comments
 (0)