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

Method UpdateRandomness

onchain/eth_set.go:139–170  ·  view source on GitHub ↗
(sign *vss.Signature)

Source from the content-addressed store, hash-verified

137}
138
139func (e *ethAdaptor) UpdateRandomness(sign *vss.Signature) (err error) {
140 if !e.isConnecting() {
141 err = errors.New("not connecting to geth")
142 return
143 }
144
145 // define how to parse parameters and execute proxy function
146 opCtx, opCancel := context.WithTimeout(e.ctx, e.setTimeout)
147 defer opCancel()
148 proxies := e.proxies
149 x, y := sign.ToBigInt()
150 sig := [2]*big.Int{x, y}
151
152 f := func(ctx context.Context) (tx *types.Transaction, err error) {
153 idx := getIndex(ctx)
154 if idx == -1 {
155 err = errors.New("no client index in context")
156 } else {
157 tx, err = proxies[idx].UpdateRandomness(sig)
158 if err != nil {
159 err = &OnchainError{err: errors.Errorf(": %w", err), Idx: idx}
160 } else {
161 e.logger.Info(fmt.Sprintf("UpdateRandomness %x", tx.Hash()))
162 }
163 }
164 if err != nil {
165 e.logger.Error(err)
166 }
167 return
168 }
169 return e.waitForReply(&request{opCtx: opCtx, f: f, reply: make(chan *response)})
170}
171
172func (e *ethAdaptor) DataReturn(sign *vss.Signature) (err error) {
173 if !e.isConnecting() {

Callers

nothing calls this directly

Calls 9

isConnectingMethod · 0.95
waitForReplyMethod · 0.95
getIndexFunction · 0.85
ToBigIntMethod · 0.80
NewMethod · 0.65
UpdateRandomnessMethod · 0.65
InfoMethod · 0.65
ErrorMethod · 0.65
HashMethod · 0.45

Tested by

no test coverage detected