using deneb_mev for Deneb is less incorrect than using capella_mev (#5516)

This commit is contained in:
tersec 2023-10-20 01:39:47 +00:00 committed by GitHub
parent 769316d909
commit a986a1bcd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -5,6 +5,8 @@
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.push raises: [].}
import std/[typetraits, strutils]
import stew/[assign2, results, base10, byteutils, endians2], presto/common,
libp2p/peerid, serialization, json_serialization,
@ -162,9 +164,8 @@ type
RestBlockTypes* = phase0.BeaconBlock | altair.BeaconBlock |
bellatrix.BeaconBlock | capella.BeaconBlock |
DenebBlockContents | capella_mev.BlindedBeaconBlock
{.push raises: [].}
DenebBlockContents | capella_mev.BlindedBeaconBlock |
deneb_mev.BlindedBeaconBlock
proc prepareJsonResponse*(t: typedesc[RestApiResponse], d: auto): seq[byte] =
let res =
@ -1223,7 +1224,7 @@ proc readValue*[BlockType: ForkedBlindedBeaconBlock](
let res =
try:
RestJson.decode(string(data.get()),
capella_mev.BlindedBeaconBlock,
deneb_mev.BlindedBeaconBlock,
requireAllFields = true,
allowUnknownFields = true)
except SerializationError as exc:
@ -3483,7 +3484,7 @@ proc decodeBytes*[T: DecodeConsensysTypes](
case fork
of ConsensusFork.Deneb:
let
blck = ? readSszResBytes(capella_mev.BlindedBeaconBlock, value)
blck = ? readSszResBytes(deneb_mev.BlindedBeaconBlock, value)
forked = ForkedBlindedBeaconBlock(
kind: ConsensusFork.Deneb, denebData: blck)
ok(ProduceBlindedBlockResponse(forked))

View File

@ -155,7 +155,7 @@ type
of ConsensusFork.Altair: altairData*: altair.BeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix_mev.BlindedBeaconBlock
of ConsensusFork.Capella: capellaData*: capella_mev.BlindedBeaconBlock
of ConsensusFork.Deneb: denebData*: capella_mev.BlindedBeaconBlock
of ConsensusFork.Deneb: denebData*: deneb_mev.BlindedBeaconBlock
ForkedTrustedBeaconBlock* = object
case kind*: ConsensusFork
@ -191,7 +191,7 @@ type
of ConsensusFork.Altair: altairData*: altair.SignedBeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix_mev.SignedBlindedBeaconBlock
of ConsensusFork.Capella: capellaData*: capella_mev.SignedBlindedBeaconBlock
of ConsensusFork.Deneb: denebData*: capella_mev.SignedBlindedBeaconBlock
of ConsensusFork.Deneb: denebData*: deneb_mev.SignedBlindedBeaconBlock
ForkySigVerifiedSignedBeaconBlock* =
phase0.SigVerifiedSignedBeaconBlock |
@ -562,7 +562,7 @@ func init*(T: type ForkedSignedBlindedBeaconBlock,
signature: signature))
of ConsensusFork.Deneb:
T(kind: ConsensusFork.Deneb,
denebData: capella_mev.SignedBlindedBeaconBlock(message: forked.denebData,
denebData: deneb_mev.SignedBlindedBeaconBlock(message: forked.denebData,
signature: signature))
template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: phase0.MsgTrustedSignedBeaconBlock): T =