forked from initia-labs/opinit-bots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
status.go
35 lines (32 loc) · 865 Bytes
/
status.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
package executor
import (
"github.com/initia-labs/opinit-bots/executor/batch"
"github.com/initia-labs/opinit-bots/executor/child"
"github.com/initia-labs/opinit-bots/executor/host"
nodetypes "github.com/initia-labs/opinit-bots/node/types"
)
type Status struct {
BridgeId uint64 `json:"bridge_id"`
Host host.Status `json:"host,omitempty"`
Child child.Status `json:"child,omitempty"`
Batch batch.Status `json:"batch,omitempty"`
DA nodetypes.Status `json:"da,omitempty"`
}
func (ex Executor) GetStatus() Status {
s := Status{
BridgeId: ex.host.BridgeId(),
}
if ex.host != nil {
s.Host = ex.host.GetStatus()
}
if ex.child != nil {
s.Child = ex.child.GetStatus()
}
if ex.batch != nil {
s.Batch = ex.batch.GetStatus()
if ex.batch.DA() != nil {
s.DA = ex.batch.DA().GetNodeStatus()
}
}
return s
}