@@ -38,14 +38,16 @@ async def display_stake_movement_cross_subnets(
3838
3939 if origin_netuid == destination_netuid :
4040 subnet = await subtensor .subnet (origin_netuid )
41- received_amount_tao = subnet .alpha_to_tao (amount_to_move )
42- received_amount_tao -= stake_fee
41+ received_amount_tao = subnet .alpha_to_tao (amount_to_move - stake_fee )
42+ received_amount = subnet . tao_to_alpha ( received_amount_tao )
4343
44- if received_amount_tao < Balance .from_tao (0 ):
45- print_error ("Not enough Alpha to pay the transaction fee." )
44+ if received_amount < Balance .from_tao (0 ).set_unit (destination_netuid ):
45+ print_error (
46+ f"Not enough Alpha to pay the transaction fee. The fee is { stake_fee } , "
47+ f"which would set the total received to { received_amount } ."
48+ )
4649 raise ValueError
4750
48- received_amount = subnet .tao_to_alpha (received_amount_tao )
4951 price = subnet .price .tao
5052 price_str = (
5153 str (float (price ))
@@ -60,13 +62,15 @@ async def display_stake_movement_cross_subnets(
6062 price_destination = dynamic_destination .price .tao
6163 rate = price_origin / (price_destination or 1 )
6264
63- received_amount_tao = dynamic_origin .alpha_to_tao (amount_to_move )
64- received_amount_tao -= stake_fee
65+ received_amount_tao = dynamic_origin .alpha_to_tao (amount_to_move - stake_fee )
6566 received_amount = dynamic_destination .tao_to_alpha (received_amount_tao )
6667 received_amount .set_unit (destination_netuid )
6768
68- if received_amount < Balance .from_tao (0 ):
69- print_error ("Not enough Alpha to pay the transaction fee." )
69+ if received_amount < Balance .from_tao (0 ).set_unit (destination_netuid ):
70+ print_error (
71+ f"Not enough Alpha to pay the transaction fee. The fee is { stake_fee } , "
72+ f"which would set the total received to { received_amount } ."
73+ )
7074 raise ValueError
7175
7276 price_str = (
0 commit comments