Skip to content

Commit

Permalink
fix validator client
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz committed Dec 12, 2022
1 parent 45e6f3b commit deb1389
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions validator/client/beacon-api/beacon_block_json_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ func jsonifyTransactions(transactions [][]byte) []string {
return jsonTransactions
}

func jsonifyBlsToExecutionChanges(blsToExecutionChanges []*ethpb.SignedBLSToExecutionChange) []*apimiddleware.BLSToExecutionChangeJson {
jsonBlsToExecutionChanges := make([]*apimiddleware.BLSToExecutionChangeJson, len(blsToExecutionChanges))
func jsonifyBlsToExecutionChanges(blsToExecutionChanges []*ethpb.SignedBLSToExecutionChange) []*apimiddleware.SignedBLSToExecutionChangeJson {
jsonBlsToExecutionChanges := make([]*apimiddleware.SignedBLSToExecutionChangeJson, len(blsToExecutionChanges))
for index, signedBlsToExecutionChange := range blsToExecutionChanges {
blsToExecutionChangeJson := &apimiddleware.BLSToExecutionChangeJson{
ValidatorIndex: uint64ToString(signedBlsToExecutionChange.Message.ValidatorIndex),
FromBLSPubkey: hexutil.Encode(signedBlsToExecutionChange.Message.FromBlsPubkey),
ToExecutionAddress: hexutil.Encode(signedBlsToExecutionChange.Message.ToExecutionAddress),
}
jsonBlsToExecutionChanges[index] = blsToExecutionChangeJson
signedJson := &apimiddleware.SignedBLSToExecutionChangeJson{
BLSToExecutionChange: blsToExecutionChangeJson,
Signature: hexutil.Encode(signedBlsToExecutionChange.Signature),
}
jsonBlsToExecutionChanges[index] = signedJson
}
return jsonBlsToExecutionChanges
}
Expand Down

0 comments on commit deb1389

Please sign in to comment.