def script_verification_error_test(self):
    'Create and sign a raw transaction with valid (vin 0), invalid (vin 1) and one missing (vin 2) input script.\n\n        Expected results:\n\n        3) The transaction has no complete set of signatures\n        4) Two script verification errors occurred\n        5) Script verification errors have certain properties ("txid", "vout", "scriptSig", "sequence", "error")\n        6) The verification errors refer to the invalid (vin 1) and missing input (vin 2)'
    privKeys = ['EXAMPLE_KEY']
    inputs = [{'txid': 'EXAMPLE_KEY', 'vout': 0}, {'txid': 'EXAMPLE_KEY', 'vout': 7}, {'txid': 'EXAMPLE_KEY', 'vout': 1}]
    scripts = [{'txid': 'EXAMPLE_KEY', 'vout': 0, 'scriptPubKey': 'EXAMPLE_KEY'}, {'txid': 'EXAMPLE_KEY', 'vout': 7, 'scriptPubKey': 'badbadbadbad'}]
    outputs = {'EXAMPLE_KEY': 0.1}
    rawTx = self.nodes[0].createrawtransaction(inputs, outputs)
    rawTxSigned = self.nodes[0].signrawtransaction(rawTx, scripts, privKeys)
    assert ('complete' in rawTxSigned)
    assert_equal(rawTxSigned['complete'], False)
    assert ('errors' in rawTxSigned)
    assert_equal(len(rawTxSigned['errors']), 2)
    assert ('txid' in rawTxSigned['errors'][0])
    assert ('vout' in rawTxSigned['errors'][0])
    assert ('scriptSig' in rawTxSigned['errors'][0])
    assert ('sequence' in rawTxSigned['errors'][0])
    assert ('error' in rawTxSigned['errors'][0])
    assert_equal(rawTxSigned['errors'][0]['txid'], inputs[1]['txid'])
    assert_equal(rawTxSigned['errors'][0]['vout'], inputs[1]['vout'])
    assert_equal(rawTxSigned['errors'][1]['txid'], inputs[2]['txid'])
    assert_equal(rawTxSigned['errors'][1]['vout'], inputs[2]['vout'])
Create and sign a raw transaction with valid (vin 0), invalid (vin 1) and one missing (vin 2) input script.

Expected results:

3) The transaction has no complete set of signatures
4) Two script verification errors occurred
5) Script verification errors have certain properties ("txid", "vout", "scriptSig", "sequence", "error")
6) The verification errors refer to the invalid (vin 1) and missing input (vin 2)
def script_verification_error_test(self):
    'Create and sign a raw transaction with valid (vin 0), invalid (vin 1) and one missing (vin 2) input script.\n\n        Expected results:\n\n        3) The transaction has no complete set of signatures\n        4) Two script verification errors occurred\n        5) Script verification errors have certain properties ("txid", "vout", "scriptSig", "sequence", "error")\n        6) The verification errors refer to the invalid (vin 1) and missing input (vin 2)'
    privKeys = ['EXAMPLE_KEY']
    inputs = [{'txid': 'EXAMPLE_KEY', 'vout': 0}, {'txid': 'EXAMPLE_KEY', 'vout': 7}, {'txid': 'EXAMPLE_KEY', 'vout': 1}]
    scripts = [{'txid': 'EXAMPLE_KEY', 'vout': 0, 'scriptPubKey': 'EXAMPLE_KEY'}, {'txid': 'EXAMPLE_KEY', 'vout': 7, 'scriptPubKey': 'badbadbadbad'}]
    outputs = {'EXAMPLE_KEY': 0.1}
    rawTx = self.nodes[0].createrawtransaction(inputs, outputs)
    rawTxSigned = self.nodes[0].signrawtransaction(rawTx, scripts, privKeys)
    assert ('complete' in rawTxSigned)
    assert_equal(rawTxSigned['complete'], False)
    assert ('errors' in rawTxSigned)
    assert_equal(len(rawTxSigned['errors']), 2)
    assert ('txid' in rawTxSigned['errors'][0])
    assert ('vout' in rawTxSigned['errors'][0])
    assert ('scriptSig' in rawTxSigned['errors'][0])
    assert ('sequence' in rawTxSigned['errors'][0])
    assert ('error' in rawTxSigned['errors'][0])
    assert_equal(rawTxSigned['errors'][0]['txid'], inputs[1]['txid'])
    assert_equal(rawTxSigned['errors'][0]['vout'], inputs[1]['vout'])
    assert_equal(rawTxSigned['errors'][1]['txid'], inputs[2]['txid'])
    assert_equal(rawTxSigned['errors'][1]['vout'], inputs[2]['vout'])