Exemplo n.º 1
0
    def test_fundrawtransaction_adds_output(self):
        num_outputs = 5
        unfunded_transaction = CMutableTransaction(
            [], [make_txout() for x in range(0, num_outputs)])
        proxy = FakeRavencoinProxy()

        funded_transaction_hex = proxy.fundrawtransaction(
            b2x(unfunded_transaction.serialize()))["hex"]
        funded_transaction = CMutableTransaction.deserialize(
            x(funded_transaction_hex))

        self.assertTrue(len(funded_transaction.vout) > num_outputs)
        self.assertEqual(len(funded_transaction.vout), num_outputs + 1)
Exemplo n.º 2
0
    def test_fundrawtransaction_hex_hash(self):
        unfunded_transaction = CMutableTransaction(
            [], [make_txout() for x in range(0, 5)])
        proxy = FakeRavencoinProxy()

        funded_transaction_hex = proxy.fundrawtransaction(
            b2x(unfunded_transaction.serialize()))["hex"]
        funded_transaction = CMutableTransaction.deserialize(
            x(funded_transaction_hex))

        self.assertTrue(unfunded_transaction is not funded_transaction)
        self.assertEqual(type(funded_transaction), type(unfunded_transaction))
        self.assertNotEqual(len(funded_transaction.vin), 0)
        self.assertTrue(
            len(funded_transaction.vin) > len(unfunded_transaction.vin))
        self.assertEqual(type(funded_transaction.vin[0]), CTxIn)