(c *gin.Context)
| 171 | } |
| 172 | |
| 173 | func setMainAccount(c *gin.Context) { |
| 174 | r := struct { |
| 175 | Account utils.AccountAddress `json:"account" form:"account" binding:"required,len=64"` |
| 176 | }{} |
| 177 | |
| 178 | if err := c.ShouldBind(&r); err != nil { |
| 179 | abortWithError(c, http.StatusBadRequest, err) |
| 180 | return |
| 181 | } |
| 182 | |
| 183 | developer := getDeveloperID(c) |
| 184 | err := model.SetMainAccount(model.GetDB(c), developer, r.Account) |
| 185 | if err != nil { |
| 186 | _ = c.Error(err) |
| 187 | abortWithError(c, http.StatusInternalServerError, ErrSetMainAccountFailed) |
| 188 | return |
| 189 | } |
| 190 | |
| 191 | responseWithData(c, http.StatusOK, nil) |
| 192 | |
| 193 | return |
| 194 | } |
| 195 | |
| 196 | // ApplyTokenTask handles the token apply process. |
| 197 | func ApplyTokenTask(ctx context.Context, cfg *config.Config, db *gorp.DbMap, t *model.Task) (r gin.H, err error) { |
nothing calls this directly
no test coverage detected