@@ -33,18 +33,22 @@ def __init__(self):
3333 def add_options (self , parser ):
3434 parser .add_option ("--parent_binpath" , dest = "parent_binpath" , default = "" ,
3535 help = "Use a different binary for launching nodes" )
36- parser .add_option ("--parent_bitcoin " , dest = "parent_bitcoin " , default = False , action = "store_true " ,
37- help = "Parent nodes are Bitcoin " )
36+ parser .add_option ("--parent_type " , dest = "parent_type " , default = "elements " ,
37+ help = "Type of parent nodes {elements, bitcoin} " )
3838
3939 def setup_network (self , split = False ):
40- if self .options .parent_bitcoin and self .options .parent_binpath == "" :
41- raise Exception ("Can't run with --parent_bitcoin without specifying --parent_binpath" )
42-
4340 self .nodes = []
4441 self .extra_args = []
42+
43+ if self .options .parent_type not in ['elements' , 'bitcoin' ]:
44+ raise Exception ("Invalid option --parent_type=%s, valid options: elements, bitcoin" % self .options .parent_type )
45+
46+ if self .options .parent_type == 'bitcoin' and self .options .parent_binpath == "" :
47+ raise Exception ("Can't run with --parent_type=bitcoin without specifying --parent_binpath" )
48+
4549 # Parent chain args
4650 for n in range (2 ):
47- if self .options .parent_bitcoin :
51+ if self .options .parent_type == 'bitcoin' :
4852 self .parent_chain = 'regtest'
4953 rpc_u , rpc_p = rpc_auth_pair (n )
5054 self .extra_args .append ([
@@ -70,7 +74,7 @@ def setup_network(self, split=False):
7074 connect_nodes_bi (self .nodes , 0 , 1 )
7175 self .parentgenesisblockhash = self .nodes [0 ].getblockhash (0 )
7276 print ('parentgenesisblockhash' , self .parentgenesisblockhash )
73- if not self .options .parent_bitcoin :
77+ if self .options .parent_type == 'elements' :
7478 parent_pegged_asset = self .nodes [0 ].getsidechaininfo ()['pegged_asset' ]
7579
7680 # Sidechain args
@@ -91,7 +95,7 @@ def setup_network(self, split=False):
9195 '-mainchainrpcuser=%s' % rpc_u ,
9296 '-mainchainrpcpassword=%s' % rpc_p ,
9397 ]
94- if not self .options .parent_bitcoin :
98+ if self .options .parent_type == 'elements' :
9599 args .extend ([
96100 '-parentpubkeyprefix=235' ,
97101 '-parentscriptprefix=75' ,
0 commit comments