Skip to content

Commit

Permalink
core: added builder registration to proto (#888)
Browse files Browse the repository at this point in the history
- added builder registration to proto

category: feature
ticket: #849
  • Loading branch information
ciaranmcveigh5 authored Aug 2, 2022
1 parent 149c60e commit c624660
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ func ParSignedDataFromProto(typ DutyType, data *pbv1.ParSignedData) (ParSignedDa
return ParSignedData{}, errors.Wrap(err, "unmarshal blinded block")
}
signedData = b
case DutyBuilderRegistration:
var r VersionedSignedValidatorRegistration
if err := json.Unmarshal(data.Data, &r); err != nil {
return ParSignedData{}, errors.Wrap(err, "unmarshal validator (builder) registration")
}
signedData = r
case DutyExit:
var e SignedVoluntaryExit
if err := json.Unmarshal(data.Data, &e); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions core/proto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func TestParSignedDataSetProto(t *testing.T) {
Type: core.DutyBuilderProposer,
Data: testutil.RandomCoreVersionSignedBlindedBeaconBlock(t),
},
{
Type: core.DutyBuilderRegistration,
Data: testutil.RandomCoreVersionedSignedValidatorRegistration(t),
},
}
for _, test := range tests {
t.Run(test.Type.String(), func(t *testing.T) {
Expand Down

0 comments on commit c624660

Please sign in to comment.