MCPcopy Create free account
hub / github.com/DOSNetwork/core / NumPendingGroups

Method NumPendingGroups

onchain/eth_get.go:278–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

276 return
277}
278func (e *ethAdaptor) NumPendingGroups() (result uint64, err error) {
279 if !e.isConnecting() {
280 err = errors.New("not connecting to geth")
281 }
282 proxies := e.proxies
283 f := func(ctx context.Context) (chan interface{}, chan error) {
284 outc := make(chan interface{})
285 errc := make(chan error)
286 go func() {
287 defer close(outc)
288 defer close(errc)
289 idx := getIndex(ctx)
290 if idx == -1 {
291 err = errors.New("no client index in context")
292 } else {
293 if val, err := proxies[idx].NumPendingGroups(); err != nil {
294 replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx})
295 } else {
296 utils.ReportResult(ctx, outc, val)
297 }
298 }
299 }()
300 return outc, errc
301 }
302 var r interface{}
303 if r, err = e.get(f); err != nil {
304 return
305 }
306 if v, ok := r.(*big.Int); ok {
307 result = v.Uint64()
308 } else {
309 err = errors.New("casting error")
310 }
311 return
312}
313func (e *ethAdaptor) NumPendingNodes() (result uint64, err error) {
314 if !e.isConnecting() {
315 err = errors.New("not connecting to geth")

Callers

nothing calls this directly

Calls 7

isConnectingMethod · 0.95
getMethod · 0.95
getIndexFunction · 0.85
replyErrorFunction · 0.85
Uint64Method · 0.80
NewMethod · 0.65
NumPendingGroupsMethod · 0.65

Tested by

no test coverage detected