-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
It seems like the init scheme here is a too general (with auto) and causes issue with bls curve init from status-im/nim-blscurve#26
Lines 1 to 15 in 5f1dc75
| template init*(lvalue: var auto) = | |
| mixin init | |
| lvalue = init(type(lvalue)) | |
| template init*(lvalue: var auto, a1: auto)= | |
| mixin init | |
| lvalue = init(type(lvalue), a1) | |
| template init*(lvalue: var auto, a1, a2: auto) = | |
| mixin init | |
| lvalue = init(type(lvalue), a1, a2) | |
| template init*(lvalue: var auto, a1, a2, a3: auto) = | |
| mixin init | |
| lvalue = init(type(lvalue), a1, a2, a3) |
proc init*[T: SigKey|VerKey|Signature](obj: var T,
data: openarray[byte]): bool {.inline.} =
## Initialize ``SignatureKey``, ``VerificationKey`` or ``Signature`` from
## raw binary representation ``data``.
##
## Procedure returns ``true`` on success and ``false`` otherwise.
when T is SigKey:
result = obj.x.fromBytes(data)
else:
result = obj.point.fromBytes(data)The error thrown is especially hard to debug
../beacon_chain/spec/crypto.nim(195, 7) template/generic instantiation from here
../beacon_chain/spec/crypto.nim(186, 18) template/generic instantiation from here
../beacon_chain/spec/crypto.nim(125, 21) Error: expression '
buffer = init(type(buffer), a.blob)' has no type (or is ambiguous)
corresponding to this line:
let success = buffer.init(a.blob)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels