(c *gin.Context)
| 164 | } |
| 165 | |
| 166 | func waitTx(c *gin.Context) { |
| 167 | r := struct { |
| 168 | Tx string `json:"tx" form:"tx" uri:"tx" binding:"required,len=64"` |
| 169 | }{} |
| 170 | |
| 171 | _ = c.ShouldBindUri(&r) |
| 172 | |
| 173 | if err := c.ShouldBind(&r); err != nil { |
| 174 | abortWithError(c, http.StatusBadRequest, err) |
| 175 | return |
| 176 | } |
| 177 | |
| 178 | var h hash.Hash |
| 179 | |
| 180 | if err := hash.Decode(&h, r.Tx); err != nil { |
| 181 | _ = c.Error(err) |
| 182 | abortWithError(c, http.StatusBadRequest, ErrInvalidTxHash) |
| 183 | return |
| 184 | } |
| 185 | |
| 186 | txState, err := client.WaitTxConfirmation(c.Request.Context(), h) |
| 187 | if err != nil { |
| 188 | _ = c.Error(err) |
| 189 | abortWithError(c, http.StatusInternalServerError, ErrWaitTxConfirmationTimeout) |
| 190 | return |
| 191 | } |
| 192 | |
| 193 | responseWithData(c, http.StatusOK, gin.H{ |
| 194 | "state": txState.String(), |
| 195 | }) |
| 196 | } |
| 197 | |
| 198 | func databaseList(c *gin.Context) { |
| 199 | // query account belongings |
nothing calls this directly
no test coverage detected