update to engine API alpha.6 (#3351)

This commit is contained in:
tersec 2022-02-04 12:12:19 +00:00 committed by GitHub
parent d358299875
commit 02349b4181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View File

@ -436,7 +436,7 @@ proc getBlockByHash(p: Web3DataProviderRef, hash: BlockHash):
Future[BlockObject] =
return p.web3.provider.eth_getBlockByHash(hash, false)
proc getBlockByNumber(p: Web3DataProviderRef,
proc getBlockByNumber*(p: Web3DataProviderRef,
number: Eth1BlockNumber): Future[BlockObject] =
let hexNumber = try: &"0x{number:X}" # No leading 0's!
except ValueError as exc: raiseAssert exc.msg # Never fails
@ -446,9 +446,9 @@ proc getPayload*(p: Web3DataProviderRef,
payloadId: bellatrix.PayloadID): Future[engine_api.ExecutionPayloadV1] =
p.web3.provider.engine_getPayloadV1(FixedBytes[8] payloadId)
proc executePayload*(p: Web3DataProviderRef,
payload: engine_api.ExecutionPayloadV1): Future[ExecutePayloadResponse] =
p.web3.provider.engine_executePayloadV1(payload)
proc newPayload*(p: Web3DataProviderRef,
payload: engine_api.ExecutionPayloadV1): Future[PayloadStatusV1] =
p.web3.provider.engine_newPayloadV1(payload)
proc forkchoiceUpdated*(p: Web3DataProviderRef,
headBlock, finalizedBlock: Eth2Digest):

View File

@ -15,7 +15,7 @@ suite "Merge test vectors":
let web3Provider = (waitFor Web3DataProvider.new(
default(Eth1Address), "http://127.0.0.1:8550")).get
test "getPayload, executePayload, and forkchoiceUpdated":
test "getPayload, newPayload, and forkchoiceUpdated":
const feeRecipient =
Eth1Address.fromHex("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b")
let
@ -28,7 +28,7 @@ suite "Merge test vectors":
feeRecipient)
payload = waitFor web3Provider.getPayload(
array[8, byte] (payloadId.payloadId.get))
payloadStatus = waitFor web3Provider.executePayload(payload)
payloadStatus = waitFor web3Provider.newPayload(payload)
fcupdatedStatus = waitFor web3Provider.forkchoiceUpdated(
payload.blockHash.asEth2Digest,
payload.blockHash.asEth2Digest,
@ -38,7 +38,7 @@ suite "Merge test vectors":
payload2 = waitFor web3Provider.getPayload(
array[8, byte] (fcupdatedStatus.payloadId.get))
payloadStatus2 = waitFor web3Provider.executePayload(payload2)
payloadStatus2 = waitFor web3Provider.newPayload(payload2)
fcupdatedStatus2 = waitFor web3Provider.forkchoiceUpdated(
payload2.blockHash.asEth2Digest,
payload2.blockHash.asEth2Digest,
@ -47,7 +47,7 @@ suite "Merge test vectors":
feeRecipient)
check:
payloadStatus.status == "VALID"
fcupdatedStatus.status == "SUCCESS"
payloadStatus2.status == "VALID"
fcupdatedStatus2.status == "SUCCESS"
payloadStatus.status == PayloadExecutionStatus.valid
fcupdatedStatus.payloadStatus == ForkchoiceUpdatedStatus.valid
payloadStatus2.status == PayloadExecutionStatus.valid
fcupdatedStatus2.payloadStatus == ForkchoiceUpdatedStatus.valid

2
vendor/nim-web3 vendored

@ -1 +1 @@
Subproject commit 0b5466f56ecc45a1e3c039abcccaf6a5e8250e18
Subproject commit a8a464c5fe33715141dd5c6749cc0bba2827d05a