Mysterious fix for the mysterious build issue
This commit is contained in:
parent
794f6aed89
commit
68a39a21be
|
@ -46,7 +46,7 @@
|
|||
|
||||
import
|
||||
sequtils,
|
||||
hashes,
|
||||
hashes, eth/rlp,
|
||||
blscurve, json_serialization
|
||||
|
||||
export
|
||||
|
@ -127,3 +127,16 @@ proc readValue*(reader: var JsonReader, value: var ValidatorPrivKey) {.inline.}
|
|||
value = SigKey.init(reader.readValue(string))
|
||||
|
||||
proc newPrivKey*(): ValidatorPrivKey = SigKey.random()
|
||||
|
||||
proc append*(writer: var RlpWriter, value: ValidatorPubKey) =
|
||||
writer.append value.getBytes()
|
||||
|
||||
proc read*(rlp: var Rlp, T: type ValidatorPubKey): T {.inline.} =
|
||||
ValidatorPubKey.init rlp.toBytes.toOpenArray
|
||||
|
||||
proc append*(writer: var RlpWriter, value: ValidatorSig) =
|
||||
writer.append value.getBytes()
|
||||
|
||||
proc read*(rlp: var Rlp, T: type ValidatorSig): T {.inline.} =
|
||||
ValidatorSig.init rlp.toBytes.toOpenArray
|
||||
|
||||
|
|
|
@ -482,29 +482,6 @@ type
|
|||
# TODO: not in spec
|
||||
CrosslinkCommittee* = tuple[committee: seq[ValidatorIndex], shard: uint64]
|
||||
|
||||
when true:
|
||||
# TODO: Remove these once RLP serialization is no longer used
|
||||
import nimcrypto, eth/rlp, json_serialization
|
||||
export append, read, json_serialization
|
||||
|
||||
proc append*(rlpWriter: var RlpWriter, value: ValidatorPubKey) =
|
||||
discard
|
||||
|
||||
proc read*(rlp: var Rlp, T: type ValidatorPubKey): T {.inline.} =
|
||||
discard
|
||||
|
||||
proc append*(rlpWriter: var RlpWriter, value: ValidatorIndex) =
|
||||
discard
|
||||
|
||||
proc read*(rlp: var Rlp, T: type ValidatorIndex): T {.inline.} =
|
||||
discard
|
||||
|
||||
proc append*(rlpWriter: var RlpWriter, value: ValidatorSig) =
|
||||
discard
|
||||
|
||||
proc read*(rlp: var Rlp, T: type ValidatorSig): T {.inline.} =
|
||||
discard
|
||||
|
||||
func shortValidatorKey*(state: BeaconState, validatorIdx: int): string =
|
||||
($state.validator_registry[validatorIdx].pubkey)[0..7]
|
||||
|
||||
|
@ -514,6 +491,7 @@ func humaneSlotNum*(s: Slot): Slot =
|
|||
func humaneEpochNum*(e: Epoch): Epoch =
|
||||
e - GENESIS_EPOCH
|
||||
|
||||
export
|
||||
writeValue, readValue
|
||||
import nimcrypto, json_serialization
|
||||
export json_serialization
|
||||
export writeValue, readValue, append, read
|
||||
|
||||
|
|
Loading…
Reference in New Issue