Skip to content

Commit

Permalink
allow for null parameters and responses where required in engine API
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Nov 8, 2021
1 parent 27c19ce commit 94635bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion web3/engine_api_callsigs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import ethtypes, engine_api_types

proc engine_executePayloadV1(payload: ExecutionPayloadV1): ExecutePayloadResponse
proc engine_forkchoiceUpdatedV1(forkchoiceState: ForkchoiceStateV1): ForkchoiceUpdatedResponse
proc engine_forkchoiceUpdatedV1(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Option[PayloadAttributesV1]): ForkchoiceUpdatedResponse
proc engine_getPayloadV1(payloadId: Quantity): ExecutionPayloadV1
11 changes: 6 additions & 5 deletions web3/engine_api_types.nim
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# https://github.com/ethereum/execution-apis/blob/main/src/engine/interop/specification.md
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.4/src/engine/specification.md

import
std/options,
ethtypes

export
ethtypes

type
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.4/src/engine/specification.md#payloadattributesv1
PayloadAttributes* = object
PayloadAttributesV1* = object
timestamp*: Quantity
random*: FixedBytes[32]
feeRecipient*: Address
Expand All @@ -20,8 +21,8 @@ type

ExecutePayloadResponse* = object
status*: string
latestValidHash*: BlockHash
message*: string
latestValidHash*: Option[BlockHash]
message*: Option[string]

# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.4/src/engine/specification.md#forkchoicestatev1
ForkchoiceStateV1* = object
Expand All @@ -35,7 +36,7 @@ type

ForkchoiceUpdatedResponse* = object
status*: ForkchoiceUpdatedStatus
payloadId*: Quantity
payloadId*: Option[Quantity]

const
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.4/src/engine/specification.md#errors
Expand Down

0 comments on commit 94635bb

Please sign in to comment.