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

Method RegisterGroupPubKey

onchain/eth_set.go:208–240  ·  view source on GitHub ↗
(idPubkey [5]*big.Int)

Source from the content-addressed store, hash-verified

206}
207
208func (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
242func (e *ethAdaptor) RegisterNewNode() (err error) {
243 if !e.isConnecting() {

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected