start node is specific now for cryptoconditions tests

This commit is contained in:
Anton Lysakov
2018-11-23 10:57:06 +06:00
parent b1ece1933f
commit 3a1f15a5ef
2 changed files with 23 additions and 16 deletions

View File

@@ -43,7 +43,7 @@ class CryptoConditionsTest (BitcoinTestFramework):
self.privkey1 = "UtdydP56pGTFmawHzHr1wDrc4oUwCNW1ttX8Pc3KrvH3MA8P49Wi" self.privkey1 = "UtdydP56pGTFmawHzHr1wDrc4oUwCNW1ttX8Pc3KrvH3MA8P49Wi"
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, self.nodes = start_nodes(self.num_nodes, self.options.tmpdir,
extra_args=[[ extra_args=[[
# always give -ac_name as first extra_arg # always give -ac_name as first extra_arg and port as third
'-ac_name=REGTEST', '-ac_name=REGTEST',
'-conf='+self.options.tmpdir+'/node0/REGTEST.conf', '-conf='+self.options.tmpdir+'/node0/REGTEST.conf',
'-port=64367', '-port=64367',
@@ -57,7 +57,7 @@ class CryptoConditionsTest (BitcoinTestFramework):
'-ac_cc=2', '-ac_cc=2',
'-whitelist=127.0.0.1', '-whitelist=127.0.0.1',
'-debug', '-debug',
'-daemon', '--daemon',
'-rpcuser=rt', '-rpcuser=rt',
'-rpcpassword=rt' '-rpcpassword=rt'
], ],
@@ -75,7 +75,7 @@ class CryptoConditionsTest (BitcoinTestFramework):
'-whitelist=127.0.0.1', '-whitelist=127.0.0.1',
'-debug', '-debug',
'-addnode=127.0.0.1:64367', '-addnode=127.0.0.1:64367',
'-daemon', '--daemon',
'-rpcuser=rt', '-rpcuser=rt',
'-rpcpassword=rt']] '-rpcpassword=rt']]
) )
@@ -674,6 +674,7 @@ class CryptoConditionsTest (BitcoinTestFramework):
# assert_success(result) # assert_success(result)
# globals()["oracle_{}".format(f)] = self.send_and_mine(result['hex'], rpc) # globals()["oracle_{}".format(f)] = self.send_and_mine(result['hex'], rpc)
def run_test (self): def run_test (self):
print("Mining blocks...") print("Mining blocks...")
rpc = self.nodes[0] rpc = self.nodes[0]
@@ -688,9 +689,13 @@ class CryptoConditionsTest (BitcoinTestFramework):
rpc.importprivkey(self.privkey) rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1) rpc1.importprivkey(self.privkey1)
self.run_faucet_tests() self.run_faucet_tests()
self.sync_all()
self.run_rewards_tests() self.run_rewards_tests()
self.sync_all()
self.run_dice_tests() self.run_dice_tests()
self.sync_all()
self.run_token_tests() self.run_token_tests()
self.sync_all()
self.run_oracles_tests() self.run_oracles_tests()

View File

@@ -198,6 +198,8 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
Start a komodod and return RPC connection to it Start a komodod and return RPC connection to it
""" """
datadir = os.path.join(dirname, "node"+str(i)) datadir = os.path.join(dirname, "node"+str(i))
# creating special config in case of cryptocondition asset chain test
if extra_args[0] == '-ac_name=REGTEST':
configpath = datadir + "/REGTEST.conf" configpath = datadir + "/REGTEST.conf"
with open(configpath, "w+") as config: with open(configpath, "w+") as config:
config.write("regtest=1\n") config.write("regtest=1\n")