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

Method BootstrapStartThreshold

onchain/eth_get.go:418–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

416 return
417}
418func (e *ethAdaptor) BootstrapStartThreshold() (result uint64, err error) {
419 if !e.isConnecting() {
420 err = errors.New("not connecting to geth")
421 }
422 proxies := e.proxies
423 f := func(ctx context.Context) (chan interface{}, chan error) {
424 outc := make(chan interface{})
425 errc := make(chan error)
426 go func() {
427 defer close(outc)
428 defer close(errc)
429 idx := getIndex(ctx)
430 if idx == -1 {
431 err = errors.New("no client index in context")
432 } else {
433 if val, err := proxies[idx].BootstrapStartThreshold(); err != nil {
434 replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx})
435 } else {
436 utils.ReportResult(ctx, outc, val)
437 }
438 }
439 }()
440 return outc, errc
441 }
442 var r interface{}
443 if r, err = e.get(f); err != nil {
444 return
445 }
446 if v, ok := r.(*big.Int); ok {
447 result = v.Uint64()
448 } else {
449 err = errors.New("casting error")
450 }
451 return
452}
453func (e *ethAdaptor) GroupPubKey(gIdx int) (result [4]*big.Int, err error) {
454 if !e.isConnecting() {
455 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

Tested by

no test coverage detected