bootstrap: implement SignedDataSource on Request message

This commit is contained in:
Leonard Lyubich 2020-05-11 13:57:23 +03:00
parent 3fb293543f
commit 9327c5f816
6 changed files with 226 additions and 5 deletions

View file

@ -1,5 +1,7 @@
package service
import "encoding/binary"
const (
_ NodeRole = iota
// InnerRingNode that work like IR node.
@ -19,3 +21,15 @@ func (nt NodeRole) String() string {
return "Unknown"
}
}
func (nt NodeRole) Size() int {
return 4
}
func (nt NodeRole) Bytes() []byte {
data := make([]byte, nt.Size())
binary.BigEndian.PutUint32(data, uint32(nt))
return data
}