Skip to content

Commit

Permalink
Merge #bdc9157 into Windows. Update pyinstall spec file with mospy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
freQniK committed Oct 9, 2024
1 parent 3bb17ec commit 9933fe2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 48 deletions.
2 changes: 1 addition & 1 deletion meile_gui.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ binaries = []
hiddenimports = []
tmp_ret = collect_all('bip_utils')
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
tmp_ret = collect_all('mospy_wallet')
tmp_ret = collect_all('mospy')
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
tmp_ret = collect_all('sentinel_protobuf')
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
Expand Down
10 changes: 6 additions & 4 deletions src/cli/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,15 @@ def send_2plan_wallet(self, KEYNAME, plan_id, DENOM, amount_required):
# token_ibc (k: v) is a dict like: {'uscrt': 'ibc/31FEE1A2A9F9C01113F90BD0BBCCE8FD6BBB8585FAF109A2101827DD1D5B95B8', 'uatom': 'ibc/A8C2D23A1E6
token_ibc = {k: v for k, v in IBCTokens.IBCUNITTOKEN.items()}
DENOM = token_ibc.get(DENOM, DENOM)


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

tx_params = TxParams(
# denom="udvpn", # TODO: from ConfParams
# fee_amount=20000, # TODO: from ConfParams
gas=ConfParams.GAS,
gas=gas,
gas_multiplier=ConfParams.GASADJUSTMENT,
fee_amount=ConfParams.FEE
#fee_amount=ConfParams.FEE
)

tx = Transaction(
Expand All @@ -354,7 +356,7 @@ def send_2plan_wallet(self, KEYNAME, plan_id, DENOM, amount_required):
tx.add_msg(
tx_type='transfer',
sender=sdk._account,
receipient=MEILE_PLAN_WALLET,
recipient=MEILE_PLAN_WALLET,
# receipient=sdk._account.address, # TODO: debug send to myself
amount=amount_required,
denom=DENOM,
Expand Down
8 changes: 5 additions & 3 deletions src/typedef/konstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class HTTParams():
]
GRPC = "grpc.ungovernable.dev:443"
GRPCS = [GRPC] + [
"grc.mathnodes.com:443",
"grpc.mathnodes.com:443",
"grpc.dvpn.me:443",
"grpc.noncompliant.network:443",
"grpc.ungovernable.dev:443",
Expand Down Expand Up @@ -545,8 +545,8 @@ class IBCTokens():
#mu_coins = ["tsent", "udvpn", "uscrt", "uosmo", "uatom", "udec"]
class TextStrings():
dash = "-"
VERSION = "2.0.0-beta6"
BUILD = "1727851832347"
VERSION = "v2.0.0-beta6.1"
BUILD = "1728465227960"
RootTag = "SENTINEL"
PassedHealthCheck = "Passed Sentinel Health Check"
FailedHealthCheck = "Failed Sentinel Health Check"
Expand Down Expand Up @@ -676,6 +676,8 @@ class NodeKeys():








64 changes: 24 additions & 40 deletions src/ui/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
from unidecode import unidecode
from datetime import datetime
import json
from treelib.exceptions import NodeIDAbsentError


class WalletRestore(Screen):
screemanager = ObjectProperty()
Expand Down Expand Up @@ -1694,41 +1696,7 @@ def __init__(self, node_tree, **kwargs):
self.remove_loading_widget(None)
self.sub_address_error()
return

def GetSubscriptions(self):
mw = Meile.app.root.get_screen(WindowNames.MAIN_WINDOW)



'''
Make this a background thread and not on main loop
Remove ThreadWtithResult dep.
Add loading bar or spinning wheel
'''
try:
print("Staring thread...")
#self.NodeTree.get_subscriptions(self.address)

t = Thread(target=lambda: self.NodeTree.get_subscriptions(self.address))
t.start()
l = 13
pool = l*100
inc = float(1/pool)
while t.is_alive():
yield 0.0165
self.cd.ids.pb.value += inc
print("Thread completed.")
self.cd.ids.pb.value = 1
#thread = ThreadWithResult(target=self.NodeTree.get_subscriptions, args=(self.address,))
#thread.start()
#thread.join()

mw.NodeTree.SubResult = deepcopy(self.NodeTree.SubResult)
print(mw.NodeTree.SubResult)
except Exception as e:
print(str(e))
return None

@delayable
def subs_callback(self, dt):
yield 0.314
Expand Down Expand Up @@ -2024,8 +1992,8 @@ def __init__(self, **kwargs):
http = Request.hadapter()

req = http.get(HTTParams.PLAN_API + HTTParams.API_PLANS, auth=HTTPBasicAuth(scrtsxx.PLANUSERNAME, scrtsxx.PLANPASSWORD))
plan_data = req.json()
print(plan_data)
plan_data = req.json() if req.ok and req.status_code != 404 else []
#print(plan_data)

# Prevent plan parsing when wallet is not initialized
user_enrolled_plans = []
Expand All @@ -2036,9 +2004,25 @@ def __init__(self, **kwargs):
user_enrolled_plans = req2.json() if req2.ok and req2.status_code != 404 else []

for pd in plan_data:
self.build_plans( pd, user_enrolled_plans)
req3 = http.get(HTTParams.PLAN_API + HTTParams.API_PLANS_NODES % pd['uuid'], auth=HTTPBasicAuth(scrtsxx.PLANUSERNAME, scrtsxx.PLANPASSWORD))
plan_nodes = req3.json() if req3.ok and req3.status_code != 404 else []
no_of_nodes = len(plan_nodes)
countries = []
no_of_countries = 0
for node in plan_nodes:
node_data = self.mw.NodeTree.NodeTree.get_node(node)
try:
if node_data.data['Country'] in countries:
continue
else:
no_of_countries += 1
countries.append(node_data.data['Country'])
except AttributeError as e:
print(f"{node}: {str(e)}")
continue
self.build_plans( pd, user_enrolled_plans, no_of_nodes, no_of_countries)

def build_plans(self, data, plans):
def build_plans(self, data, plans, no_of_nodes, no_of_countries):
plan = None
for p in plans:
if data['uuid'] == p['uuid']:
Expand All @@ -2051,8 +2035,8 @@ def build_plans(self, data, plans):
item = PlanAccordion(
node=PlanRow(
plan_name=data['plan_name'],
num_of_nodes=str(45),
num_of_countries=str(30),
num_of_nodes=str(no_of_nodes),
num_of_countries=str(no_of_countries),
cost=str(round(float(data['plan_price'] / IBCTokens.SATOSHI),2)) + data['plan_denom'],
logo_image=data['logo'],
uuid=data['uuid'],
Expand Down

0 comments on commit 9933fe2

Please sign in to comment.