diff --git a/interfaces/vote.go b/interfaces/vote.go index dbfb1c1..7f6b3e7 100644 --- a/interfaces/vote.go +++ b/interfaces/vote.go @@ -9,4 +9,6 @@ type NodeVotes interface { msgpack.CustomDecoder Good() int Bad() int + Upvote() + Downvote() } diff --git a/service/vote.go b/service/vote.go index 1748288..e8c9ab1 100644 --- a/service/vote.go +++ b/service/vote.go @@ -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++ +}