Esempio n. 1
0
 def test_create_account_password(self):
     bts = Steem(node=get_steem_nodes(),
                 nobroadcast=True,
                 unsigned=True,
                 data_refresh_time_seconds=900,
                 keys={"active": wif, "owner": wif2, "memo": wif3},
                 num_retries=10)
     core_unit = "STM"
     name = ''.join(random.choice(string.ascii_lowercase) for _ in range(12))
     key5 = PrivateKey()
     bts.txbuffer.clear()
     tx = bts.create_account(
         name,
         creator="test",   # 1.2.7
         password="******",
         additional_owner_keys=[format(key5.pubkey, core_unit)],
         additional_active_keys=[format(key5.pubkey, core_unit)],
         additional_posting_keys=[format(key5.pubkey, core_unit)],
         additional_owner_accounts=["test1"],  # 1.2.0
         additional_active_accounts=["test1"],
         storekeys=False,
     )
     if isinstance(tx["operations"][0], list):
         self.assertEqual(
             tx["operations"][0][0],
             "account_create"
         )
         op = tx["operations"][0][1]
     else:
         self.assertEqual(
             tx["operations"][0]["type"],
             "account_create_operation"
         )
         op = tx["operations"][0]["value"]            
     role = "active"
     self.assertIn(
         format(key5.pubkey, core_unit),
         [x[0] for x in op[role]["key_auths"]])
     self.assertIn(
         format(key5.pubkey, core_unit),
         [x[0] for x in op[role]["key_auths"]])
     self.assertIn(
         "test1",
         [x[0] for x in op[role]["account_auths"]])
     role = "owner"
     self.assertIn(
         format(key5.pubkey, core_unit),
         [x[0] for x in op[role]["key_auths"]])
     self.assertIn(
         format(key5.pubkey, core_unit),
         [x[0] for x in op[role]["key_auths"]])
     self.assertIn(
         "test1",
         [x[0] for x in op[role]["account_auths"]])
     self.assertEqual(
         op["creator"],
         "test")
Esempio n. 2
0
 def test_create_account(self):
     bts = Steem(node=self.nodelist.get_steem_nodes(),
                 nobroadcast=True,
                 unsigned=True,
                 data_refresh_time_seconds=900,
                 keys={
                     "active": wif,
                     "owner": wif,
                     "memo": wif
                 },
                 num_retries=10)
     core_unit = "STM"
     name = ''.join(
         random.choice(string.ascii_lowercase) for _ in range(12))
     key1 = PrivateKey()
     key2 = PrivateKey()
     key3 = PrivateKey()
     key4 = PrivateKey()
     key5 = PrivateKey()
     bts.txbuffer.clear()
     tx = bts.create_account(
         name,
         creator="test",  # 1.2.7
         owner_key=format(key1.pubkey, core_unit),
         active_key=format(key2.pubkey, core_unit),
         posting_key=format(key3.pubkey, core_unit),
         memo_key=format(key4.pubkey, core_unit),
         additional_owner_keys=[format(key5.pubkey, core_unit)],
         additional_active_keys=[format(key5.pubkey, core_unit)],
         additional_posting_keys=[format(key5.pubkey, core_unit)],
         additional_owner_accounts=["test1"],  # 1.2.0
         additional_active_accounts=["test2"],
         additional_posting_accounts=["test3"],
         storekeys=False,
     )
     self.assertEqual(tx["operations"][0][0], "account_create")
     op = tx["operations"][0][1]
     role = "active"
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn("test2", [x[0] for x in op[role]["account_auths"]])
     role = "posting"
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn("test3", [x[0] for x in op[role]["account_auths"]])
     role = "owner"
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn("test1", [x[0] for x in op[role]["account_auths"]])
     self.assertEqual(op["creator"], "test")
Esempio n. 3
0
 def test_create_account_password(self, node_param):
     if node_param == "non_appbase":
         bts = Steem(node=self.nodelist.get_nodes(appbase=False),
                     nobroadcast=True,
                     unsigned=True,
                     data_refresh_time_seconds=900,
                     keys={
                         "active": wif,
                         "owner": wif,
                         "memo": wif
                     },
                     num_retries=10)
     elif node_param == "appbase":
         bts = Steem(node=self.nodelist.get_nodes(normal=False,
                                                  appbase=True),
                     nobroadcast=True,
                     unsigned=True,
                     data_refresh_time_seconds=900,
                     keys={
                         "active": wif,
                         "owner": wif,
                         "memo": wif
                     },
                     num_retries=10)
     name = ''.join(
         random.choice(string.ascii_lowercase) for _ in range(12))
     key5 = PrivateKey()
     bts.txbuffer.clear()
     tx = bts.create_account(
         name,
         creator="test",  # 1.2.7
         password="******",
         additional_owner_keys=[format(key5.pubkey, core_unit)],
         additional_active_keys=[format(key5.pubkey, core_unit)],
         additional_posting_keys=[format(key5.pubkey, core_unit)],
         additional_owner_accounts=["test1"],  # 1.2.0
         additional_active_accounts=["test1"],
         storekeys=False,
         delegation_fee_steem="0 STEEM")
     self.assertEqual(tx["operations"][0][0], "account_create")
     op = tx["operations"][0][1]
     role = "active"
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn("test1", [x[0] for x in op[role]["account_auths"]])
     role = "owner"
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn(format(key5.pubkey, core_unit),
                   [x[0] for x in op[role]["key_auths"]])
     self.assertIn("test1", [x[0] for x in op[role]["account_auths"]])
     self.assertEqual(op["creator"], "test")