@@ -38,14 +38,16 @@ async def display_stake_movement_cross_subnets(
38
38
39
39
if origin_netuid == destination_netuid :
40
40
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 )
43
43
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
+ )
46
49
raise ValueError
47
50
48
- received_amount = subnet .tao_to_alpha (received_amount_tao )
49
51
price = subnet .price .tao
50
52
price_str = (
51
53
str (float (price ))
@@ -60,13 +62,15 @@ async def display_stake_movement_cross_subnets(
60
62
price_destination = dynamic_destination .price .tao
61
63
rate = price_origin / (price_destination or 1 )
62
64
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 )
65
66
received_amount = dynamic_destination .tao_to_alpha (received_amount_tao )
66
67
received_amount .set_unit (destination_netuid )
67
68
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
+ )
70
74
raise ValueError
71
75
72
76
price_str = (
0 commit comments