parent
dc50abbc90
commit
06a5c67e62
|
@ -764,21 +764,22 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
"/eth/v1/validator/prepare_beacon_proposer") do (
|
||||
contentBody: Option[ContentBody]) -> RestApiResponse:
|
||||
let
|
||||
proposerData =
|
||||
body =
|
||||
block:
|
||||
if contentBody.isNone():
|
||||
return RestApiResponse.jsonError(Http400, EmptyRequestBodyError)
|
||||
let dres = decodeBody(PrepareBeaconProposerBody, contentBody.get())
|
||||
let dres = decodeBody(seq[PrepareBeaconProposer], contentBody.get())
|
||||
if dres.isErr():
|
||||
return RestApiResponse.jsonError(Http400,
|
||||
InvalidPrepareBeaconProposerError)
|
||||
dres.get()
|
||||
currentEpoch = node.beaconClock.now.slotOrZero.epoch
|
||||
|
||||
node.dynamicFeeRecipientsStore.addMapping(
|
||||
proposerData.validator_index,
|
||||
proposerData.fee_recipient,
|
||||
currentEpoch)
|
||||
for proposerData in body:
|
||||
node.dynamicFeeRecipientsStore.addMapping(
|
||||
proposerData.validator_index,
|
||||
proposerData.fee_recipient,
|
||||
currentEpoch)
|
||||
|
||||
return RestApiResponse.response("", Http200, "text/plain")
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ type
|
|||
ImportDistributedKeystoresBody |
|
||||
ImportRemoteKeystoresBody |
|
||||
KeystoresAndSlashingProtection |
|
||||
PrepareBeaconProposerBody |
|
||||
PrepareBeaconProposer |
|
||||
ProposerSlashing |
|
||||
SetFeeRecipientRequest |
|
||||
SignedBlindedBeaconBlock |
|
||||
|
@ -105,6 +105,7 @@ type
|
|||
|
||||
EncodeArrays* =
|
||||
seq[Attestation] |
|
||||
seq[PrepareBeaconProposer] |
|
||||
seq[RemoteKeystoreInfo] |
|
||||
seq[RestCommitteeSubscription] |
|
||||
seq[RestSignedContributionAndProof] |
|
||||
|
@ -128,7 +129,7 @@ type
|
|||
KeymanagerGenericError |
|
||||
KeystoresAndSlashingProtection |
|
||||
ListFeeRecipientResponse |
|
||||
PrepareBeaconProposerBody |
|
||||
PrepareBeaconProposer |
|
||||
ProduceBlockResponseV2 |
|
||||
RestDutyError |
|
||||
RestGenericError |
|
||||
|
|
|
@ -242,7 +242,7 @@ type
|
|||
epoch*: Epoch
|
||||
active*: bool
|
||||
|
||||
PrepareBeaconProposerBody* = object
|
||||
PrepareBeaconProposer* = object
|
||||
validator_index*: ValidatorIndex
|
||||
fee_recipient*: Eth1Address
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ proc publishContributionAndProofs*(body: seq[RestSignedContributionAndProof]): R
|
|||
meth: MethodPost.}
|
||||
## https://ethereum.github.io/beacon-APIs/#/Validator/publishContributionAndProofs
|
||||
|
||||
proc prepareBeaconProposer*(body: PrepareBeaconProposerBody): RestPlainResponse {.
|
||||
proc prepareBeaconProposer*(body: seq[PrepareBeaconProposer]): RestPlainResponse {.
|
||||
rest, endpoint: "/eth/v1/validator/prepare_beacon_proposer",
|
||||
meth: MethodPost.}
|
||||
## https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/prepareBeaconProposer
|
||||
|
|
Loading…
Reference in New Issue