Skip to content

IRISHUB-321: finish the ParameterProposal Excution#251

Merged
wukongcheng merged 5 commits intoirisnet:feature/govfrom
MrXJC:jiacheng/gov
Sep 18, 2018
Merged

IRISHUB-321: finish the ParameterProposal Excution#251
wukongcheng merged 5 commits intoirisnet:feature/govfrom
MrXJC:jiacheng/gov

Conversation

@MrXJC
Copy link
Contributor

@MrXJC MrXJC commented Sep 18, 2018

No description provided.


func (param *DepositProcedureParam) Update(ctx sdk.Context, jsonStr string) {
if err := json.Unmarshal([]byte(jsonStr), &param.Value); err == nil {
fmt.Println(param.Value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

improve print log msg

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"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a const define for the magic number

Op string `json:"op"`
}

type Params []Param
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

}
if pp.Param.Op == Update {
parameter.ParamMapping[pp.Param.Key].Update(ctx,pp.Param.Value)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add ( //TODO)

)

const lowerBoundAmount = 1
const upperBoundAmount = 200
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const define should be uppercase

@wukongcheng wukongcheng merged commit 320a031 into irisnet:feature/gov Sep 18, 2018
wangjiulian pushed a commit that referenced this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants