Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ssv/partial_sig_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (ps *PartialSigContainer) ReconstructSignature(root [32]byte, validatorPubK
validatorPubKeyCopy := make([]byte, len(validatorPubKey))
copy(validatorPubKeyCopy, validatorPubKey)

if err := types.VerifyReconstructedSignature(signature, validatorPubKeyCopy, root); err != nil {
if err = types.VerifyReconstructedSignature(signature, validatorPubKeyCopy, root); err != nil {
return nil, errors.Wrap(err, "failed to verify reconstruct signature")
}
return signature.Serialize(), nil
Expand Down
6 changes: 3 additions & 3 deletions ssv/spectest/all_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ var AllTests = []tests.TestF{

dutyexe.WrongDutyRole,
dutyexe.WrongDutyPubKey,
// partialsigcontainer.OneSignature,
partialsigcontainer.OneSignature,
partialsigcontainer.Quorum,
// partialsigcontainer.Duplicate,
partialsigcontainer.Duplicate,
partialsigcontainer.DuplicateQuorum,
// partialsigcontainer.Invalid,
partialsigcontainer.Invalid,

runnerconstruction.OneShare,
runnerconstruction.NoShares,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions ssv/spectest/tests/partialsigcontainer/invalid.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ func Invalid() tests.SpecTest {
msgs := []*types.PartialSignatureMessage{msg1.Messages[0], msg2.Messages[0], msg3.Messages[0]}

// Verify the reconstructed signature
expectedSig, err := types.ReconstructSignatures(map[types.OperatorID][]byte{1: msgs[0].PartialSignature, 2: msgs[1].PartialSignature, 3: msgs[2].PartialSignature})
_, err := types.ReconstructSignatures(map[types.OperatorID][]byte{1: msgs[0].PartialSignature,
2: msgs[1].PartialSignature, 3: msgs[2].PartialSignature})
if err != nil {
panic(err.Error())
}
Expand All @@ -32,7 +33,7 @@ func Invalid() tests.SpecTest {
ks.ValidatorPK.Serialize(),
msgs,
types.ReconstructSignatureErrorCode,
expectedSig.Serialize(),
nil,
true,
ks,
)
Expand Down
4 changes: 2 additions & 2 deletions ssv/spectest/tests/partialsigcontainer/one_signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func OneSignature() tests.SpecTest {
msgs := []*types.PartialSignatureMessage{msg.Messages[0]}

// Verify the reconstructed signature
expectedSig, err := types.ReconstructSignatures(map[types.OperatorID][]byte{1: msgs[0].PartialSignature})
_, err := types.ReconstructSignatures(map[types.OperatorID][]byte{1: msgs[0].PartialSignature})
if err != nil {
panic(err.Error())
}
Expand All @@ -30,7 +30,7 @@ func OneSignature() tests.SpecTest {
ks.ValidatorPK.Serialize(),
msgs,
types.ReconstructSignatureErrorCode,
expectedSig.Serialize(),
nil,
false,
ks,
)
Expand Down
4 changes: 0 additions & 4 deletions ssv/spectest/tests/partialsigcontainer/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ func (test *PartialSigContainerTest) Run(t *testing.T) {
result, err := ps.ReconstructSignature(root, test.ValidatorPubKey, validatorIndex)
// Check the result and error
tests.AssertErrorCode(t, test.ExpectedErrorCode, err)
if err != nil {
require.Contains(t, err.Error(), test.ExpectedErrorCode)
return
}
require.EqualValues(t, test.ExpectedResult, result)
}
}
Expand Down