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

Votes should be hashed according to EIP-712 #335 #399

Merged
merged 6 commits into from
Oct 23, 2018

Conversation

deepesh-kn
Copy link
Contributor

Fixes: #335

  • Created struct VoteMessage
  • Created struct Vote
  • Added Hashing logic as per EIP-712

Please note: In this PR bytes20 coreIdentifier is still part of struct VoteMessage.
As the votes are for both origin and auxiliary chain, we need to have the coreIdentifier information while generating the voteHash.

Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

Did you check whether it is possible to calculate the vote hash only once?

_v,
_r,
_s
);
_s);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_s);
_s
);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@deepesh-kn deepesh-kn self-assigned this Oct 23, 2018
@deepesh-kn
Copy link
Contributor Author

Did you check whether it is possible to calculate the vote hash only once?
Yes, that was missed in the initial commit, I committed that part now, thanks!!!

Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

LGTM 🎉
Just a tiny addition in a comment would be helpful in the future I think.

/** Vote message */
struct VoteMessage {

/** A unique identifier that identifies what chain this vote is about. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also explain here why it has to be part of the struct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the comment 👍

Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@schemar schemar merged commit 51d6eb8 into OpenST:develop Oct 23, 2018
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