MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / setMainAccount

Function setMainAccount

cmd/cql-proxy/api/account.go:173–194  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

171}
172
173func 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.
197func ApplyTokenTask(ctx context.Context, cfg *config.Config, db *gorp.DbMap, t *model.Task) (r gin.H, err error) {

Callers

nothing calls this directly

Calls 6

SetMainAccountFunction · 0.92
GetDBFunction · 0.92
abortWithErrorFunction · 0.85
getDeveloperIDFunction · 0.85
responseWithDataFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected