Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
dyng committed Dec 13, 2022
1 parent 7f66dfe commit fb62cdd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions beacon-chain/sync/batch_verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ func TestValidateWithBatchVerifier(t *testing.T) {
sig := keys[0].Sign(make([]byte, 32))
badSig := keys[1].Sign(make([]byte, 32))
validSet := &bls.SignatureBatch{
Messages: [][32]byte{{}},
PublicKeys: []bls.PublicKey{keys[0].PublicKey()},
Signatures: [][]byte{sig.Marshal()},
Messages: [][32]byte{{}},
PublicKeys: []bls.PublicKey{keys[0].PublicKey()},
Signatures: [][]byte{sig.Marshal()},
Descriptions: []string{bls.UnknownSignature},
}
invalidSet := &bls.SignatureBatch{
Messages: [][32]byte{{}},
PublicKeys: []bls.PublicKey{keys[0].PublicKey()},
Signatures: [][]byte{badSig.Marshal()},
Messages: [][32]byte{{}},
PublicKeys: []bls.PublicKey{keys[0].PublicKey()},
Signatures: [][]byte{badSig.Marshal()},
Descriptions: []string{bls.UnknownSignature},
}
tests := []struct {
Expand Down
6 changes: 3 additions & 3 deletions beacon-chain/sync/validate_sync_committee_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ func (s *Service) rejectInvalidSyncCommitteeSignature(m *ethpb.SyncCommitteeMess
// the signature to a G2 point if batch verification is
// enabled.
set := &bls.SignatureBatch{
Messages: [][32]byte{sigRoot},
PublicKeys: []bls.PublicKey{pKey},
Signatures: [][]byte{m.Signature},
Messages: [][32]byte{sigRoot},
PublicKeys: []bls.PublicKey{pKey},
Signatures: [][]byte{m.Signature},
Descriptions: []string{bls.SyncCommitteeSignature},
}
return s.validateWithBatchVerifier(ctx, "sync committee message", set)
Expand Down
12 changes: 6 additions & 6 deletions beacon-chain/sync/validate_sync_contribution_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ func (s *Service) rejectInvalidSyncAggregateSignature(m *ethpb.SignedContributio
return pubsub.ValidationIgnore, err
}
set := &bls.SignatureBatch{
Messages: [][32]byte{sigRoot},
PublicKeys: []bls.PublicKey{aggKey},
Signatures: [][]byte{m.Message.Contribution.Signature},
Messages: [][32]byte{sigRoot},
PublicKeys: []bls.PublicKey{aggKey},
Signatures: [][]byte{m.Message.Contribution.Signature},
Descriptions: []string{bls.SyncAggregateSignature},
}
return s.validateWithBatchVerifier(ctx, "sync contribution aggregate signature", set)
Expand Down Expand Up @@ -405,9 +405,9 @@ func (s *Service) verifySyncSelectionData(ctx context.Context, m *ethpb.Contribu
return err
}
set := &bls.SignatureBatch{
Messages: [][32]byte{root},
PublicKeys: []bls.PublicKey{publicKey},
Signatures: [][]byte{m.SelectionProof},
Messages: [][32]byte{root},
PublicKeys: []bls.PublicKey{publicKey},
Signatures: [][]byte{m.SelectionProof},
Descriptions: []string{bls.SyncSelectionProof},
}
valid, err := s.validateWithBatchVerifier(ctx, "sync contribution selection signature", set)
Expand Down
2 changes: 1 addition & 1 deletion crypto/bls/signature_batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestVerifyVerbosely_SomeSignaturesInvalid(t *testing.T) {
assert.StringContains(t, "signature 'signature of bad0' is invalid", err.Error())
assert.StringContains(t, "signature 'signature of bad1' is invalid", err.Error())
assert.StringContains(t, "signature 'signature of bad2' is invalid", err.Error())
assert.StringNotContains(t, "signature 'signature of bad0' is invalid", err.Error())
assert.StringNotContains(t, "signature 'signature of good0' is invalid", err.Error())
assert.StringNotContains(t, "signature 'signature of good1' is invalid", err.Error())
assert.StringNotContains(t, "signature 'signature of good2' is invalid", err.Error())
}
Expand Down

0 comments on commit fb62cdd

Please sign in to comment.