@@ -18,10 +18,6 @@ QtObject:
18
18
NodeModel * = ref object of QObject
19
19
client: RestClientRef
20
20
genesis: string
21
- attestations: string
22
- attester_slashings: string
23
- proposer_slashings: string
24
- voluntary_exits: string
25
21
heads: string
26
22
identity: string
27
23
version: string
@@ -38,56 +34,16 @@ QtObject:
38
34
res.setup ()
39
35
res
40
36
41
- proc getGenesis * (self: NodeModel ): string {.slot .} = self.genesis
37
+ proc getgenesis * (self: NodeModel ): string {.slot .} = self.genesis
42
38
proc genesisChanged * (self: NodeModel , v: string ) {.signal .}
43
- proc setGenesis * (self: NodeModel , v: string ) =
39
+ proc setgenesis * (self: NodeModel , v: string ) =
44
40
self.genesis = v
45
41
self.genesisChanged (v)
46
42
QtProperty [string ] genesis:
47
43
read = getgenesis
48
44
notify = genesisChanged
49
45
write = setgenesis
50
46
51
- proc getattestations * (self: NodeModel ): string {.slot .} = self.attestations
52
- proc attestationsChanged * (self: NodeModel , v: string ) {.signal .}
53
- proc setattestations * (self: NodeModel , v: string ) =
54
- self.attestations = v
55
- self.attestationsChanged (v)
56
- QtProperty [string ] attestations:
57
- read = getattestations
58
- notify = attestationsChanged
59
- write = setattestations
60
-
61
- proc getattester_slashings * (self: NodeModel ): string {.slot .} = self.attester_slashings
62
- proc attester_slashingsChanged * (self: NodeModel , v: string ) {.signal .}
63
- proc setattester_slashings * (self: NodeModel , v: string ) =
64
- self.attester_slashings = v
65
- self.attester_slashingsChanged (v)
66
- QtProperty [string ] attester_slashings:
67
- read = getattester_slashings
68
- notify = attester_slashingsChanged
69
- write = setattester_slashings
70
-
71
- proc getproposer_slashings * (self: NodeModel ): string {.slot .} = self.proposer_slashings
72
- proc proposer_slashingsChanged * (self: NodeModel , v: string ) {.signal .}
73
- proc setproposer_slashings * (self: NodeModel , v: string ) =
74
- self.proposer_slashings = v
75
- self.proposer_slashingsChanged (v)
76
- QtProperty [string ] proposer_slashings:
77
- read = getproposer_slashings
78
- notify = proposer_slashingsChanged
79
- write = setproposer_slashings
80
-
81
- proc getvoluntary_exits * (self: NodeModel ): string {.slot .} = self.voluntary_exits
82
- proc voluntary_exitsChanged * (self: NodeModel , v: string ) {.signal .}
83
- proc setvoluntary_exits * (self: NodeModel , v: string ) =
84
- self.voluntary_exits = v
85
- self.voluntary_exitsChanged (v)
86
- QtProperty [string ] voluntary_exits:
87
- read = getvoluntary_exits
88
- notify = voluntary_exitsChanged
89
- write = setvoluntary_exits
90
-
91
47
proc getheads * (self: NodeModel ): string {.slot .} = self.heads
92
48
proc headsChanged * (self: NodeModel , v: string ) {.signal .}
93
49
proc setheads * (self: NodeModel , v: string ) =
@@ -129,12 +85,10 @@ QtObject:
129
85
write = sethealth
130
86
131
87
proc update * (self: NodeModel ) {.slot .} =
132
- self.setgenesis (xxx (waitFor self.client.getBeaconGenesis ()))
133
- self.setattestations (xxx (waitFor self.client.getPoolAttestations (none (Slot ), none (CommitteeIndex ))))
134
- self.setattester_slashings (xxx (waitFor self.client.getPoolAttesterSlashings ()))
135
- self.setproposer_slashings (xxx (waitFor self.client.getPoolProposerSlashings ()))
136
- self.setvoluntary_exits (xxx (waitFor self.client.getPoolVoluntaryExits ()))
137
- self.setheads (xxx (waitFor self.client.getDebugChainHeads ()))
138
- self.setidentity (xxx (waitFor self.client.getNetworkIdentity ()))
139
- self.setversion (xxx (waitFor self.client.getNodeVersion ()))
140
- self.sethealth (xxx (waitFor self.client.getHealth ()))
88
+ self.setgenesis (xxx (waitFor (self.client.getBeaconGenesis ()).data.data))
89
+ self.setheads (xxx (waitFor (self.client.getDebugChainHeads ()).data.data.mapIt (
90
+ toBlockLink (it.root) & " @ " & $ it.slot
91
+ ).join (" \n " )))
92
+ self.setidentity (xxx (waitFor (self.client.getNetworkIdentity ()).data.data))
93
+ self.setversion (xxx (waitFor (self.client.getNodeVersion ()).data.data.version))
94
+ self.sethealth (xxx (waitFor (self.client.getHealth ())))
0 commit comments