MCPcopy
hub / github.com/canopy-network/canopy / Equal

Method Equal

lib/crypto/classgroup.go:343–349  ·  view source on GitHub ↗

Equal() compares two ClassGroups using their underlying values and returns true if they are equivalent

(other *ClassGroup)

Source from the content-addressed store, hash-verified

341
342// Equal() compares two ClassGroups using their underlying values and returns true if they are equivalent
343func (group *ClassGroup) Equal(other *ClassGroup) bool {
344 // reduce both to their simplest form
345 g := group.Reduced()
346 o := other.Reduced()
347 // compare a,b,c
348 return g.a.Cmp(o.a) == 0 && g.b.Cmp(o.b) == 0 && g.c.Cmp(o.c) == 0
349}
350
351// Discard() recycles the big ints used for the class group
352func (group *ClassGroup) Discard() { bip.Recycle(group.a, group.b, group.c) }

Callers 15

verifyProofFunction · 0.95
DeliverMessageSendMethod · 0.80
verifyResponseMethod · 0.80
ShouldGossipMethod · 0.80
SendToReplicasMethod · 0.80
UpdateP2PMustConnectMethod · 0.80
singleNodeNetworkMethod · 0.80
ConsensusSummaryMethod · 0.80
addPaymentPercentMethod · 0.80
CommitCertificateMethod · 0.80
ApplyAndValidateBlockMethod · 0.80

Calls 1

ReducedMethod · 0.95

Tested by 15

TestFileConfigFunction · 0.64
TestNewValidatorSetFunction · 0.64
TestGetNonSignersFunction · 0.64
TestGetDoubleSignersFunction · 0.64
TestViewCheckBasicFunction · 0.64
TestViewCheckFunction · 0.64