From 3366b75236badeb1438244ec2e7404e7fbedbed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Wed, 6 Jan 2021 10:38:42 +0100 Subject: [PATCH] compile test_fixture_operations_attestations. Generics sandwiches strike again https://github.com/nim-lang/Nim/issues/11225 --- beacon_chain/spec/beaconstate.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/beacon_chain/spec/beaconstate.nim b/beacon_chain/spec/beaconstate.nim index 2efbf5486..1cc4b356c 100644 --- a/beacon_chain/spec/beaconstate.nim +++ b/beacon_chain/spec/beaconstate.nim @@ -15,6 +15,9 @@ import ./crypto, ./datatypes, ./digest, ./helpers, ./signatures, ./validator, ../../nbench/bench_lab +# Workaround for the generic sandwich with items(Hashset) +export sets, chronicles + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0/specs/phase0/beacon-chain.md#is_valid_merkle_branch func is_valid_merkle_branch*(leaf: Eth2Digest, branch: openArray[Eth2Digest], depth: int, index: uint64, @@ -525,10 +528,11 @@ func get_indexed_attestation[Trust](state: BeaconState, attestation: Attestation get_attesting_indices( state, attestation.data, attestation.aggregation_bits, cache) + # Note: this requires exporting items(Hashsets) from here IndexedAttestation[Trust]( attesting_indices: List[uint64, Limit MAX_VALIDATORS_PER_COMMITTEE].init( - sorted(mapIt(attesting_indices.toSeq, it.uint64), system.cmp)), + sorted(mapIt(toSeq(attesting_indices), it.uint64), system.cmp)), data: attestation.data, signature: attestation.signature )