astreum 0.2.45__tar.gz → 0.2.47__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 (60) hide show
  1. {astreum-0.2.45/src/astreum.egg-info → astreum-0.2.47}/PKG-INFO +1 -1
  2. {astreum-0.2.45 → astreum-0.2.47}/pyproject.toml +1 -1
  3. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_lispeum/parser.py +25 -25
  4. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_node.py +24 -15
  5. {astreum-0.2.45 → astreum-0.2.47/src/astreum.egg-info}/PKG-INFO +1 -1
  6. {astreum-0.2.45 → astreum-0.2.47}/LICENSE +0 -0
  7. {astreum-0.2.45 → astreum-0.2.47}/README.md +0 -0
  8. {astreum-0.2.45 → astreum-0.2.47}/setup.cfg +0 -0
  9. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/__init__.py +0 -0
  10. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_communication/__init__.py +0 -0
  11. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_communication/message.py +0 -0
  12. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_communication/peer.py +0 -0
  13. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_communication/ping.py +0 -0
  14. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_communication/route.py +0 -0
  15. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_communication/setup.py +0 -0
  16. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_communication/util.py +0 -0
  17. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/__init__.py +0 -0
  18. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/account.py +0 -0
  19. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/accounts.py +0 -0
  20. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/block.py +0 -0
  21. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/chain.py +0 -0
  22. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/fork.py +0 -0
  23. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/genesis.py +0 -0
  24. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/receipt.py +0 -0
  25. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/setup.py +0 -0
  26. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/transaction.py +0 -0
  27. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/workers/__init__.py +0 -0
  28. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/workers/discovery.py +0 -0
  29. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/workers/validation.py +0 -0
  30. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_consensus/workers/verify.py +0 -0
  31. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_lispeum/__init__.py +0 -0
  32. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_lispeum/environment.py +0 -0
  33. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_lispeum/expression.py +0 -0
  34. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_lispeum/high_evaluation.py +0 -0
  35. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_lispeum/low_evaluation.py +0 -0
  36. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_lispeum/meter.py +0 -0
  37. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_lispeum/tokenizer.py +0 -0
  38. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_storage/__init__.py +0 -0
  39. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_storage/atom.py +0 -0
  40. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/_storage/patricia.py +0 -0
  41. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/crypto/__init__.py +0 -0
  42. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/crypto/ed25519.py +0 -0
  43. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/crypto/quadratic_form.py +0 -0
  44. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/crypto/wesolowski.py +0 -0
  45. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/crypto/x25519.py +0 -0
  46. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/format.py +0 -0
  47. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/models/__init__.py +0 -0
  48. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/models/block.py +0 -0
  49. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/models/merkle.py +0 -0
  50. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/models/patricia.py +0 -0
  51. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/node.py +0 -0
  52. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/storage/__init__.py +0 -0
  53. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/storage/object.py +0 -0
  54. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/storage/setup.py +0 -0
  55. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/utils/bytes.py +0 -0
  56. {astreum-0.2.45 → astreum-0.2.47}/src/astreum/utils/integer.py +0 -0
  57. {astreum-0.2.45 → astreum-0.2.47}/src/astreum.egg-info/SOURCES.txt +0 -0
  58. {astreum-0.2.45 → astreum-0.2.47}/src/astreum.egg-info/dependency_links.txt +0 -0
  59. {astreum-0.2.45 → astreum-0.2.47}/src/astreum.egg-info/requires.txt +0 -0
  60. {astreum-0.2.45 → astreum-0.2.47}/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.45
3
+ Version: 0.2.47
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.45"
3
+ version = "0.2.47"
4
4
  authors = [
5
5
  { name="Roy R. O. Okello", email="roy@stelar.xyz" },
6
6
  ]
@@ -1,5 +1,5 @@
1
- from typing import List, Tuple
2
- from src.astreum._lispeum import Expr
1
+ from typing import List, Tuple
2
+ from . import Expr
3
3
 
4
4
  class ParseError(Exception):
5
5
  pass
@@ -27,30 +27,30 @@ def _parse_one(tokens: List[str], pos: int = 0) -> Tuple[Expr, int]:
27
27
  if tok == ')':
28
28
  raise ParseError("unexpected ')'")
29
29
 
30
- # try integer → Bytes (variable-length two's complement)
31
- try:
32
- n = int(tok)
33
- # encode as minimal-width signed two's complement, big-endian
34
- def int_to_min_tc(v: int) -> bytes:
35
- """Return the minimal-width signed two's complement big-endian
36
- byte encoding of integer v. Width expands just enough so that
37
- decoding with signed=True yields the same value and sign.
38
- Example: 0 -> b"\x00", 127 -> b"\x7f", 128 -> b"\x00\x80".
39
- """
40
- if v == 0:
41
- return b"\x00"
42
- w = 1
43
- while True:
44
- try:
45
- return v.to_bytes(w, "big", signed=True)
46
- except OverflowError:
47
- w += 1
48
-
49
- return Expr.Bytes(int_to_min_tc(n)), pos + 1
50
- except ValueError:
51
- return Expr.Symbol(tok), pos + 1
30
+ # try integer → Bytes (variable-length two's complement)
31
+ try:
32
+ n = int(tok)
33
+ # encode as minimal-width signed two's complement, big-endian
34
+ def int_to_min_tc(v: int) -> bytes:
35
+ """Return the minimal-width signed two's complement big-endian
36
+ byte encoding of integer v. Width expands just enough so that
37
+ decoding with signed=True yields the same value and sign.
38
+ Example: 0 -> b"\x00", 127 -> b"\x7f", 128 -> b"\x00\x80".
39
+ """
40
+ if v == 0:
41
+ return b"\x00"
42
+ w = 1
43
+ while True:
44
+ try:
45
+ return v.to_bytes(w, "big", signed=True)
46
+ except OverflowError:
47
+ w += 1
48
+
49
+ return Expr.Bytes(int_to_min_tc(n)), pos + 1
50
+ except ValueError:
51
+ return Expr.Symbol(tok), pos + 1
52
52
 
53
53
  def parse(tokens: List[str]) -> Tuple[Expr, List[str]]:
54
54
  """Parse tokens into an Expr and return (expr, remaining_tokens)."""
55
55
  expr, next_pos = _parse_one(tokens, 0)
56
- return expr, tokens[next_pos:]
56
+ return expr, tokens[next_pos:]
@@ -3,10 +3,19 @@ from typing import Dict, Optional
3
3
  import uuid
4
4
  import threading
5
5
 
6
- from src.astreum._storage.atom import Atom
7
- from src.astreum._lispeum import Env, Expr, low_eval, parse, tokenize, ParseError
8
-
9
- def bytes_touched(*vals: bytes) -> int:
6
+ from ._storage.atom import Atom
7
+ from ._lispeum import Env, Expr, Meter, low_eval, parse, tokenize, ParseError
8
+
9
+ __all__ = [
10
+ "Node",
11
+ "Env",
12
+ "Expr",
13
+ "Meter",
14
+ "parse",
15
+ "tokenize",
16
+ ]
17
+
18
+ def bytes_touched(*vals: bytes) -> int:
10
19
  """For metering: how many bytes were manipulated (max of operands)."""
11
20
  return max((len(v) for v in vals), default=1)
12
21
 
@@ -21,16 +30,16 @@ class Node:
21
30
  self.machine_environments_lock = threading.RLock()
22
31
  self.low_eval = low_eval
23
32
  # Communication and Validation Setup (import lazily to avoid heavy deps during parsing tests)
24
- try:
25
- from astreum._communication import communication_setup # type: ignore
26
- communication_setup(node=self, config=config)
27
- except Exception:
28
- pass
29
- try:
30
- from astreum._consensus import consensus_setup # type: ignore
31
- consensus_setup(node=self, config=config)
32
- except Exception:
33
- pass
33
+ try:
34
+ from astreum._communication import communication_setup # type: ignore
35
+ communication_setup(node=self, config=config)
36
+ except Exception:
37
+ pass
38
+ try:
39
+ from astreum._consensus import consensus_setup # type: ignore
40
+ consensus_setup(node=self, config=config)
41
+ except Exception:
42
+ pass
34
43
 
35
44
 
36
45
 
@@ -75,7 +84,7 @@ class Node:
75
84
  def _network_set(self, atom: Atom) -> None:
76
85
  """Advertise an atom to the closest known peer so they can fetch it from us."""
77
86
  try:
78
- from src.astreum._communication.message import Message, MessageTopic
87
+ from ._communication.message import Message, MessageTopic
79
88
  except Exception:
80
89
  return
81
90
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: astreum
3
- Version: 0.2.45
3
+ Version: 0.2.47
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