feat: implement upvote and downvote

This commit is contained in:
Derrick Hammer 2024-01-09 06:54:22 -05:00
parent f9e94ce205
commit 75db7bcc7a
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 10 additions and 0 deletions

View File

@ -9,4 +9,6 @@ type NodeVotes interface {
msgpack.CustomDecoder
Good() int
Bad() int
Upvote()
Downvote()
}

View File

@ -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++
}