-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
34 lines (25 loc) · 892 Bytes
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package datastore
import (
"encoding/json"
"github.com/flashbots/go-boost-utils/types"
)
type AliasSignedValidatorRegistration types.SignedValidatorRegistration
func (i AliasSignedValidatorRegistration) MarshalBinary() ([]byte, error) {
return json.Marshal(i)
}
type ValidatorLatency struct {
Registration types.SignedValidatorRegistration `json:"registration"`
IPAddress string `json:"ip_address"`
LastRegistered int64 `json:"last_registered"`
Latency float32 `json:"latency"`
IsTrusted bool `json:"is_trusted"`
}
func (l *ValidatorLatency) MarshalBinary() ([]byte, error) {
return json.Marshal(l)
}
func (l *ValidatorLatency) UnmarshalBinary(data []byte) error {
if err := json.Unmarshal(data, &l); err != nil {
return err
}
return nil
}