diff --git a/validator/client/beacon-api/beacon_block_json_helpers.go b/validator/client/beacon-api/beacon_block_json_helpers.go index 0034ed589dd0..b8a5a48b7261 100644 --- a/validator/client/beacon-api/beacon_block_json_helpers.go +++ b/validator/client/beacon-api/beacon_block_json_helpers.go @@ -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 }