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.
- {astreum-0.2.42/src/astreum.egg-info → astreum-0.2.43}/PKG-INFO +1 -1
- {astreum-0.2.42 → astreum-0.2.43}/pyproject.toml +1 -1
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/account.py +1 -1
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/block.py +2 -2
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/transaction.py +2 -2
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/workers/verify.py +1 -1
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_node.py +15 -3
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_storage/patricia.py +2 -2
- {astreum-0.2.42 → astreum-0.2.43/src/astreum.egg-info}/PKG-INFO +1 -1
- {astreum-0.2.42 → astreum-0.2.43}/LICENSE +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/README.md +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/setup.cfg +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/__init__.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/__init__.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/message.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/peer.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/ping.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/route.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/setup.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_communication/util.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/__init__.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/accounts.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/chain.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/fork.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/genesis.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/receipt.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/setup.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/workers/__init__.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/workers/discovery.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_consensus/workers/validation.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/__init__.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/environment.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/expression.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/high_evaluation.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/low_evaluation.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/meter.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/parser.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_lispeum/tokenizer.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_storage/__init__.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/_storage/atom.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/__init__.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/ed25519.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/quadratic_form.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/wesolowski.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/crypto/x25519.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/format.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/models/__init__.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/models/block.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/models/merkle.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/models/patricia.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/node.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/storage/__init__.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/storage/object.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/storage/setup.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum/utils/integer.py +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum.egg-info/SOURCES.txt +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum.egg-info/dependency_links.txt +0 -0
- {astreum-0.2.42 → astreum-0.2.43}/src/astreum.egg-info/requires.txt +0 -0
- {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.
|
|
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
|
|
@@ -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.
|
|
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 =
|
|
189
|
+
storage_get = source.storage_get
|
|
190
190
|
if not callable(storage_get):
|
|
191
|
-
raise TypeError("Block.from_atom requires a node with '
|
|
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.
|
|
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(
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|