Skip to content

IRISHUB-447:refactor the ParameterDoc#280

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

IRISHUB-447:refactor the ParameterDoc#280
wukongcheng merged 5 commits intoirisnet:feature/govfrom
MrXJC:jiacheng/gov

Conversation

@MrXJC
Copy link
Contributor

@MrXJC MrXJC commented Sep 20, 2018

No description provided.

Govparams govparams.ParamSet `json:"gov"`
}

func (pd *ParameterDoc) ReadFile(cdc *wire.Codec,pathStr string) error {
Copy link
Contributor

@wukongcheng wukongcheng Sep 21, 2018

Choose a reason for hiding this comment

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

how about ParameterConfigFile ? Not a general document

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

parameter.RegisterGovParamMapping(&govparams.DepositProcedureParameter,
&govparams.VotingProcedureParameter,
&govparams.TallyingProcedureParameter,)

Copy link
Contributor

@wukongcheng wukongcheng Sep 21, 2018

Choose a reason for hiding this comment

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

Move 'parameter.RegisterGovParamMapping' into a utils.go.

cdc.MustUnmarshalBinary(kv.Value, &pd.Govparams.TallyingProcedure)
default:
return sdk.NewError(parameter.DefaultCodespace, parameter.CodeInvalidTallyingProcedure, fmt.Sprintf(string(kv.Key)+" is not found"))
}
Copy link
Contributor

@wukongcheng wukongcheng Sep 21, 2018

Choose a reason for hiding this comment

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

Use the following code block:

if p , ok:=parameter.ParamMapping[kv.Key]; ok {
p.GetValueFromRawData(cdc, kv.Value)
pd.Govparams.Update(kv.Key, p)
}

Instead of the switch case ?

Copy link
Contributor Author

@MrXJC MrXJC Sep 21, 2018

Choose a reason for hiding this comment

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

No, it is different.

Copy link
Contributor

@wukongcheng wukongcheng left a comment

Choose a reason for hiding this comment

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

as the comments

@irisnet irisnet deleted a comment from MrXJC Sep 25, 2018
@wukongcheng wukongcheng merged commit 3b857a7 into irisnet:feature/gov Sep 25, 2018
wangjiulian pushed a commit that referenced this pull request Nov 7, 2024
`FundSelfBond` should be an optional param
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