()
| 241 | } |
| 242 | |
| 243 | func (e *ethAdaptor) LastUpdatedBlock() (result uint64, err error) { |
| 244 | if !e.isConnecting() { |
| 245 | err = errors.New("not connecting to geth") |
| 246 | } |
| 247 | proxies := e.proxies |
| 248 | f := func(ctx context.Context) (chan interface{}, chan error) { |
| 249 | outc := make(chan interface{}) |
| 250 | errc := make(chan error) |
| 251 | go func() { |
| 252 | defer close(outc) |
| 253 | defer close(errc) |
| 254 | idx := getIndex(ctx) |
| 255 | if idx == -1 { |
| 256 | err = errors.New("no client index in context") |
| 257 | } else { |
| 258 | if val, err := proxies[idx].LastUpdatedBlock(); err != nil { |
| 259 | replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx}) |
| 260 | } else { |
| 261 | utils.ReportResult(ctx, outc, val) |
| 262 | } |
| 263 | } |
| 264 | }() |
| 265 | return outc, errc |
| 266 | } |
| 267 | var r interface{} |
| 268 | if r, err = e.get(f); err != nil { |
| 269 | return |
| 270 | } |
| 271 | if v, ok := r.(*big.Int); ok { |
| 272 | result = v.Uint64() |
| 273 | } else { |
| 274 | err = errors.New("casting error") |
| 275 | } |
| 276 | return |
| 277 | } |
| 278 | func (e *ethAdaptor) NumPendingGroups() (result uint64, err error) { |
| 279 | if !e.isConnecting() { |
| 280 | err = errors.New("not connecting to geth") |
nothing calls this directly
no test coverage detected