work around some CastSizes warnings and fix unreachable code warnings (#5149)
This commit is contained in:
parent
0be95571a7
commit
583eb4db17
|
@ -968,22 +968,22 @@ proc validateBlsToExecutionChange*(
|
|||
if res.isErr:
|
||||
return pool.checkedReject(res.error)
|
||||
|
||||
# BLS to execution change signatures are batch-verified
|
||||
let deferredCrypto = batchCrypto.scheduleBlsToExecutionChangeCheck(
|
||||
pool.dag.cfg.genesisFork, signed_address_change)
|
||||
if deferredCrypto.isErr():
|
||||
return pool.checkedReject(deferredCrypto.error)
|
||||
# BLS to execution change signatures are batch-verified
|
||||
let deferredCrypto = batchCrypto.scheduleBlsToExecutionChangeCheck(
|
||||
pool.dag.cfg.genesisFork, signed_address_change)
|
||||
if deferredCrypto.isErr():
|
||||
return pool.checkedReject(deferredCrypto.error)
|
||||
|
||||
let (cryptoFut, sig) = deferredCrypto.get()
|
||||
case await cryptoFut
|
||||
of BatchResult.Invalid:
|
||||
return pool.checkedReject(
|
||||
"SignedBLSToExecutionChange: invalid signature")
|
||||
of BatchResult.Timeout:
|
||||
return errIgnore(
|
||||
"SignedBLSToExecutionChange: timeout checking signature")
|
||||
of BatchResult.Valid:
|
||||
discard # keep going only in this case
|
||||
let (cryptoFut, sig) = deferredCrypto.get()
|
||||
case await cryptoFut
|
||||
of BatchResult.Invalid:
|
||||
return pool.checkedReject(
|
||||
"SignedBLSToExecutionChange: invalid signature")
|
||||
of BatchResult.Timeout:
|
||||
return errIgnore(
|
||||
"SignedBLSToExecutionChange: timeout checking signature")
|
||||
of BatchResult.Valid:
|
||||
discard # keep going only in this case
|
||||
|
||||
return ok()
|
||||
|
||||
|
|
|
@ -650,7 +650,8 @@ proc readValue*(
|
|||
raiseUnexpectedValue(reader, "Hex string of 4 bytes expected")
|
||||
|
||||
func `$`*(x: JustificationBits): string =
|
||||
"0x" & toHex(uint8(x))
|
||||
# TODO, works around https://github.com/nim-lang/Nim/issues/22191
|
||||
"0x" & toHex(uint64(uint8(x)))
|
||||
|
||||
proc readValue*(reader: var JsonReader, value: var JustificationBits)
|
||||
{.raises: [IOError, SerializationError, Defect].} =
|
||||
|
|
Loading…
Reference in New Issue