(idPubkey [5]*big.Int)
| 206 | } |
| 207 | |
| 208 | func (e *ethAdaptor) RegisterGroupPubKey(idPubkey [5]*big.Int) (err error) { |
| 209 | if !e.isConnecting() { |
| 210 | err = errors.New("not connecting to geth") |
| 211 | return |
| 212 | } |
| 213 | |
| 214 | // define how to parse parameters and execute proxy function |
| 215 | opCtx, opCancel := context.WithTimeout(e.ctx, e.setTimeout) |
| 216 | defer opCancel() |
| 217 | proxies := e.proxies |
| 218 | groupId := idPubkey[0] |
| 219 | var pubKey [4]*big.Int |
| 220 | copy(pubKey[:], idPubkey[1:]) |
| 221 | |
| 222 | f := func(ctx context.Context) (tx *types.Transaction, err error) { |
| 223 | idx := getIndex(ctx) |
| 224 | if idx == -1 { |
| 225 | err = errors.New("no client index in context") |
| 226 | } else { |
| 227 | tx, err = proxies[idx].RegisterGroupPubKey(groupId, pubKey) |
| 228 | if err != nil { |
| 229 | err = &OnchainError{err: errors.Errorf(": %w", err), Idx: idx} |
| 230 | } else { |
| 231 | e.logger.Info(fmt.Sprintf("RegisterGroupPubKey %x", tx.Hash())) |
| 232 | } |
| 233 | } |
| 234 | if err != nil { |
| 235 | e.logger.Error(err) |
| 236 | } |
| 237 | return |
| 238 | } |
| 239 | return e.waitForReply(&request{opCtx: opCtx, f: f, reply: make(chan *response)}) |
| 240 | } |
| 241 | |
| 242 | func (e *ethAdaptor) RegisterNewNode() (err error) { |
| 243 | if !e.isConnecting() { |
nothing calls this directly
no test coverage detected