()
| 311 | return |
| 312 | } |
| 313 | func (e *ethAdaptor) NumPendingNodes() (result uint64, err error) { |
| 314 | if !e.isConnecting() { |
| 315 | err = errors.New("not connecting to geth") |
| 316 | } |
| 317 | proxies := e.proxies |
| 318 | f := func(ctx context.Context) (chan interface{}, chan error) { |
| 319 | outc := make(chan interface{}) |
| 320 | errc := make(chan error) |
| 321 | go func() { |
| 322 | defer close(outc) |
| 323 | defer close(errc) |
| 324 | idx := getIndex(ctx) |
| 325 | if idx == -1 { |
| 326 | err = errors.New("no client index in context") |
| 327 | } else { |
| 328 | if val, err := proxies[idx].NumPendingNodes(); err != nil { |
| 329 | replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx}) |
| 330 | } else { |
| 331 | utils.ReportResult(ctx, outc, val) |
| 332 | } |
| 333 | } |
| 334 | }() |
| 335 | return outc, errc |
| 336 | } |
| 337 | var r interface{} |
| 338 | if r, err = e.get(f); err != nil { |
| 339 | return |
| 340 | } |
| 341 | if v, ok := r.(*big.Int); ok { |
| 342 | result = v.Uint64() |
| 343 | } else { |
| 344 | err = errors.New("casting error") |
| 345 | } |
| 346 | return |
| 347 | } |
| 348 | func (e *ethAdaptor) BootstrapEndBlk() (result uint64, err error) { |
| 349 | if !e.isConnecting() { |
| 350 | err = errors.New("not connecting to geth") |
nothing calls this directly
no test coverage detected