예제 #1
0
    def test_broadcast_duplicate_tx_spent_testnet(self):
        tx_hex = "020000000001018b526b2fecec943908bbc2e61edbbe8182af32cdfaac3f3f97a07550c0221bc800000000171600145d2f5871d3b1c9a72e86071645fbff06634cdc00feffffff028c12d10300000000160014b2f894963b3bdb3dcf46e0eb06817aa0fd65cda050c30000000000001600143d9e1c6c27c4dd45816cedb9334672da6eea27a102473044022000f991d8a8556efa902a482c836557bde98fece79ed428b248d23480315e24780220461d4fc104d1af74967ba6a2ecd994746b243bf2c74b55ee25e6d170e778caa3012102fdd06a74d4791846e0f86239c7dbbf208afc7eb6108620b8ee842ebab1b1c6f2c4b72300"

        with self.assertRaises(HTTPError) as fail:
            TxFetcher.sendrawtransaction(tx_hex, network="testnet")

        self.assertEqual(400, fail.exception.code)
        self.assertIn("missingorspent", fail.exception.read().decode())
예제 #2
0
    def test_broadcast_duplicate_tx_spent_signet(self):
        tx_hex = "020000000001017bf99a29dd2f9968ca9a075e85b43a638b600bcc49fd9ba0ac8eaf2fa8d851330000000000feffffff02a0860100000000001600149253a4d3d120add0ddd578a5cca6139891503cb917ef7d9c4f060000160014f59bb0a324f3f6026574c1186b4f7e82de9ed77e0247304402201d7531c7aff722a10f4c97ea52bd10ae48dda497d514d0c8d491e80c9981daa0022036b67fb050b0e503ebba71578e2f5c35118b4f0cfa65f0ded1605c896e3c09ce012102eb882bb156e79619d5cd9089be277b39980830030e2ee2c5a07deed3fa1aba7ff9940100"

        with self.assertRaises(HTTPError) as fail:
            TxFetcher.sendrawtransaction(tx_hex, network="signet")

        self.assertEqual(400, fail.exception.code)
        self.assertIn("missingorspent", fail.exception.read().decode())