Example #1
0
 def test_betting_market_rules_create(self):
     name = [["en", "NHL Rules v1.0"]]
     rule = [["en", "The winner will be the team with the most points at the end of the game.  The team with fewer points will not be the winner."]]
     self.ppy.betting_market_rules_create(
         name, rule, append_to=self.ppy.proposal()
     )
     tx = self.ppy.tx()
     ops = tx["operations"]
     prop = ops[0][1]
     self.assertEqual(len(ops), 1)
     self.assertEqual(
         getOperationNameForId(ops[0][0]),
         "proposal_create"
     )
     self.assertEqual(len(prop["proposed_ops"]), 1)
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][0]["op"][0]),
         "betting_market_rules_create"
     )
     self.assertEqual(
         name,
         prop["proposed_ops"][0]["op"][1]["name"]
     )
     self.assertEqual(
         rule,
         prop["proposed_ops"][0]["op"][1]["description"]
     )
Example #2
0
 def test_event_group_create(self):
     ev = [
         ["de", "1. Bundesliga"],
         ["en", "First Country League"],
     ]
     proposal = self.ppy.proposal()
     self.ppy.sport_create(["en", "testsport"], append_to=proposal)
     self.ppy.event_group_create(ev, sport_id="0.0.0", append_to=proposal)
     tx = self.ppy.tx()
     ops = tx["operations"]
     prop = ops[0][1]
     self.assertEqual(len(ops), 1)
     self.assertEqual(
         getOperationNameForId(ops[0][0]),
         "proposal_create"
     )
     self.assertEqual(len(prop["proposed_ops"]), 2)
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][1]["op"][0]),
         "event_group_create"
     )
     self.assertEqual(
         ev,
         prop["proposed_ops"][1]["op"][1]["name"]
     )
     self.assertEqual(
         prop["proposed_ops"][1]["op"][1]["sport_id"],
         "0.0.0"
     )
Example #3
0
 def test_two_sport_create(self):
     sport = [
         ["de", "Fussball"],
         ["en", "Soccer"],
     ]
     proposal = self.ppy.proposal()
     self.ppy.sport_create(sport, append_to=proposal)
     self.ppy.sport_create(sport, append_to=proposal)
     tx = self.ppy.tx()
     ops = tx["operations"]
     prop = ops[0][1]
     self.assertEqual(len(ops), 1)
     self.assertEqual(
         getOperationNameForId(ops[0][0]),
         "proposal_create"
     )
     self.assertEqual(len(prop["proposed_ops"]), 2)
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][0]["op"][0]),
         "sport_create"
     )
     self.assertEqual(
         sport,
         prop["proposed_ops"][0]["op"][1]["name"]
     )
     self.assertEqual(
         sport,
         prop["proposed_ops"][1]["op"][1]["name"]
     )
Example #4
0
 def test_event_create(self):
     ev = [["de", "1. Bundesliga"], ["en", "First Country League"]]
     desc = [["de", "Bundesliga"], ["en", "Germany Scoccer Championship"]]
     season = [["de", "Januar 2016"], ["en", "January 2016"]]
     start = datetime.datetime(2016,
                               1,
                               1,
                               0,
                               0,
                               0,
                               tzinfo=datetime.timezone.utc)
     proposal = peerplays.proposal()
     peerplays.sport_create(["en", "testsport"], append_to=proposal)
     peerplays.event_group_create(ev, sport_id="0.0.0", append_to=proposal)
     peerplays.event_create(desc,
                            season,
                            start,
                            event_group_id="0.0.1",
                            append_to=proposal)
     tx = peerplays.tx()
     ops = tx["operations"]
     prop = ops[0][1]
     self.assertEqual(len(ops), 1)
     self.assertEqual(getOperationNameForId(ops[0][0]), "proposal_create")
     self.assertEqual(len(prop["proposed_ops"]), 3)
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][2]["op"][0]),
         "event_create")
     self.assertEqual(desc, prop["proposed_ops"][2]["op"][1]["name"])
     self.assertEqual(season, prop["proposed_ops"][2]["op"][1]["season"])
     self.assertEqual(prop["proposed_ops"][2]["op"][1]["event_group_id"],
                      "0.0.1")
     self.assertEqual(
         parse_time(prop["proposed_ops"][2]["op"][1]["start_time"]), start)
 def test_finalizeOps_changeproposer_legacy(self):
     peerplays.proposer = "init5"
     tx = peerplays.transfer("init1", 1, core_unit)
     ops = tx["operations"]
     self.assertEqual(len(ops), 1)
     self.assertEqual(getOperationNameForId(ops[0][0]), "proposal_create")
     prop = ops[0][1]
     self.assertEqual(len(prop["proposed_ops"]), 1)
     self.assertEqual(prop["fee_paying_account"], "1.2.12")
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][0]["op"][0]),
         "transfer")
Example #6
0
    def test_betting_market_create(self):
        name = [["de", "Nuernberg gewinnt"], ["en", "Nuremberg wins"]]
        cond = [
            ["de", "Description: Fuerth gewinnt"],
            ["en", "Description: Fuerth wins"],
        ]

        bmg_name = [["de", "Meine Market Group"],
                    ["en", "My betting market group"]]
        rule_name = [["en", "NHL Rules v1.0"]]
        rule = [[
            "en",
            "The winner will be the team with the most points at the end of the game.  The team with fewer points will not be the winner.",
        ]]
        ev = [["de", "1. Bundesliga"], ["en", "First Country League"]]
        desc = [["de", "Bundesliga"], ["en", "Germany Scoccer Championship"]]
        season = [["de", "Januar 2016"], ["en", "January 2016"]]
        start = datetime.datetime(2016, 1, 1, 0, 0, 0)

        proposal = peerplays.proposal()
        peerplays.sport_create(["en", "testsport"], append_to=proposal)
        peerplays.event_group_create(ev, sport_id="0.0.0", append_to=proposal)
        peerplays.event_create(desc,
                               season,
                               start,
                               event_group_id="0.0.1",
                               append_to=proposal)
        peerplays.betting_market_rules_create(rule_name,
                                              rule,
                                              append_to=proposal)
        peerplays.betting_market_group_create(bmg_name,
                                              event_id="0.0.2",
                                              rules_id="0.0.3",
                                              append_to=proposal)

        peerplays.betting_market_create(cond,
                                        name,
                                        group_id="0.0.4",
                                        append_to=proposal)
        tx = peerplays.tx()
        ops = tx["operations"]
        prop = ops[0][1]
        self.assertEqual(len(ops), 1)
        self.assertEqual(getOperationNameForId(ops[0][0]), "proposal_create")
        self.assertEqual(len(prop["proposed_ops"]), 6)
        self.assertEqual(
            getOperationNameForId(prop["proposed_ops"][5]["op"][0]),
            "betting_market_create",
        )
        self.assertEqual(name, prop["proposed_ops"][5]["op"][1]["description"])
        self.assertEqual(cond,
                         prop["proposed_ops"][5]["op"][1]["payout_condition"])
        self.assertEqual("0.0.4", prop["proposed_ops"][5]["op"][1]["group_id"])
 def test_finalizeOps_proposal2(self):
     proposal = peerplays.new_proposal()
     # proposal = peerplays.proposal()
     peerplays.transfer("init1", 1, core_unit, append_to=proposal)
     tx = peerplays.tx().json()  # default tx buffer
     ops = tx["operations"]
     self.assertEqual(len(ops), 1)
     self.assertEqual(getOperationNameForId(ops[0][0]), "proposal_create")
     prop = ops[0][1]
     self.assertEqual(len(prop["proposed_ops"]), 1)
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][0]["op"][0]),
         "transfer")
 def test_finalizeOps_proposal(self):
     ppy = self.ppy
     # proposal = ppy.new_proposal(ppy.tx())
     proposal = ppy.proposal()
     self.ppy.transfer("init1", 1, "PPY", append_to=proposal)
     tx = ppy.tx().json()  # default tx buffer
     ops = tx["operations"]
     self.assertEqual(len(ops), 1)
     self.assertEqual(getOperationNameForId(ops[0][0]), "proposal_create")
     prop = ops[0][1]
     self.assertEqual(len(prop["proposed_ops"]), 1)
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][0]["op"][0]),
         "transfer")
 def test_finalizeOps_changeproposer_new(self):
     ppy = self.ppy
     proposal = ppy.proposal(proposer="init5")
     ppy.transfer("init1", 1, "PPY", append_to=proposal)
     tx = ppy.tx().json()
     ops = tx["operations"]
     self.assertEqual(len(ops), 1)
     self.assertEqual(getOperationNameForId(ops[0][0]), "proposal_create")
     prop = ops[0][1]
     self.assertEqual(len(prop["proposed_ops"]), 1)
     self.assertEqual(prop["fee_paying_account"], "1.2.12")
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][0]["op"][0]),
         "transfer")
 def test_finalizeOps_combined_proposal(self):
     parent = peerplays.new_tx()
     proposal = peerplays.new_proposal(parent)
     peerplays.transfer("init1", 1, core_unit, append_to=proposal)
     peerplays.transfer("init1", 1, core_unit, append_to=parent)
     tx = parent.json()
     ops = tx["operations"]
     self.assertEqual(len(ops), 2)
     self.assertEqual(getOperationNameForId(ops[0][0]), "proposal_create")
     self.assertEqual(getOperationNameForId(ops[1][0]), "transfer")
     prop = ops[0][1]
     self.assertEqual(len(prop["proposed_ops"]), 1)
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][0]["op"][0]),
         "transfer")
Example #11
0
def getProposalOperations(tx):
    convertedOperations = []

    if tx.get('operations', None):
        if isProposal(tx):
            # its a proposal, proceed
            for idx, operation in enumerate(
                    tx['operations'][0][1]['proposed_ops']):
                operation = operation['op']
                operationName = getOperationNameForId(operation[0])
                typeName = 'unknown'
                for tmpTypeName, newOpName in TYPENAME_TO_NEWOP_MAP.items():
                    if newOpName == operationName:
                        typeName = tmpTypeName

                typeName = UPDATEOP_TO_TYPENAME_MAP.get(
                    operationName, typeName)

                if typeName == 'unknown':
                    raise Exception
                # this is a hack. proper id construction __must__ be
                # provided by backend
                operationId = '0.0.' + str(idx)
                tmpData = operation[1].copy()
                tmpData.update({
                    'operationName': operationName,
                    'operationId': operationId
                })

                bufferedObject = wrapper.mapOperationToObject(
                    typeName, tmpData)
                convertedOperations.append(bufferedObject)

    return convertedOperations
Example #12
0
    def test_bet_place(self):
        def new_refresh(self):
            dict.__init__(self, {"id": "1.21.11123"})

        with mock.patch("peerplays.bettingmarket.BettingMarket.refresh",
                        new=new_refresh):
            self.ppy.bet_place(
                "1.21.11123",
                Amount(1244, "PPY"),
                2,
                "back",
            )
            tx = self.ppy.tx().json()
            ops = tx["operations"]
            op = ops[0][1]
            self.assertEqual(len(ops), 1)
            self.assertEqual(getOperationNameForId(ops[0][0]), "bet_place")
            self.assertEqual(op["amount_to_bet"], {
                'amount': 124400000,
                'asset_id': '1.3.0'
            })
            self.assertEqual(op["back_or_lay"], "back")
            self.assertEqual(op["backer_multiplier"], 2 * 10000)
            self.assertEqual(
                op["betting_market_id"],
                "1.21.11123",
            )
            self.assertEqual(
                op["bettor_id"],
                "1.2.7",
            )
 def test_approvecommittee(self):
     ppy = self.ppy
     tx = ppy.approvecommittee("1.5.0")
     self.assertEqual(getOperationNameForId(tx["operations"][0][0]),
                      "account_update")
     op = tx["operations"][0][1]
     self.assertIn("0:11", op["new_options"]["votes"])
Example #14
0
    def __init__(self, **kwargs):
        super(OperationWidget, self).__init__(**kwargs)

        name = operationids.getOperationNameForId(kwargs['operationId'])
        file = 'operation_' + name + '.html'

        if kwargs['operationId'] == 22:
            self.template = os.path.join('widgets', 'operation_proposal.html')

            # add child operations
            operation = kwargs['data']
            self.template_args['title'] = 'Proposal'
            self.template_args['listItems'] = [
                ('Fee paying account', operation['fee_paying_account']),
                ('Expiration time', operation['expiration_time'])
            ]

            for tmpOp in operation['proposed_ops']:
                self.addOperation(tmpOp['op'][0], tmpOp['op'][1])
        elif os.path.isfile(
                os.path.join('bos_mint', 'templates', 'widgets', file)):
            self.template = os.path.join('widgets', file)
        elif os.path.isfile(os.path.join('templates', 'widgets', file)):
            self.template = os.path.join('widgets', file)
        elif os.path.isfile(
                os.path.join(os.path.dirname(os.path.realpath(__file__)),
                             'templates', 'widgets', file)):
            self.template = os.path.join('widgets', file)
        else:
            self.template = 'widgets/operation_unknown.html'
Example #15
0
    def ops(self, start=None, stop=None, **kwargs):
        """ Yields all operations (including virtual operations) starting from
            ``start``.

            :param int start: Starting block
            :param int stop: Stop at this block
            :param str mode: We here have the choice between
             "head" (the last block) and "irreversible" (the block that is
             confirmed by 2/3 of all block producers and is thus irreversible)
            :param bool only_virtual_ops: Only yield virtual operations

            This call returns a list that only carries one operation and
            its type!
        """

        for block in self.blocks(start=start, stop=stop, **kwargs):
            for tx in block["transactions"]:
                for op in tx["operations"]:
                    # Replace opid by op name
                    op[0] = getOperationNameForId(op[0])
                    yield {
                        "block_num": block["block_num"],
                        "op": op,
                        "timestamp": block["timestamp"]
                    }
 def test_approvewitness(self):
     ppy = self.ppy
     tx = ppy.approvewitness("1.6.1")
     self.assertEqual(getOperationNameForId(tx["operations"][0][0]),
                      "account_update")
     op = tx["operations"][0][1]
     self.assertIn("1:0", op["new_options"]["votes"])
Example #17
0
 def test_bet_cancel(self):
     tx = peerplays.bet_cancel("1.26.13")
     ops = tx["operations"]
     op = ops[0][1]
     self.assertEqual(len(ops), 1)
     self.assertEqual(getOperationNameForId(ops[0][0]), "bet_cancel")
     self.assertEqual(op["bet_to_cancel"], "1.26.13")
     self.assertEqual(op["bettor_id"], "1.2.7")
Example #18
0
    def addOperation(self, operationId, data):
        if not self.template_args.get('operations'):
            self.template_args['operations'] = []

        ow = OperationWidget(
            operationId=operationId,
            operationName=operationids.getOperationNameForId(operationId),
            data=data)
        self.template_args['operations'].append(ow)
Example #19
0
 def test_update_memo_key(self):
     tx = peerplays.update_memo_key(
         "TEST55VCzsb47NZwWe5F3qyQKedX9iHBHMVVFSc96PDvV7wuj7W86n")
     self.assertEqual(getOperationNameForId(tx["operations"][0][0]),
                      "account_update")
     op = tx["operations"][0][1]
     self.assertEqual(
         op["new_options"]["memo_key"],
         "TEST55VCzsb47NZwWe5F3qyQKedX9iHBHMVVFSc96PDvV7wuj7W86n",
     )
Example #20
0
 def test_betting_market_resolve(self):
     result = [["1.25.2950", "win"], ["1.25.2951", "not_win"]]
     peerplays.betting_market_resolve("1.24.212",
                                      result,
                                      append_to=peerplays.proposal())
     tx = peerplays.tx()
     ops = tx["operations"]
     prop = ops[0][1]
     self.assertEqual(len(ops), 1)
     self.assertEqual(getOperationNameForId(ops[0][0]), "proposal_create")
     self.assertEqual(len(prop["proposed_ops"]), 1)
     self.assertEqual(
         getOperationNameForId(prop["proposed_ops"][0]["op"][0]),
         "betting_market_group_resolve",
     )
     self.assertEqual(
         "1.24.212",
         prop["proposed_ops"][0]["op"][1]["betting_market_group_id"])
     self.assertEqual(result,
                      prop["proposed_ops"][0]["op"][1]["resolutions"])
Example #21
0
    def test_betting_market_resolve(self):
        def new_refresh(self):
            dict.__init__(
                self,
                {"id": "1.20.0"}
            )

        result = [["1.21.257", "win"],
                  ["1.21.258", "not_win"],
                  ["1.21.259", "cancel"]]

        with mock.patch(
            "peerplays.bettingmarketgroup.BettingMarketGroup.refresh",
            new=new_refresh
        ):
            self.ppy.betting_market_resolve(
                "1.20.0",
                result,
                append_to=self.ppy.proposal()
            )
            tx = self.ppy.tx()
            ops = tx["operations"]
            prop = ops[0][1]
            self.assertEqual(len(ops), 1)
            self.assertEqual(
                getOperationNameForId(ops[0][0]),
                "proposal_create"
            )
            self.assertEqual(len(prop["proposed_ops"]), 1)
            self.assertEqual(
                getOperationNameForId(prop["proposed_ops"][0]["op"][0]),
                "betting_market_group_resolve"
            )
            self.assertEqual(
                "1.20.0",
                prop["proposed_ops"][0]["op"][1]["betting_market_group_id"]
            )
            self.assertEqual(
                result,
                prop["proposed_ops"][0]["op"][1]["resolutions"]
            )
Example #22
0
 def test_account_upgrade(self):
     account = Account("witness-account")
     tx = account.upgrade()
     ops = tx["operations"]
     op = ops[0][1]
     self.assertEqual(len(ops), 1)
     self.assertEqual(getOperationNameForId(ops[0][0]), "account_upgrade")
     self.assertTrue(op["upgrade_to_lifetime_member"])
     self.assertEqual(
         op["account_to_upgrade"],
         "1.2.1",
     )
Example #23
0
 def test_bet_place(self):
     tx = peerplays.bet_place("1.25.2950", Amount(1244, "1.3.0"), 2, "back")
     ops = tx["operations"]
     op = ops[0][1]
     self.assertEqual(len(ops), 1)
     self.assertEqual(getOperationNameForId(ops[0][0]), "bet_place")
     self.assertEqual(
         op["amount_to_bet"], {"amount": 124400000, "asset_id": "1.3.0"}
     )
     self.assertEqual(op["back_or_lay"], "back")
     self.assertEqual(op["backer_multiplier"], 2 * 10000)
     self.assertEqual(op["betting_market_id"], "1.25.2950")
     self.assertEqual(op["bettor_id"], "1.2.7")
Example #24
0
 def test_transfer(self):
     tx = peerplays.transfer("1.2.8",
                             1.33,
                             core_unit,
                             memo="Foobar",
                             account="1.2.7")
     self.assertEqual(getOperationNameForId(tx["operations"][0][0]),
                      "transfer")
     op = tx["operations"][0][1]
     self.assertIn("memo", op)
     self.assertEqual(op["from"], "1.2.7")
     self.assertEqual(op["to"], "1.2.8")
     amount = Amount(op["amount"])
     self.assertEqual(float(amount), 1.33)
 def test_allow(self):
     ppy = self.ppy
     tx = ppy.allow("PPY55VCzsb47NZwWe5F3qyQKedX9iHBHMVVFSc96PDvV7wuj7W86n",
                    weight=1,
                    threshold=1,
                    permission="owner")
     self.assertEqual(getOperationNameForId(tx["operations"][0][0]),
                      "account_update")
     op = tx["operations"][0][1]
     self.assertIn("owner", op)
     self.assertIn(
         ["PPY55VCzsb47NZwWe5F3qyQKedX9iHBHMVVFSc96PDvV7wuj7W86n", '1'],
         op["owner"]["key_auths"])
     self.assertEqual(op["owner"]["weight_threshold"], 1)
Example #26
0
    def has_buffered_new(self, **kwargs):
        """ This call tests if an operation is buffered for proposal

            It only returns true if the exact content is proposed

            We forward **kwargs so we can use custom
            triggers when doing operation comparison. This feature
            allows us to define the 'comparing'-lambda from the outside
            and is needed for fuzzy matching (e.g. for dynamic markets)
        """
        from peerplaysbase.operationids import getOperationNameForId
        for op, pid, oid in self.get_buffered_operations():
            if getOperationNameForId(op[0]) == self.operation_create:
                if self.test_operation_equal(op[1], **kwargs):
                    return pid, oid
Example #27
0
    def has_pending_update(self, **kwargs):
        """ Test if there is an update on-chain to properly match blockchain
            content with lookup content

            It only returns true if the exact content is proposed

            We forward **kwargs so we can use custom
            triggers when doing operation comparison. This feature
            allows us to define the 'comparing'-lambda from the outside
            and is needed for fuzzy matching (e.g. for dynamic markets)
        """
        from peerplaysbase.operationids import getOperationNameForId
        for proposalObject in self.get_pending_operations():
            proposal = proposalObject["proposal"]
            for op, pid, oid in proposalObject["data"]:
                if getOperationNameForId(op[0]) == self.operation_update:
                    if self.test_operation_equal(op[1], proposal=proposal, **kwargs):
                        yield dict(pid=pid, oid=oid, proposal=proposal)
Example #28
0
    def test_bet_cancel(self):
        def new_refresh(self):
            dict.__init__(self, {"id": "1.22.13"})

        with mock.patch("peerplays.bet.Bet.refresh", new=new_refresh):
            self.ppy.bet_cancel("1.22.13", )
            tx = self.ppy.tx().json()
            ops = tx["operations"]
            op = ops[0][1]
            self.assertEqual(len(ops), 1)
            self.assertEqual(getOperationNameForId(ops[0][0]), "bet_cancel")
            self.assertEqual(
                op["bet_to_cancel"],
                "1.22.13",
            )
            self.assertEqual(
                op["bettor_id"],
                "1.2.7",
            )
Example #29
0
    def has_pending_new(self, **kwargs):
        """ This call tests if a proposal that would create this object is
            pending on-chain

            It only returns true if the exact content is proposed

            We forward **kwargs so we can use custom
            triggers when doing operation comparison. This feature
            allows us to define the 'comparing'-lambda from the outside
            and is needed for fuzzy matching (e.g. for dynamic markets)
        """
        from peerplaysbase.operationids import getOperationNameForId
        for proposalObject in self.get_pending_operations():
            proposal = proposalObject["proposal"]
            for op, pid, oid in proposalObject["data"]:
                if getOperationNameForId(op[0]) == self.operation_create:
                    log.debug("Testing pending proposal {}".format(proposal["id"]))
                    kwargs["proposal"] = proposal
                    if self.test_operation_equal(op[1], **kwargs):
                        yield dict(pid=pid, oid=oid, proposal=proposal)
Example #30
0
 def test_create_account(self):
     name = "".join(
         random.choice(string.ascii_lowercase) for _ in range(12))
     key1 = PrivateKey()
     key2 = PrivateKey()
     key3 = PrivateKey()
     key4 = PrivateKey()
     tx = peerplays.create_account(
         name,
         registrar="init0",  # 1.2.7
         referrer="init1",  # 1.2.8
         referrer_percent=33,
         owner_key=format(key1.pubkey, "TEST"),
         active_key=format(key2.pubkey, "TEST"),
         memo_key=format(key3.pubkey, "TEST"),
         additional_owner_keys=[format(key4.pubkey, "TEST")],
         additional_active_keys=[format(key4.pubkey, "TEST")],
         additional_owner_accounts=["committee-account"],  # 1.2.0
         additional_active_accounts=["committee-account"],
         proxy_account="init0",
         storekeys=False,
     )
     self.assertEqual(getOperationNameForId(tx["operations"][0][0]),
                      "account_create")
     op = tx["operations"][0][1]
     role = "active"
     self.assertIn(format(key2.pubkey, "TEST"),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn(format(key4.pubkey, "TEST"),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn("1.2.0", [x[0] for x in op[role]["account_auths"]])
     role = "owner"
     self.assertIn(format(key1.pubkey, "TEST"),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn(format(key4.pubkey, "TEST"),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn("1.2.0", [x[0] for x in op[role]["account_auths"]])
     self.assertEqual(op["options"]["voting_account"], "1.2.7")
     self.assertEqual(op["registrar"], "1.2.7")
     self.assertEqual(op["referrer"], "1.2.8")
     self.assertEqual(op["referrer_percent"], 33 * 100)