예제 #1
0
 def test_activevotes(self, node_param):
     if node_param == "non_appbase":
         bts = self.bts
     else:
         bts = self.appbase
     votes = ActiveVotes(self.authorperm, steem_instance=bts)
     votes.printAsTable()
     vote_list = votes.get_list()
     self.assertTrue(isinstance(vote_list, list))
예제 #2
0
                    if comment["parent_author"] == "" and created > addTzInfo(
                            last_paid_post):
                        print("add post %s" % comment["authorperm"])
                        blog.append(comment["authorperm"])
                    elif comment["parent_author"] != "" and created > addTzInfo(
                            last_paid_comment):
                        print("add comment %s" % comment["authorperm"])
                        posts.append(comment["authorperm"])

                post_rshares = 0
                for authorperm in blog:
                    post = Comment(authorperm, steem_instance=stm)
                    if post["created"] > addTzInfo(new_paid_post):
                        new_paid_post = post["created"].replace(tzinfo=None)
                    last_paid_post = post["created"].replace(tzinfo=None)
                    all_votes = ActiveVotes(post["authorperm"])
                    for vote in all_votes:
                        if vote["voter"] in member_data:
                            if member_data[vote["voter"]]["shares"] <= 0:
                                continue
                            if account["name"] == "steembasicincome":
                                rshares = vote["rshares"] * upvote_multiplier
                                if rshares < rshares_per_cycle:
                                    rshares = rshares_per_cycle
                            else:
                                rshares = vote[
                                    "rshares"] * upvote_multiplier * upvote_multiplier_adjusted
                            member_data[
                                vote["voter"]]["earned_rshares"] += rshares
                            member_data[
                                vote["voter"]]["curation_rshares"] += rshares
                            last_paid_post):
                        print("add post %s" % comment["authorperm"])
                        blog.append(comment["authorperm"])
                    elif comment["parent_author"] != "" and created > addTzInfo(
                            last_paid_comment):
                        print("add comment %s" % comment["authorperm"])
                        posts.append(comment["authorperm"])

                post_rshares = 0
                for authorperm in blog:
                    post = Comment(authorperm, steem_instance=stm)
                    print("Checking post %s" % post["authorperm"])
                    if post["created"] > addTzInfo(new_paid_post):
                        new_paid_post = post["created"].replace(tzinfo=None)
                    last_paid_post = post["created"].replace(tzinfo=None)
                    all_votes = ActiveVotes(post["authorperm"],
                                            steem_instance=stm2)
                    for vote in all_votes:
                        if vote["voter"] in member_data:
                            if member_data[vote["voter"]]["shares"] <= 0:
                                continue
                            if account["name"] == "steembasicincome":
                                rshares = vote["rshares"] * upvote_multiplier
                                if rshares < rshares_per_cycle:
                                    rshares = rshares_per_cycle
                            else:
                                rshares = vote[
                                    "rshares"] * upvote_multiplier * upvote_multiplier_adjusted
                            member_data[
                                vote["voter"]]["earned_rshares"] += rshares
                            member_data[
                                vote["voter"]]["curation_rshares"] += rshares
예제 #4
0
파일: test_vote.py 프로젝트: oldas1/beem
 def test_activevotes(self):
     bts = self.bts
     votes = ActiveVotes(self.authorperm, steem_instance=bts)
     votes.printAsTable()
     vote_list = votes.get_list()
     self.assertTrue(isinstance(vote_list, list))
예제 #5
0
         curation_SBD = curation_rewards_SBD["active_votes"][vote["voter"]]
         if voter_rshares > 0 and vote["voter"] == vote_log["voter"]:
             vote_SBD = stm.rshares_to_sbd(voter_rshares)
             performance = (float(curation_SBD) / vote_SBD * 100)   
         if voter_rshares > 0 and voter_rshares > rshares / rshares_divider:
             vote_SBD = stm.rshares_to_sbd(voter_rshares)
             p = float(curation_rewards_SBD["active_votes"][vote["voter"]]) / vote_SBD * 100
             if p > best_performance:
                 best_performance = p
                 best_vote_delay_min = ((vote["time"]) - c["created"]).total_seconds() / 60                    
 else:
     rshares_sum = 0
     rshares_before = 0
     rshares_after = 0
     try:
         activeVotes = ActiveVotes(authorperm, steem_instance=stm2).get_sorted_list()
     except:
         continue
     total_rshares_sum = 0
     for v in activeVotes:
         if v["rshares"] > 0:
             rshares_sum += int(v["rshares"])
         total_rshares_sum += int(v["rshares"])
         if v["voter"] == vote_log["voter"]:
             rshares = int(v["rshares"])                    
     curation_rshares = 0.25 * total_rshares_sum
     for vote in activeVotes:
         voter_rshares = int(vote["rshares"])
         rshares_after = rshares_sum - rshares_before - voter_rshares
         if voter_rshares > 0:
             y = curation_performance(rshares_before, voter_rshares, rshares_after)