()
| 346 | return |
| 347 | } |
| 348 | func (e *ethAdaptor) BootstrapEndBlk() (result uint64, err error) { |
| 349 | if !e.isConnecting() { |
| 350 | err = errors.New("not connecting to geth") |
| 351 | } |
| 352 | proxies := e.proxies |
| 353 | f := func(ctx context.Context) (chan interface{}, chan error) { |
| 354 | outc := make(chan interface{}) |
| 355 | errc := make(chan error) |
| 356 | go func() { |
| 357 | defer close(outc) |
| 358 | defer close(errc) |
| 359 | idx := getIndex(ctx) |
| 360 | if idx == -1 { |
| 361 | err = errors.New("no client index in context") |
| 362 | } else { |
| 363 | if val, err := proxies[idx].BootstrapEndBlk(); err != nil { |
| 364 | replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx}) |
| 365 | } else { |
| 366 | utils.ReportResult(ctx, outc, val) |
| 367 | } |
| 368 | } |
| 369 | }() |
| 370 | return outc, errc |
| 371 | } |
| 372 | var r interface{} |
| 373 | if r, err = e.get(f); err != nil { |
| 374 | return |
| 375 | } |
| 376 | if v, ok := r.(*big.Int); ok { |
| 377 | result = v.Uint64() |
| 378 | } else { |
| 379 | err = errors.New("casting error") |
| 380 | } |
| 381 | return |
| 382 | } |
| 383 | func (e *ethAdaptor) RefreshSystemRandomHardLimit() (result uint64, err error) { |
| 384 | if !e.isConnecting() { |
| 385 | err = errors.New("not connecting to geth") |
nothing calls this directly
no test coverage detected