Skip to content

Commit

Permalink
styleCheck tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Oct 11, 2024
1 parent b4efaaa commit 3806a8d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1417,8 +1417,8 @@ template prepareForkedBlockReading(blockType: typedesc,
version: var Opt[ConsensusFork],
data: var Opt[JsonString],
blinded: var Opt[bool],
payloadValue: var Opt[Uint256],
blockValue: var Opt[Uint256]) =
payloadValue: var Opt[UInt256],
blockValue: var Opt[UInt256]) =
for fieldName {.inject.} in readObjectFields(reader):
case fieldName
of "version":
Expand Down Expand Up @@ -1459,15 +1459,15 @@ template prepareForkedBlockReading(blockType: typedesc,
if payloadValue.isSome():
reader.raiseUnexpectedField(
"Multiple `execution_payload_value` fields found", blockType.name)
payloadValue = Opt.some(reader.readValue(Uint256))
payloadValue = Opt.some(reader.readValue(UInt256))
else:
unrecognizedFieldWarning(fieldName, blockType.name)
of "consensus_block_value":
when (blockType is ProduceBlockResponseV3):
if blockValue.isSome():
reader.raiseUnexpectedField(
"Multiple `consensus_block_value` fields found", blockType.name)
blockValue = Opt.some(reader.readValue(Uint256))
blockValue = Opt.some(reader.readValue(UInt256))
else:
unrecognizedFieldWarning(fieldName, blockType.name)
else:
Expand All @@ -1486,8 +1486,8 @@ proc readValue*[BlockType: ForkedBlindedBeaconBlock](
version: Opt[ConsensusFork]
data: Opt[JsonString]
blinded: Opt[bool]
payloadValue: Opt[Uint256]
blockValue: Opt[Uint256]
payloadValue: Opt[UInt256]
blockValue: Opt[UInt256]

prepareForkedBlockReading(BlockType, reader, version, data, blinded,
payloadValue, blockValue)
Expand Down Expand Up @@ -1552,8 +1552,8 @@ proc readValue*[BlockType: Web3SignerForkedBeaconBlock](
version: Opt[ConsensusFork]
data: Opt[JsonString]
blinded: Opt[bool]
payloadValue: Opt[Uint256]
blockValue: Opt[Uint256]
payloadValue: Opt[UInt256]
blockValue: Opt[UInt256]

prepareForkedBlockReading(BlockType, reader, version, data, blinded,
payloadValue, blockValue)
Expand Down Expand Up @@ -3360,7 +3360,7 @@ proc decodeBytes*[T: ProduceBlockResponseV3](
consensusValue =
if len(headerConsensusValue) == 0:
# TODO (cheatfate): We should not allow empty `consensus-value`.
Opt.none(Uint256)
Opt.none(UInt256)
else:
try:
Opt.some parse(headerConsensusValue, UInt256, 10)
Expand Down
2 changes: 1 addition & 1 deletion ncli/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
-d:"libp2p_pki_schemes=secp256k1"

--styleCheck:usages
--styleCheck:error
--styleCheck:hint
--hint[Processing]:off
2 changes: 1 addition & 1 deletion research/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
-d:"libp2p_pki_schemes=secp256k1"

--styleCheck:usages
--styleCheck:error
--styleCheck:hint
--hint[Processing]:off

0 comments on commit 3806a8d

Please sign in to comment.