File tree 1 file changed +11
-8
lines changed
src/aleph_client/commands/instance
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -767,17 +767,20 @@ async def delete(
767
767
fetched_settings = await fetch_settings ()
768
768
community_wallet_timestamp = fetched_settings .get ("community_wallet_timestamp" )
769
769
community_wallet_address = fetched_settings .get ("community_wallet_address" )
770
- try : # Safety check to ensure account can transact
771
- account .can_transact ()
772
- except Exception as e :
773
- echo (e )
774
- raise typer .Exit (code = 1 ) from e
770
+
775
771
echo ("Deleting the flows..." )
776
772
flow_crn_percent = Decimal ("0.8" ) if community_wallet_timestamp < creation_time else Decimal ("1" )
777
773
flow_com_percent = Decimal ("1" ) - flow_crn_percent
778
- flow_hash_crn = await account .manage_flow (
779
- payment .receiver , Decimal (price .required_tokens ) * flow_crn_percent , FlowUpdate .REDUCE
780
- )
774
+ try :
775
+ flow_hash_crn = await account .manage_flow (
776
+ payment .receiver , Decimal (price .required_tokens ) * flow_crn_percent , FlowUpdate .REDUCE
777
+ )
778
+ except InsufficientFundsError as e :
779
+ echo (f"Error missing token type: { e .token_type } " )
780
+ echo (f"Required : { e .required_funds } " )
781
+ echo (f"Available : { e .available_funds } " )
782
+ raise typer .Exit (code = 1 ) from e
783
+
781
784
if flow_hash_crn :
782
785
echo (f"CRN flow has been deleted successfully (Tx: { flow_hash_crn } )" )
783
786
if flow_com_percent > Decimal ("0" ):
You can’t perform that action at this time.
0 commit comments