| @@ -407,7 +407,7 @@ func (pr *PullRequest) SetMerged() (bool, error) { | |||||
| return false, fmt.Errorf("Issue.changeStatus: %v", err) | return false, fmt.Errorf("Issue.changeStatus: %v", err) | ||||
| } | } | ||||
| if _, err := sess.Where("id = ?", pr.ID).Cols("has_merged, status, merged_commit_id, merger_id, merged_unix").Update(pr); err != nil { | |||||
| if _, err := sess.Where("id = ?", pr.ID).Cols("has_merged, status, merged_commit_id, merger_id, merged_unix, amount").Update(pr); err != nil { | |||||
| return false, fmt.Errorf("Failed to update pr[%d]: %v", pr.ID, err) | return false, fmt.Errorf("Failed to update pr[%d]: %v", pr.ID, err) | ||||
| } | } | ||||
| @@ -205,7 +205,7 @@ type Repository struct { | |||||
| //blockchain | //blockchain | ||||
| ContractAddress string `xorm:"INDEX"` | ContractAddress string `xorm:"INDEX"` | ||||
| Balance int64 `xorm:"NOT NULL DEFAULT 0"` | |||||
| Balance string `xorm:"NOT NULL DEFAULT '0'"` | |||||
| BlockChainStatus RepoBlockChainStatus `xorm:"NOT NULL DEFAULT 0"` | BlockChainStatus RepoBlockChainStatus `xorm:"NOT NULL DEFAULT 0"` | ||||
| CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` | CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` | ||||
| @@ -489,7 +489,7 @@ type MergePullRequestForm struct { | |||||
| MergeTitleField string | MergeTitleField string | ||||
| MergeMessageField string | MergeMessageField string | ||||
| ForceMerge *bool `json:"force_merge,omitempty"` | ForceMerge *bool `json:"force_merge,omitempty"` | ||||
| BlockChainAmount int `binding:"Required"` | |||||
| BlockChainAmount int | |||||
| } | } | ||||
| // Validate validates the fields | // Validate validates the fields | ||||
| @@ -816,6 +816,8 @@ func MergePullRequest(ctx *context.Context, form auth.MergePullRequestForm) { | |||||
| return | return | ||||
| } | } | ||||
| pr.Amount = form.BlockChainAmount | |||||
| if err = pull_service.Merge(pr, ctx.User, ctx.Repo.GitRepo, models.MergeStyle(form.Do), message); err != nil { | if err = pull_service.Merge(pr, ctx.User, ctx.Repo.GitRepo, models.MergeStyle(form.Do), message); err != nil { | ||||
| if models.IsErrInvalidMergeStyle(err) { | if models.IsErrInvalidMergeStyle(err) { | ||||
| ctx.Flash.Error(ctx.Tr("repo.pulls.invalid_merge_option")) | ctx.Flash.Error(ctx.Tr("repo.pulls.invalid_merge_option")) | ||||