use correct proposer when mocking blocks (#2869)

When creating beacon blocks, the state needs to be advanced to the new
slot to determine the correct proposer index. In #875 a regression got
introduced that removed this logic when mocking blocks. Existing tests
failed to detect this, as they do not make use of the proposer index.
This patch re-introduces the state advancement, fixing the problem.
This commit is contained in:
Etan Kissling 2021-09-16 17:48:49 +02:00 committed by GitHub
parent 859c1a3c10
commit 7bc1737653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ proc mockBlock*(
## Mock a BeaconBlock for the specific slot ## Mock a BeaconBlock for the specific slot
var emptyCache = StateCache() var emptyCache = StateCache()
let proposer_index = get_beacon_proposer_index(state, emptyCache) let proposer_index = get_beacon_proposer_index(state, emptyCache, slot)
result.message.slot = slot result.message.slot = slot
result.message.proposer_index = proposer_index.get.uint64 result.message.proposer_index = proposer_index.get.uint64
result.message.body.eth1_data.deposit_count = state.eth1_deposit_index result.message.body.eth1_data.deposit_count = state.eth1_deposit_index