()
| 527 | return |
| 528 | } |
| 529 | func (e *ethAdaptor) BootstrapRound() (result uint64, err error) { |
| 530 | if !e.isConnecting() { |
| 531 | err = errors.New("not connecting to geth") |
| 532 | } |
| 533 | proxies := e.proxies |
| 534 | f := func(ctx context.Context) (chan interface{}, chan error) { |
| 535 | outc := make(chan interface{}) |
| 536 | errc := make(chan error) |
| 537 | go func() { |
| 538 | defer close(outc) |
| 539 | defer close(errc) |
| 540 | idx := getIndex(ctx) |
| 541 | if idx == -1 { |
| 542 | err = errors.New("no client index in context") |
| 543 | } else { |
| 544 | if val, err := proxies[idx].BootstrapRound(); err != nil { |
| 545 | replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx}) |
| 546 | } else { |
| 547 | utils.ReportResult(ctx, outc, val) |
| 548 | } |
| 549 | } |
| 550 | }() |
| 551 | return outc, errc |
| 552 | } |
| 553 | var r interface{} |
| 554 | if r, err = e.get(f); err != nil { |
| 555 | return |
| 556 | } |
| 557 | if v, ok := r.(*big.Int); ok { |
| 558 | result = v.Uint64() |
| 559 | } else { |
| 560 | err = errors.New("casting error") |
| 561 | } |
| 562 | return |
| 563 | } |
| 564 | func (e *ethAdaptor) Balance() (result *big.Float, err error) { |
| 565 | if !e.isConnecting() { |
| 566 | err = errors.New("not connecting to geth") |
nothing calls this directly
no test coverage detected