compile test_fixture_operations_attestations. Generics sandwiches strike again https://github.com/nim-lang/Nim/issues/11225

This commit is contained in:
Mamy André-Ratsimbazafy 2021-01-06 10:38:42 +01:00
parent 644c17fdbc
commit 3366b75236
No known key found for this signature in database
GPG Key ID: 7B88AD1FE79492E1
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,9 @@ import
./crypto, ./datatypes, ./digest, ./helpers, ./signatures, ./validator, ./crypto, ./datatypes, ./digest, ./helpers, ./signatures, ./validator,
../../nbench/bench_lab ../../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 # 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], func is_valid_merkle_branch*(leaf: Eth2Digest, branch: openArray[Eth2Digest],
depth: int, index: uint64, depth: int, index: uint64,
@ -525,10 +528,11 @@ func get_indexed_attestation[Trust](state: BeaconState, attestation: Attestation
get_attesting_indices( get_attesting_indices(
state, attestation.data, attestation.aggregation_bits, cache) state, attestation.data, attestation.aggregation_bits, cache)
# Note: this requires exporting items(Hashsets) from here
IndexedAttestation[Trust]( IndexedAttestation[Trust](
attesting_indices: attesting_indices:
List[uint64, Limit MAX_VALIDATORS_PER_COMMITTEE].init( 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, data: attestation.data,
signature: attestation.signature signature: attestation.signature
) )