Skip to content

Commit 04a7428

Browse files
committed
Fix bug in pay plan w/ wallet intro. in 2.0.6. Fix bug in app.theme fail dialog
1 parent c83906e commit 04a7428

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

src/cli/wallet.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,25 +321,27 @@ def send_2plan_wallet(self, KEYNAME, plan_id, DENOM, amount_required, tax: bool=
321321
balance = self.get_balance(sdk._account.address)
322322
print(balance)
323323

324-
amount_required = float(amount_required) # Just in case was passed as str
325-
token_ibc = {v: k for k, v in IBCTokens.IBCUNITTOKEN.items()}
326-
ubalance = balance.get(token_ibc[DENOM][1:], 0) * IBCTokens.SATOSHI
327-
# Get balance automatically return udvpn ad dvpn
328-
if ubalance < amount_required:
329-
message = f"Balance is too low, required: {amount_required}{DENOM}"
330-
return (False, {'hash' : None, 'success' : False, 'message' : message})
324+
amount_required = int(amount_required) # Just in case was passed as str
331325

332326
# F***ck we have always a unit issue ...
333327
if DENOM == "dvpn":
334328
print(f"Denom is a dvpn, convert as udvpn, amount_required: {amount_required}dvpn")
335329
DENOM = "udvpn"
336-
amount_required = int(round(amount_required * IBCTokens.SATOSHI, 4))
337-
print(f"amount_required: {amount_required}udvpn")
330+
ubalance = balance.get("dvpn", 0) * IBCTokens.SATOSHI
338331
else:
339332
# I need to convert osmo, atom etc to ibc denom
340333
# token_ibc (k: v) is a dict like: {'uscrt': 'ibc/31FEE1A2A9F9C01113F90BD0BBCCE8FD6BBB8585FAF109A2101827DD1D5B95B8', 'uatom': 'ibc/A8C2D23A1E6
341334
token_ibc = {k: v for k, v in IBCTokens.IBCUNITTOKEN.items()}
342335
DENOM = token_ibc.get(DENOM, DENOM)
336+
ubalance = balance.get(token_ibc[DENOM][1:], 0) * IBCTokens.SATOSHI
337+
338+
print(ubalance)
339+
print(f"amount_required: {amount_required}{DENOM}")
340+
341+
# Get balance automatically return udvpn ad dvpn
342+
if ubalance < amount_required:
343+
message = f"Balance is too low, required: {amount_required}{DENOM}"
344+
return (False, {'hash' : None, 'success' : False, 'message' : message})
343345

344346
gas = random.randint(ConfParams.GAS-50000, 314159)
345347

src/typedef/konstants.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ class IBCTokens():
558558
#mu_coins = ["tsent", "udvpn", "uscrt", "uosmo", "uatom", "udec"]
559559
class TextStrings():
560560
dash = "-"
561-
VERSION = "v2.0.4"
562-
BUILD = "1733738460383"
561+
VERSION = "v2.0.7"
562+
BUILD = "1734702982077"
563563
RootTag = "SENTINEL"
564564
PassedHealthCheck = "Passed Sentinel Health Check"
565565
FailedHealthCheck = "Failed Sentinel Health Check"
@@ -722,6 +722,22 @@ class NodeKeys():
722722

723723

724724

725+
726+
727+
728+
729+
730+
731+
732+
733+
734+
735+
736+
737+
738+
739+
740+
725741

726742

727743

src/ui/widgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ def pay_meile_plan_with_wallet(self, deposit, mu_coin, usd, on_success: callable
10361036
KEYNAME = CONFIG['wallet'].get('keyname', '')
10371037

10381038
hwf = HandleWalletFunctions()
1039-
result, output = hwf.send_2plan_wallet(KEYNAME, self.plan_id, mu_coin, deposit)
1039+
result, output = hwf.send_2plan_wallet(KEYNAME, self.plan_id, mu_coin, int(round(float(deposit),4)*IBCTokens.SATOSHI))
10401040
print("result", result)
10411041
print("output", output)
10421042

@@ -1061,7 +1061,7 @@ def pay_meile_plan_with_wallet(self, deposit, mu_coin, usd, on_success: callable
10611061
MDFlatButton(
10621062
text="OK",
10631063
theme_text_color="Custom",
1064-
text_color=self.theme_cls.primary_color,
1064+
text_color=MeileColors.MEILE,
10651065
on_release=self.closeDialog
10661066
),])
10671067
if isinstance(output, dict) is True:

0 commit comments

Comments
 (0)