From 7bc1737653e643bd927f1f6814016f51d0286ec7 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Thu, 16 Sep 2021 17:48:49 +0200 Subject: [PATCH] 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. --- tests/mocking/mock_blocks.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mocking/mock_blocks.nim b/tests/mocking/mock_blocks.nim index d9fecf0cb..31e18ce8b 100644 --- a/tests/mocking/mock_blocks.nim +++ b/tests/mocking/mock_blocks.nim @@ -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