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

Method GroupPubKey

onchain/eth_get.go:453–487  ·  view source on GitHub ↗
(gIdx int)

Source from the content-addressed store, hash-verified

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")
456 }
457 proxies := e.proxies
458 f := func(ctx context.Context) (chan interface{}, chan error) {
459 outc := make(chan interface{})
460 errc := make(chan error)
461 go func() {
462 defer close(outc)
463 defer close(errc)
464 idx := getIndex(ctx)
465 if idx == -1 {
466 err = errors.New("no client index in context")
467 } else {
468 if val, err := proxies[idx].GetGroupPubKey(big.NewInt(int64(gIdx))); err != nil {
469 replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx})
470 } else {
471 utils.ReportResult(ctx, outc, val)
472 }
473 }
474 }()
475 return outc, errc
476 }
477 var r interface{}
478 if r, err = e.get(f); err != nil {
479 return
480 }
481 if v, ok := r.([4]*big.Int); ok {
482 result = v
483 } else {
484 err = errors.New("casting error")
485 }
486 return
487}
488func (e *ethAdaptor) IsPendingNode(id []byte) (result bool, err error) {
489 if !e.isConnecting() {
490 err = errors.New("not connecting to geth")

Callers

nothing calls this directly

Calls 6

isConnectingMethod · 0.95
getMethod · 0.95
getIndexFunction · 0.85
replyErrorFunction · 0.85
NewMethod · 0.65
GetGroupPubKeyMethod · 0.45

Tested by

no test coverage detected