MCPcopy Create free account
hub / github.com/DOSNetwork/core / LastGroupFormationRequestId

Method LastGroupFormationRequestId

onchain/eth_get.go:207–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205}
206
207func (e *ethAdaptor) LastGroupFormationRequestId() (result uint64, err error) {
208 if !e.isConnecting() {
209 err = errors.New("not connecting to geth")
210 }
211 proxies := e.proxies
212 f := func(ctx context.Context) (chan interface{}, chan error) {
213 outc := make(chan interface{})
214 errc := make(chan error)
215 go func() {
216 defer close(outc)
217 defer close(errc)
218 idx := getIndex(ctx)
219 if idx == -1 {
220 err = errors.New("no client index in context")
221 } else {
222 if val, err := proxies[idx].LastFormGrpReqId(); err != nil {
223 replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx})
224 } else {
225 utils.ReportResult(ctx, outc, val)
226 }
227 }
228 }()
229 return outc, errc
230 }
231 var r interface{}
232 if r, err = e.get(f); err != nil {
233 return
234 }
235 if v, ok := r.(*big.Int); ok {
236 result = v.Uint64()
237 } else {
238 err = errors.New("casting error")
239 }
240 return
241}
242
243func (e *ethAdaptor) LastUpdatedBlock() (result uint64, err error) {
244 if !e.isConnecting() {

Callers

nothing calls this directly

Calls 7

isConnectingMethod · 0.95
getMethod · 0.95
getIndexFunction · 0.85
replyErrorFunction · 0.85
Uint64Method · 0.80
NewMethod · 0.65
LastFormGrpReqIdMethod · 0.45

Tested by

no test coverage detected