astreum 0.2.42__tar.gz → 0.2.43__tar.gz

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.

Files changed (59) hide show
  1. {astreum-0.2.42/src/astreum.egg-info → astreum-0.2.43}/PKG-INFO +1 -1
  2. {astreum-0.2.42 → astreum-0.2.43}/pyproject.toml +1 -1
  3. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/account.py +1 -1
  4. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/block.py +2 -2
  5. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/transaction.py +2 -2
  6. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/workers/verify.py +1 -1
  7. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_node.py +15 -3
  8. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_storage/patricia.py +2 -2
  9. {astreum-0.2.42 → astreum-0.2.43/src/astreum.egg-info}/PKG-INFO +1 -1
  10. {astreum-0.2.42 → astreum-0.2.43}/LICENSE +0 -0
  11. {astreum-0.2.42 → astreum-0.2.43}/README.md +0 -0
  12. {astreum-0.2.42 → astreum-0.2.43}/setup.cfg +0 -0
  13. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/__init__.py +0 -0
  14. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/__init__.py +0 -0
  15. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/message.py +0 -0
  16. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/peer.py +0 -0
  17. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/ping.py +0 -0
  18. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/route.py +0 -0
  19. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/setup.py +0 -0
  20. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/util.py +0 -0
  21. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/__init__.py +0 -0
  22. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/accounts.py +0 -0
  23. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/chain.py +0 -0
  24. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/fork.py +0 -0
  25. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/genesis.py +0 -0
  26. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/receipt.py +0 -0
  27. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/setup.py +0 -0
  28. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/workers/__init__.py +0 -0
  29. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/workers/discovery.py +0 -0
  30. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/workers/validation.py +0 -0
  31. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/__init__.py +0 -0
  32. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/environment.py +0 -0
  33. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/expression.py +0 -0
  34. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/high_evaluation.py +0 -0
  35. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/low_evaluation.py +0 -0
  36. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/meter.py +0 -0
  37. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/parser.py +0 -0
  38. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/tokenizer.py +0 -0
  39. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_storage/__init__.py +0 -0
  40. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_storage/atom.py +0 -0
  41. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/__init__.py +0 -0
  42. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/ed25519.py +0 -0
  43. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/quadratic_form.py +0 -0
  44. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/wesolowski.py +0 -0
  45. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/x25519.py +0 -0
  46. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/format.py +0 -0
  47. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/models/__init__.py +0 -0
  48. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/models/block.py +0 -0
  49. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/models/merkle.py +0 -0
  50. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/models/patricia.py +0 -0
  51. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/node.py +0 -0
  52. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/storage/__init__.py +0 -0
  53. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/storage/object.py +0 -0
  54. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/storage/setup.py +0 -0
  55. {astreum-0.2.42 → astreum-0.2.43}/src/astreum/utils/integer.py +0 -0
  56. {astreum-0.2.42 → astreum-0.2.43}/src/astreum.egg-info/SOURCES.txt +0 -0
  57. {astreum-0.2.42 → astreum-0.2.43}/src/astreum.egg-info/dependency_links.txt +0 -0
  58. {astreum-0.2.42 → astreum-0.2.43}/src/astreum.egg-info/requires.txt +0 -0
  59. {astreum-0.2.42 → astreum-0.2.43}/src/astreum.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: astreum
3
- Version: 0.2.42
3
+ Version: 0.2.43
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
  [project]
2
2
  name = "astreum"
3
- version = "0.2.42"
3
+ version = "0.2.43"
4
4
  authors = [
5
5
  { name="Roy R. O. Okello", email="roy@stelar.xyz" },
6
6
  ]
@@ -33,7 +33,7 @@ class Account:
33
33
 
34
34
  @classmethod
35
35
  def from_atom(cls, node: Any, account_id: bytes) -> "Account":
36
- storage_get = node._local_get
36
+ storage_get = node.storage_get
37
37
 
38
38
  type_atom = storage_get(account_id)
39
39
  if type_atom is None or type_atom.data != b"account":
@@ -186,9 +186,9 @@ class Block:
186
186
  if callable(source):
187
187
  storage_get = source
188
188
  else:
189
- storage_get = getattr(source, "_local_get", None)
189
+ storage_get = source.storage_get
190
190
  if not callable(storage_get):
191
- raise TypeError("Block.from_atom requires a node with '_local_get' or a callable storage getter")
191
+ raise TypeError("Block.from_atom requires a node with 'storage_get' or a callable storage getter")
192
192
  # 1) Expect main list
193
193
  main_typ = storage_get(block_id)
194
194
  if main_typ is None or main_typ.data != b"list":
@@ -76,7 +76,7 @@ class Transaction:
76
76
  node: Any,
77
77
  transaction_id: bytes,
78
78
  ) -> Transaction:
79
- storage_get = node._local_get
79
+ storage_get = node.storage_get
80
80
  if not callable(storage_get):
81
81
  raise NotImplementedError("node does not expose a storage getter")
82
82
 
@@ -204,7 +204,7 @@ def apply_transaction(node: Any, block: object, transaction_hash: bytes) -> None
204
204
 
205
205
  block.accounts.set_account(address=recipient_account)
206
206
 
207
- block.transactions.append(transaction)
207
+ block.transactions.append(transaction_hash)
208
208
 
209
209
  receipt = Receipt(
210
210
  transaction_hash=bytes(transaction_hash),
@@ -17,7 +17,7 @@ def _process_peers_latest_block(
17
17
  fk.head for fk in node.forks.values() if fk.head != latest_block_hash
18
18
  }
19
19
 
20
- new_fork.validate(storage_get=node._local_get, stop_heads=current_fork_heads)
20
+ new_fork.validate(storage_get=node.storage_get, stop_heads=current_fork_heads)
21
21
 
22
22
  if new_fork.validated_upto and new_fork.validated_upto in node.forks:
23
23
  ref = node.forks[new_fork.validated_upto]
@@ -25,9 +25,9 @@ class Node:
25
25
  communication_setup(node=self, config=config)
26
26
  except Exception:
27
27
  pass
28
- try:
29
- from astreum._consensus import consensus_setup # type: ignore
30
- consensus_setup(node=self)
28
+ try:
29
+ from astreum._consensus import consensus_setup # type: ignore
30
+ consensus_setup(node=self)
31
31
  except Exception:
32
32
  pass
33
33
 
@@ -56,3 +56,15 @@ class Node:
56
56
  def _local_set(self, key: bytes, value: Atom) -> None:
57
57
  with self.in_memory_storage_lock:
58
58
  self.in_memory_storage[key] = value
59
+
60
+ def _network_get(self, key: bytes) -> Optional[Atom]:
61
+ # locate storage provider
62
+ # query storage provider
63
+ return None
64
+
65
+ def storage_get(self, key: bytes) -> Optional[Atom]:
66
+ """Retrieve an Atom by checking local storage first, then the network."""
67
+ atom = self._local_get(key)
68
+ if atom is not None:
69
+ return atom
70
+ return self._network_get(key)
@@ -87,7 +87,7 @@ class PatriciaNode:
87
87
  hops = 0
88
88
 
89
89
  while current != ZERO32 and hops < 4:
90
- atom = node._local_get(current)
90
+ atom = node.storage_get(current)
91
91
  if atom is None:
92
92
  raise ValueError("missing atom while decoding Patricia node")
93
93
  entries.append(atom.data)
@@ -163,7 +163,7 @@ class PatriciaTrie:
163
163
  if cached is not None:
164
164
  return cached
165
165
 
166
- if storage_node._local_get(h) is None:
166
+ if storage_node.storage_get(h) is None:
167
167
  return None
168
168
 
169
169
  pat_node = PatriciaNode.from_atoms(storage_node, h)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: astreum
3
- Version: 0.2.42
3
+ Version: 0.2.43
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
File without changes
File without changes
File without changes
File without changes
File without changes