comment.upvote doesn't work on some cases at Beem

Project Information

Expected behavior

Comment class in beem.comment has a helper method to initiate upvotes called as .upvote.

This should work as expected on all cases.

Actual behavior

Beem fails to create an upvote transaction if the comment will be upvoted doesn't have any vote before. This is happening because of this check on the library.

How to reproduce

Here is a little python script to reproduce the issue:

from beem.comment import Comment
from beem.steem import Steem

ACCOUNT = ""


def reproduce(s):
    main_comment = Comment("@beemtutorials/test-case-for-beem-upvote", steem_instance=s)
    reply = main_comment.reply("test-comment", author=ACCOUNT)
    reply_comment = Comment(reply["operations"][0][1])
    reply_comment.upvote(+50, voter=ACCOUNT)


def main():
    s = Steem(
        node=["https://rpc.buildteam.io"],
        keys=[""]
    )
    reproduce(s)


if __name__ == '__main__':
    main()


Stacktrace:

/Users/emre/Environments/beemtutorials/bin/python /Users/emre/Projects/beem_tutorials/repro_bug.py
Traceback (most recent call last):
  File "/Users/emre/Projects/beem_tutorials/repro_bug.py", line 23, in <module>
    main()
  File "/Users/emre/Projects/beem_tutorials/repro_bug.py", line 19, in main
    reproduce(s)
  File "/Users/emre/Projects/beem_tutorials/repro_bug.py", line 11, in reproduce
    reply_comment.upvote(+50, voter=ACCOUNT)
  File "/Users/emre/Environments/beemtutorials/lib/python3.6/site-packages/beem/comment.py", line 555, in upvote
    raise VotingInvalidOnArchivedPost
beem.exceptions.VotingInvalidOnArchivedPost
  • Browser/App version: N/A, beem-0.19.47
  • Operating system: N/A

My GitHub Account

https://github.com/emre

H2
H3
H4
3 columns
2 columns
1 column
5 Comments