astreum 0.2.3__py3-none-any.whl → 0.2.4__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.

Potentially problematic release.


This version of astreum might be problematic. Click here for more details.

astreum/node.py CHANGED
@@ -705,6 +705,16 @@ class Node:
705
705
  env_id = uuid.uuid4()
706
706
  self.environments[env_id] = Env(parent_id=parent_id)
707
707
  return env_id
708
+
709
+ def machine_get_or_create_environment(self, env_id: Optional[uuid.UUID] = None, parent_id: Optional[uuid.UUID] = None) -> uuid.UUID:
710
+ with self.machine_environments_lock:
711
+ if env_id is not None and env_id in self.environments:
712
+ return env_id
713
+ new_id = env_id if env_id is not None else uuid.uuid4()
714
+ while new_id in self.environments:
715
+ new_id = uuid.uuid4()
716
+ self.environments[new_id] = Env(parent_id=parent_id)
717
+ return new_id
708
718
 
709
719
  def machine_delete_environment(self, env_id: uuid.UUID) -> bool:
710
720
  with self.machine_environments_lock:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: astreum
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Python library to interact with the Astreum blockchain and its Lispeum virtual machine.
5
5
  Author-email: "Roy R. O. Okello" <roy@stelar.xyz>
6
6
  Project-URL: Homepage, https://github.com/astreum/lib
@@ -1,6 +1,6 @@
1
1
  astreum/__init__.py,sha256=y2Ok3EY_FstcmlVASr80lGR_0w-dH-SXDCCQFmL6uwA,28
2
2
  astreum/format.py,sha256=X4tG5GGPweNCE54bHYkLFiuLTbmpy5upO_s1Cef-MGA,2711
3
- astreum/node.py,sha256=KoNnrD4au1_-Uh-7D5P79VhQ_1Yq8gFgJ8nptxMTMps,45850
3
+ astreum/node.py,sha256=tbU8FNbZeI8mWO3SJriwZsIP0vPhwDnn5sCpMfTZsBY,46378
4
4
  astreum/_node/__init__.py,sha256=7yz1YHo0DCUgUQvJf75qdUo_ocl5-XZRU-Vc2NhcvJs,18639
5
5
  astreum/_node/utils.py,sha256=Zj4NtbmJ9CWFO3oBvYYauwOiLcpd219qCyGvgTw9Lak,704
6
6
  astreum/_node/relay/__init__.py,sha256=A6br8QSGLW7qmKYBJNIC4bEf5QMzLBFaa_FH3MaOJrs,15069
@@ -49,8 +49,8 @@ astreum/lispeum/special/number/addition.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
49
49
  astreum/machine/__init__.py,sha256=GOdZl1tS9uIJHbq5WVcplifMDPDLQroX7CVew-K2YbA,15262
50
50
  astreum/machine/environment.py,sha256=QsRaDtAIwlkH8Cn-F7Zzuvx2eXcwLys2M5vdsP1omrI,84
51
51
  astreum/machine/error.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
- astreum-0.2.3.dist-info/licenses/LICENSE,sha256=gYBvRDP-cPLmTyJhvZ346QkrYW_eleke4Z2Yyyu43eQ,1089
53
- astreum-0.2.3.dist-info/METADATA,sha256=5P15fXrZFiisMKlHJEURSDlzawm1sJjwzuajgVC9Swo,5453
54
- astreum-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
- astreum-0.2.3.dist-info/top_level.txt,sha256=1EG1GmkOk3NPmUA98FZNdKouhRyget-KiFiMk0i2Uz0,8
56
- astreum-0.2.3.dist-info/RECORD,,
52
+ astreum-0.2.4.dist-info/licenses/LICENSE,sha256=gYBvRDP-cPLmTyJhvZ346QkrYW_eleke4Z2Yyyu43eQ,1089
53
+ astreum-0.2.4.dist-info/METADATA,sha256=Bapxtz6Heu4UUh2SxiplnWu2LMBz1_gWtU6Vq_LY6YQ,5453
54
+ astreum-0.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
+ astreum-0.2.4.dist-info/top_level.txt,sha256=1EG1GmkOk3NPmUA98FZNdKouhRyget-KiFiMk0i2Uz0,8
56
+ astreum-0.2.4.dist-info/RECORD,,