Skip to content

Commit

Permalink
Addressed PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
pinebit committed Jan 29, 2024
1 parent 7b23240 commit d85c769
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
12 changes: 6 additions & 6 deletions cluster/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ type Definition struct {
ValidatorAddresses []ValidatorAddresses `config_hash:"10" definition_hash:"10" json:"validators" ssz:"CompositeList[65536]"`

// DepositAmounts specifies partial deposit amounts that sum up to 32ETH.
DepositAmounts []eth2p0.Gwei `definition_hash:"11" deposit_amounts:"11" json:"deposit_amounts" ssz:"uint64[256]"`
DepositAmounts []eth2p0.Gwei `config_hash:"11" definition_hash:"11" json:"deposit_amounts" ssz:"uint64[256]"`

// ConfigHash uniquely identifies a cluster definition excluding operator ENRs and signatures.
ConfigHash []byte `json:"config_hash,0xhex" ssz:"Bytes32" config_hash:"-" definition_hash:"12"`
Expand Down Expand Up @@ -476,7 +476,7 @@ func marshalDefinitionV1x0or1(def Definition) ([]byte, error) {
DefinitionHash: def.DefinitionHash,
})
if err != nil {
return nil, errors.Wrap(err, "marshal definition v1.0")
return nil, errors.Wrap(err, "marshal definition", z.Str("version", def.Version))

Check warning on line 479 in cluster/definition.go

View check run for this annotation

Codecov / codecov/patch

cluster/definition.go#L479

Added line #L479 was not covered by tests
}

return resp, nil
Expand Down Expand Up @@ -504,7 +504,7 @@ func marshalDefinitionV1x2or3(def Definition) ([]byte, error) {
DefinitionHash: def.DefinitionHash,
})
if err != nil {
return nil, errors.Wrap(err, "marshal definition v1.1")
return nil, errors.Wrap(err, "marshal definition", z.Str("version", def.Version))

Check warning on line 507 in cluster/definition.go

View check run for this annotation

Codecov / codecov/patch

cluster/definition.go#L507

Added line #L507 was not covered by tests
}

return resp, nil
Expand Down Expand Up @@ -536,7 +536,7 @@ func marshalDefinitionV1x4(def Definition) ([]byte, error) {
},
})
if err != nil {
return nil, errors.Wrap(err, "marshal definition v1.4")
return nil, errors.Wrap(err, "marshal definition", z.Str("version", def.Version))

Check warning on line 539 in cluster/definition.go

View check run for this annotation

Codecov / codecov/patch

cluster/definition.go#L539

Added line #L539 was not covered by tests
}

return resp, nil
Expand All @@ -562,7 +562,7 @@ func marshalDefinitionV1x5to7(def Definition) ([]byte, error) {
},
})
if err != nil {
return nil, errors.Wrap(err, "marshal definition v1.5")
return nil, errors.Wrap(err, "marshal definition", z.Str("version", def.Version))
}

Check warning on line 566 in cluster/definition.go

View check run for this annotation

Codecov / codecov/patch

cluster/definition.go#L565-L566

Added lines #L565 - L566 were not covered by tests

return resp, nil
Expand All @@ -589,7 +589,7 @@ func marshalDefinitionV1x8(def Definition) ([]byte, error) {
DepositAmounts: def.DepositAmounts,
})
if err != nil {
return nil, errors.Wrap(err, "marshal definition v1.8")
return nil, errors.Wrap(err, "marshal definition", z.Str("version", def.Version))

Check warning on line 592 in cluster/definition.go

View check run for this annotation

Codecov / codecov/patch

cluster/definition.go#L592

Added line #L592 was not covered by tests
}

return resp, nil
Expand Down
1 change: 0 additions & 1 deletion cluster/distvalidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ type distValidatorJSONv1x7 struct {
type distValidatorJSONv1x8 struct {
PubKey ethHex `json:"distributed_public_key"`
PubShares []ethHex `json:"public_shares,omitempty"`
DepositData depositDataJSON `json:"deposit_data,omitempty"`
BuilderRegistration builderRegistrationJSON `json:"builder_registration,omitempty"`
PartialDepositData []depositDataJSON `json:"partial_deposit_data,omitempty"`
}
Expand Down
12 changes: 0 additions & 12 deletions cluster/testdata/cluster_lock_v1_8_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@
"0x975deda77e758579ea3dfe4136abf752b3b8271d03e944b3c9db366b75045f8efd69d22ae5411947cb553d7694267aef",
"0x4ebcea406b32d6108bd68584f57e37caac6e33feaa3263a399437024ba9c9b14678a274f01a910ae295f6efbfe5f5abf"
],
"deposit_data": {
"pubkey": "",
"withdrawal_credentials": "",
"amount": "0",
"signature": ""
},
"builder_registration": {
"message": {
"fee_recipient": "0x89b79bf504cfb57c7601232d589baccea9d6e263",
Expand Down Expand Up @@ -86,12 +80,6 @@
"0x4b89cb5165ce64002cbd9c2887aa113df2468928d5a23b9ca740f80c9382d9c6034ad2960c796503e1ce221725f50caf",
"0x1fbfe831b10b7bf5b15c47a53dbf8e7dcafc9e138647a4b44ed4bce964ed47f74aa594468ced323cb76f0d3fac476c9f"
],
"deposit_data": {
"pubkey": "",
"withdrawal_credentials": "",
"amount": "0",
"signature": ""
},
"builder_registration": {
"message": {
"fee_recipient": "0x72e6415a761f03abaa40abc9448fddeb2191d945",
Expand Down
2 changes: 1 addition & 1 deletion cmd/createcluster_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func testCreateCluster(t *testing.T, conf clusterConfig, def cluster.Definition,
}

if isAnyVersion(lock.Version, "v1.6.0", "v1.7.0") {
require.NotEmpty(t, val.PartialDepositData)
require.Len(t, val.PartialDepositData, 1)
}

if isAnyVersion(lock.Version, "v1.7.0") {
Expand Down

0 comments on commit d85c769

Please sign in to comment.