20 print(
"Initializing test directory "+self.options.tmpdir)
27 self.
nodes.append(
start_node(1, self.options.tmpdir, [
"-debug",
"-txindex"]))
29 self.
nodes.append(
start_node(2, self.options.tmpdir, [
"-debug",
"-txindex"]))
30 self.
nodes.append(
start_node(3, self.options.tmpdir, [
"-debug",
"-txindex"]))
39 print "Mining blocks..." 46 print "Testing transaction index..." 48 privkey =
"cU4zhap7nPJAWeMFu4j6jLrfPmqakDAzy8zn8Fhb3oEevdm4e5Lc" 49 address =
"yeMpGzMj3rhtnz48XsfpB8itPHhHtgxLc3" 50 addressHash =
"C5E4FB9171C22409809A3E8047A29C83886E325D".decode(
"hex")
51 scriptPubKey =
CScript([OP_DUP, OP_HASH160, addressHash, OP_EQUALVERIFY, OP_CHECKSIG])
54 amount = unspent[0][
"amount"] * 100000000
55 tx.vin = [
CTxIn(
COutPoint(int(unspent[0][
"txid"], 16), unspent[0][
"vout"]))]
56 tx.vout = [
CTxOut(amount, scriptPubKey)]
66 assert_equal(verbose[
"vout"][0][
"valueSat"], 5000000000);
72 if __name__ ==
'__main__':
UniValue getrawtransaction(const UniValue ¶ms, bool fHelp)
UniValue listunspent(const UniValue ¶ms, bool fHelp)
def connect_nodes(from_connection, node_num)
UniValue getblockcount(const UniValue ¶ms, bool fHelp)
def initialize_chain_clean(test_dir, num_nodes)
UniValue signrawtransaction(const UniValue ¶ms, bool fHelp)
def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=None)
UniValue generate(const UniValue ¶ms, bool fHelp)
UniValue sendrawtransaction(const UniValue ¶ms, bool fHelp)
def assert_equal(thing1, thing2)