mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-21 20:10:36 +00:00
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:
parent
859c1a3c10
commit
7bc1737653
@ -43,7 +43,7 @@ proc mockBlock*(
|
||||
## Mock a BeaconBlock for the specific slot
|
||||
|
||||
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.proposer_index = proposer_index.get.uint64
|
||||
result.message.body.eth1_data.deposit_count = state.eth1_deposit_index
|
||||
|
Loading…
x
Reference in New Issue
Block a user