types: Simplify Ticket.Equals
This commit is contained in:
parent
96555aa74b
commit
2a1253e45a
@ -9,7 +9,6 @@ import (
|
|||||||
|
|
||||||
block "github.com/ipfs/go-block-format"
|
block "github.com/ipfs/go-block-format"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/minio/blake2b-simd"
|
|
||||||
"github.com/minio/sha256-simd"
|
"github.com/minio/sha256-simd"
|
||||||
"github.com/multiformats/go-multihash"
|
"github.com/multiformats/go-multihash"
|
||||||
xerrors "golang.org/x/xerrors"
|
xerrors "golang.org/x/xerrors"
|
||||||
@ -215,7 +214,5 @@ func ElectionPostChallengeCount(sectors uint64, faults uint64) uint64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *Ticket) Equals(ot *Ticket) bool {
|
func (t *Ticket) Equals(ot *Ticket) bool {
|
||||||
tDigest := blake2b.Sum256(t.VRFProof)
|
return bytes.Equal(t.VRFProof, ot.VRFProof)
|
||||||
otDigest := blake2b.Sum256(ot.VRFProof)
|
|
||||||
return bytes.Equal(tDigest[:], otDigest[:])
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user