GetExpiredWorkingGroupSize returns the GetExpiredWorkingGroupSize value
()
| 98 | |
| 99 | // GetExpiredWorkingGroupSize returns the GetExpiredWorkingGroupSize value |
| 100 | func (e *ethAdaptor) GetExpiredWorkingGroupSize() (result uint64, err error) { |
| 101 | if !e.isConnecting() { |
| 102 | err = errors.New("not connecting to geth") |
| 103 | } |
| 104 | proxies := e.proxies |
| 105 | f := func(ctx context.Context) (chan interface{}, chan error) { |
| 106 | outc := make(chan interface{}) |
| 107 | errc := make(chan error) |
| 108 | go func() { |
| 109 | defer close(outc) |
| 110 | defer close(errc) |
| 111 | idx := getIndex(ctx) |
| 112 | if idx == -1 { |
| 113 | err = errors.New("no client index in context") |
| 114 | } else { |
| 115 | if val, err := proxies[idx].GetExpiredWorkingGroupSize(); err != nil { |
| 116 | replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx}) |
| 117 | } else { |
| 118 | utils.ReportResult(ctx, outc, val) |
| 119 | } |
| 120 | } |
| 121 | }() |
| 122 | return outc, errc |
| 123 | } |
| 124 | var r interface{} |
| 125 | if r, err = e.get(f); err != nil { |
| 126 | return |
| 127 | } |
| 128 | if v, ok := r.(*big.Int); ok { |
| 129 | result = v.Uint64() |
| 130 | } else { |
| 131 | err = errors.New("casting error") |
| 132 | } |
| 133 | return |
| 134 | } |
| 135 | |
| 136 | func (e *ethAdaptor) GroupSize() (result uint64, err error) { |
| 137 | if !e.isConnecting() { |
nothing calls this directly
no test coverage detected