Exemple #1
0
 def test_verifyAuthority(self):
     hv = self.bts
     hv.wallet.unlock("123")
     tx = TransactionBuilder(use_condenser_api=True, hive_instance=hv)
     tx.appendOps(Transfer(**{"from": "bhive",
                              "to": "bhive1",
                              "amount": Amount("1.300 HBD", hive_instance=hv),
                              "memo": "Foobar"}))
     account = Account("bhive", hive_instance=hv)
     tx.appendSigner(account, "active")
     self.assertTrue(len(tx.wifs) > 0)
     tx.sign()
     tx.verify_authority()
     self.assertTrue(len(tx["signatures"]) > 0)
Exemple #2
0
 def test_verifyAuthorityException(self):
     nodelist = NodeList()
     hv = Hive(node=self.nodes,
                 keys=[self.posting_key],
                 nobroadcast=True,
                 expiration=120,
                 num_retries=10)
     tx = TransactionBuilder(use_condenser_api=True, hive_instance=hv)
     tx.appendOps(Transfer(**{"from": "bhive",
                              "to": "bhive1",
                              "amount": Amount("1 HIVE", hive_instance=hv),
                              "memo": ""}))
     account = Account("bhive2", hive_instance=hv)
     tx.appendSigner(account, "active")
     tx.appendWif(self.posting_key)
     self.assertTrue(len(tx.wifs) > 0)
     tx.sign()
     with self.assertRaises(
         exceptions.MissingRequiredActiveAuthority
     ):
         tx.verify_authority()
     self.assertTrue(len(tx["signatures"]) > 0)