()
| 276 | return |
| 277 | } |
| 278 | func (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 | } |
| 313 | func (e *ethAdaptor) NumPendingNodes() (result uint64, err error) { |
| 314 | if !e.isConnecting() { |
| 315 | err = errors.New("not connecting to geth") |
nothing calls this directly
no test coverage detected