()
| 134 | } |
| 135 | |
| 136 | func (e *ethAdaptor) GroupSize() (result uint64, err error) { |
| 137 | if !e.isConnecting() { |
| 138 | err = errors.New("not connecting to geth") |
| 139 | } |
| 140 | proxies := e.proxies |
| 141 | f := func(ctx context.Context) (chan interface{}, chan error) { |
| 142 | outc := make(chan interface{}) |
| 143 | errc := make(chan error) |
| 144 | go func() { |
| 145 | defer close(outc) |
| 146 | defer close(errc) |
| 147 | idx := getIndex(ctx) |
| 148 | if idx == -1 { |
| 149 | err = errors.New("no client index in context") |
| 150 | } else { |
| 151 | if val, err := proxies[idx].GroupSize(); err != nil { |
| 152 | replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx}) |
| 153 | } else { |
| 154 | utils.ReportResult(ctx, outc, val) |
| 155 | } |
| 156 | } |
| 157 | }() |
| 158 | return outc, errc |
| 159 | } |
| 160 | var r interface{} |
| 161 | if r, err = e.get(f); err != nil { |
| 162 | return |
| 163 | } |
| 164 | if v, ok := r.(*big.Int); ok { |
| 165 | result = v.Uint64() |
| 166 | } else { |
| 167 | err = errors.New("casting error") |
| 168 | } |
| 169 | return |
| 170 | } |
| 171 | func (e *ethAdaptor) GetWorkingGroupSize() (result uint64, err error) { |
| 172 | if !e.isConnecting() { |
| 173 | err = errors.New("not connecting to geth") |
nothing calls this directly
no test coverage detected