Properly display sync committees in GetStateV2 (#9599)

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
Radosław Kapka 2021-09-15 19:23:13 +02:00 committed by GitHub
parent 5230af0e0c
commit c47923d20e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -527,8 +527,8 @@ type beaconStateV2Json struct {
CurrentJustifiedCheckpoint *checkpointJson `json:"current_justified_checkpoint"`
FinalizedCheckpoint *checkpointJson `json:"finalized_checkpoint"`
InactivityScores []string `json:"inactivity_scores"`
CurrentSyncCommittee syncCommitteeJson `json:"current_sync_committee"`
NextSyncCommittee syncCommitteeJson `json:"next_sync_committee"`
CurrentSyncCommittee *syncCommitteeJson `json:"current_sync_committee"`
NextSyncCommittee *syncCommitteeJson `json:"next_sync_committee"`
}
type beaconStateContainerV2Json struct {
@ -573,7 +573,7 @@ type committeeJson struct {
type syncCommitteeJson struct {
Pubkeys []string `json:"pubkeys" hex:"true"`
PubkeyAggregates string `json:"pubkey_aggregates" hex:"true"`
AggregatePubkey string `json:"aggregate_pubkey" hex:"true"`
}
type syncCommitteeValidatorsJson struct {

View File

@ -294,6 +294,9 @@ func hexToBase64Processor(v reflect.Value) error {
}
func base64ToHexProcessor(v reflect.Value) error {
if v.String() == "" {
return nil
}
b, err := base64.StdEncoding.DecodeString(v.String())
if err != nil {
return err