(sign *vss.Signature)
| 137 | } |
| 138 | |
| 139 | func (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 | |
| 172 | func (e *ethAdaptor) DataReturn(sign *vss.Signature) (err error) { |
| 173 | if !e.isConnecting() { |
nothing calls this directly
no test coverage detected