Files
Adrian Hamelink a4699a1bab internal:
- Add testing network for handler
- broadcast: make rounds public so we can access the inner round.
- pool fix error
2021-08-23 13:53:54 +02:00

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" }