()
| 271 | } |
| 272 | |
| 273 | func (e *ethAdaptor) UnRegisterNode() (err error) { |
| 274 | if !e.isConnecting() { |
| 275 | err = errors.New("[ONCHAIN] not connecting to geth") |
| 276 | return |
| 277 | } |
| 278 | |
| 279 | // define how to parse parameters and execute proxy function |
| 280 | opCtx, opCancel := context.WithTimeout(e.ctx, e.setTimeout) |
| 281 | defer opCancel() |
| 282 | proxies := e.proxies |
| 283 | |
| 284 | f := func(ctx context.Context) (tx *types.Transaction, err error) { |
| 285 | idx := getIndex(ctx) |
| 286 | if idx == -1 { |
| 287 | err = errors.New("no client index in context") |
| 288 | } else { |
| 289 | tx, err = proxies[idx].UnregisterNode() |
| 290 | if err != nil { |
| 291 | err = &OnchainError{err: errors.Errorf(": %w", err), Idx: idx} |
| 292 | } else { |
| 293 | e.logger.Info(fmt.Sprintf("UnRegisterNode %x", tx.Hash())) |
| 294 | } |
| 295 | } |
| 296 | if err != nil { |
| 297 | e.logger.Error(err) |
| 298 | } |
| 299 | return |
| 300 | } |
| 301 | return e.waitForReply(&request{opCtx: opCtx, f: f, reply: make(chan *response)}) |
| 302 | } |
| 303 | |
| 304 | func (e *ethAdaptor) SignalRandom() (err error) { |
| 305 | if !e.isConnecting() { |
nothing calls this directly
no test coverage detected