@@ -19,15 +19,15 @@ def __init__(
1919 # We need to find a good way to this. **The method could return only the MsgRequest and type_url**
2020 # Who wants to submit the tx, can call transaction (we should also implement multi-add_raw_msg), one tx with multiple msg
2121
22- def PrepareOrTransactMsg ( self ,
23- msg : Any ,
22+ def PrepareOrTransactMsg ( self ,
23+ msg : Any ,
2424 transact : bool = False ,
2525 tx_params : TxParams = TxParams (),
2626 ** kwargs ):
2727 msg_args = {
2828 k : kwargs [k ] for k in kwargs if k in ["address" , "node_address" , "id" , "gigabytes" , "hours" , "rating" , "denom" ]
2929 }
30-
30+
3131 msg_args ['frm' ] = self .__account .address
3232 prepared_msg = msg (** msg_args )
3333
@@ -39,6 +39,9 @@ def transaction(
3939 messages : list ,
4040 tx_params : TxParams = TxParams (),
4141 ) -> dict :
42+ if self ._account is None or self ._client is None :
43+ raise ValueError ("Transactor was not initialized due missing secret, unable to transact" )
44+
4245 tx = Transaction (
4346 account = self ._account ,
4447 fee = Coin (denom = tx_params .denom , amount = f"{ tx_params .fee_amount } " ),
@@ -70,6 +73,9 @@ def transaction(
7073 def wait_transaction (
7174 self , tx_hash : str , timeout : float = 120 , pool_period : float = 10
7275 ):
76+ if self ._account is None or self ._client is None :
77+ raise ValueError ("Transactor was not initialized due missing secret, unable to wait transaction" )
78+
7379 start = time .time ()
7480 while 1 :
7581 try :
0 commit comments