get_v1_validator_attestation_data() implementation.

This commit is contained in:
cheatfate 2020-12-01 18:05:59 +02:00 committed by zah
parent f6285d8381
commit 0904ee5609
1 changed files with 9 additions and 0 deletions

View File

@ -117,3 +117,12 @@ proc installValidatorApiHandlers*(rpcServer: RpcServer, node: BeaconNode) =
validator_pubkey: ValidatorPubKey, slot_signature: ValidatorSig) -> bool:
debug "post_v1_validator_beacon_committee_subscriptions"
raise newException(CatchableError, "Not implemented")
rpcServer.rpc("get_v1_validator_attestation_data") do (
slot: uint64, committee_index: uint64) -> AttestationData:
let ares = node.attestationPool[].getAggregatedAttestation(slot,
committee_index)
if ares.isSome():
return ares.get().data
else:
raise newException(CatchableError, "Could not create attestation data!")