Exemplo n.º 1
0
 def test_create_write(self):
     wm = WalletManager()
     wm.create_wallet_file(self.path)
     try:
         wm.open_wallet(self.path)
         random_password = utils.get_random_hex_str(10)
         label = 'label'
         wm.create_account(random_password, label)
         default_account = wm.get_default_account_data()
         self.assertEqual(label, default_account.label)
         wm.create_identity(random_password, label)
         default_identity = wm.get_default_identity()
         self.assertEqual(default_identity.label, label)
         wm.write_wallet()
     finally:
         wm.del_wallet_file()
Exemplo n.º 2
0
 def test_get_default_account(self):
     wm = WalletManager()
     wm.create_wallet_file(self.path)
     try:
         wm.open_wallet(self.path)
         size = 3
         for _ in range(size):
             wm.create_account(password)
         accounts = wm.get_wallet().get_accounts()
         self.assertEqual(len(accounts), size)
         for acct in accounts:
             wm.get_wallet().set_default_account_by_address(
                 acct.b58_address)
             default_account = wm.get_default_account_data()
             self.assertEqual(default_account.b58_address, acct.b58_address)
     finally:
         wm.del_wallet_file()