-
Notifications
You must be signed in to change notification settings - Fork 19
/
node_basic.go
36 lines (32 loc) · 913 Bytes
/
node_basic.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
35
36
package entities
import (
"time"
v2 "code.vegaprotocol.io/vega/protos/data-node/api/v2"
"code.vegaprotocol.io/vega/protos/vega"
)
type NodeBasic struct {
ID NodeID
PubKey VegaPublicKey `db:"vega_pub_key"`
TmPubKey TendermintPublicKey `db:"tendermint_pub_key"`
EthereumAddress EthereumAddress
InfoURL string
Location string
Status NodeStatus
Name string
AvatarURL string
TxHash TxHash
VegaTime time.Time
}
func (n NodeBasic) ToProto() *v2.NodeBasic {
return &v2.NodeBasic{
Id: n.ID.String(),
PubKey: n.PubKey.String(),
TmPubKey: n.TmPubKey.String(),
EthereumAddress: n.EthereumAddress.String(),
InfoUrl: n.InfoURL,
Location: n.Location,
Status: vega.NodeStatus(n.Status),
Name: n.Name,
AvatarUrl: n.AvatarURL,
}
}