mirror of
https://github.com/embarklabs/dreddit-tutorial.git
synced 2025-02-20 04:28:07 +00:00
step 5: add method to fetch votes
This commit is contained in:
parent
c79154b9f2
commit
191d6ef5c5
@ -64,5 +64,10 @@ contract DReddit {
|
||||
Post storage post = posts[_postId];
|
||||
return (post.voters[msg.sender] == Ballot.NONE);
|
||||
}
|
||||
|
||||
function getVote(uint _postId) public view returns (uint8) {
|
||||
Post storage post = posts[_postId];
|
||||
return uint8(post.voters[msg.sender]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user