@@ -69,10 +69,13 @@ def _submit_tx(
6969 help = "The account to fund on the opposite chain." ,
7070)
7171@click .option (
72- "--verbose" , is_flag = True , help = "Whether or not to print more verbose information."
72+ "-v" ,
73+ "--verbose" ,
74+ help = "Whether or not to print more verbose information. Also supports `-vv`." ,
75+ count = True ,
7376)
7477def create_xchain_account (
75- from_chain : str , bridge : str , from_seed : str , to_account : str , verbose : bool = False
78+ from_chain : str , bridge : str , from_seed : str , to_account : str , verbose : int = 0
7679) -> None :
7780 """
7881 Create an account on the opposite chain via a cross-chain transfer.
@@ -83,11 +86,9 @@ def create_xchain_account(
8386 bridge: The bridge across which to create the account.
8487 from_seed: The seed of the account that the funds come from.
8588 to_account: The chain to fund an account on.
86- verbose: Whether or not to print more verbose information.
89+ verbose: Whether or not to print more verbose information. Add more v's for
90+ more verbosity.
8791 """ # noqa: D301
88- # tutorial = True
89- print_level = 2
90-
9192 bridge_config = get_config ().get_bridge (bridge )
9293 from_chain_config = get_config ().get_chain (from_chain )
9394 from_client = from_chain_config .get_client ()
@@ -116,7 +117,7 @@ def create_xchain_account(
116117 destination = to_account ,
117118 amount = create_account_amount ,
118119 )
119- submit_tx (fund_tx , from_client , from_wallet .seed , print_level )
120+ submit_tx (fund_tx , from_client , from_wallet .seed , verbose )
120121
121122 # wait for attestations
122123 time_count = 0.0
@@ -147,9 +148,9 @@ def create_xchain_account(
147148 if element ["Destination" ] != to_account :
148149 continue
149150 attestation_count += 1
150- if print_level > 1 :
151+ if verbose > 1 :
151152 click .echo (pformat (element ))
152- if print_level > 0 :
153+ if verbose > 0 :
153154 click .secho (
154155 f"Received { attestation_count } attestations" ,
155156 fg = "bright_green" ,
@@ -169,5 +170,5 @@ def create_xchain_account(
169170 click .secho ("Error: Timeout on attestations." , fg = "red" )
170171 return
171172
172- if verbose :
173+ if verbose > 0 :
173174 click .echo (pformat (to_client .request (AccountInfo (account = to_account )).result ))
0 commit comments