From e69a0d82e3628a26157dec47b371a8eb6a8b7be0 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 24 Oct 2024 21:26:38 -0400 Subject: [PATCH 1/2] drop 3 8 --- .github/workflows/benchmark.yml | 2 +- .github/workflows/build-riscv64.yml | 2 - .github/workflows/build-wheels.yml | 16 +- README.md | 2 +- bump-version.py | 6 +- crates/chia-tools/parse-analyze-chain.py | 3 +- tests/merkle_set.py | 50 +- tests/run_gen.py | 4 +- tests/test_additions_and_removals.py | 8 +- tests/test_block_record_fidelity.py | 6 +- tests/test_blscache.py | 11 +- tests/test_blspy_fidelity.py | 2 +- tests/test_merkle_set.py | 16 +- tests/test_program_fidelity.py | 4 +- tests/test_spend_bundle.py | 3 +- tests/test_struct_stream.py | 10 +- wheel/generate_type_stubs.py | 94 ++-- wheel/python/chia_rs/chia_rs.pyi | 568 +++++++++++------------ wheel/python/chia_rs/sized_byte_class.py | 11 +- wheel/python/chia_rs/struct_stream.py | 9 +- 20 files changed, 404 insertions(+), 423 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7110562d8..60ba4ee95 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [macos-latest, ubuntu-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] env: stubtest_args: ${{ matrix.python-version == '3.11' && '--allowlist wheel/stubtest.allowlist.3-11-plus' || ''}} diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index 57708ccf3..b38051c97 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -54,8 +54,6 @@ jobs: matrix: os: [ubuntu-latest] python: - - major-dot-minor: "3.8" - matrix: "3.8" - major-dot-minor: "3.9" matrix: "3.9" - major-dot-minor: "3.10" diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 27fd6a386..d704aac77 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -41,18 +41,6 @@ jobs: runs-on: intel: [windows-latest] python: - - major-dot-minor: "3.8" - cibw-build: "cp38-*" - by-arch: - arm: - manylinux-version: 2_28 - docker-url: ghcr.io/chia-network/build-images/centos-pypa-rust-aarch64 - rustup-target: aarch64-unknown-linux-musl - intel: - manylinux-version: 2_28 - docker-url: ghcr.io/chia-network/build-images/centos-pypa-rust-x86_64 - rustup-target: x86_64-unknown-linux-musl - matrix: "3.8" - major-dot-minor: "3.9" cibw-build: "cp39-*" by-arch: @@ -235,8 +223,8 @@ jobs: arm: [Linux, ARM64] intel: [ubuntu-latest] python: - - major-dot-minor: "3.8" - matrix: "3.8" + - major-dot-minor: "3.9" + matrix: "3.9" arch: - name: Intel matrix: intel diff --git a/README.md b/README.md index 19884df0c..1fc76308a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ A collection of Rust crates for working with the Chia blockchain. There are also ## Prerequisites -- [Python](https://www.python.org/downloads/) 3.8 or higher installed. +- [Python](https://www.python.org/downloads/) 3.9 or higher installed. - The [Rust toolchain](https://rustup.rs/) must be installed. ## Unit Tests diff --git a/bump-version.py b/bump-version.py index 511b7021b..70f2382fd 100644 --- a/bump-version.py +++ b/bump-version.py @@ -7,7 +7,7 @@ import re import sys from pathlib import Path -from typing import Callable, Set +from typing import Callable v = sys.argv[1] tag = sys.argv[2] @@ -31,7 +31,7 @@ "crates/clvm-utils/fuzz", ] -def crates_with_changes() -> Set[str]: +def crates_with_changes() -> set[str]: ret = set() for c in our_crates: diff = os.popen(f"git diff {tag} -- {c}").read().strip() @@ -42,7 +42,7 @@ def crates_with_changes() -> Set[str]: ret.add("wheel") return ret -def update_cargo(name: str, crates: Set[str]) -> None: +def update_cargo(name: str, crates: set[str]) -> None: subst = "" with open(f"{name}/Cargo.toml") as f: for line in f: diff --git a/crates/chia-tools/parse-analyze-chain.py b/crates/chia-tools/parse-analyze-chain.py index dc290acfc..98d7576ef 100644 --- a/crates/chia-tools/parse-analyze-chain.py +++ b/crates/chia-tools/parse-analyze-chain.py @@ -1,6 +1,5 @@ -from typing import Dict, List -all_counters: Dict[str, List[int]] = {} +all_counters: dict[str, list[int]] = {} keys = ["atoms:", "small_atoms:", diff --git a/tests/merkle_set.py b/tests/merkle_set.py index e71ffad9e..02ac234a9 100644 --- a/tests/merkle_set.py +++ b/tests/merkle_set.py @@ -2,7 +2,7 @@ from abc import ABCMeta, abstractmethod from hashlib import sha256 -from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple +from typing import TYPE_CHECKING, Any, Iterable, Optional from chia_rs.sized_bytes import bytes32 @@ -47,7 +47,7 @@ BLANK = bytes32([0] * 32) -prehashed: Dict[bytes, _Hash] = {} +prehashed: dict[bytes, _Hash] = {} def init_prehashed() -> None: @@ -105,17 +105,17 @@ def add(self, toadd: bytes, depth: int) -> Node: pass @abstractmethod - def is_included(self, tocheck: bytes, depth: int, p: List[bytes]) -> bool: + def is_included(self, tocheck: bytes, depth: int, p: list[bytes]) -> bool: pass @abstractmethod def other_included( - self, tocheck: bytes, depth: int, p: List[bytes], collapse: bool + self, tocheck: bytes, depth: int, p: list[bytes], collapse: bool ) -> None: pass @abstractmethod - def _audit(self, hashes: List[bytes], bits: List[int]) -> None: + def _audit(self, hashes: list[bytes], bits: list[int]) -> None: pass @@ -133,13 +133,13 @@ def get_root(self) -> bytes32: def add_already_hashed(self, toadd: bytes) -> None: self.root = self.root.add(toadd, 0) - def is_included_already_hashed(self, tocheck: bytes) -> Tuple[bool, bytes]: - proof: List[bytes] = [] + def is_included_already_hashed(self, tocheck: bytes) -> tuple[bool, bytes]: + proof: list[bytes] = [] r = self.root.is_included(tocheck, 0, proof) return r, b"".join(proof) - def _audit(self, hashes: List[bytes]) -> None: - newhashes: List[bytes] = [] + def _audit(self, hashes: list[bytes]) -> None: + newhashes: list[bytes] = [] self.root._audit(newhashes, []) assert newhashes == sorted(newhashes) @@ -169,16 +169,16 @@ def is_double(self) -> bool: def add(self, toadd: bytes, depth: int) -> Node: return TerminalNode(toadd) - def is_included(self, tocheck: bytes, depth: int, p: List[bytes]) -> bool: + def is_included(self, tocheck: bytes, depth: int, p: list[bytes]) -> bool: p.append(EMPTY) return False def other_included( - self, tocheck: bytes, depth: int, p: List[bytes], collapse: bool + self, tocheck: bytes, depth: int, p: list[bytes], collapse: bool ) -> None: p.append(EMPTY) - def _audit(self, hashes: List[bytes], bits: List[int]) -> None: + def _audit(self, hashes: list[bytes], bits: list[int]) -> None: pass @@ -189,14 +189,14 @@ def _make_middle(children: Any, depth: int) -> Node: cbits = [get_bit(child.hash, depth) for child in children] if cbits[0] != cbits[1]: return MiddleNode(children) - nextvals: List[Node] = [_empty, _empty] + nextvals: list[Node] = [_empty, _empty] nextvals[cbits[0] ^ 1] = _empty nextvals[cbits[0]] = _make_middle(children, depth + 1) return MiddleNode(nextvals) class TerminalNode(Node): - def __init__(self, hash: bytes, bits: Optional[List[int]] = None) -> None: + def __init__(self, hash: bytes, bits: Optional[list[int]] = None) -> None: assert len(hash) == 32 self.hash = hash if bits is not None: @@ -222,23 +222,23 @@ def add(self, toadd: bytes, depth: int) -> Node: else: return _make_middle([TerminalNode(toadd), self], depth) - def is_included(self, tocheck: bytes, depth: int, p: List[bytes]) -> bool: + def is_included(self, tocheck: bytes, depth: int, p: list[bytes]) -> bool: p.append(TERMINAL + self.hash) return tocheck == self.hash def other_included( - self, tocheck: bytes, depth: int, p: List[bytes], collapse: bool + self, tocheck: bytes, depth: int, p: list[bytes], collapse: bool ) -> None: p.append(TERMINAL + self.hash) - def _audit(self, hashes: List[bytes], bits: List[int]) -> None: + def _audit(self, hashes: list[bytes], bits: list[int]) -> None: hashes.append(self.hash) for pos, v in enumerate(bits): assert get_bit(self.hash, pos) == v class MiddleNode(Node): - def __init__(self, children: List[Node]): + def __init__(self, children: list[Node]): self.children = children if children[0].is_empty() and children[1].is_double(): self.hash = children[1].hash @@ -285,7 +285,7 @@ def add(self, toadd: bytes, depth: int) -> Node: newvals[bit] = newchild return MiddleNode(newvals) - def is_included(self, tocheck: bytes, depth: int, p: List[bytes]) -> bool: + def is_included(self, tocheck: bytes, depth: int, p: list[bytes]) -> bool: p.append(MIDDLE) if get_bit(tocheck, depth) == 0: r = self.children[0].is_included(tocheck, depth + 1, p) @@ -300,14 +300,14 @@ def is_included(self, tocheck: bytes, depth: int, p: List[bytes]) -> bool: return self.children[1].is_included(tocheck, depth + 1, p) def other_included( - self, tocheck: bytes, depth: int, p: List[bytes], collapse: bool + self, tocheck: bytes, depth: int, p: list[bytes], collapse: bool ) -> None: if collapse or not self.is_double(): p.append(TRUNCATED + self.hash) else: self.is_included(tocheck, depth, p) - def _audit(self, hashes: List[bytes], bits: List[int]) -> None: + def _audit(self, hashes: list[bytes], bits: list[int]) -> None: self.children[0]._audit(hashes, bits + [0]) self.children[1]._audit(hashes, bits + [1]) @@ -331,15 +331,15 @@ def is_double(self) -> bool: def add(self, toadd: bytes, depth: int) -> Node: return self - def is_included(self, tocheck: bytes, depth: int, p: List[bytes]) -> bool: + def is_included(self, tocheck: bytes, depth: int, p: list[bytes]) -> bool: raise SetError() def other_included( - self, tocheck: bytes, depth: int, p: List[bytes], collapse: bool + self, tocheck: bytes, depth: int, p: list[bytes], collapse: bool ) -> None: p.append(TRUNCATED + self.hash) - def _audit(self, hashes: List[bytes], bits: List[int]) -> None: + def _audit(self, hashes: list[bytes], bits: list[int]) -> None: pass @@ -378,7 +378,7 @@ def deserialize_proof(proof: bytes) -> MerkleSet: raise SetError() -def _deserialize(proof: bytes, pos: int, bits: List[int]) -> Tuple[Node, int]: +def _deserialize(proof: bytes, pos: int, bits: list[int]) -> tuple[Node, int]: t = proof[pos : pos + 1] # flake8: noqa if t == EMPTY: return _empty, pos + 1 diff --git a/tests/run_gen.py b/tests/run_gen.py index 5a28ce643..4099a1118 100755 --- a/tests/run_gen.py +++ b/tests/run_gen.py @@ -13,7 +13,7 @@ from time import time import sys from time import perf_counter -from typing import Optional, Tuple +from typing import Optional DEFAULT_CONSTANTS = ConsensusConstants( SLOT_BLOCKS_TARGET=uint32(32), @@ -87,7 +87,7 @@ def run_gen( fn: str, flags: int = 0, args: Optional[str] = None, version: int = 1 -) -> Tuple[Optional[int], Optional[SpendBundleConditions], float]: +) -> tuple[Optional[int], Optional[SpendBundleConditions], float]: # constants from the main chia blockchain: # https://github.com/Chia-Network/chia-blockchain/blob/main/chia/consensus/default_constants.py diff --git a/tests/test_additions_and_removals.py b/tests/test_additions_and_removals.py index 13d8ff53b..ee3cc4091 100644 --- a/tests/test_additions_and_removals.py +++ b/tests/test_additions_and_removals.py @@ -1,4 +1,4 @@ -from typing import Set, Optional, Tuple +from typing import Optional from chia_rs import ( additions_and_removals, ALLOW_BACKREFS, @@ -39,8 +39,8 @@ def test_additions_and_removals() -> None: if "FAILED: " in test_file: continue - expected_additions: Set[Tuple[str, str, str, Optional[str]]] = set() - expected_removals: Set[Tuple[str, str]] = set() + expected_additions: set[tuple[str, str, str, Optional[str]]] = set() + expected_removals: set[tuple[str, str]] = set() last_coin_id = "" for l in test_file.splitlines(): if "- coin id: " in l: @@ -62,7 +62,7 @@ def test_additions_and_removals() -> None: assert len(removals) == len(expected_removals) for add in additions: - addition: Tuple[str, str, str, Optional[str]] + addition: tuple[str, str, str, Optional[str]] if add[1] is not None: addition = ( f"{add[0].parent_coin_info}", diff --git a/tests/test_block_record_fidelity.py b/tests/test_block_record_fidelity.py index ec1b3afad..e37ec5ef2 100644 --- a/tests/test_block_record_fidelity.py +++ b/tests/test_block_record_fidelity.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Any, Callable +from typing import Optional, Any, Callable import sys import time @@ -46,9 +46,9 @@ def get_optional(rng: Random, gen: Callable[[Random], Any]) -> Optional[Any]: return gen(rng) -def get_list(rng: Random, gen: Callable[[Random], Any]) -> List[Any]: +def get_list(rng: Random, gen: Callable[[Random], Any]) -> list[Any]: length = rng.sample([0, 1, 5, 32, 500], 1)[0] - ret: List[Any] = [] + ret: list[Any] = [] for i in range(length): ret.append(gen(rng)) return ret diff --git a/tests/test_blscache.py b/tests/test_blscache.py index 35fda7619..570b6f3a8 100644 --- a/tests/test_blscache.py +++ b/tests/test_blscache.py @@ -14,7 +14,6 @@ ) from chia_rs.sized_bytes import bytes32 from chia_rs.sized_ints import uint8, uint16, uint32, uint64, uint128 -from typing import List from chia.util.hash import std_hash from chia.util.lru_cache import LRUCache from chia.types.blockchain_format.program import Program as ChiaProgram @@ -103,8 +102,8 @@ def test_instantiation() -> None: pk: G1Element = sk.get_g1() msg = b"hello" sig: G2Element = AugSchemeMPL.sign(sk, msg) - pks: List[G1Element] = [pk] - msgs: List[bytes] = [msg] + pks: list[G1Element] = [pk] + msgs: list[bytes] = [msg] result = bls_cache.aggregate_verify(pks, msgs, sig) assert result assert bls_cache.len() == 1 @@ -131,9 +130,9 @@ def test_cache_limit() -> None: sk: PrivateKey = AugSchemeMPL.key_gen(seed) pk: G1Element = sk.get_g1() - pks: List[G1Element] = [] - msgs: List[bytes] = [] - sigs: List[G2Element] = [] + pks: list[G1Element] = [] + msgs: list[bytes] = [] + sigs: list[G2Element] = [] for i in [0xCAFE, 0xF00D, 0xABCD, 0x1234]: msgs.append(i.to_bytes(8, byteorder="little")) pks.append(pk) diff --git a/tests/test_blspy_fidelity.py b/tests/test_blspy_fidelity.py index 8e89a1dd4..7ab01755d 100644 --- a/tests/test_blspy_fidelity.py +++ b/tests/test_blspy_fidelity.py @@ -2,7 +2,7 @@ import chia_rs from random import getrandbits import sys -from typing import Any, Type +from typing import Any import pytest from concurrent.futures import ThreadPoolExecutor diff --git a/tests/test_merkle_set.py b/tests/test_merkle_set.py index 08034a285..bdfef9e45 100644 --- a/tests/test_merkle_set.py +++ b/tests/test_merkle_set.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Any, Callable, Protocol, Tuple +from typing import Optional, Any, Callable, Protocol from hashlib import sha256 import sys @@ -35,7 +35,7 @@ def check_proof( assert confirm_not_included_already_hashed(root, item, proof) -def check_tree(leafs: List[bytes32]) -> None: +def check_tree(leafs: list[bytes32]) -> None: ru_tree = RustMerkleSet(leafs) py_tree = PythonMerkleSet(leafs) @@ -118,14 +118,14 @@ def h2(a: bytes, b: bytes) -> bytes32: return bytes32(sha256(a + b).digest()) -def hashdown(t: List[int], buf: bytes) -> bytes32: +def hashdown(t: list[int], buf: bytes) -> bytes32: return bytes32(sha256(bytes([0] * 30) + bytes(t) + buf).digest()) BLANK = h("0000000000000000000000000000000000000000000000000000000000000000") -def merkle_tree_5() -> Tuple[bytes32, List[bytes32]]: +def merkle_tree_5() -> tuple[bytes32, list[bytes32]]: a = h("5800000000000000000000000000000000000000000000000000000000000000") b = h("2300000000000000000000000000000000000000000000000000000000000000") c = h("2100000000000000000000000000000000000000000000000000000000000000") @@ -164,7 +164,7 @@ def merkle_tree_5() -> Tuple[bytes32, List[bytes32]]: # e c -def merkle_tree_left_edge() -> Tuple[bytes32, List[bytes32]]: +def merkle_tree_left_edge() -> tuple[bytes32, list[bytes32]]: a = h("8000000000000000000000000000000000000000000000000000000000000000") b = h("0000000000000000000000000000000000000000000000000000000000000001") c = h("0000000000000000000000000000000000000000000000000000000000000002") @@ -196,7 +196,7 @@ def merkle_tree_left_edge() -> Tuple[bytes32, List[bytes32]]: # c d -def merkle_tree_left_edge_duplicates() -> Tuple[bytes32, List[bytes32]]: +def merkle_tree_left_edge_duplicates() -> tuple[bytes32, list[bytes32]]: a = h("8000000000000000000000000000000000000000000000000000000000000000") b = h("0000000000000000000000000000000000000000000000000000000000000001") c = h("0000000000000000000000000000000000000000000000000000000000000002") @@ -230,7 +230,7 @@ def merkle_tree_left_edge_duplicates() -> Tuple[bytes32, List[bytes32]]: # c d -def merkle_tree_right_edge() -> Tuple[bytes32, List[bytes32]]: +def merkle_tree_right_edge() -> tuple[bytes32, list[bytes32]]: a = h("4000000000000000000000000000000000000000000000000000000000000000") b = h("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff") c = h("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe") @@ -262,7 +262,7 @@ def merkle_tree_right_edge() -> Tuple[bytes32, List[bytes32]]: # c b -def merkle_set_test_cases() -> List[Tuple[bytes32, List[bytes32]]]: +def merkle_set_test_cases() -> list[tuple[bytes32, list[bytes32]]]: a = h("7000000000000000000000000000000000000000000000000000000000000000") b = h("7100000000000000000000000000000000000000000000000000000000000000") c = h("8000000000000000000000000000000000000000000000000000000000000000") diff --git a/tests/test_program_fidelity.py b/tests/test_program_fidelity.py index 384b6da7a..b8753aefe 100644 --- a/tests/test_program_fidelity.py +++ b/tests/test_program_fidelity.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional import string import chia_rs @@ -24,7 +24,7 @@ def rand_int(rnd: Random) -> int: return rnd.randint(0, 100000000000000) -def rand_list(rnd: Random) -> List: +def rand_list(rnd: Random) -> list: size = rnd.randint(0, 3) ret = [] for _ in range(size): diff --git a/tests/test_spend_bundle.py b/tests/test_spend_bundle.py index 5975b12b2..14d324b5e 100644 --- a/tests/test_spend_bundle.py +++ b/tests/test_spend_bundle.py @@ -1,6 +1,5 @@ from chia_rs import SpendBundle import pytest -from typing import Type expected_add1 = """\ [Coin { parent_coin_info: a48e6325fee4948d0703d1d722416331890e068d095a05049dd516ee7eab7f4b, \ @@ -197,7 +196,7 @@ ], ) def test_spend_bundle( - ty: Type, input_file: str, expected_add: str, expected_rem: str + ty: type, input_file: str, expected_add: str, expected_rem: str ) -> None: buf = open(f"test-bundles/{input_file}.bundle", "rb").read() bundle = ty.from_bytes(buf) diff --git a/tests/test_struct_stream.py b/tests/test_struct_stream.py index 898b34e1e..9b39073fa 100644 --- a/tests/test_struct_stream.py +++ b/tests/test_struct_stream.py @@ -5,7 +5,7 @@ import struct from dataclasses import dataclass from decimal import Decimal -from typing import Iterable, List, Optional, Type +from typing import Iterable, Optional import pytest @@ -37,7 +37,7 @@ def dataclass_parameter(instance: object) -> ParameterSet: ) -def dataclass_parameters(instances: Iterable[object]) -> List[ParameterSet]: +def dataclass_parameters(instances: Iterable[object]) -> list[ParameterSet]: return [dataclass_parameter(instance) for instance in instances] @@ -58,7 +58,7 @@ class BadName: @dataclass(frozen=True) class Good: name: str - cls: Type[StructStream] + cls: type[StructStream] size: int bits: int signed: bool @@ -74,7 +74,7 @@ def create( maximum: int, minimum: int, ) -> Good: - raw_class: Type[StructStream] = type(name, (StructStream,), {}) + raw_class: type[StructStream] = type(name, (StructStream,), {}) parsed_cls = parse_metadata_from_name(raw_class) return cls( name=name, @@ -122,7 +122,7 @@ def good_fixture(request: SubRequest) -> Good: class TestStructStream: def _test_impl( self, - cls: Type[StructStream], + cls: type[StructStream], upper_boundary: int, lower_boundary: int, length: int, diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 66a9f01c4..9d9f2cc02 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import List, Optional, Tuple, TextIO +from typing import Optional, TextIO from glob import glob output_file = Path(__file__).parent.resolve() / "python" / "chia_rs" / "chia_rs.pyi" @@ -12,8 +12,8 @@ def transform_type(m: str) -> str: n, t = m.split(":") - if "List[" in t: - t = t.replace("List[", "Sequence[") + if "list[" in t: + t = t.replace("list[", "Sequence[") elif "bytes32" == t.strip(): t = " bytes" elif t.strip() in enums: @@ -22,7 +22,7 @@ def transform_type(m: str) -> str: def print_class( - file: TextIO, name: str, members: List[str], extra: Optional[List[str]] = None + file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None ): def add_indent(x: str): return "\n " + x @@ -62,7 +62,7 @@ def from_bytes(cls, blob: bytes) -> Self: ... @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -85,9 +85,9 @@ def rust_type_to_python(t: str) -> str: ret = ( t.replace("<", "[") .replace(">", "]") - .replace("(", "Tuple[") + .replace("(", "tuple[") .replace(")", "]") - .replace("Vec", "List") + .replace("Vec", "list") .replace("Option", "Optional") .replace("Bytes", "bytes") .replace("String", "str") @@ -108,10 +108,10 @@ def rust_type_to_python(t: str) -> str: return ret -def parse_rust_source(filename: str, upper_case: bool) -> List[Tuple[str, List[str]]]: - ret: List[Tuple[str, List[str]]] = [] +def parse_rust_source(filename: str, upper_case: bool) -> list[tuple[str, list[str]]]: + ret: list[tuple[str, list[str]]] = [] in_struct: Optional[str] = None - members: List[str] = [] + members: list[str] = [] with open(filename) as f: for line in f: if not in_struct: @@ -185,7 +185,7 @@ def parse_rust_source(filename: str, upper_case: bool) -> List[Tuple[str, List[s "total_iters: uint128", "height: uint32", "weight: uint128", - "def get_included_reward_coins(self) -> List[Coin]: ...", + "def get_included_reward_coins(self) -> list[Coin]: ...", "def is_fully_compactified(self) -> bool: ...", ], "HeaderBlock": [ @@ -215,19 +215,19 @@ def parse_rust_source(filename: str, upper_case: bool) -> List[Tuple[str, List[s "def get_tree_hash(self) -> bytes32: ...", "@staticmethod\n def default() -> Program: ...", "@staticmethod\n def fromhex(h: str) -> Program: ...", - "def run_mempool_with_cost(self, max_cost: int, args: object) -> Tuple[int, ChiaProgram]: ...", - "def run_with_cost(self, max_cost: int, args: object) -> Tuple[int, ChiaProgram]: ...", - "def _run(self, max_cost: int, flags: int, args: object) -> Tuple[int, ChiaProgram]: ...", + "def run_mempool_with_cost(self, max_cost: int, args: object) -> tuple[int, ChiaProgram]: ...", + "def run_with_cost(self, max_cost: int, args: object) -> tuple[int, ChiaProgram]: ...", + "def _run(self, max_cost: int, flags: int, args: object) -> tuple[int, ChiaProgram]: ...", "@staticmethod\n def to(o: object) -> Program: ...", "@staticmethod\n def from_program(p: ChiaProgram) -> Program: ...", "def to_program(self) -> ChiaProgram: ...", - "def uncurry(self) -> Tuple[ChiaProgram, ChiaProgram]: ...", + "def uncurry(self) -> tuple[ChiaProgram, ChiaProgram]: ...", ], "SpendBundle": [ - "@classmethod\n def aggregate(cls, spend_bundles: List[SpendBundle]) -> Self: ...", + "@classmethod\n def aggregate(cls, spend_bundles: list[SpendBundle]) -> Self: ...", "def name(self) -> bytes32: ...", - "def removals(self) -> List[Coin]: ...", - "def additions(self) -> List[Coin]: ...", + "def removals(self) -> list[Coin]: ...", + "def additions(self) -> list[Coin]: ...", ], "BlockRecord": [ "is_transaction_block: bool", @@ -261,7 +261,7 @@ def parse_rust_source(filename: str, upper_case: bool) -> List[Tuple[str, List[s # this file is generated by generate_type_stubs.py # -from typing import List, Optional, Sequence, Tuple, Union, Dict, Any, ClassVar, final +from typing import Optional, Sequence, Union, Any, ClassVar, final from .sized_bytes import bytes32, bytes100 from .sized_ints import uint8, uint16, uint32, uint64, uint128, int8, int16, int32, int64 from typing_extensions import Self @@ -272,8 +272,8 @@ def parse_rust_source(filename: str, upper_case: bool) -> List[Tuple[str, List[s class _Unspec: pass -def solution_generator(spends: Sequence[Tuple[Coin, bytes, bytes]]) -> bytes: ... -def solution_generator_backrefs(spends: Sequence[Tuple[Coin, bytes, bytes]]) -> bytes: ... +def solution_generator(spends: Sequence[tuple[Coin, bytes, bytes]]) -> bytes: ... +def solution_generator_backrefs(spends: Sequence[tuple[Coin, bytes, bytes]]) -> bytes: ... def compute_merkle_set_root(values: Sequence[bytes]) -> bytes: ... @@ -281,16 +281,16 @@ def supports_fast_forward(spend: CoinSpend) -> bool : ... def fast_forward_singleton(spend: CoinSpend, new_coin: Coin, new_parent: Coin) -> bytes: ... def run_block_generator( - program: ReadableBuffer, block_refs: List[ReadableBuffer], max_cost: int, flags: int, signature: G2Element, bls_cache: Optional[BLSCache], constants: ConsensusConstants -) -> Tuple[Optional[int], Optional[SpendBundleConditions]]: ... + program: ReadableBuffer, block_refs: list[ReadableBuffer], max_cost: int, flags: int, signature: G2Element, bls_cache: Optional[BLSCache], constants: ConsensusConstants +) -> tuple[Optional[int], Optional[SpendBundleConditions]]: ... def run_block_generator2( - program: ReadableBuffer, block_refs: List[ReadableBuffer], max_cost: int, flags: int, signature: G2Element, bls_cache: Optional[BLSCache], constants: ConsensusConstants -) -> Tuple[Optional[int], Optional[SpendBundleConditions]]: ... + program: ReadableBuffer, block_refs: list[ReadableBuffer], max_cost: int, flags: int, signature: G2Element, bls_cache: Optional[BLSCache], constants: ConsensusConstants +) -> tuple[Optional[int], Optional[SpendBundleConditions]]: ... def additions_and_removals( - program: ReadableBuffer, block_refs: List[ReadableBuffer], flags: int, constants: ConsensusConstants -) -> Tuple[List[Tuple[Coin, Optional[bytes]]], List[Coin]]: ... + program: ReadableBuffer, block_refs: list[ReadableBuffer], flags: int, constants: ConsensusConstants +) -> tuple[list[tuple[Coin, Optional[bytes]]], list[Coin]]: ... def confirm_included_already_hashed( root: bytes32, @@ -309,7 +309,7 @@ def validate_clvm_and_signature( max_cost: int, constants: ConsensusConstants, peak_height: int, -) -> Tuple[SpendBundleConditions, List[Tuple[bytes32, GTElement]], float]: ... +) -> tuple[SpendBundleConditions, list[tuple[bytes32, GTElement]], float]: ... def get_conditions_from_spendbundle( spend_bundle: SpendBundle, @@ -338,25 +338,25 @@ def get_flags_for_height_and_constants( def run_chia_program( program: bytes, args: bytes, max_cost: int, flags: int -) -> Tuple[int, LazyNode]: ... +) -> tuple[int, LazyNode]: ... @final class LazyNode: - pair: Optional[Tuple[LazyNode, LazyNode]] + pair: Optional[tuple[LazyNode, LazyNode]] atom: Optional[bytes] def serialized_length(program: ReadableBuffer) -> int: ... def tree_hash(blob: ReadableBuffer) -> bytes32: ... -def get_puzzle_and_solution_for_coin(program: ReadableBuffer, args: ReadableBuffer, max_cost: int, find_parent: bytes32, find_amount: int, find_ph: bytes32, flags: int) -> Tuple[bytes, bytes]: ... -def get_puzzle_and_solution_for_coin2(generator: Program, block_refs: List[ReadableBuffer], max_cost: int, find_coin: Coin, flags: int) -> Tuple[Program, Program]: ... +def get_puzzle_and_solution_for_coin(program: ReadableBuffer, args: ReadableBuffer, max_cost: int, find_parent: bytes32, find_amount: int, find_ph: bytes32, flags: int) -> tuple[bytes, bytes]: ... +def get_puzzle_and_solution_for_coin2(generator: Program, block_refs: list[ReadableBuffer], max_cost: int, find_coin: Coin, flags: int) -> tuple[Program, Program]: ... @final class BLSCache: def __init__(self, cache_size: Optional[int] = 50000) -> None: ... def len(self) -> int: ... - def aggregate_verify(self, pks: List[G1Element], msgs: List[bytes], sig: G2Element) -> bool: ... - def items(self) -> List[Tuple[bytes, GTElement]]: ... - def update(self, other: Sequence[Tuple[bytes, GTElement]]) -> None: ... + def aggregate_verify(self, pks: list[G1Element], msgs: list[bytes], sig: G2Element) -> bool: ... + def items(self) -> list[tuple[bytes, GTElement]]: ... + def update(self, other: Sequence[tuple[bytes, GTElement]]) -> None: ... @final class AugSchemeMPL: @@ -382,10 +382,10 @@ def derive_child_pk_unhardened(pk: G1Element, index: int) -> G1Element: ... @final class MerkleSet: def get_root(self) -> bytes32: ... - def is_included_already_hashed(self, included_leaf: bytes32) -> Tuple[bool, bytes]: ... + def is_included_already_hashed(self, included_leaf: bytes32) -> tuple[bool, bytes]: ... def __init__( self, - leafs: List[bytes32], + leafs: list[bytes32], ) -> None: ... """ ) @@ -465,14 +465,14 @@ def __init__( "before_seconds_relative: Optional[int]", "birth_height: Optional[int]", "birth_seconds: Optional[int]", - "create_coin: List[Tuple[bytes, int, Optional[bytes]]]", - "agg_sig_me: List[Tuple[G1Element, bytes]]", - "agg_sig_parent: List[Tuple[G1Element, bytes]]", - "agg_sig_puzzle: List[Tuple[G1Element, bytes]]", - "agg_sig_amount: List[Tuple[G1Element, bytes]]", - "agg_sig_puzzle_amount: List[Tuple[G1Element, bytes]]", - "agg_sig_parent_amount: List[Tuple[G1Element, bytes]]", - "agg_sig_parent_puzzle: List[Tuple[G1Element, bytes]]", + "create_coin: list[tuple[bytes, int, Optional[bytes]]]", + "agg_sig_me: list[tuple[G1Element, bytes]]", + "agg_sig_parent: list[tuple[G1Element, bytes]]", + "agg_sig_puzzle: list[tuple[G1Element, bytes]]", + "agg_sig_amount: list[tuple[G1Element, bytes]]", + "agg_sig_puzzle_amount: list[tuple[G1Element, bytes]]", + "agg_sig_parent_amount: list[tuple[G1Element, bytes]]", + "agg_sig_parent_puzzle: list[tuple[G1Element, bytes]]", "flags: int", ], ) @@ -481,13 +481,13 @@ def __init__( file, "SpendBundleConditions", [ - "spends: List[SpendConditions]", + "spends: list[SpendConditions]", "reserve_fee: int", "height_absolute: int", "seconds_absolute: int", "before_height_absolute: Optional[int]", "before_seconds_absolute: Optional[int]", - "agg_sig_unsafe: List[Tuple[G1Element, bytes]]", + "agg_sig_unsafe: list[tuple[G1Element, bytes]]", "cost: int", "removal_amount: int", "addition_amount: int", diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index b7636f8af..bbefde155 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -3,7 +3,7 @@ # this file is generated by generate_type_stubs.py # -from typing import List, Optional, Sequence, Tuple, Union, Dict, Any, ClassVar, final +from typing import Optional, Sequence, Union, Any, ClassVar, final from .sized_bytes import bytes32, bytes100 from .sized_ints import uint8, uint16, uint32, uint64, uint128, int8, int16, int32, int64 from typing_extensions import Self @@ -14,8 +14,8 @@ ReadableBuffer = Union[bytes, bytearray, memoryview] class _Unspec: pass -def solution_generator(spends: Sequence[Tuple[Coin, bytes, bytes]]) -> bytes: ... -def solution_generator_backrefs(spends: Sequence[Tuple[Coin, bytes, bytes]]) -> bytes: ... +def solution_generator(spends: Sequence[tuple[Coin, bytes, bytes]]) -> bytes: ... +def solution_generator_backrefs(spends: Sequence[tuple[Coin, bytes, bytes]]) -> bytes: ... def compute_merkle_set_root(values: Sequence[bytes]) -> bytes: ... @@ -23,16 +23,16 @@ def supports_fast_forward(spend: CoinSpend) -> bool : ... def fast_forward_singleton(spend: CoinSpend, new_coin: Coin, new_parent: Coin) -> bytes: ... def run_block_generator( - program: ReadableBuffer, block_refs: List[ReadableBuffer], max_cost: int, flags: int, signature: G2Element, bls_cache: Optional[BLSCache], constants: ConsensusConstants -) -> Tuple[Optional[int], Optional[SpendBundleConditions]]: ... + program: ReadableBuffer, block_refs: list[ReadableBuffer], max_cost: int, flags: int, signature: G2Element, bls_cache: Optional[BLSCache], constants: ConsensusConstants +) -> tuple[Optional[int], Optional[SpendBundleConditions]]: ... def run_block_generator2( - program: ReadableBuffer, block_refs: List[ReadableBuffer], max_cost: int, flags: int, signature: G2Element, bls_cache: Optional[BLSCache], constants: ConsensusConstants -) -> Tuple[Optional[int], Optional[SpendBundleConditions]]: ... + program: ReadableBuffer, block_refs: list[ReadableBuffer], max_cost: int, flags: int, signature: G2Element, bls_cache: Optional[BLSCache], constants: ConsensusConstants +) -> tuple[Optional[int], Optional[SpendBundleConditions]]: ... def additions_and_removals( - program: ReadableBuffer, block_refs: List[ReadableBuffer], flags: int, constants: ConsensusConstants -) -> Tuple[List[Tuple[Coin, Optional[bytes]]], List[Coin]]: ... + program: ReadableBuffer, block_refs: list[ReadableBuffer], flags: int, constants: ConsensusConstants +) -> tuple[list[tuple[Coin, Optional[bytes]]], list[Coin]]: ... def confirm_included_already_hashed( root: bytes32, @@ -51,7 +51,7 @@ def validate_clvm_and_signature( max_cost: int, constants: ConsensusConstants, peak_height: int, -) -> Tuple[SpendBundleConditions, List[Tuple[bytes32, GTElement]], float]: ... +) -> tuple[SpendBundleConditions, list[tuple[bytes32, GTElement]], float]: ... def get_conditions_from_spendbundle( spend_bundle: SpendBundle, @@ -80,25 +80,25 @@ NO_UNKNOWN_OPS: int = ... def run_chia_program( program: bytes, args: bytes, max_cost: int, flags: int -) -> Tuple[int, LazyNode]: ... +) -> tuple[int, LazyNode]: ... @final class LazyNode: - pair: Optional[Tuple[LazyNode, LazyNode]] + pair: Optional[tuple[LazyNode, LazyNode]] atom: Optional[bytes] def serialized_length(program: ReadableBuffer) -> int: ... def tree_hash(blob: ReadableBuffer) -> bytes32: ... -def get_puzzle_and_solution_for_coin(program: ReadableBuffer, args: ReadableBuffer, max_cost: int, find_parent: bytes32, find_amount: int, find_ph: bytes32, flags: int) -> Tuple[bytes, bytes]: ... -def get_puzzle_and_solution_for_coin2(generator: Program, block_refs: List[ReadableBuffer], max_cost: int, find_coin: Coin, flags: int) -> Tuple[Program, Program]: ... +def get_puzzle_and_solution_for_coin(program: ReadableBuffer, args: ReadableBuffer, max_cost: int, find_parent: bytes32, find_amount: int, find_ph: bytes32, flags: int) -> tuple[bytes, bytes]: ... +def get_puzzle_and_solution_for_coin2(generator: Program, block_refs: list[ReadableBuffer], max_cost: int, find_coin: Coin, flags: int) -> tuple[Program, Program]: ... @final class BLSCache: def __init__(self, cache_size: Optional[int] = 50000) -> None: ... def len(self) -> int: ... - def aggregate_verify(self, pks: List[G1Element], msgs: List[bytes], sig: G2Element) -> bool: ... - def items(self) -> List[Tuple[bytes, GTElement]]: ... - def update(self, other: Sequence[Tuple[bytes, GTElement]]) -> None: ... + def aggregate_verify(self, pks: list[G1Element], msgs: list[bytes], sig: G2Element) -> bool: ... + def items(self) -> list[tuple[bytes, GTElement]]: ... + def update(self, other: Sequence[tuple[bytes, GTElement]]) -> None: ... @final class AugSchemeMPL: @@ -124,10 +124,10 @@ class AugSchemeMPL: @final class MerkleSet: def get_root(self) -> bytes32: ... - def is_included_already_hashed(self, included_leaf: bytes32) -> Tuple[bool, bytes]: ... + def is_included_already_hashed(self, included_leaf: bytes32) -> tuple[bool, bytes]: ... def __init__( self, - leafs: List[bytes32], + leafs: list[bytes32], ) -> None: ... @final @@ -155,7 +155,7 @@ class G1Element: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -186,7 +186,7 @@ class G2Element: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -213,7 +213,7 @@ class GTElement: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -245,7 +245,7 @@ class PrivateKey: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -266,14 +266,14 @@ class SpendConditions: before_seconds_relative: Optional[int] birth_height: Optional[int] birth_seconds: Optional[int] - create_coin: List[Tuple[bytes, int, Optional[bytes]]] - agg_sig_me: List[Tuple[G1Element, bytes]] - agg_sig_parent: List[Tuple[G1Element, bytes]] - agg_sig_puzzle: List[Tuple[G1Element, bytes]] - agg_sig_amount: List[Tuple[G1Element, bytes]] - agg_sig_puzzle_amount: List[Tuple[G1Element, bytes]] - agg_sig_parent_amount: List[Tuple[G1Element, bytes]] - agg_sig_parent_puzzle: List[Tuple[G1Element, bytes]] + create_coin: list[tuple[bytes, int, Optional[bytes]]] + agg_sig_me: list[tuple[G1Element, bytes]] + agg_sig_parent: list[tuple[G1Element, bytes]] + agg_sig_puzzle: list[tuple[G1Element, bytes]] + agg_sig_amount: list[tuple[G1Element, bytes]] + agg_sig_puzzle_amount: list[tuple[G1Element, bytes]] + agg_sig_parent_amount: list[tuple[G1Element, bytes]] + agg_sig_parent_puzzle: list[tuple[G1Element, bytes]] flags: int def __init__( self, @@ -287,14 +287,14 @@ class SpendConditions: before_seconds_relative: Optional[int], birth_height: Optional[int], birth_seconds: Optional[int], - create_coin: Sequence[Tuple[bytes, int, Optional[bytes]]], - agg_sig_me: Sequence[Tuple[G1Element, bytes]], - agg_sig_parent: Sequence[Tuple[G1Element, bytes]], - agg_sig_puzzle: Sequence[Tuple[G1Element, bytes]], - agg_sig_amount: Sequence[Tuple[G1Element, bytes]], - agg_sig_puzzle_amount: Sequence[Tuple[G1Element, bytes]], - agg_sig_parent_amount: Sequence[Tuple[G1Element, bytes]], - agg_sig_parent_puzzle: Sequence[Tuple[G1Element, bytes]], + create_coin: Sequence[tuple[bytes, int, Optional[bytes]]], + agg_sig_me: Sequence[tuple[G1Element, bytes]], + agg_sig_parent: Sequence[tuple[G1Element, bytes]], + agg_sig_puzzle: Sequence[tuple[G1Element, bytes]], + agg_sig_amount: Sequence[tuple[G1Element, bytes]], + agg_sig_puzzle_amount: Sequence[tuple[G1Element, bytes]], + agg_sig_parent_amount: Sequence[tuple[G1Element, bytes]], + agg_sig_parent_puzzle: Sequence[tuple[G1Element, bytes]], flags: int ) -> None: ... def __hash__(self) -> int: ... @@ -306,7 +306,7 @@ class SpendConditions: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -324,25 +324,25 @@ class SpendConditions: before_seconds_relative: Union[ Optional[int], _Unspec] = _Unspec(), birth_height: Union[ Optional[int], _Unspec] = _Unspec(), birth_seconds: Union[ Optional[int], _Unspec] = _Unspec(), - create_coin: Union[ List[Tuple[bytes, int, Optional[bytes]]], _Unspec] = _Unspec(), - agg_sig_me: Union[ List[Tuple[G1Element, bytes]], _Unspec] = _Unspec(), - agg_sig_parent: Union[ List[Tuple[G1Element, bytes]], _Unspec] = _Unspec(), - agg_sig_puzzle: Union[ List[Tuple[G1Element, bytes]], _Unspec] = _Unspec(), - agg_sig_amount: Union[ List[Tuple[G1Element, bytes]], _Unspec] = _Unspec(), - agg_sig_puzzle_amount: Union[ List[Tuple[G1Element, bytes]], _Unspec] = _Unspec(), - agg_sig_parent_amount: Union[ List[Tuple[G1Element, bytes]], _Unspec] = _Unspec(), - agg_sig_parent_puzzle: Union[ List[Tuple[G1Element, bytes]], _Unspec] = _Unspec(), + create_coin: Union[ list[tuple[bytes, int, Optional[bytes]]], _Unspec] = _Unspec(), + agg_sig_me: Union[ list[tuple[G1Element, bytes]], _Unspec] = _Unspec(), + agg_sig_parent: Union[ list[tuple[G1Element, bytes]], _Unspec] = _Unspec(), + agg_sig_puzzle: Union[ list[tuple[G1Element, bytes]], _Unspec] = _Unspec(), + agg_sig_amount: Union[ list[tuple[G1Element, bytes]], _Unspec] = _Unspec(), + agg_sig_puzzle_amount: Union[ list[tuple[G1Element, bytes]], _Unspec] = _Unspec(), + agg_sig_parent_amount: Union[ list[tuple[G1Element, bytes]], _Unspec] = _Unspec(), + agg_sig_parent_puzzle: Union[ list[tuple[G1Element, bytes]], _Unspec] = _Unspec(), flags: Union[ int, _Unspec] = _Unspec()) -> SpendConditions: ... @final class SpendBundleConditions: - spends: List[SpendConditions] + spends: list[SpendConditions] reserve_fee: int height_absolute: int seconds_absolute: int before_height_absolute: Optional[int] before_seconds_absolute: Optional[int] - agg_sig_unsafe: List[Tuple[G1Element, bytes]] + agg_sig_unsafe: list[tuple[G1Element, bytes]] cost: int removal_amount: int addition_amount: int @@ -355,7 +355,7 @@ class SpendBundleConditions: seconds_absolute: int, before_height_absolute: Optional[int], before_seconds_absolute: Optional[int], - agg_sig_unsafe: Sequence[Tuple[G1Element, bytes]], + agg_sig_unsafe: Sequence[tuple[G1Element, bytes]], cost: int, removal_amount: int, addition_amount: int, @@ -370,7 +370,7 @@ class SpendBundleConditions: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -378,13 +378,13 @@ class SpendBundleConditions: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, spends: Union[ List[SpendConditions], _Unspec] = _Unspec(), + def replace(self, *, spends: Union[ list[SpendConditions], _Unspec] = _Unspec(), reserve_fee: Union[ int, _Unspec] = _Unspec(), height_absolute: Union[ int, _Unspec] = _Unspec(), seconds_absolute: Union[ int, _Unspec] = _Unspec(), before_height_absolute: Union[ Optional[int], _Unspec] = _Unspec(), before_seconds_absolute: Union[ Optional[int], _Unspec] = _Unspec(), - agg_sig_unsafe: Union[ List[Tuple[G1Element, bytes]], _Unspec] = _Unspec(), + agg_sig_unsafe: Union[ list[tuple[G1Element, bytes]], _Unspec] = _Unspec(), cost: Union[ int, _Unspec] = _Unspec(), removal_amount: Union[ int, _Unspec] = _Unspec(), addition_amount: Union[ int, _Unspec] = _Unspec(), @@ -412,10 +412,10 @@ class BlockRecord: timestamp: Optional[uint64] prev_transaction_block_hash: Optional[bytes32] fees: Optional[uint64] - reward_claims_incorporated: Optional[List[Coin]] - finished_challenge_slot_hashes: Optional[List[bytes32]] - finished_infused_challenge_slot_hashes: Optional[List[bytes32]] - finished_reward_slot_hashes: Optional[List[bytes32]] + reward_claims_incorporated: Optional[list[Coin]] + finished_challenge_slot_hashes: Optional[list[bytes32]] + finished_infused_challenge_slot_hashes: Optional[list[bytes32]] + finished_reward_slot_hashes: Optional[list[bytes32]] sub_epoch_summary_included: Optional[SubEpochSummary] is_transaction_block: bool first_in_sub_slot: bool @@ -462,7 +462,7 @@ class BlockRecord: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -490,10 +490,10 @@ class BlockRecord: timestamp: Union[ Optional[uint64], _Unspec] = _Unspec(), prev_transaction_block_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), fees: Union[ Optional[uint64], _Unspec] = _Unspec(), - reward_claims_incorporated: Union[ Optional[List[Coin]], _Unspec] = _Unspec(), - finished_challenge_slot_hashes: Union[ Optional[List[bytes32]], _Unspec] = _Unspec(), - finished_infused_challenge_slot_hashes: Union[ Optional[List[bytes32]], _Unspec] = _Unspec(), - finished_reward_slot_hashes: Union[ Optional[List[bytes32]], _Unspec] = _Unspec(), + reward_claims_incorporated: Union[ Optional[list[Coin]], _Unspec] = _Unspec(), + finished_challenge_slot_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec(), + finished_infused_challenge_slot_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec(), + finished_reward_slot_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec(), sub_epoch_summary_included: Union[ Optional[SubEpochSummary], _Unspec] = _Unspec()) -> BlockRecord: ... @final @@ -516,7 +516,7 @@ class Message: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -535,7 +535,7 @@ class Handshake: software_version: str server_port: uint16 node_type: int - capabilities: List[Tuple[uint16, str]] + capabilities: list[tuple[uint16, str]] def __init__( self, network_id: str, @@ -543,7 +543,7 @@ class Handshake: software_version: str, server_port: uint16, node_type: int, - capabilities: Sequence[Tuple[uint16, str]] + capabilities: Sequence[tuple[uint16, str]] ) -> None: ... def __hash__(self) -> int: ... def __repr__(self) -> str: ... @@ -554,7 +554,7 @@ class Handshake: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -567,7 +567,7 @@ class Handshake: software_version: Union[ str, _Unspec] = _Unspec(), server_port: Union[ uint16, _Unspec] = _Unspec(), node_type: Union[ int, _Unspec] = _Unspec(), - capabilities: Union[ List[Tuple[uint16, str]], _Unspec] = _Unspec()) -> Handshake: ... + capabilities: Union[ list[tuple[uint16, str]], _Unspec] = _Unspec()) -> Handshake: ... @final class ClassgroupElement: @@ -591,7 +591,7 @@ class ClassgroupElement: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -622,7 +622,7 @@ class Coin: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -654,7 +654,7 @@ class CoinSpend: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -686,7 +686,7 @@ class CoinState: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -720,7 +720,7 @@ class EndOfSubSlotBundle: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -749,7 +749,7 @@ class FeeRate: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -779,7 +779,7 @@ class FeeEstimate: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -794,7 +794,7 @@ class FeeEstimate: @final class FeeEstimateGroup: error: Optional[str] - estimates: List[FeeEstimate] + estimates: list[FeeEstimate] def __init__( self, error: Optional[str], @@ -809,7 +809,7 @@ class FeeEstimateGroup: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -818,7 +818,7 @@ class FeeEstimateGroup: @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, error: Union[ Optional[str], _Unspec] = _Unspec(), - estimates: Union[ List[FeeEstimate], _Unspec] = _Unspec()) -> FeeEstimateGroup: ... + estimates: Union[ list[FeeEstimate], _Unspec] = _Unspec()) -> FeeEstimateGroup: ... @final class TransactionsInfo: @@ -827,7 +827,7 @@ class TransactionsInfo: aggregated_signature: G2Element fees: uint64 cost: uint64 - reward_claims_incorporated: List[Coin] + reward_claims_incorporated: list[Coin] def __init__( self, generator_root: bytes, @@ -846,7 +846,7 @@ class TransactionsInfo: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -859,7 +859,7 @@ class TransactionsInfo: aggregated_signature: Union[ G2Element, _Unspec] = _Unspec(), fees: Union[ uint64, _Unspec] = _Unspec(), cost: Union[ uint64, _Unspec] = _Unspec(), - reward_claims_incorporated: Union[ List[Coin], _Unspec] = _Unspec()) -> TransactionsInfo: ... + reward_claims_incorporated: Union[ list[Coin], _Unspec] = _Unspec()) -> TransactionsInfo: ... @final class FoliageTransactionBlock: @@ -887,7 +887,7 @@ class FoliageTransactionBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -926,7 +926,7 @@ class FoliageBlockData: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -966,7 +966,7 @@ class Foliage: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1005,7 +1005,7 @@ class NewPeak: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1039,7 +1039,7 @@ class NewTransaction: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1067,7 +1067,7 @@ class RequestTransaction: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1093,7 +1093,7 @@ class RespondTransaction: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1121,7 +1121,7 @@ class RequestProofOfWeight: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1150,7 +1150,7 @@ class RespondProofOfWeight: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1179,7 +1179,7 @@ class RequestBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1206,7 +1206,7 @@ class RejectBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1236,7 +1236,7 @@ class RequestBlocks: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1252,7 +1252,7 @@ class RequestBlocks: class RespondBlocks: start_height: uint32 end_height: uint32 - blocks: List[FullBlock] + blocks: list[FullBlock] def __init__( self, start_height: uint32, @@ -1268,7 +1268,7 @@ class RespondBlocks: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1278,7 +1278,7 @@ class RespondBlocks: def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), - blocks: Union[ List[FullBlock], _Unspec] = _Unspec()) -> RespondBlocks: ... + blocks: Union[ list[FullBlock], _Unspec] = _Unspec()) -> RespondBlocks: ... @final class RejectBlocks: @@ -1298,7 +1298,7 @@ class RejectBlocks: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1325,7 +1325,7 @@ class RespondBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1351,7 +1351,7 @@ class NewUnfinishedBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1377,7 +1377,7 @@ class RequestUnfinishedBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1403,7 +1403,7 @@ class RespondUnfinishedBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1435,7 +1435,7 @@ class NewSignagePointOrEndOfSubSlot: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1468,7 +1468,7 @@ class RequestSignagePointOrEndOfSubSlot: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1504,7 +1504,7 @@ class RespondSignagePoint: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1534,7 +1534,7 @@ class RespondEndOfSubSlot: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1560,7 +1560,7 @@ class RequestMempoolTransactions: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1592,7 +1592,7 @@ class NewCompactVDF: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1627,7 +1627,7 @@ class RequestCompactVDF: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1664,7 +1664,7 @@ class RespondCompactVDF: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1692,7 +1692,7 @@ class RequestPeers: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1703,7 +1703,7 @@ class RequestPeers: @final class RespondPeers: - peer_list: List[TimestampedPeerInfo] + peer_list: list[TimestampedPeerInfo] def __init__( self, peer_list: Sequence[TimestampedPeerInfo] @@ -1717,7 +1717,7 @@ class RespondPeers: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1725,7 +1725,7 @@ class RespondPeers: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, peer_list: Union[ List[TimestampedPeerInfo], _Unspec] = _Unspec()) -> RespondPeers: ... + def replace(self, *, peer_list: Union[ list[TimestampedPeerInfo], _Unspec] = _Unspec()) -> RespondPeers: ... @final class NewUnfinishedBlock2: @@ -1745,7 +1745,7 @@ class NewUnfinishedBlock2: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1774,7 +1774,7 @@ class RequestUnfinishedBlock2: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1787,7 +1787,7 @@ class RequestUnfinishedBlock2: @final class FullBlock: - finished_sub_slots: List[EndOfSubSlotBundle] + finished_sub_slots: list[EndOfSubSlotBundle] reward_chain_block: RewardChainBlock challenge_chain_sp_proof: Optional[VDFProof] challenge_chain_ip_proof: VDFProof @@ -1798,14 +1798,14 @@ class FullBlock: foliage_transaction_block: Optional[FoliageTransactionBlock] transactions_info: Optional[TransactionsInfo] transactions_generator: Optional[Program] - transactions_generator_ref_list: List[uint32] + transactions_generator_ref_list: list[uint32] prev_header_hash: bytes32 header_hash: bytes32 def is_transaction_block(self) -> bool: ... total_iters: uint128 height: uint32 weight: uint128 - def get_included_reward_coins(self) -> List[Coin]: ... + def get_included_reward_coins(self) -> list[Coin]: ... def is_fully_compactified(self) -> bool: ... def __init__( self, @@ -1831,7 +1831,7 @@ class FullBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1839,7 +1839,7 @@ class FullBlock: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, finished_sub_slots: Union[ List[EndOfSubSlotBundle], _Unspec] = _Unspec(), + def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlock, _Unspec] = _Unspec(), challenge_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), challenge_chain_ip_proof: Union[ VDFProof, _Unspec] = _Unspec(), @@ -1850,11 +1850,11 @@ class FullBlock: foliage_transaction_block: Union[ Optional[FoliageTransactionBlock], _Unspec] = _Unspec(), transactions_info: Union[ Optional[TransactionsInfo], _Unspec] = _Unspec(), transactions_generator: Union[ Optional[Program], _Unspec] = _Unspec(), - transactions_generator_ref_list: Union[ List[uint32], _Unspec] = _Unspec()) -> FullBlock: ... + transactions_generator_ref_list: Union[ list[uint32], _Unspec] = _Unspec()) -> FullBlock: ... @final class HeaderBlock: - finished_sub_slots: List[EndOfSubSlotBundle] + finished_sub_slots: list[EndOfSubSlotBundle] reward_chain_block: RewardChainBlock challenge_chain_sp_proof: Optional[VDFProof] challenge_chain_ip_proof: VDFProof @@ -1897,7 +1897,7 @@ class HeaderBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1905,7 +1905,7 @@ class HeaderBlock: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, finished_sub_slots: Union[ List[EndOfSubSlotBundle], _Unspec] = _Unspec(), + def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlock, _Unspec] = _Unspec(), challenge_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), challenge_chain_ip_proof: Union[ VDFProof, _Unspec] = _Unspec(), @@ -1937,7 +1937,7 @@ class TimestampedPeerInfo: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1967,7 +1967,7 @@ class PoolTarget: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -1986,15 +1986,15 @@ class Program: def default() -> Program: ... @staticmethod def fromhex(h: str) -> Program: ... - def run_mempool_with_cost(self, max_cost: int, args: object) -> Tuple[int, ChiaProgram]: ... - def run_with_cost(self, max_cost: int, args: object) -> Tuple[int, ChiaProgram]: ... - def _run(self, max_cost: int, flags: int, args: object) -> Tuple[int, ChiaProgram]: ... + def run_mempool_with_cost(self, max_cost: int, args: object) -> tuple[int, ChiaProgram]: ... + def run_with_cost(self, max_cost: int, args: object) -> tuple[int, ChiaProgram]: ... + def _run(self, max_cost: int, flags: int, args: object) -> tuple[int, ChiaProgram]: ... @staticmethod def to(o: object) -> Program: ... @staticmethod def from_program(p: ChiaProgram) -> Program: ... def to_program(self) -> ChiaProgram: ... - def uncurry(self) -> Tuple[ChiaProgram, ChiaProgram]: ... + def uncurry(self) -> tuple[ChiaProgram, ChiaProgram]: ... def __init__( self, a0: bytes @@ -2008,7 +2008,7 @@ class Program: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2043,7 +2043,7 @@ class ProofOfSpace: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2088,7 +2088,7 @@ class RewardChainBlockUnfinished: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2148,7 +2148,7 @@ class RewardChainBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2193,7 +2193,7 @@ class ChallengeBlockInfo: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2230,7 +2230,7 @@ class ChallengeChainSubSlot: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2260,7 +2260,7 @@ class InfusedChallengeChainSubSlot: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2292,7 +2292,7 @@ class RewardChainSubSlot: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2325,7 +2325,7 @@ class SubSlotProofs: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2339,13 +2339,13 @@ class SubSlotProofs: class SpendBundle: - coin_spends: List[CoinSpend] + coin_spends: list[CoinSpend] aggregated_signature: G2Element @classmethod - def aggregate(cls, spend_bundles: List[SpendBundle]) -> Self: ... + def aggregate(cls, spend_bundles: list[SpendBundle]) -> Self: ... def name(self) -> bytes32: ... - def removals(self) -> List[Coin]: ... - def additions(self) -> List[Coin]: ... + def removals(self) -> list[Coin]: ... + def additions(self) -> list[Coin]: ... def __init__( self, coin_spends: Sequence[CoinSpend], @@ -2360,7 +2360,7 @@ class SpendBundle: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2368,7 +2368,7 @@ class SpendBundle: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, coin_spends: Union[ List[CoinSpend], _Unspec] = _Unspec(), + def replace(self, *, coin_spends: Union[ list[CoinSpend], _Unspec] = _Unspec(), aggregated_signature: Union[ G2Element, _Unspec] = _Unspec()) -> SpendBundle: ... @final @@ -2395,7 +2395,7 @@ class SubEpochSummary: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2411,7 +2411,7 @@ class SubEpochSummary: @final class UnfinishedBlock: - finished_sub_slots: List[EndOfSubSlotBundle] + finished_sub_slots: list[EndOfSubSlotBundle] reward_chain_block: RewardChainBlockUnfinished challenge_chain_sp_proof: Optional[VDFProof] reward_chain_sp_proof: Optional[VDFProof] @@ -2419,7 +2419,7 @@ class UnfinishedBlock: foliage_transaction_block: Optional[FoliageTransactionBlock] transactions_info: Optional[TransactionsInfo] transactions_generator: Optional[Program] - transactions_generator_ref_list: List[uint32] + transactions_generator_ref_list: list[uint32] prev_header_hash: bytes32 partial_hash: bytes32 def is_transaction_block(self) -> bool: ... @@ -2445,7 +2445,7 @@ class UnfinishedBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2453,7 +2453,7 @@ class UnfinishedBlock: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, finished_sub_slots: Union[ List[EndOfSubSlotBundle], _Unspec] = _Unspec(), + def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlockUnfinished, _Unspec] = _Unspec(), challenge_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), reward_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), @@ -2461,11 +2461,11 @@ class UnfinishedBlock: foliage_transaction_block: Union[ Optional[FoliageTransactionBlock], _Unspec] = _Unspec(), transactions_info: Union[ Optional[TransactionsInfo], _Unspec] = _Unspec(), transactions_generator: Union[ Optional[Program], _Unspec] = _Unspec(), - transactions_generator_ref_list: Union[ List[uint32], _Unspec] = _Unspec()) -> UnfinishedBlock: ... + transactions_generator_ref_list: Union[ list[uint32], _Unspec] = _Unspec()) -> UnfinishedBlock: ... @final class UnfinishedHeaderBlock: - finished_sub_slots: List[EndOfSubSlotBundle] + finished_sub_slots: list[EndOfSubSlotBundle] reward_chain_block: RewardChainBlockUnfinished challenge_chain_sp_proof: Optional[VDFProof] reward_chain_sp_proof: Optional[VDFProof] @@ -2494,7 +2494,7 @@ class UnfinishedHeaderBlock: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2502,7 +2502,7 @@ class UnfinishedHeaderBlock: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, finished_sub_slots: Union[ List[EndOfSubSlotBundle], _Unspec] = _Unspec(), + def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlockUnfinished, _Unspec] = _Unspec(), challenge_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), reward_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), @@ -2530,7 +2530,7 @@ class VDFInfo: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2562,7 +2562,7 @@ class VDFProof: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2592,7 +2592,7 @@ class RequestPuzzleSolution: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2625,7 +2625,7 @@ class PuzzleSolutionResponse: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2654,7 +2654,7 @@ class RespondPuzzleSolution: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2682,7 +2682,7 @@ class RejectPuzzleSolution: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2709,7 +2709,7 @@ class SendTransaction: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2739,7 +2739,7 @@ class TransactionAck: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2773,7 +2773,7 @@ class NewPeakWallet: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2802,7 +2802,7 @@ class RequestBlockHeader: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2828,7 +2828,7 @@ class RespondBlockHeader: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2854,7 +2854,7 @@ class RejectHeaderRequest: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2868,7 +2868,7 @@ class RejectHeaderRequest: class RequestRemovals: height: uint32 header_hash: bytes32 - coin_names: Optional[List[bytes32]] + coin_names: Optional[list[bytes32]] def __init__( self, height: uint32, @@ -2884,7 +2884,7 @@ class RequestRemovals: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2894,20 +2894,20 @@ class RequestRemovals: def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), - coin_names: Union[ Optional[List[bytes32]], _Unspec] = _Unspec()) -> RequestRemovals: ... + coin_names: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemovals: ... @final class RespondRemovals: height: uint32 header_hash: bytes32 - coins: List[Tuple[bytes32, Optional[Coin]]] - proofs: Optional[List[Tuple[bytes32, bytes]]] + coins: list[tuple[bytes32, Optional[Coin]]] + proofs: Optional[list[tuple[bytes32, bytes]]] def __init__( self, height: uint32, header_hash: bytes, - coins: Sequence[Tuple[bytes32, Optional[Coin]]], - proofs: Optional[Sequence[Tuple[bytes32, bytes]]] + coins: Sequence[tuple[bytes32, Optional[Coin]]], + proofs: Optional[Sequence[tuple[bytes32, bytes]]] ) -> None: ... def __hash__(self) -> int: ... def __repr__(self) -> str: ... @@ -2918,7 +2918,7 @@ class RespondRemovals: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2928,8 +2928,8 @@ class RespondRemovals: def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), - coins: Union[ List[Tuple[bytes32, Optional[Coin]]], _Unspec] = _Unspec(), - proofs: Union[ Optional[List[Tuple[bytes32, bytes]]], _Unspec] = _Unspec()) -> RespondRemovals: ... + coins: Union[ list[tuple[bytes32, Optional[Coin]]], _Unspec] = _Unspec(), + proofs: Union[ Optional[list[tuple[bytes32, bytes]]], _Unspec] = _Unspec()) -> RespondRemovals: ... @final class RejectRemovalsRequest: @@ -2949,7 +2949,7 @@ class RejectRemovalsRequest: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2964,7 +2964,7 @@ class RejectRemovalsRequest: class RequestAdditions: height: uint32 header_hash: Optional[bytes32] - puzzle_hashes: Optional[List[bytes32]] + puzzle_hashes: Optional[list[bytes32]] def __init__( self, height: uint32, @@ -2980,7 +2980,7 @@ class RequestAdditions: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -2990,20 +2990,20 @@ class RequestAdditions: def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), - puzzle_hashes: Union[ Optional[List[bytes32]], _Unspec] = _Unspec()) -> RequestAdditions: ... + puzzle_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestAdditions: ... @final class RespondAdditions: height: uint32 header_hash: bytes32 - coins: List[Tuple[bytes32, List[Coin]]] - proofs: Optional[List[Tuple[bytes32, bytes, Optional[bytes]]]] + coins: list[tuple[bytes32, list[Coin]]] + proofs: Optional[list[tuple[bytes32, bytes, Optional[bytes]]]] def __init__( self, height: uint32, header_hash: bytes, - coins: Sequence[Tuple[bytes32, Sequence[Coin]]], - proofs: Optional[Sequence[Tuple[bytes32, bytes, Optional[bytes]]]] + coins: Sequence[tuple[bytes32, Sequence[Coin]]], + proofs: Optional[Sequence[tuple[bytes32, bytes, Optional[bytes]]]] ) -> None: ... def __hash__(self) -> int: ... def __repr__(self) -> str: ... @@ -3014,7 +3014,7 @@ class RespondAdditions: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3024,8 +3024,8 @@ class RespondAdditions: def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), - coins: Union[ List[Tuple[bytes32, List[Coin]]], _Unspec] = _Unspec(), - proofs: Union[ Optional[List[Tuple[bytes32, bytes, Optional[bytes]]]], _Unspec] = _Unspec()) -> RespondAdditions: ... + coins: Union[ list[tuple[bytes32, list[Coin]]], _Unspec] = _Unspec(), + proofs: Union[ Optional[list[tuple[bytes32, bytes, Optional[bytes]]]], _Unspec] = _Unspec()) -> RespondAdditions: ... @final class RejectAdditionsRequest: @@ -3045,7 +3045,7 @@ class RejectAdditionsRequest: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3060,7 +3060,7 @@ class RejectAdditionsRequest: class RespondBlockHeaders: start_height: uint32 end_height: uint32 - header_blocks: List[HeaderBlock] + header_blocks: list[HeaderBlock] def __init__( self, start_height: uint32, @@ -3076,7 +3076,7 @@ class RespondBlockHeaders: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3086,7 +3086,7 @@ class RespondBlockHeaders: def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), - header_blocks: Union[ List[HeaderBlock], _Unspec] = _Unspec()) -> RespondBlockHeaders: ... + header_blocks: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> RespondBlockHeaders: ... @final class RejectBlockHeaders: @@ -3106,7 +3106,7 @@ class RejectBlockHeaders: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3137,7 +3137,7 @@ class RequestBlockHeaders: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3167,7 +3167,7 @@ class RequestHeaderBlocks: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3196,7 +3196,7 @@ class RejectHeaderBlocks: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3211,7 +3211,7 @@ class RejectHeaderBlocks: class RespondHeaderBlocks: start_height: uint32 end_height: uint32 - header_blocks: List[HeaderBlock] + header_blocks: list[HeaderBlock] def __init__( self, start_height: uint32, @@ -3227,7 +3227,7 @@ class RespondHeaderBlocks: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3237,11 +3237,11 @@ class RespondHeaderBlocks: def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), - header_blocks: Union[ List[HeaderBlock], _Unspec] = _Unspec()) -> RespondHeaderBlocks: ... + header_blocks: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> RespondHeaderBlocks: ... @final class RegisterForPhUpdates: - puzzle_hashes: List[bytes32] + puzzle_hashes: list[bytes32] min_height: uint32 def __init__( self, @@ -3257,7 +3257,7 @@ class RegisterForPhUpdates: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3265,14 +3265,14 @@ class RegisterForPhUpdates: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, puzzle_hashes: Union[ List[bytes32], _Unspec] = _Unspec(), + def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec()) -> RegisterForPhUpdates: ... @final class RespondToPhUpdates: - puzzle_hashes: List[bytes32] + puzzle_hashes: list[bytes32] min_height: uint32 - coin_states: List[CoinState] + coin_states: list[CoinState] def __init__( self, puzzle_hashes: Sequence[bytes32], @@ -3288,7 +3288,7 @@ class RespondToPhUpdates: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3296,13 +3296,13 @@ class RespondToPhUpdates: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, puzzle_hashes: Union[ List[bytes32], _Unspec] = _Unspec(), + def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec(), - coin_states: Union[ List[CoinState], _Unspec] = _Unspec()) -> RespondToPhUpdates: ... + coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondToPhUpdates: ... @final class RegisterForCoinUpdates: - coin_ids: List[bytes32] + coin_ids: list[bytes32] min_height: uint32 def __init__( self, @@ -3318,7 +3318,7 @@ class RegisterForCoinUpdates: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3326,14 +3326,14 @@ class RegisterForCoinUpdates: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, coin_ids: Union[ List[bytes32], _Unspec] = _Unspec(), + def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec()) -> RegisterForCoinUpdates: ... @final class RespondToCoinUpdates: - coin_ids: List[bytes32] + coin_ids: list[bytes32] min_height: uint32 - coin_states: List[CoinState] + coin_states: list[CoinState] def __init__( self, coin_ids: Sequence[bytes32], @@ -3349,7 +3349,7 @@ class RespondToCoinUpdates: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3357,16 +3357,16 @@ class RespondToCoinUpdates: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, coin_ids: Union[ List[bytes32], _Unspec] = _Unspec(), + def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec(), - coin_states: Union[ List[CoinState], _Unspec] = _Unspec()) -> RespondToCoinUpdates: ... + coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondToCoinUpdates: ... @final class CoinStateUpdate: height: uint32 fork_height: uint32 peak_hash: bytes32 - items: List[CoinState] + items: list[CoinState] def __init__( self, height: uint32, @@ -3383,7 +3383,7 @@ class CoinStateUpdate: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3394,7 +3394,7 @@ class CoinStateUpdate: def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), fork_height: Union[ uint32, _Unspec] = _Unspec(), peak_hash: Union[ bytes32, _Unspec] = _Unspec(), - items: Union[ List[CoinState], _Unspec] = _Unspec()) -> CoinStateUpdate: ... + items: Union[ list[CoinState], _Unspec] = _Unspec()) -> CoinStateUpdate: ... @final class RequestChildren: @@ -3412,7 +3412,7 @@ class RequestChildren: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3424,7 +3424,7 @@ class RequestChildren: @final class RespondChildren: - coin_states: List[CoinState] + coin_states: list[CoinState] def __init__( self, coin_states: Sequence[CoinState] @@ -3438,7 +3438,7 @@ class RespondChildren: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3446,7 +3446,7 @@ class RespondChildren: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, coin_states: Union[ List[CoinState], _Unspec] = _Unspec()) -> RespondChildren: ... + def replace(self, *, coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondChildren: ... @final class RequestSesInfo: @@ -3466,7 +3466,7 @@ class RequestSesInfo: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3479,8 +3479,8 @@ class RequestSesInfo: @final class RespondSesInfo: - reward_chain_hash: List[bytes32] - heights: List[List[uint32]] + reward_chain_hash: list[bytes32] + heights: list[list[uint32]] def __init__( self, reward_chain_hash: Sequence[bytes32], @@ -3495,7 +3495,7 @@ class RespondSesInfo: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3503,12 +3503,12 @@ class RespondSesInfo: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, reward_chain_hash: Union[ List[bytes32], _Unspec] = _Unspec(), - heights: Union[ List[List[uint32]], _Unspec] = _Unspec()) -> RespondSesInfo: ... + def replace(self, *, reward_chain_hash: Union[ list[bytes32], _Unspec] = _Unspec(), + heights: Union[ list[list[uint32]], _Unspec] = _Unspec()) -> RespondSesInfo: ... @final class RequestFeeEstimates: - time_targets: List[uint64] + time_targets: list[uint64] def __init__( self, time_targets: Sequence[uint64] @@ -3522,7 +3522,7 @@ class RequestFeeEstimates: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3530,7 +3530,7 @@ class RequestFeeEstimates: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, time_targets: Union[ List[uint64], _Unspec] = _Unspec()) -> RequestFeeEstimates: ... + def replace(self, *, time_targets: Union[ list[uint64], _Unspec] = _Unspec()) -> RequestFeeEstimates: ... @final class RespondFeeEstimates: @@ -3548,7 +3548,7 @@ class RespondFeeEstimates: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3560,7 +3560,7 @@ class RespondFeeEstimates: @final class RequestRemovePuzzleSubscriptions: - puzzle_hashes: Optional[List[bytes32]] + puzzle_hashes: Optional[list[bytes32]] def __init__( self, puzzle_hashes: Optional[Sequence[bytes32]] @@ -3574,7 +3574,7 @@ class RequestRemovePuzzleSubscriptions: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3582,11 +3582,11 @@ class RequestRemovePuzzleSubscriptions: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, puzzle_hashes: Union[ Optional[List[bytes32]], _Unspec] = _Unspec()) -> RequestRemovePuzzleSubscriptions: ... + def replace(self, *, puzzle_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemovePuzzleSubscriptions: ... @final class RespondRemovePuzzleSubscriptions: - puzzle_hashes: List[bytes32] + puzzle_hashes: list[bytes32] def __init__( self, puzzle_hashes: Sequence[bytes32] @@ -3600,7 +3600,7 @@ class RespondRemovePuzzleSubscriptions: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3608,11 +3608,11 @@ class RespondRemovePuzzleSubscriptions: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, puzzle_hashes: Union[ List[bytes32], _Unspec] = _Unspec()) -> RespondRemovePuzzleSubscriptions: ... + def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemovePuzzleSubscriptions: ... @final class RequestRemoveCoinSubscriptions: - coin_ids: Optional[List[bytes32]] + coin_ids: Optional[list[bytes32]] def __init__( self, coin_ids: Optional[Sequence[bytes32]] @@ -3626,7 +3626,7 @@ class RequestRemoveCoinSubscriptions: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3634,11 +3634,11 @@ class RequestRemoveCoinSubscriptions: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, coin_ids: Union[ Optional[List[bytes32]], _Unspec] = _Unspec()) -> RequestRemoveCoinSubscriptions: ... + def replace(self, *, coin_ids: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemoveCoinSubscriptions: ... @final class RespondRemoveCoinSubscriptions: - coin_ids: List[bytes32] + coin_ids: list[bytes32] def __init__( self, coin_ids: Sequence[bytes32] @@ -3652,7 +3652,7 @@ class RespondRemoveCoinSubscriptions: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3660,7 +3660,7 @@ class RespondRemoveCoinSubscriptions: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, coin_ids: Union[ List[bytes32], _Unspec] = _Unspec()) -> RespondRemoveCoinSubscriptions: ... + def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemoveCoinSubscriptions: ... @final class CoinStateFilters: @@ -3684,7 +3684,7 @@ class CoinStateFilters: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3699,7 +3699,7 @@ class CoinStateFilters: @final class RequestPuzzleState: - puzzle_hashes: List[bytes32] + puzzle_hashes: list[bytes32] previous_height: Optional[uint32] header_hash: bytes32 filters: CoinStateFilters @@ -3721,7 +3721,7 @@ class RequestPuzzleState: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3729,7 +3729,7 @@ class RequestPuzzleState: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, puzzle_hashes: Union[ List[bytes32], _Unspec] = _Unspec(), + def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), previous_height: Union[ Optional[uint32], _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), filters: Union[ CoinStateFilters, _Unspec] = _Unspec(), @@ -3737,11 +3737,11 @@ class RequestPuzzleState: @final class RespondPuzzleState: - puzzle_hashes: List[bytes32] + puzzle_hashes: list[bytes32] height: uint32 header_hash: bytes32 is_finished: bool - coin_states: List[CoinState] + coin_states: list[CoinState] def __init__( self, puzzle_hashes: Sequence[bytes32], @@ -3759,7 +3759,7 @@ class RespondPuzzleState: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3767,11 +3767,11 @@ class RespondPuzzleState: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, puzzle_hashes: Union[ List[bytes32], _Unspec] = _Unspec(), + def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), is_finished: Union[ bool, _Unspec] = _Unspec(), - coin_states: Union[ List[CoinState], _Unspec] = _Unspec()) -> RespondPuzzleState: ... + coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondPuzzleState: ... @final class RejectPuzzleState: @@ -3789,7 +3789,7 @@ class RejectPuzzleState: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3801,7 +3801,7 @@ class RejectPuzzleState: @final class RequestCoinState: - coin_ids: List[bytes32] + coin_ids: list[bytes32] previous_height: Optional[uint32] header_hash: bytes32 subscribe: bool @@ -3821,7 +3821,7 @@ class RequestCoinState: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3829,15 +3829,15 @@ class RequestCoinState: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, coin_ids: Union[ List[bytes32], _Unspec] = _Unspec(), + def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), previous_height: Union[ Optional[uint32], _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), subscribe: Union[ bool, _Unspec] = _Unspec()) -> RequestCoinState: ... @final class RespondCoinState: - coin_ids: List[bytes32] - coin_states: List[CoinState] + coin_ids: list[bytes32] + coin_states: list[CoinState] def __init__( self, coin_ids: Sequence[bytes32], @@ -3852,7 +3852,7 @@ class RespondCoinState: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3860,8 +3860,8 @@ class RespondCoinState: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, coin_ids: Union[ List[bytes32], _Unspec] = _Unspec(), - coin_states: Union[ List[CoinState], _Unspec] = _Unspec()) -> RespondCoinState: ... + def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), + coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondCoinState: ... @final class RejectCoinState: @@ -3879,7 +3879,7 @@ class RejectCoinState: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3911,7 +3911,7 @@ class SubEpochData: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3966,7 +3966,7 @@ class SubSlotData: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -3991,7 +3991,7 @@ class SubSlotData: @final class SubEpochChallengeSegment: sub_epoch_n: uint32 - sub_slots: List[SubSlotData] + sub_slots: list[SubSlotData] rc_slot_end_info: Optional[VDFInfo] def __init__( self, @@ -4008,7 +4008,7 @@ class SubEpochChallengeSegment: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -4017,12 +4017,12 @@ class SubEpochChallengeSegment: @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, sub_epoch_n: Union[ uint32, _Unspec] = _Unspec(), - sub_slots: Union[ List[SubSlotData], _Unspec] = _Unspec(), + sub_slots: Union[ list[SubSlotData], _Unspec] = _Unspec(), rc_slot_end_info: Union[ Optional[VDFInfo], _Unspec] = _Unspec()) -> SubEpochChallengeSegment: ... @final class SubEpochSegments: - challenge_segments: List[SubEpochChallengeSegment] + challenge_segments: list[SubEpochChallengeSegment] def __init__( self, challenge_segments: Sequence[SubEpochChallengeSegment] @@ -4036,7 +4036,7 @@ class SubEpochSegments: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -4044,11 +4044,11 @@ class SubEpochSegments: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, challenge_segments: Union[ List[SubEpochChallengeSegment], _Unspec] = _Unspec()) -> SubEpochSegments: ... + def replace(self, *, challenge_segments: Union[ list[SubEpochChallengeSegment], _Unspec] = _Unspec()) -> SubEpochSegments: ... @final class RecentChainData: - recent_chain_data: List[HeaderBlock] + recent_chain_data: list[HeaderBlock] def __init__( self, recent_chain_data: Sequence[HeaderBlock] @@ -4062,7 +4062,7 @@ class RecentChainData: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -4070,11 +4070,11 @@ class RecentChainData: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, recent_chain_data: Union[ List[HeaderBlock], _Unspec] = _Unspec()) -> RecentChainData: ... + def replace(self, *, recent_chain_data: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> RecentChainData: ... @final class ProofBlockHeader: - finished_sub_slots: List[EndOfSubSlotBundle] + finished_sub_slots: list[EndOfSubSlotBundle] reward_chain_block: RewardChainBlock def __init__( self, @@ -4090,7 +4090,7 @@ class ProofBlockHeader: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -4098,14 +4098,14 @@ class ProofBlockHeader: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, finished_sub_slots: Union[ List[EndOfSubSlotBundle], _Unspec] = _Unspec(), + def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlock, _Unspec] = _Unspec()) -> ProofBlockHeader: ... @final class WeightProof: - sub_epochs: List[SubEpochData] - sub_epoch_segments: List[SubEpochChallengeSegment] - recent_chain_data: List[HeaderBlock] + sub_epochs: list[SubEpochData] + sub_epoch_segments: list[SubEpochChallengeSegment] + recent_chain_data: list[HeaderBlock] def __init__( self, sub_epochs: Sequence[SubEpochData], @@ -4121,7 +4121,7 @@ class WeightProof: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... @@ -4129,9 +4129,9 @@ class WeightProof: def to_json_dict(self) -> Any: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... - def replace(self, *, sub_epochs: Union[ List[SubEpochData], _Unspec] = _Unspec(), - sub_epoch_segments: Union[ List[SubEpochChallengeSegment], _Unspec] = _Unspec(), - recent_chain_data: Union[ List[HeaderBlock], _Unspec] = _Unspec()) -> WeightProof: ... + def replace(self, *, sub_epochs: Union[ list[SubEpochData], _Unspec] = _Unspec(), + sub_epoch_segments: Union[ list[SubEpochChallengeSegment], _Unspec] = _Unspec(), + recent_chain_data: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> WeightProof: ... @final class ConsensusConstants: @@ -4239,7 +4239,7 @@ class ConsensusConstants: @classmethod def from_bytes_unchecked(cls, blob: bytes) -> Self: ... @classmethod - def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> Tuple[Self, int]: ... + def parse_rust(cls, blob: ReadableBuffer, trusted: bool = False) -> tuple[Self, int]: ... def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... diff --git a/wheel/python/chia_rs/sized_byte_class.py b/wheel/python/chia_rs/sized_byte_class.py index 6dcbeb11e..e34eecb44 100644 --- a/wheel/python/chia_rs/sized_byte_class.py +++ b/wheel/python/chia_rs/sized_byte_class.py @@ -8,7 +8,6 @@ Optional, SupportsBytes, SupportsIndex, - Type, TypeVar, Union, ) @@ -46,7 +45,7 @@ def __init__(self, v: Union[Iterable[SupportsIndex], SupportsBytes]) -> None: raise ValueError(f"bad {type(self).__name__} initializer {v}") @classmethod - def parse(cls: Type[_T_SizedBytes], f: BinaryIO) -> _T_SizedBytes: + def parse(cls: type[_T_SizedBytes], f: BinaryIO) -> _T_SizedBytes: b = f.read(cls._size) return cls(b) @@ -54,18 +53,18 @@ def stream(self, f: BinaryIO) -> None: f.write(self) @classmethod - def from_bytes(cls: Type[_T_SizedBytes], blob: bytes) -> _T_SizedBytes: + def from_bytes(cls: type[_T_SizedBytes], blob: bytes) -> _T_SizedBytes: return cls(blob) @classmethod - def from_hexstr(cls: Type[_T_SizedBytes], input_str: str) -> _T_SizedBytes: + def from_hexstr(cls: type[_T_SizedBytes], input_str: str) -> _T_SizedBytes: if input_str.startswith("0x") or input_str.startswith("0X"): return cls.fromhex(input_str[2:]) return cls.fromhex(input_str) @classmethod def random( - cls: Type[_T_SizedBytes], r: Optional[random.Random] = None + cls: type[_T_SizedBytes], r: Optional[random.Random] = None ) -> _T_SizedBytes: if r is None: getrandbits = random.getrandbits @@ -75,7 +74,7 @@ def random( return cls(getrandbits(cls._size * 8).to_bytes(cls._size, "big")) @classmethod - def secret(cls: Type[_T_SizedBytes]) -> _T_SizedBytes: + def secret(cls: type[_T_SizedBytes]) -> _T_SizedBytes: return cls.random(r=system_random) def __str__(self) -> str: diff --git a/wheel/python/chia_rs/struct_stream.py b/wheel/python/chia_rs/struct_stream.py index 6a4372b25..dd7d51759 100644 --- a/wheel/python/chia_rs/struct_stream.py +++ b/wheel/python/chia_rs/struct_stream.py @@ -6,7 +6,6 @@ Optional, SupportsIndex, SupportsInt, - Type, TypeVar, Union, ) @@ -21,7 +20,7 @@ class SupportsTrunc(Protocol): def __trunc__(self) -> int: ... -def parse_metadata_from_name(cls: Type[_T_StructStream]) -> Type[_T_StructStream]: +def parse_metadata_from_name(cls: type[_T_StructStream]) -> type[_T_StructStream]: name_signedness, _, name_bit_size = cls.__name__.partition("int") cls.SIGNED = False if name_signedness == "u" else True try: @@ -84,7 +83,7 @@ def __init__( @classmethod def construct_optional( - cls: Type[_T_StructStream], val: Optional[int] + cls: type[_T_StructStream], val: Optional[int] ) -> Optional[_T_StructStream]: if val is None: return None @@ -92,7 +91,7 @@ def construct_optional( return cls(val) @classmethod - def parse(cls: Type[_T_StructStream], f: BinaryIO) -> _T_StructStream: + def parse(cls: type[_T_StructStream], f: BinaryIO) -> _T_StructStream: read_bytes = f.read(cls.SIZE) return cls.from_bytes(read_bytes) @@ -100,7 +99,7 @@ def stream(self, f: BinaryIO) -> None: f.write(self.stream_to_bytes()) @classmethod - def from_bytes(cls: Type[_T_StructStream], blob: bytes) -> _T_StructStream: # type: ignore[override] + def from_bytes(cls: type[_T_StructStream], blob: bytes) -> _T_StructStream: # type: ignore[override] if len(blob) != cls.SIZE: raise ValueError( f"{cls.__name__}.from_bytes() requires {cls.SIZE} bytes but got: {len(blob)}" From e3b3fe6a0ae6970f2f176e283744fd45f9833b50 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 24 Oct 2024 21:41:56 -0400 Subject: [PATCH 2/2] fixup --- tests/test_spend_bundle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_spend_bundle.py b/tests/test_spend_bundle.py index 14d324b5e..5672ee95c 100644 --- a/tests/test_spend_bundle.py +++ b/tests/test_spend_bundle.py @@ -1,3 +1,4 @@ +from typing import Any from chia_rs import SpendBundle import pytest @@ -196,7 +197,7 @@ ], ) def test_spend_bundle( - ty: type, input_file: str, expected_add: str, expected_rem: str + ty: type[Any], input_file: str, expected_add: str, expected_rem: str ) -> None: buf = open(f"test-bundles/{input_file}.bundle", "rb").read() bundle = ty.from_bytes(buf)