Ejemplo n.º 1
0
 def test_vote(self, node_param):
     if node_param == "non_appbase":
         bts = self.bts
     else:
         bts = self.appbase
     c = Comment(self.authorperm, steem_instance=bts)
     bts.txbuffer.clear()
     tx = c.vote(100, account="test")
     self.assertEqual((tx["operations"][0][0]), "vote")
     op = tx["operations"][0][1]
     self.assertIn("test", op["voter"])
     c.steem.txbuffer.clear()
     tx = c.upvote(weight=150, voter="test")
     op = tx["operations"][0][1]
     self.assertEqual(op["weight"], 10000)
     c.steem.txbuffer.clear()
     tx = c.upvote(weight=99.9, voter="test")
     op = tx["operations"][0][1]
     self.assertEqual(op["weight"], 9990)
     c.steem.txbuffer.clear()
     tx = c.downvote(weight=-150, voter="test")
     op = tx["operations"][0][1]
     self.assertEqual(op["weight"], -10000)
     c.steem.txbuffer.clear()
     tx = c.downvote(weight=-99.9, voter="test")
     op = tx["operations"][0][1]
     self.assertEqual(op["weight"], -9990)
Ejemplo n.º 2
0
    def test_vote(self):
        bts = self.bts
        c = Comment(self.authorperm, blockchain_instance=bts)
        bts.txbuffer.clear()
        tx = c.vote(100, account="test")
        self.assertEqual((tx["operations"][0][0]), "vote")
        op = tx["operations"][0][1]
        self.assertIn("test", op["voter"])
        c.blockchain.txbuffer.clear()
        tx = c.upvote(weight=150, voter="test")
        op = tx["operations"][0][1]
        self.assertEqual(op["weight"], 10000)
        c.blockchain.txbuffer.clear()
        tx = c.upvote(weight=99.9, voter="test")
        op = tx["operations"][0][1]
        self.assertEqual(op["weight"], 9990)

        c.blockchain.txbuffer.clear()
        tx = c.downvote(weight=150, voter="test")
        op = tx["operations"][0][1]
        self.assertEqual(op["weight"], -10000)
        c.blockchain.txbuffer.clear()
        tx = c.downvote(weight=99.9, voter="test")
        op = tx["operations"][0][1]
        self.assertEqual(op["weight"], -9990)
Ejemplo n.º 3
0
def downvote(s, permlink, voter):
    acc = Comment(permlink, steem_instance=s)
    votes = acc.downvote(voter=voter)