feat: implement upvote and downvote
This commit is contained in:
parent
f9e94ce205
commit
75db7bcc7a
|
@ -9,4 +9,6 @@ type NodeVotes interface {
|
|||
msgpack.CustomDecoder
|
||||
Good() int
|
||||
Bad() int
|
||||
Upvote()
|
||||
Downvote()
|
||||
}
|
||||
|
|
|
@ -55,3 +55,11 @@ func (n *NodeVotesImpl) DecodeMsgpack(dec *msgpack.Decoder) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *NodeVotesImpl) Upvote() {
|
||||
n.good++
|
||||
}
|
||||
|
||||
func (n *NodeVotesImpl) Downvote() {
|
||||
n.bad++
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue