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

Method SignalRandom

onchain/eth_set.go:304–333  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

302}
303
304func (e *ethAdaptor) SignalRandom() (err error) {
305 if !e.isConnecting() {
306 err = errors.New("not connecting to geth")
307 return
308 }
309
310 // define how to parse parameters and execute proxy function
311 opCtx, opCancel := context.WithTimeout(e.ctx, e.setTimeout)
312 defer opCancel()
313 proxies := e.proxies
314
315 f := func(ctx context.Context) (tx *types.Transaction, err error) {
316 idx := getIndex(ctx)
317 if idx == -1 {
318 err = errors.New("no client index in context")
319 } else {
320 tx, err = proxies[idx].SignalRandom()
321 if err != nil {
322 err = &OnchainError{err: errors.Errorf(": %w", err), Idx: idx}
323 } else {
324 e.logger.Info(fmt.Sprintf("SignalRandom %x", tx.Hash()))
325 }
326 }
327 if err != nil {
328 e.logger.Error(err)
329 }
330 return
331 }
332 return e.waitForReply(&request{opCtx: opCtx, f: f, reply: make(chan *response)})
333}
334
335func (e *ethAdaptor) SignalGroupFormation() (err error) {
336 if !e.isConnecting() {

Callers

nothing calls this directly

Calls 8

isConnectingMethod · 0.95
waitForReplyMethod · 0.95
getIndexFunction · 0.85
NewMethod · 0.65
SignalRandomMethod · 0.65
InfoMethod · 0.65
ErrorMethod · 0.65
HashMethod · 0.45

Tested by

no test coverage detected