IRISHUB-321: finish the ParameterProposal Excution#251
Merged
wukongcheng merged 5 commits intoirisnet:feature/govfrom Sep 18, 2018
MrXJC:jiacheng/gov
Merged
IRISHUB-321: finish the ParameterProposal Excution#251wukongcheng merged 5 commits intoirisnet:feature/govfrom MrXJC:jiacheng/gov
wukongcheng merged 5 commits intoirisnet:feature/govfrom
MrXJC:jiacheng/gov
Conversation
wukongcheng
reviewed
Sep 18, 2018
modules/gov/params/gov_params.go
Outdated
|
|
||
| func (param *DepositProcedureParam) Update(ctx sdk.Context, jsonStr string) { | ||
| if err := json.Unmarshal([]byte(jsonStr), ¶m.Value); err == nil { | ||
| fmt.Println(param.Value) |
wukongcheng
reviewed
Sep 18, 2018
modules/gov/params/gov_params.go
Outdated
| if param.Value.MinDeposit[0].Amount.GT(sdk.NewInt(10)) && param.Value.MinDeposit[0].Amount.LT(sdk.NewInt(20000)) { | ||
| return sdk.NewError(parameter.DefaultCodespace, parameter.CodeInvalidMinDepositAmount, fmt.Sprintf("MinDepositAmount should be larger than 10 and less than 20000")) | ||
| LowerBound, _ := types.NewDefaultCoinType("iris").ConvertToMinCoin(fmt.Sprintf("%d%s", 1, "iris")) | ||
| UpperBound, _ := types.NewDefaultCoinType("iris").ConvertToMinCoin(fmt.Sprintf("%d%s", 200, "iris")) |
Contributor
There was a problem hiding this comment.
create a const define for the magic number
wukongcheng
reviewed
Sep 18, 2018
modules/gov/proposal_params.go
Outdated
| Op string `json:"op"` | ||
| } | ||
|
|
||
| type Params []Param |
wukongcheng
reviewed
Sep 18, 2018
| } | ||
| if pp.Param.Op == Update { | ||
| parameter.ParamMapping[pp.Param.Key].Update(ctx,pp.Param.Value) | ||
| } |
wukongcheng
reviewed
Sep 18, 2018
modules/gov/params/gov_params.go
Outdated
| ) | ||
|
|
||
| const lowerBoundAmount = 1 | ||
| const upperBoundAmount = 200 |
Contributor
There was a problem hiding this comment.
const define should be uppercase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.