Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The sign bytes of CreateValidator msg doesn't contain commission data #2711

Closed
abelliumnt opened this issue Nov 7, 2018 · 1 comment · Fixed by #2714
Closed

The sign bytes of CreateValidator msg doesn't contain commission data #2711

abelliumnt opened this issue Nov 7, 2018 · 1 comment · Fixed by #2714
Assignees

Comments

@abelliumnt
Copy link

This is the implementation of getting sign bytes of CreateValidator msg:

// get the bytes for the message signer to sign on
func (msg MsgCreateValidator) GetSignBytes() []byte {
	b, err := MsgCdc.MarshalJSON(struct {
		Description
		DelegatorAddr sdk.AccAddress `json:"delegator_address"`
		ValidatorAddr sdk.ValAddress `json:"validator_address"`
		PubKey        string         `json:"pubkey"`
		Delegation    sdk.Coin       `json:"delegation"`
	}{
		Description:   msg.Description,
		ValidatorAddr: msg.ValidatorAddr,
		PubKey:        sdk.MustBech32ifyConsPub(msg.PubKey),
		Delegation:    msg.Delegation,
	})
	if err != nil {
		panic(err)
	}
	return sdk.MustSortJSON(b)
}

The above code location is here. This implementation does't include commission data into the sign bytes. I think this is improper.
Is there any special intention to leave commission data out?

@alexanderbez
Copy link
Contributor

No there isn't @HaoyangLiu! I'll address this shortly. Good review btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants