Skip to content

Commit

Permalink
add JSON-RPC conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Jun 18, 2024
1 parent eb17493 commit fc226d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions web3/conversions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ GetPayloadV2ResponseExact.useDefaultSerializationIn JrpcConv
GetPayloadV3Response.useDefaultSerializationIn JrpcConv
GetPayloadV4Response.useDefaultSerializationIn JrpcConv
ClientVersionV1.useDefaultSerializationIn JrpcConv
ConsolidationRequestV1.useDefaultSerializationIn JrpcConv

#------------------------------------------------------------------------------
# execution_types
Expand Down
10 changes: 5 additions & 5 deletions web3/engine_api_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -229,20 +229,20 @@ type
safeBlockHash*: BlockHash
finalizedBlockHash*: BlockHash

# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#response-1
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/paris.md#request-2
PayloadID* = FixedBytes[8]

ForkchoiceUpdatedResponse* = object
payloadStatus*: PayloadStatusV1
payloadId*: Opt[PayloadID]

# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#transitionconfigurationv1
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/paris.md#transitionconfigurationv1
TransitionConfigurationV1* = object
terminalTotalDifficulty*: UInt256
terminalBlockHash*: BlockHash
terminalBlockNumber*: Quantity

# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/shanghai.md#response-2
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/shanghai.md#response-2
GetPayloadV2Response* = object
executionPayload*: ExecutionPayloadV1OrV2
blockValue*: UInt256
Expand All @@ -251,7 +251,7 @@ type
executionPayload*: ExecutionPayloadV2
blockValue*: UInt256

# https://github.com/ethereum/execution-apis/blob/584905270d8ad665718058060267061ecfd79ca5/src/engine/cancun.md#response-2
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/cancun.md#response-2
GetPayloadV3Response* = object
executionPayload*: ExecutionPayloadV3
blockValue*: UInt256
Expand Down Expand Up @@ -279,7 +279,7 @@ type
commit*: FixedBytes[4]

const
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/common.md#errors
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/common.md#errors
engineApiParseError* = -32700
engineApiInvalidRequest* = -32600
engineApiMethodNotFound* = -32601
Expand Down

0 comments on commit fc226d4

Please sign in to comment.