Remove some SSZ compilation warnings
This commit is contained in:
parent
a620c83916
commit
4fb654f2af
|
@ -270,8 +270,8 @@ template fromSszBytes*[T; N](_: type TypeWithMaxLen[T, N],
|
|||
fromSszBytes(T, bytes)
|
||||
|
||||
proc readValue*[T](r: var SszReader, val: var T) =
|
||||
const minimalSize = fixedPortionSize(T)
|
||||
when isFixedSize(T):
|
||||
const minimalSize = fixedPortionSize(T)
|
||||
if r.stream[].ensureBytes(minimalSize):
|
||||
val = readSszValue(r.stream.readBytes(minimalSize), T)
|
||||
else:
|
||||
|
|
|
@ -20,14 +20,6 @@ proc setOutputSize(s: var string, length: int) {.inline.} =
|
|||
raise newException(MalformedSszError, "SSZ string is too large to fit in memory")
|
||||
s.setLen length
|
||||
|
||||
template assignNullValue(loc: untyped, T: type): auto =
|
||||
when T is ref|ptr:
|
||||
loc = nil
|
||||
elif T is Option:
|
||||
loc = T()
|
||||
else:
|
||||
raise newException(MalformedSszError, "SSZ list element of zero size")
|
||||
|
||||
# fromSszBytes copies the wire representation to a Nim variable,
|
||||
# assuming there's enough data in the buffer
|
||||
func fromSszBytes*(T: type SomeInteger, data: openarray[byte]): T =
|
||||
|
|
Loading…
Reference in New Issue