naeural-client 2.4.3__py3-none-any.whl → 2.4.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
naeural_client/_ver.py CHANGED
@@ -1,4 +1,4 @@
1
- __VER__ = "2.4.3"
1
+ __VER__ = "2.4.5"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
naeural_client/bc/base.py CHANGED
@@ -512,6 +512,31 @@ class BaseBlockEngine:
512
512
  path = os.path.join(folder, BCct.AUTHORISED_ADDRS)
513
513
  return path
514
514
 
515
+
516
+ def address_is_valid(self, address):
517
+ """
518
+ Checks if an address is valid
519
+
520
+ Parameters
521
+ ----------
522
+ address : str
523
+ the text address.
524
+
525
+ Returns
526
+ -------
527
+ bool
528
+ True if the address is valid.
529
+
530
+ """
531
+ result = False
532
+ try:
533
+ pk = self._address_to_pk(address)
534
+ result = False if pk is None else True
535
+ except:
536
+ result = False
537
+ return result
538
+
539
+
515
540
  def _load_and_maybe_create_allowed(self):
516
541
  fn = self._get_allowed_file()
517
542
  lst_allowed = []
@@ -526,7 +551,13 @@ class BaseBlockEngine:
526
551
  lst_allowed = [x.strip() for x in lst_allowed]
527
552
  lst_allowed = [x.split()[0] for x in lst_allowed if x != '']
528
553
  lst_allowed = [self._remove_prefix(x) for x in lst_allowed if x != '']
529
- return lst_allowed
554
+ lst_final = []
555
+ for allowed in lst_allowed:
556
+ if not self.address_is_valid(allowed):
557
+ self.P("WARNING: address <{}> is not valid. Removing from allowed list.".format(allowed), color='r')
558
+ else:
559
+ lst_final.append(allowed)
560
+ return lst_final
530
561
 
531
562
 
532
563
  def _remove_prefix(self, address):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naeural_client
3
- Version: 2.4.3
3
+ Version: 2.4.5
4
4
  Summary: `naeural_client` is the Python SDK required for client app development for the Naeural Edge Protocol Edge Protocol framework
5
5
  Project-URL: Homepage, https://github.com/NaeuralEdgeProtocol/naeural_client
6
6
  Project-URL: Bug Tracker, https://github.com/NaeuralEdgeProtocol/naeural_client/issues
@@ -1,5 +1,5 @@
1
1
  naeural_client/__init__.py,sha256=UKEDGS0wFYyxwmhEAKJGecO2vYbIfRYUP4SQgnK10IE,578
2
- naeural_client/_ver.py,sha256=MpzR_cSF0_I4RO9GF7IPkGfnxrL5sCmKqm5MMjUwiBg,330
2
+ naeural_client/_ver.py,sha256=CTLHgI0Y2uIE3BanodEk4GCQee9z1YIQ-C9czWQwqK0,330
3
3
  naeural_client/base_decentra_object.py,sha256=wXjl65gWxxkhV6Tq48wFfNGITvdYdkKPT-wLurGB5vc,4287
4
4
  naeural_client/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
5
5
  naeural_client/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
@@ -13,7 +13,7 @@ naeural_client/base/transaction.py,sha256=bfs6td5M0fINgPQNxhrl_AUjb1YiilLDQ-Cd_o
13
13
  naeural_client/base/payload/__init__.py,sha256=y8fBI8tG2ObNfaXFWjyWZXwu878FRYj_I8GIbHT4GKE,29
14
14
  naeural_client/base/payload/payload.py,sha256=v50D7mBBD2WwWzvpbRGMSr-X6vv5ie21IY1aDxTqe1c,2275
15
15
  naeural_client/bc/__init__.py,sha256=FQj23D1PrY06NUOARiKQi4cdj0-VxnoYgYDEht8lpr8,158
16
- naeural_client/bc/base.py,sha256=i8xv19VBhWXcN4IRpphQS9YYmoM_6rWvPiCzBxV3KZY,30840
16
+ naeural_client/bc/base.py,sha256=VRIM7SWLqHf1vEOFoxdkQpv1P3zEPeEWsfQBW3N86_w,31497
17
17
  naeural_client/bc/chain.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  naeural_client/bc/ec.py,sha256=mWjodWCRgC3omVXOA9jtNdtPVNn2kMKV3Dcjt9oFUCQ,22974
19
19
  naeural_client/certs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -80,8 +80,8 @@ naeural_client/utils/__init__.py,sha256=mAnke3-MeRzz3nhQvhuHqLnpaaCSmDxicd7Ck9uw
80
80
  naeural_client/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,1072
81
81
  naeural_client/utils/config.py,sha256=t_VzyBnRHJa-Kt71HUu9gXxeDOri1Aqf_-gjO04gAYs,3681
82
82
  naeural_client/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
83
- naeural_client-2.4.3.dist-info/METADATA,sha256=MOvZQAnvWcIb9FfUCrNBA4ZbRAhvgdSl_17aZSuKIsE,14471
84
- naeural_client-2.4.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
85
- naeural_client-2.4.3.dist-info/entry_points.txt,sha256=PNdyotDaQBAslZREx5luVyj0kqpQnwNACwkFNTPIHU4,55
86
- naeural_client-2.4.3.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
87
- naeural_client-2.4.3.dist-info/RECORD,,
83
+ naeural_client-2.4.5.dist-info/METADATA,sha256=eRkqlFFNchLV2i8hAWL8btqvdTfBm5is8N_QpipALl4,14471
84
+ naeural_client-2.4.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
85
+ naeural_client-2.4.5.dist-info/entry_points.txt,sha256=PNdyotDaQBAslZREx5luVyj0kqpQnwNACwkFNTPIHU4,55
86
+ naeural_client-2.4.5.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
87
+ naeural_client-2.4.5.dist-info/RECORD,,