mirror of
https://github.com/luxfi/threshold.git
synced 2026-10-30 15:15:53 +00:00
- add ability to broadcast - remove protocol.ID type in favor of simple string - cleanup helper.Send - move types.RoundNumber to round - Add round.Message type - change Round interface.. again - add testing function for round
22 lines
445 B
Go
22 lines
445 B
Go
package round
|
|
|
|
import (
|
|
"encoding/binary"
|
|
"io"
|
|
)
|
|
|
|
// Number is the index of the current round.
|
|
// 0 indicates the output round, 1 is the first round.
|
|
type Number uint16
|
|
|
|
// WriteTo implements io.WriterTo interface.
|
|
func (i Number) WriteTo(w io.Writer) (int64, error) {
|
|
err := binary.Write(w, binary.BigEndian, uint64(i))
|
|
return 2, err
|
|
}
|
|
|
|
// Domain implements hash.WriterToWithDomain.
|
|
func (Number) Domain() string {
|
|
return "Round Number"
|
|
}
|