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

Method BootstrapEndBlk

onchain/eth_get.go:348–382  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

346 return
347}
348func (e *ethAdaptor) BootstrapEndBlk() (result uint64, err error) {
349 if !e.isConnecting() {
350 err = errors.New("not connecting to geth")
351 }
352 proxies := e.proxies
353 f := func(ctx context.Context) (chan interface{}, chan error) {
354 outc := make(chan interface{})
355 errc := make(chan error)
356 go func() {
357 defer close(outc)
358 defer close(errc)
359 idx := getIndex(ctx)
360 if idx == -1 {
361 err = errors.New("no client index in context")
362 } else {
363 if val, err := proxies[idx].BootstrapEndBlk(); err != nil {
364 replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx})
365 } else {
366 utils.ReportResult(ctx, outc, val)
367 }
368 }
369 }()
370 return outc, errc
371 }
372 var r interface{}
373 if r, err = e.get(f); err != nil {
374 return
375 }
376 if v, ok := r.(*big.Int); ok {
377 result = v.Uint64()
378 } else {
379 err = errors.New("casting error")
380 }
381 return
382}
383func (e *ethAdaptor) RefreshSystemRandomHardLimit() (result uint64, err error) {
384 if !e.isConnecting() {
385 err = errors.New("not connecting to geth")

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
BootstrapEndBlkMethod · 0.65

Tested by

no test coverage detected