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 @@ -772,17 +772,20 @@ async def delete(
772
772
fetched_settings = await fetch_settings ()
773
773
community_wallet_timestamp = fetched_settings .get ("community_wallet_timestamp" )
774
774
community_wallet_address = fetched_settings .get ("community_wallet_address" )
775
- try : # Safety check to ensure account can transact
776
- account .can_transact ()
777
- except Exception as e :
778
- echo (e )
779
- raise typer .Exit (code = 1 ) from e
775
+
780
776
echo ("Deleting the flows..." )
781
777
flow_crn_percent = Decimal ("0.8" ) if community_wallet_timestamp < creation_time else Decimal ("1" )
782
778
flow_com_percent = Decimal ("1" ) - flow_crn_percent
783
- flow_hash_crn = await account .manage_flow (
784
- payment .receiver , Decimal (price .required_tokens ) * flow_crn_percent , FlowUpdate .REDUCE
785
- )
779
+ try :
780
+ flow_hash_crn = await account .manage_flow (
781
+ payment .receiver , Decimal (price .required_tokens ) * flow_crn_percent , FlowUpdate .REDUCE
782
+ )
783
+ except InsufficientFundsError as e :
784
+ echo (f"Error missing token type: { e .token_type } " )
785
+ echo (f"Required : { e .required_funds } " )
786
+ echo (f"Available : { e .available_funds } " )
787
+ raise typer .Exit (code = 1 ) from e
788
+
786
789
if flow_hash_crn :
787
790
echo (f"CRN flow has been deleted successfully (Tx: { flow_hash_crn } )" )
788
791
if flow_com_percent > Decimal ("0" ):
You can’t perform that action at this time.
0 commit comments