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

Method RefreshSystemRandomHardLimit

onchain/eth_get.go:383–417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

381 return
382}
383func (e *ethAdaptor) RefreshSystemRandomHardLimit() (result uint64, err error) {
384 if !e.isConnecting() {
385 err = errors.New("not connecting to geth")
386 }
387 proxies := e.proxies
388 f := func(ctx context.Context) (chan interface{}, chan error) {
389 outc := make(chan interface{})
390 errc := make(chan error)
391 go func() {
392 defer close(outc)
393 defer close(errc)
394 idx := getIndex(ctx)
395 if idx == -1 {
396 err = errors.New("no client index in context")
397 } else {
398 if val, err := proxies[idx].RefreshSystemRandomHardLimit(); err != nil {
399 replyError(ctx, errc, &OnchainError{err: errors.Errorf("get err : %w", err), Idx: idx})
400 } else {
401 utils.ReportResult(ctx, outc, val)
402 }
403 }
404 }()
405 return outc, errc
406 }
407 var r interface{}
408 if r, err = e.get(f); err != nil {
409 return
410 }
411 if v, ok := r.(*big.Int); ok {
412 result = v.Uint64()
413 } else {
414 err = errors.New("casting error")
415 }
416 return
417}
418func (e *ethAdaptor) BootstrapStartThreshold() (result uint64, err error) {
419 if !e.isConnecting() {
420 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

Tested by

no test coverage detected