mirror of
https://github.com/luxfi/threshold.git
synced 2026-10-30 15:15:53 +00:00
- Add testing network for handler - broadcast: make rounds public so we can access the inner round. - pool fix error
21 lines
503 B
Go
21 lines
503 B
Go
package types
|
|
|
|
import (
|
|
"encoding/binary"
|
|
"io"
|
|
)
|
|
|
|
// ThresholdWrapper wraps a uint32 and enables writing with domain.
|
|
type ThresholdWrapper uint32
|
|
|
|
// WriteTo implements io.WriterTo interface.
|
|
func (t ThresholdWrapper) WriteTo(w io.Writer) (int64, error) {
|
|
intBuffer := make([]byte, 4)
|
|
binary.BigEndian.PutUint32(intBuffer, uint32(t))
|
|
n, err := w.Write(intBuffer)
|
|
return int64(n), err
|
|
}
|
|
|
|
// Domain implements hash.WriterToWithDomain.
|
|
func (ThresholdWrapper) Domain() string { return "Threshold" }
|