(gIdx int)
| 451 | return |
| 452 | } |
| 453 | func (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 | } |
| 488 | func (e *ethAdaptor) IsPendingNode(id []byte) (result bool, err error) { |
| 489 | if !e.isConnecting() { |
| 490 | err = errors.New("not connecting to geth") |
nothing calls this directly
no test coverage detected