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

Method BootstrapRound

onchain/eth_get.go:529–563  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

527 return
528}
529func (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}
564func (e *ethAdaptor) Balance() (result *big.Float, err error) {
565 if !e.isConnecting() {
566 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
BootstrapRoundMethod · 0.65

Tested by

no test coverage detected