mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Fix bls signature batch unit test (#12602)
We randomly observe this failure when running unit test go test -test.v -run=^TestSignatureBatch_AggregateBatch/common_and_uncommon_messages_in_batch_with_multiple_messages === RUN TestSignatureBatch_AggregateBatch === RUN TestSignatureBatch_AggregateBatch/common_and_uncommon_messages_in_batch_with_multiple_messages signature_batch_test.go:643: AggregateBatch() Descriptions got = [test signature bls aggregated signature test signature bls aggregated signature test signature bls aggregated signature], want [bls aggregated signature test signature bls aggregated signature test signature bls aggregated signature test signature] --- FAIL: TestSignatureBatch_AggregateBatch (0.02s) --- FAIL: TestSignatureBatch_AggregateBatch/common_and_uncommon_messages_in_batch_with_multiple_messages (0.02s) The problem is that the signature sort forgets to swap the description when a swap occurs. This commit adds the description swap when swap occurs. Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
parent
6a0db800b3
commit
25ebd335cb
@ -737,6 +737,7 @@ func (s sorter) Swap(i, j int) {
|
||||
s.set.Signatures[i], s.set.Signatures[j] = s.set.Signatures[j], s.set.Signatures[i]
|
||||
s.set.PublicKeys[i], s.set.PublicKeys[j] = s.set.PublicKeys[j], s.set.PublicKeys[i]
|
||||
s.set.Messages[i], s.set.Messages[j] = s.set.Messages[j], s.set.Messages[i]
|
||||
s.set.Descriptions[i], s.set.Descriptions[j] = s.set.Descriptions[j], s.set.Descriptions[i]
|
||||
}
|
||||
|
||||
func (s sorter) Less(i, j int) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user