()
| 169 | return |
| 170 | } |
| 171 | func (e *ethAdaptor) GetWorkingGroupSize() (result uint64, err error) { |
| 172 | if !e.isConnecting() { |
| 173 | err = errors.New("not connecting to geth") |
| 174 | } |
| 175 | proxies := e.proxies |
| 176 | f := func(ctx context.Context) (chan interface{}, chan error) { |
| 177 | outc := make(chan interface{}) |
| 178 | errc := make(chan error) |
| 179 | go func() { |
| 180 | defer close(outc) |
| 181 | defer close(errc) |
| 182 | idx := getIndex(ctx) |
| 183 | if idx == -1 { |
| 184 | err = errors.New("no client index in context") |
| 185 | } else { |
| 186 | if val, err := proxies[idx].GetWorkingGroupSize(); err != nil { |
| 187 | replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx}) |
| 188 | } else { |
| 189 | utils.ReportResult(ctx, outc, val) |
| 190 | } |
| 191 | } |
| 192 | }() |
| 193 | return outc, errc |
| 194 | } |
| 195 | var r interface{} |
| 196 | if r, err = e.get(f); err != nil { |
| 197 | return |
| 198 | } |
| 199 | if v, ok := r.(*big.Int); ok { |
| 200 | result = v.Uint64() |
| 201 | } else { |
| 202 | err = errors.New("casting error") |
| 203 | } |
| 204 | return |
| 205 | } |
| 206 | |
| 207 | func (e *ethAdaptor) LastGroupFormationRequestId() (result uint64, err error) { |
| 208 | if !e.isConnecting() { |
nothing calls this directly
no test coverage detected