remove unused phase0/altair-specific REST deserialization (#4605)
This commit is contained in:
parent
f9022618f0
commit
d838e5b6ba
|
@ -88,7 +88,7 @@ func checkMissing*(quarantine: var Quarantine): seq[FetchRecord] =
|
|||
|
||||
# TODO stew/sequtils2
|
||||
template anyIt(s, pred: untyped): bool =
|
||||
# https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/collections/sequtils.nim#L682-L704
|
||||
# https://github.com/nim-lang/Nim/blob/v1.6.10/lib/pure/collections/sequtils.nim#L753-L775
|
||||
# without the items(...)
|
||||
var result = false
|
||||
for it {.inject.} in s:
|
||||
|
|
|
@ -134,10 +134,6 @@ type
|
|||
Web3SignerSignatureResponse |
|
||||
Web3SignerStatusResponse
|
||||
|
||||
SszDecodeTypes* =
|
||||
GetPhase0StateSszResponse |
|
||||
GetPhase0BlockSszResponse
|
||||
|
||||
RestVersioned*[T] = object
|
||||
data*: T
|
||||
jsonVersion*: ConsensusFork
|
||||
|
@ -2864,29 +2860,6 @@ proc decodeBytes*[T: DecodeTypes](
|
|||
else:
|
||||
err("Content-Type not supported")
|
||||
|
||||
proc decodeBytes*[T: SszDecodeTypes](
|
||||
t: typedesc[T],
|
||||
value: openArray[byte],
|
||||
contentType: Opt[ContentTypeData],
|
||||
updateRoot = true
|
||||
): RestResult[T] =
|
||||
|
||||
if contentType.isNone() or
|
||||
isWildCard(contentType.get().mediaType):
|
||||
return err("Missing or incorrect Content-Type")
|
||||
|
||||
let mediaType = contentType.get().mediaType
|
||||
if mediaType == OctetStreamMediaType:
|
||||
try:
|
||||
var v: RestResult[T]
|
||||
v.ok(T()) # This optimistically avoids an expensive genericAssign
|
||||
readSszBytes(value, v.get(), updateRoot)
|
||||
v
|
||||
except SerializationError as exc:
|
||||
err("Serialization error")
|
||||
else:
|
||||
err("Content-Type not supported")
|
||||
|
||||
proc encodeString*(value: string): RestResult[string] =
|
||||
ok(value)
|
||||
|
||||
|
|
|
@ -607,14 +607,8 @@ type
|
|||
serializedFieldName: "validator_registration".}:
|
||||
Web3SignerValidatorRegistration
|
||||
|
||||
GetBlockResponse* = DataEnclosedObject[phase0.SignedBeaconBlock]
|
||||
GetStateResponse* = DataEnclosedObject[phase0.BeaconState]
|
||||
GetBlockV2Response* = ForkedSignedBeaconBlock
|
||||
GetStateV2Response* = ref ForkedHashedBeaconState
|
||||
GetPhase0StateSszResponse* = phase0.BeaconState
|
||||
GetAltairStateSszResponse* = altair.BeaconState
|
||||
GetPhase0BlockSszResponse* = phase0.SignedBeaconBlock
|
||||
GetAltairBlockSszResponse* = altair.SignedBeaconBlock
|
||||
|
||||
RestRoot* = object
|
||||
root*: Eth2Digest
|
||||
|
|
Loading…
Reference in New Issue