From 37c71a551746bfe731c5ea5091bf56b19bf7fd15 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 23 Oct 2024 11:02:33 -0400 Subject: [PATCH 01/11] add fuzz packages to workspace --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index a1cbc6669..a3ac55c18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -113,6 +113,11 @@ clvm-traits = { path = "./crates/clvm-traits", version = "0.15.0" } clvm-utils = { path = "./crates/clvm-utils", version = "0.15.0" } clvm-derive = { path = "./crates/clvm-derive", version = "0.13.0" } chia-fuzz = { path = "./crates/chia-consensus/fuzz", version = "0.15.0" } +chia-bls-fuzz = { path = "./crates/chia-bls/fuzz", version = "0.15.0" } +chia-protocol-fuzz = { path = "./crates/chia-protocol/fuzz", version = "0.15.0" } +chia-puzzles-fuzz = { path = "./crates/chia-puzzles/fuzz", version = "0.15.0" } +chia-traits-fuzz = { path = "./crates/chia-traits/fuzz", version = "0.15.0" } +chia-utils-fuzz = { path = "./crates/chia-utils/fuzz", version = "0.15.0" } blst = { version = "0.3.12", features = ["portable"] } clvmr = "0.9.0" syn = "2.0.75" From 5ba9ad8e7c136a00435103f1e47c6300c91d9150 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 23 Oct 2024 12:57:38 -0400 Subject: [PATCH 02/11] add fuzz packages to workspace but righter this time --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a3ac55c18..59370c183 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -116,8 +116,8 @@ chia-fuzz = { path = "./crates/chia-consensus/fuzz", version = "0.15.0" } chia-bls-fuzz = { path = "./crates/chia-bls/fuzz", version = "0.15.0" } chia-protocol-fuzz = { path = "./crates/chia-protocol/fuzz", version = "0.15.0" } chia-puzzles-fuzz = { path = "./crates/chia-puzzles/fuzz", version = "0.15.0" } -chia-traits-fuzz = { path = "./crates/chia-traits/fuzz", version = "0.15.0" } -chia-utils-fuzz = { path = "./crates/chia-utils/fuzz", version = "0.15.0" } +clvm-traits-fuzz = { path = "./crates/clvm-traits/fuzz", version = "0.15.0" } +clvm-utils-fuzz = { path = "./crates/clvm-utils/fuzz", version = "0.15.0" } blst = { version = "0.3.12", features = ["portable"] } clvmr = "0.9.0" syn = "2.0.75" From e69a0d82e3628a26157dec47b371a8eb6a8b7be0 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 24 Oct 2024 21:26:38 -0400 Subject: [PATCH 03/11] 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 04/11] 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) From aca3623478ddb42c8ab039725a807634daf7e07a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 24 Oct 2024 22:39:04 -0400 Subject: [PATCH 05/11] hint `.to_json_dict()` better --- wheel/generate_type_stubs.py | 3 +- wheel/python/chia_rs/chia_rs.pyi | 239 ++++++++++++++++--------------- wheel/stubtest.allowlist | 4 + 3 files changed, 126 insertions(+), 120 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 9d9f2cc02..1ed287483 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -67,7 +67,7 @@ def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... """ @@ -267,6 +267,7 @@ def parse_rust_source(filename: str, upper_case: bool) -> list[tuple[str, list[s from typing_extensions import Self from chia.types.blockchain_format.program import Program as ChiaProgram +Json = Union[str, bool, int, float, list["Json"], dict[str, "Json"]] ReadableBuffer = Union[bytes, bytearray, memoryview] class _Unspec: diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index bbefde155..1eaa9f053 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -9,6 +9,7 @@ from .sized_ints import uint8, uint16, uint32, uint64, uint128, int8, int16, int from typing_extensions import Self from chia.types.blockchain_format.program import Program as ChiaProgram +Json = Union[str, bool, int, float, list["Json"], dict[str, "Json"]] ReadableBuffer = Union[bytes, bytearray, memoryview] class _Unspec: @@ -160,7 +161,7 @@ class G1Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -191,7 +192,7 @@ class G2Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -218,7 +219,7 @@ class GTElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -250,7 +251,7 @@ class PrivateKey: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -311,7 +312,7 @@ class SpendConditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_id: Union[ bytes, _Unspec] = _Unspec(), @@ -375,7 +376,7 @@ class SpendBundleConditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, spends: Union[ list[SpendConditions], _Unspec] = _Unspec(), @@ -467,7 +468,7 @@ class BlockRecord: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -521,7 +522,7 @@ class Message: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, msg_type: Union[ int, _Unspec] = _Unspec(), @@ -559,7 +560,7 @@ class Handshake: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, network_id: Union[ str, _Unspec] = _Unspec(), @@ -596,7 +597,7 @@ class ClassgroupElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, data: Union[ bytes100, _Unspec] = _Unspec()) -> ClassgroupElement: ... @@ -627,7 +628,7 @@ class Coin: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, parent_coin_info: Union[ bytes32, _Unspec] = _Unspec(), @@ -659,7 +660,7 @@ class CoinSpend: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin: Union[ Coin, _Unspec] = _Unspec(), @@ -691,7 +692,7 @@ class CoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin: Union[ Coin, _Unspec] = _Unspec(), @@ -725,7 +726,7 @@ class EndOfSubSlotBundle: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_chain: Union[ ChallengeChainSubSlot, _Unspec] = _Unspec(), @@ -754,7 +755,7 @@ class FeeRate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, mojos_per_clvm_cost: Union[ uint64, _Unspec] = _Unspec()) -> FeeRate: ... @@ -784,7 +785,7 @@ class FeeEstimate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, error: Union[ Optional[str], _Unspec] = _Unspec(), @@ -814,7 +815,7 @@ class FeeEstimateGroup: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, error: Union[ Optional[str], _Unspec] = _Unspec(), @@ -851,7 +852,7 @@ class TransactionsInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, generator_root: Union[ bytes32, _Unspec] = _Unspec(), @@ -892,7 +893,7 @@ class FoliageTransactionBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, prev_transaction_block_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -931,7 +932,7 @@ class FoliageBlockData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_block_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -971,7 +972,7 @@ class Foliage: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, prev_block_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1010,7 +1011,7 @@ class NewPeak: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1044,7 +1045,7 @@ class NewTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, transaction_id: Union[ bytes32, _Unspec] = _Unspec(), @@ -1072,7 +1073,7 @@ class RequestTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, transaction_id: Union[ bytes32, _Unspec] = _Unspec()) -> RequestTransaction: ... @@ -1098,7 +1099,7 @@ class RespondTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, transaction: Union[ SpendBundle, _Unspec] = _Unspec()) -> RespondTransaction: ... @@ -1126,7 +1127,7 @@ class RequestProofOfWeight: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, total_number_of_blocks: Union[ uint32, _Unspec] = _Unspec(), @@ -1155,7 +1156,7 @@ class RespondProofOfWeight: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, wp: Union[ WeightProof, _Unspec] = _Unspec(), @@ -1184,7 +1185,7 @@ class RequestBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -1211,7 +1212,7 @@ class RejectBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RejectBlock: ... @@ -1241,7 +1242,7 @@ class RequestBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -1273,7 +1274,7 @@ class RespondBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -1303,7 +1304,7 @@ class RejectBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -1330,7 +1331,7 @@ class RespondBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, block: Union[ FullBlock, _Unspec] = _Unspec()) -> RespondBlock: ... @@ -1356,7 +1357,7 @@ class NewUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec()) -> NewUnfinishedBlock: ... @@ -1382,7 +1383,7 @@ class RequestUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec()) -> RequestUnfinishedBlock: ... @@ -1408,7 +1409,7 @@ class RespondUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_block: Union[ UnfinishedBlock, _Unspec] = _Unspec()) -> RespondUnfinishedBlock: ... @@ -1440,7 +1441,7 @@ class NewSignagePointOrEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, prev_challenge_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), @@ -1473,7 +1474,7 @@ class RequestSignagePointOrEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1509,7 +1510,7 @@ class RespondSignagePoint: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, index_from_challenge: Union[ uint8, _Unspec] = _Unspec(), @@ -1539,7 +1540,7 @@ class RespondEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, end_of_slot_bundle: Union[ EndOfSubSlotBundle, _Unspec] = _Unspec()) -> RespondEndOfSubSlot: ... @@ -1565,7 +1566,7 @@ class RequestMempoolTransactions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, filter: Union[ bytes, _Unspec] = _Unspec()) -> RequestMempoolTransactions: ... @@ -1597,7 +1598,7 @@ class NewCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -1632,7 +1633,7 @@ class RequestCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -1669,7 +1670,7 @@ class RespondCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -1697,7 +1698,7 @@ class RequestPeers: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -1722,7 +1723,7 @@ class RespondPeers: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, peer_list: Union[ list[TimestampedPeerInfo], _Unspec] = _Unspec()) -> RespondPeers: ... @@ -1750,7 +1751,7 @@ class NewUnfinishedBlock2: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1779,7 +1780,7 @@ class RequestUnfinishedBlock2: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1836,7 +1837,7 @@ class FullBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -1902,7 +1903,7 @@ class HeaderBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -1942,7 +1943,7 @@ class TimestampedPeerInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, host: Union[ str, _Unspec] = _Unspec(), @@ -1972,7 +1973,7 @@ class PoolTarget: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -2013,7 +2014,7 @@ class Program: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -2048,7 +2049,7 @@ class ProofOfSpace: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge: Union[ bytes32, _Unspec] = _Unspec(), @@ -2093,7 +2094,7 @@ class RewardChainBlockUnfinished: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, total_iters: Union[ uint128, _Unspec] = _Unspec(), @@ -2153,7 +2154,7 @@ class RewardChainBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, weight: Union[ uint128, _Unspec] = _Unspec(), @@ -2198,7 +2199,7 @@ class ChallengeBlockInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, proof_of_space: Union[ ProofOfSpace, _Unspec] = _Unspec(), @@ -2235,7 +2236,7 @@ class ChallengeChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_chain_end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), @@ -2265,7 +2266,7 @@ class InfusedChallengeChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, infused_challenge_chain_end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec()) -> InfusedChallengeChainSubSlot: ... @@ -2297,7 +2298,7 @@ class RewardChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), @@ -2330,7 +2331,7 @@ class SubSlotProofs: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_chain_slot_proof: Union[ VDFProof, _Unspec] = _Unspec(), @@ -2365,7 +2366,7 @@ class SpendBundle: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_spends: Union[ list[CoinSpend], _Unspec] = _Unspec(), @@ -2400,7 +2401,7 @@ class SubEpochSummary: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, prev_subepoch_summary_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -2450,7 +2451,7 @@ class UnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -2499,7 +2500,7 @@ class UnfinishedHeaderBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -2535,7 +2536,7 @@ class VDFInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge: Union[ bytes32, _Unspec] = _Unspec(), @@ -2567,7 +2568,7 @@ class VDFProof: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, witness_type: Union[ uint8, _Unspec] = _Unspec(), @@ -2597,7 +2598,7 @@ class RequestPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), @@ -2630,7 +2631,7 @@ class PuzzleSolutionResponse: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), @@ -2659,7 +2660,7 @@ class RespondPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, response: Union[ PuzzleSolutionResponse, _Unspec] = _Unspec()) -> RespondPuzzleSolution: ... @@ -2687,7 +2688,7 @@ class RejectPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), @@ -2714,7 +2715,7 @@ class SendTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, transaction: Union[ SpendBundle, _Unspec] = _Unspec()) -> SendTransaction: ... @@ -2744,7 +2745,7 @@ class TransactionAck: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, txid: Union[ bytes32, _Unspec] = _Unspec(), @@ -2778,7 +2779,7 @@ class NewPeakWallet: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -2807,7 +2808,7 @@ class RequestBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RequestBlockHeader: ... @@ -2833,7 +2834,7 @@ class RespondBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, header_block: Union[ HeaderBlock, _Unspec] = _Unspec()) -> RespondBlockHeader: ... @@ -2859,7 +2860,7 @@ class RejectHeaderRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RejectHeaderRequest: ... @@ -2889,7 +2890,7 @@ class RequestRemovals: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -2923,7 +2924,7 @@ class RespondRemovals: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -2954,7 +2955,7 @@ class RejectRemovalsRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -2985,7 +2986,7 @@ class RequestAdditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -3019,7 +3020,7 @@ class RespondAdditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -3050,7 +3051,7 @@ class RejectAdditionsRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -3081,7 +3082,7 @@ class RespondBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3111,7 +3112,7 @@ class RejectBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3142,7 +3143,7 @@ class RequestBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3172,7 +3173,7 @@ class RequestHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3201,7 +3202,7 @@ class RejectHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3232,7 +3233,7 @@ class RespondHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3262,7 +3263,7 @@ class RegisterForPhUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3293,7 +3294,7 @@ class RespondToPhUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3323,7 +3324,7 @@ class RegisterForCoinUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3354,7 +3355,7 @@ class RespondToCoinUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3388,7 +3389,7 @@ class CoinStateUpdate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -3417,7 +3418,7 @@ class RequestChildren: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec()) -> RequestChildren: ... @@ -3443,7 +3444,7 @@ class RespondChildren: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondChildren: ... @@ -3471,7 +3472,7 @@ class RequestSesInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3500,7 +3501,7 @@ class RespondSesInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, reward_chain_hash: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3527,7 +3528,7 @@ class RequestFeeEstimates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, time_targets: Union[ list[uint64], _Unspec] = _Unspec()) -> RequestFeeEstimates: ... @@ -3553,7 +3554,7 @@ class RespondFeeEstimates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, estimates: Union[ FeeEstimateGroup, _Unspec] = _Unspec()) -> RespondFeeEstimates: ... @@ -3579,7 +3580,7 @@ class RequestRemovePuzzleSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemovePuzzleSubscriptions: ... @@ -3605,7 +3606,7 @@ class RespondRemovePuzzleSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemovePuzzleSubscriptions: ... @@ -3631,7 +3632,7 @@ class RequestRemoveCoinSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemoveCoinSubscriptions: ... @@ -3657,7 +3658,7 @@ class RespondRemoveCoinSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemoveCoinSubscriptions: ... @@ -3689,7 +3690,7 @@ class CoinStateFilters: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, include_spent: Union[ bool, _Unspec] = _Unspec(), @@ -3726,7 +3727,7 @@ class RequestPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3764,7 +3765,7 @@ class RespondPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3794,7 +3795,7 @@ class RejectPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, reason: Union[ int, _Unspec] = _Unspec()) -> RejectPuzzleState: ... @@ -3826,7 +3827,7 @@ class RequestCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3857,7 +3858,7 @@ class RespondCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3884,7 +3885,7 @@ class RejectCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, reason: Union[ int, _Unspec] = _Unspec()) -> RejectCoinState: ... @@ -3916,7 +3917,7 @@ class SubEpochData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, reward_chain_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3971,7 +3972,7 @@ class SubSlotData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, proof_of_space: Union[ Optional[ProofOfSpace], _Unspec] = _Unspec(), @@ -4013,7 +4014,7 @@ class SubEpochChallengeSegment: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, sub_epoch_n: Union[ uint32, _Unspec] = _Unspec(), @@ -4041,7 +4042,7 @@ class SubEpochSegments: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_segments: Union[ list[SubEpochChallengeSegment], _Unspec] = _Unspec()) -> SubEpochSegments: ... @@ -4067,7 +4068,7 @@ class RecentChainData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, recent_chain_data: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> RecentChainData: ... @@ -4095,7 +4096,7 @@ class ProofBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -4126,7 +4127,7 @@ class WeightProof: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, sub_epochs: Union[ list[SubEpochData], _Unspec] = _Unspec(), @@ -4244,7 +4245,7 @@ class ConsensusConstants: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, SLOT_BLOCKS_TARGET: Union[ uint32, _Unspec] = _Unspec(), diff --git a/wheel/stubtest.allowlist b/wheel/stubtest.allowlist index 0da900bc1..77420a8f4 100644 --- a/wheel/stubtest.allowlist +++ b/wheel/stubtest.allowlist @@ -7,6 +7,10 @@ chia_rs\.chia_rs\..* # runtime accessible. is there a better option for handling this? chia_rs\.ReadableBuffer +# this is offered to help with hinting only and is not intended to be +# runtime accessible. is there a better option for handling this? +chia_rs\.Json + # TODO: perhaps these should be private as _* chia_rs\.BlockRecord\.ip_iters_impl chia_rs\.BlockRecord\.ip_sub_slot_total_iters_impl From aca98183aafd177d433e3e7ed34364cfaf9ce584 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 09:10:08 -0400 Subject: [PATCH 06/11] dict[str, Any] --- wheel/generate_type_stubs.py | 5 +- wheel/python/chia_rs/chia_rs.pyi | 477 +++++++++++++++---------------- wheel/stubtest.allowlist | 4 - 3 files changed, 240 insertions(+), 246 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 1ed287483..33262a7e5 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -67,9 +67,9 @@ def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... """ ) @@ -267,7 +267,6 @@ def parse_rust_source(filename: str, upper_case: bool) -> list[tuple[str, list[s from typing_extensions import Self from chia.types.blockchain_format.program import Program as ChiaProgram -Json = Union[str, bool, int, float, list["Json"], dict[str, "Json"]] ReadableBuffer = Union[bytes, bytearray, memoryview] class _Unspec: diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index 1eaa9f053..0209dd864 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -9,7 +9,6 @@ from .sized_ints import uint8, uint16, uint32, uint64, uint128, int8, int16, int from typing_extensions import Self from chia.types.blockchain_format.program import Program as ChiaProgram -Json = Union[str, bool, int, float, list["Json"], dict[str, "Json"]] ReadableBuffer = Union[bytes, bytearray, memoryview] class _Unspec: @@ -161,9 +160,9 @@ class G1Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class G2Element: @@ -192,9 +191,9 @@ class G2Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class GTElement: @@ -219,9 +218,9 @@ class GTElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class PrivateKey: @@ -251,9 +250,9 @@ class PrivateKey: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class SpendConditions: @@ -312,9 +311,9 @@ class SpendConditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_id: Union[ bytes, _Unspec] = _Unspec(), parent_id: Union[ bytes, _Unspec] = _Unspec(), puzzle_hash: Union[ bytes, _Unspec] = _Unspec(), @@ -376,9 +375,9 @@ class SpendBundleConditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, spends: Union[ list[SpendConditions], _Unspec] = _Unspec(), reserve_fee: Union[ int, _Unspec] = _Unspec(), height_absolute: Union[ int, _Unspec] = _Unspec(), @@ -468,9 +467,9 @@ class BlockRecord: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), prev_hash: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), @@ -522,9 +521,9 @@ class Message: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, msg_type: Union[ int, _Unspec] = _Unspec(), id: Union[ Optional[uint16], _Unspec] = _Unspec(), data: Union[ bytes, _Unspec] = _Unspec()) -> Message: ... @@ -560,9 +559,9 @@ class Handshake: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, network_id: Union[ str, _Unspec] = _Unspec(), protocol_version: Union[ str, _Unspec] = _Unspec(), software_version: Union[ str, _Unspec] = _Unspec(), @@ -597,9 +596,9 @@ class ClassgroupElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, data: Union[ bytes100, _Unspec] = _Unspec()) -> ClassgroupElement: ... @final @@ -628,9 +627,9 @@ class Coin: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, parent_coin_info: Union[ bytes32, _Unspec] = _Unspec(), puzzle_hash: Union[ bytes32, _Unspec] = _Unspec(), amount: Union[ uint64, _Unspec] = _Unspec()) -> Coin: ... @@ -660,9 +659,9 @@ class CoinSpend: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin: Union[ Coin, _Unspec] = _Unspec(), puzzle_reveal: Union[ Program, _Unspec] = _Unspec(), solution: Union[ Program, _Unspec] = _Unspec()) -> CoinSpend: ... @@ -692,9 +691,9 @@ class CoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin: Union[ Coin, _Unspec] = _Unspec(), spent_height: Union[ Optional[uint32], _Unspec] = _Unspec(), created_height: Union[ Optional[uint32], _Unspec] = _Unspec()) -> CoinState: ... @@ -726,9 +725,9 @@ class EndOfSubSlotBundle: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_chain: Union[ ChallengeChainSubSlot, _Unspec] = _Unspec(), infused_challenge_chain: Union[ Optional[InfusedChallengeChainSubSlot], _Unspec] = _Unspec(), reward_chain: Union[ RewardChainSubSlot, _Unspec] = _Unspec(), @@ -755,9 +754,9 @@ class FeeRate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, mojos_per_clvm_cost: Union[ uint64, _Unspec] = _Unspec()) -> FeeRate: ... @final @@ -785,9 +784,9 @@ class FeeEstimate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, error: Union[ Optional[str], _Unspec] = _Unspec(), time_target: Union[ uint64, _Unspec] = _Unspec(), estimated_fee_rate: Union[ FeeRate, _Unspec] = _Unspec()) -> FeeEstimate: ... @@ -815,9 +814,9 @@ class FeeEstimateGroup: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, error: Union[ Optional[str], _Unspec] = _Unspec(), estimates: Union[ list[FeeEstimate], _Unspec] = _Unspec()) -> FeeEstimateGroup: ... @@ -852,9 +851,9 @@ class TransactionsInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, generator_root: Union[ bytes32, _Unspec] = _Unspec(), generator_refs_root: Union[ bytes32, _Unspec] = _Unspec(), aggregated_signature: Union[ G2Element, _Unspec] = _Unspec(), @@ -893,9 +892,9 @@ class FoliageTransactionBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, prev_transaction_block_hash: Union[ bytes32, _Unspec] = _Unspec(), timestamp: Union[ uint64, _Unspec] = _Unspec(), filter_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -932,9 +931,9 @@ class FoliageBlockData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_block_hash: Union[ bytes32, _Unspec] = _Unspec(), pool_target: Union[ PoolTarget, _Unspec] = _Unspec(), pool_signature: Union[ Optional[G2Element], _Unspec] = _Unspec(), @@ -972,9 +971,9 @@ class Foliage: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, prev_block_hash: Union[ bytes32, _Unspec] = _Unspec(), reward_block_hash: Union[ bytes32, _Unspec] = _Unspec(), foliage_block_data: Union[ FoliageBlockData, _Unspec] = _Unspec(), @@ -1011,9 +1010,9 @@ class NewPeak: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), weight: Union[ uint128, _Unspec] = _Unspec(), @@ -1045,9 +1044,9 @@ class NewTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, transaction_id: Union[ bytes32, _Unspec] = _Unspec(), cost: Union[ uint64, _Unspec] = _Unspec(), fees: Union[ uint64, _Unspec] = _Unspec()) -> NewTransaction: ... @@ -1073,9 +1072,9 @@ class RequestTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, transaction_id: Union[ bytes32, _Unspec] = _Unspec()) -> RequestTransaction: ... @final @@ -1099,9 +1098,9 @@ class RespondTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, transaction: Union[ SpendBundle, _Unspec] = _Unspec()) -> RespondTransaction: ... @final @@ -1127,9 +1126,9 @@ class RequestProofOfWeight: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, total_number_of_blocks: Union[ uint32, _Unspec] = _Unspec(), tip: Union[ bytes32, _Unspec] = _Unspec()) -> RequestProofOfWeight: ... @@ -1156,9 +1155,9 @@ class RespondProofOfWeight: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, wp: Union[ WeightProof, _Unspec] = _Unspec(), tip: Union[ bytes32, _Unspec] = _Unspec()) -> RespondProofOfWeight: ... @@ -1185,9 +1184,9 @@ class RequestBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), include_transaction_block: Union[ bool, _Unspec] = _Unspec()) -> RequestBlock: ... @@ -1212,9 +1211,9 @@ class RejectBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RejectBlock: ... @final @@ -1242,9 +1241,9 @@ class RequestBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), include_transaction_block: Union[ bool, _Unspec] = _Unspec()) -> RequestBlocks: ... @@ -1274,9 +1273,9 @@ class RespondBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), blocks: Union[ list[FullBlock], _Unspec] = _Unspec()) -> RespondBlocks: ... @@ -1304,9 +1303,9 @@ class RejectBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RejectBlocks: ... @@ -1331,9 +1330,9 @@ class RespondBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, block: Union[ FullBlock, _Unspec] = _Unspec()) -> RespondBlock: ... @final @@ -1357,9 +1356,9 @@ class NewUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec()) -> NewUnfinishedBlock: ... @final @@ -1383,9 +1382,9 @@ class RequestUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec()) -> RequestUnfinishedBlock: ... @final @@ -1409,9 +1408,9 @@ class RespondUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_block: Union[ UnfinishedBlock, _Unspec] = _Unspec()) -> RespondUnfinishedBlock: ... @final @@ -1441,9 +1440,9 @@ class NewSignagePointOrEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, prev_challenge_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), challenge_hash: Union[ bytes32, _Unspec] = _Unspec(), index_from_challenge: Union[ uint8, _Unspec] = _Unspec(), @@ -1474,9 +1473,9 @@ class RequestSignagePointOrEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_hash: Union[ bytes32, _Unspec] = _Unspec(), index_from_challenge: Union[ uint8, _Unspec] = _Unspec(), last_rc_infusion: Union[ bytes32, _Unspec] = _Unspec()) -> RequestSignagePointOrEndOfSubSlot: ... @@ -1510,9 +1509,9 @@ class RespondSignagePoint: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, index_from_challenge: Union[ uint8, _Unspec] = _Unspec(), challenge_chain_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), challenge_chain_proof: Union[ VDFProof, _Unspec] = _Unspec(), @@ -1540,9 +1539,9 @@ class RespondEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, end_of_slot_bundle: Union[ EndOfSubSlotBundle, _Unspec] = _Unspec()) -> RespondEndOfSubSlot: ... @final @@ -1566,9 +1565,9 @@ class RequestMempoolTransactions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, filter: Union[ bytes, _Unspec] = _Unspec()) -> RequestMempoolTransactions: ... @final @@ -1598,9 +1597,9 @@ class NewCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), field_vdf: Union[ uint8, _Unspec] = _Unspec(), @@ -1633,9 +1632,9 @@ class RequestCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), field_vdf: Union[ uint8, _Unspec] = _Unspec(), @@ -1670,9 +1669,9 @@ class RespondCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), field_vdf: Union[ uint8, _Unspec] = _Unspec(), @@ -1698,9 +1697,9 @@ class RequestPeers: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class RespondPeers: @@ -1723,9 +1722,9 @@ class RespondPeers: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, peer_list: Union[ list[TimestampedPeerInfo], _Unspec] = _Unspec()) -> RespondPeers: ... @final @@ -1751,9 +1750,9 @@ class NewUnfinishedBlock2: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec(), foliage_hash: Union[ Optional[bytes32], _Unspec] = _Unspec()) -> NewUnfinishedBlock2: ... @@ -1780,9 +1779,9 @@ class RequestUnfinishedBlock2: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec(), foliage_hash: Union[ Optional[bytes32], _Unspec] = _Unspec()) -> RequestUnfinishedBlock2: ... @@ -1837,9 +1836,9 @@ class FullBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... 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(), @@ -1903,9 +1902,9 @@ class HeaderBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... 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(), @@ -1943,9 +1942,9 @@ class TimestampedPeerInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, host: Union[ str, _Unspec] = _Unspec(), port: Union[ uint16, _Unspec] = _Unspec(), timestamp: Union[ uint64, _Unspec] = _Unspec()) -> TimestampedPeerInfo: ... @@ -1973,9 +1972,9 @@ class PoolTarget: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hash: Union[ bytes32, _Unspec] = _Unspec(), max_height: Union[ uint32, _Unspec] = _Unspec()) -> PoolTarget: ... @@ -2014,9 +2013,9 @@ class Program: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class ProofOfSpace: @@ -2049,9 +2048,9 @@ class ProofOfSpace: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge: Union[ bytes32, _Unspec] = _Unspec(), pool_public_key: Union[ Optional[G1Element], _Unspec] = _Unspec(), pool_contract_puzzle_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), @@ -2094,9 +2093,9 @@ class RewardChainBlockUnfinished: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, total_iters: Union[ uint128, _Unspec] = _Unspec(), signage_point_index: Union[ uint8, _Unspec] = _Unspec(), pos_ss_cc_challenge_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -2154,9 +2153,9 @@ class RewardChainBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, weight: Union[ uint128, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), total_iters: Union[ uint128, _Unspec] = _Unspec(), @@ -2199,9 +2198,9 @@ class ChallengeBlockInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, proof_of_space: Union[ ProofOfSpace, _Unspec] = _Unspec(), challenge_chain_sp_vdf: Union[ Optional[VDFInfo], _Unspec] = _Unspec(), challenge_chain_sp_signature: Union[ G2Element, _Unspec] = _Unspec(), @@ -2236,9 +2235,9 @@ class ChallengeChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_chain_end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), infused_challenge_chain_sub_slot_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), subepoch_summary_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), @@ -2266,9 +2265,9 @@ class InfusedChallengeChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, infused_challenge_chain_end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec()) -> InfusedChallengeChainSubSlot: ... @final @@ -2298,9 +2297,9 @@ class RewardChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), challenge_chain_sub_slot_hash: Union[ bytes32, _Unspec] = _Unspec(), infused_challenge_chain_sub_slot_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), @@ -2331,9 +2330,9 @@ class SubSlotProofs: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_chain_slot_proof: Union[ VDFProof, _Unspec] = _Unspec(), infused_challenge_chain_slot_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), reward_chain_slot_proof: Union[ VDFProof, _Unspec] = _Unspec()) -> SubSlotProofs: ... @@ -2366,9 +2365,9 @@ class SpendBundle: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_spends: Union[ list[CoinSpend], _Unspec] = _Unspec(), aggregated_signature: Union[ G2Element, _Unspec] = _Unspec()) -> SpendBundle: ... @@ -2401,9 +2400,9 @@ class SubEpochSummary: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, prev_subepoch_summary_hash: Union[ bytes32, _Unspec] = _Unspec(), reward_chain_hash: Union[ bytes32, _Unspec] = _Unspec(), num_blocks_overflow: Union[ uint8, _Unspec] = _Unspec(), @@ -2451,9 +2450,9 @@ class UnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... 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(), @@ -2500,9 +2499,9 @@ class UnfinishedHeaderBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... 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(), @@ -2536,9 +2535,9 @@ class VDFInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge: Union[ bytes32, _Unspec] = _Unspec(), number_of_iterations: Union[ uint64, _Unspec] = _Unspec(), output: Union[ ClassgroupElement, _Unspec] = _Unspec()) -> VDFInfo: ... @@ -2568,9 +2567,9 @@ class VDFProof: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, witness_type: Union[ uint8, _Unspec] = _Unspec(), witness: Union[ bytes, _Unspec] = _Unspec(), normalized_to_identity: Union[ bool, _Unspec] = _Unspec()) -> VDFProof: ... @@ -2598,9 +2597,9 @@ class RequestPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec()) -> RequestPuzzleSolution: ... @@ -2631,9 +2630,9 @@ class PuzzleSolutionResponse: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), puzzle: Union[ Program, _Unspec] = _Unspec(), @@ -2660,9 +2659,9 @@ class RespondPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, response: Union[ PuzzleSolutionResponse, _Unspec] = _Unspec()) -> RespondPuzzleSolution: ... @final @@ -2688,9 +2687,9 @@ class RejectPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec()) -> RejectPuzzleSolution: ... @@ -2715,9 +2714,9 @@ class SendTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, transaction: Union[ SpendBundle, _Unspec] = _Unspec()) -> SendTransaction: ... @final @@ -2745,9 +2744,9 @@ class TransactionAck: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, txid: Union[ bytes32, _Unspec] = _Unspec(), status: Union[ uint8, _Unspec] = _Unspec(), error: Union[ Optional[str], _Unspec] = _Unspec()) -> TransactionAck: ... @@ -2779,9 +2778,9 @@ class NewPeakWallet: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), weight: Union[ uint128, _Unspec] = _Unspec(), @@ -2808,9 +2807,9 @@ class RequestBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RequestBlockHeader: ... @final @@ -2834,9 +2833,9 @@ class RespondBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, header_block: Union[ HeaderBlock, _Unspec] = _Unspec()) -> RespondBlockHeader: ... @final @@ -2860,9 +2859,9 @@ class RejectHeaderRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RejectHeaderRequest: ... @final @@ -2890,9 +2889,9 @@ class RequestRemovals: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, 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: ... @@ -2924,9 +2923,9 @@ class RespondRemovals: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, 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(), @@ -2955,9 +2954,9 @@ class RejectRemovalsRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec()) -> RejectRemovalsRequest: ... @@ -2986,9 +2985,9 @@ class RequestAdditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, 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: ... @@ -3020,9 +3019,9 @@ class RespondAdditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, 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(), @@ -3051,9 +3050,9 @@ class RejectAdditionsRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec()) -> RejectAdditionsRequest: ... @@ -3082,9 +3081,9 @@ class RespondBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, 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: ... @@ -3112,9 +3111,9 @@ class RejectBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RejectBlockHeaders: ... @@ -3143,9 +3142,9 @@ class RequestBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), return_filter: Union[ bool, _Unspec] = _Unspec()) -> RequestBlockHeaders: ... @@ -3173,9 +3172,9 @@ class RequestHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RequestHeaderBlocks: ... @@ -3202,9 +3201,9 @@ class RejectHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RejectHeaderBlocks: ... @@ -3233,9 +3232,9 @@ class RespondHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, 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: ... @@ -3263,9 +3262,9 @@ class RegisterForPhUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec()) -> RegisterForPhUpdates: ... @@ -3294,9 +3293,9 @@ class RespondToPhUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec(), coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondToPhUpdates: ... @@ -3324,9 +3323,9 @@ class RegisterForCoinUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec()) -> RegisterForCoinUpdates: ... @@ -3355,9 +3354,9 @@ class RespondToCoinUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec(), coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondToCoinUpdates: ... @@ -3389,9 +3388,9 @@ class CoinStateUpdate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), fork_height: Union[ uint32, _Unspec] = _Unspec(), peak_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3418,9 +3417,9 @@ class RequestChildren: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec()) -> RequestChildren: ... @final @@ -3444,9 +3443,9 @@ class RespondChildren: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondChildren: ... @final @@ -3472,9 +3471,9 @@ class RequestSesInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RequestSesInfo: ... @@ -3501,9 +3500,9 @@ class RespondSesInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, reward_chain_hash: Union[ list[bytes32], _Unspec] = _Unspec(), heights: Union[ list[list[uint32]], _Unspec] = _Unspec()) -> RespondSesInfo: ... @@ -3528,9 +3527,9 @@ class RequestFeeEstimates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, time_targets: Union[ list[uint64], _Unspec] = _Unspec()) -> RequestFeeEstimates: ... @final @@ -3554,9 +3553,9 @@ class RespondFeeEstimates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, estimates: Union[ FeeEstimateGroup, _Unspec] = _Unspec()) -> RespondFeeEstimates: ... @final @@ -3580,9 +3579,9 @@ class RequestRemovePuzzleSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemovePuzzleSubscriptions: ... @final @@ -3606,9 +3605,9 @@ class RespondRemovePuzzleSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemovePuzzleSubscriptions: ... @final @@ -3632,9 +3631,9 @@ class RequestRemoveCoinSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemoveCoinSubscriptions: ... @final @@ -3658,9 +3657,9 @@ class RespondRemoveCoinSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemoveCoinSubscriptions: ... @final @@ -3690,9 +3689,9 @@ class CoinStateFilters: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, include_spent: Union[ bool, _Unspec] = _Unspec(), include_unspent: Union[ bool, _Unspec] = _Unspec(), include_hinted: Union[ bool, _Unspec] = _Unspec(), @@ -3727,9 +3726,9 @@ class RequestPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), previous_height: Union[ Optional[uint32], _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3765,9 +3764,9 @@ class RespondPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3795,9 +3794,9 @@ class RejectPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, reason: Union[ int, _Unspec] = _Unspec()) -> RejectPuzzleState: ... @final @@ -3827,9 +3826,9 @@ class RequestCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), previous_height: Union[ Optional[uint32], _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3858,9 +3857,9 @@ class RespondCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondCoinState: ... @@ -3885,9 +3884,9 @@ class RejectCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, reason: Union[ int, _Unspec] = _Unspec()) -> RejectCoinState: ... @final @@ -3917,9 +3916,9 @@ class SubEpochData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, reward_chain_hash: Union[ bytes32, _Unspec] = _Unspec(), num_blocks_overflow: Union[ uint8, _Unspec] = _Unspec(), new_sub_slot_iters: Union[ Optional[uint64], _Unspec] = _Unspec(), @@ -3972,9 +3971,9 @@ class SubSlotData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, proof_of_space: Union[ Optional[ProofOfSpace], _Unspec] = _Unspec(), cc_signage_point: Union[ Optional[VDFProof], _Unspec] = _Unspec(), cc_infusion_point: Union[ Optional[VDFProof], _Unspec] = _Unspec(), @@ -4014,9 +4013,9 @@ class SubEpochChallengeSegment: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, sub_epoch_n: Union[ uint32, _Unspec] = _Unspec(), sub_slots: Union[ list[SubSlotData], _Unspec] = _Unspec(), rc_slot_end_info: Union[ Optional[VDFInfo], _Unspec] = _Unspec()) -> SubEpochChallengeSegment: ... @@ -4042,9 +4041,9 @@ class SubEpochSegments: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_segments: Union[ list[SubEpochChallengeSegment], _Unspec] = _Unspec()) -> SubEpochSegments: ... @final @@ -4068,9 +4067,9 @@ class RecentChainData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, recent_chain_data: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> RecentChainData: ... @final @@ -4096,9 +4095,9 @@ class ProofBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlock, _Unspec] = _Unspec()) -> ProofBlockHeader: ... @@ -4127,9 +4126,9 @@ class WeightProof: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, 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: ... @@ -4245,9 +4244,9 @@ class ConsensusConstants: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, SLOT_BLOCKS_TARGET: Union[ uint32, _Unspec] = _Unspec(), MIN_BLOCKS_PER_CHALLENGE_BLOCK: Union[ uint8, _Unspec] = _Unspec(), MAX_SUB_SLOT_BLOCKS: Union[ uint32, _Unspec] = _Unspec(), diff --git a/wheel/stubtest.allowlist b/wheel/stubtest.allowlist index 77420a8f4..0da900bc1 100644 --- a/wheel/stubtest.allowlist +++ b/wheel/stubtest.allowlist @@ -7,10 +7,6 @@ chia_rs\.chia_rs\..* # runtime accessible. is there a better option for handling this? chia_rs\.ReadableBuffer -# this is offered to help with hinting only and is not intended to be -# runtime accessible. is there a better option for handling this? -chia_rs\.Json - # TODO: perhaps these should be private as _* chia_rs\.BlockRecord\.ip_iters_impl chia_rs\.BlockRecord\.ip_sub_slot_total_iters_impl From ef4c1ddf54074c4db6ffc84b99cce9d484157f93 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 10:24:17 -0400 Subject: [PATCH 07/11] a touch better --- wheel/generate_type_stubs.py | 10 +++++++--- wheel/python/chia_rs/chia_rs.pyi | 16 ++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 33262a7e5..6db2ee509 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -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, martialed_for_json_hint: str = "dict[str, Any]", ): def add_indent(x: str): return "\n " + x @@ -67,9 +67,9 @@ def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> {martialed_for_json_hint}: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: {martialed_for_json_hint}) -> Self: ... """ ) @@ -407,6 +407,7 @@ def __init__( "def __iadd__(self, other: G1Element) -> G1Element: ...", "def derive_unhardened(self, idx: int) -> G1Element: ...", ], + martialed_for_json_hint="str", ) print_class( file, @@ -422,6 +423,7 @@ def __init__( "def __add__(self, other: G2Element) -> G2Element: ...", "def __iadd__(self, other: G2Element) -> G2Element: ...", ], + martialed_for_json_hint="str", ) print_class( file, @@ -433,6 +435,7 @@ def __init__( "def __mul__(self, rhs: GTElement) -> GTElement: ...", "def __imul__(self, rhs: GTElement) -> GTElement : ...", ], + martialed_for_json_hint="str", ) print_class( file, @@ -449,6 +452,7 @@ def __init__( "@staticmethod", "def from_seed(seed: bytes) -> PrivateKey: ...", ], + martialed_for_json_hint="str", ) print_class( diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index 0209dd864..4ce357497 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -160,9 +160,9 @@ class G1Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class G2Element: @@ -191,9 +191,9 @@ class G2Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class GTElement: @@ -218,9 +218,9 @@ class GTElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class PrivateKey: @@ -250,9 +250,9 @@ class PrivateKey: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class SpendConditions: From 2e466f34e6359036e99370b65652a5f023a74dbf Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 10:34:11 -0400 Subject: [PATCH 08/11] and inching closer --- wheel/generate_type_stubs.py | 8 ++++++-- wheel/python/chia_rs/chia_rs.pyi | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 6db2ee509..d3e70eb29 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -22,11 +22,14 @@ def transform_type(m: str) -> str: def print_class( - file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martialed_for_json_hint: str = "dict[str, Any]", + file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martialed_for_json_hint: Optional[str] = None, ): def add_indent(x: str): return "\n " + x + if martialed_for_json_hint is None: + martialed_for_json_hint = "dict[str, Any]" + init_args = "".join([(",\n " + transform_type(x)) for x in members]) all_replace_parameters = [] @@ -500,4 +503,5 @@ def __init__( ) for item in classes: - print_class(file, item[0], item[1], extra_members.get(item[0])) + # TODO: yeah... nope, don't do it this way + print_class(file, item[0], item[1], extra_members.get(item[0]), martialed_for_json_hint=None if item[0] != "Program" else "str") diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index 4ce357497..fb8ee3c06 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -2013,9 +2013,9 @@ class Program: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class ProofOfSpace: From ae105721b7b4b7e9849c4b5493fc6e9e4f4b147d Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 10:38:02 -0400 Subject: [PATCH 09/11] and there --- wheel/generate_type_stubs.py | 25 +++++++++++++++---------- wheel/python/chia_rs/chia_rs.pyi | 4 ++-- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index d3e70eb29..5453497a7 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -22,13 +22,16 @@ def transform_type(m: str) -> str: def print_class( - file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martialed_for_json_hint: Optional[str] = None, + file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martial_for_json_hint: Optional[str] = None, unmartial_from_json_hint: Optional[str] = None, ): def add_indent(x: str): return "\n " + x - if martialed_for_json_hint is None: - martialed_for_json_hint = "dict[str, Any]" + if martial_for_json_hint is None: + martial_for_json_hint = "dict[str, Any]" + + if unmartial_from_json_hint is None: + unmartial_from_json_hint = martial_for_json_hint init_args = "".join([(",\n " + transform_type(x)) for x in members]) @@ -70,9 +73,9 @@ def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> {martialed_for_json_hint}: ... + def to_json_dict(self) -> {martial_for_json_hint}: ... @classmethod - def from_json_dict(cls, json_dict: {martialed_for_json_hint}) -> Self: ... + def from_json_dict(cls, json_dict: {unmartial_from_json_hint}) -> Self: ... """ ) @@ -410,7 +413,8 @@ def __init__( "def __iadd__(self, other: G1Element) -> G1Element: ...", "def derive_unhardened(self, idx: int) -> G1Element: ...", ], - martialed_for_json_hint="str", + martial_for_json_hint="str", + unmartial_from_json_hint="Union[str, bytes]", ) print_class( file, @@ -426,7 +430,8 @@ def __init__( "def __add__(self, other: G2Element) -> G2Element: ...", "def __iadd__(self, other: G2Element) -> G2Element: ...", ], - martialed_for_json_hint="str", + martial_for_json_hint="str", + unmartial_from_json_hint="Union[str, bytes]", ) print_class( file, @@ -438,7 +443,7 @@ def __init__( "def __mul__(self, rhs: GTElement) -> GTElement: ...", "def __imul__(self, rhs: GTElement) -> GTElement : ...", ], - martialed_for_json_hint="str", + martial_for_json_hint="str", ) print_class( file, @@ -455,7 +460,7 @@ def __init__( "@staticmethod", "def from_seed(seed: bytes) -> PrivateKey: ...", ], - martialed_for_json_hint="str", + martial_for_json_hint="str", ) print_class( @@ -504,4 +509,4 @@ def __init__( for item in classes: # TODO: yeah... nope, don't do it this way - print_class(file, item[0], item[1], extra_members.get(item[0]), martialed_for_json_hint=None if item[0] != "Program" else "str") + print_class(file, item[0], item[1], extra_members.get(item[0]), martial_for_json_hint=None if item[0] != "Program" else "str") diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index fb8ee3c06..7f8dc7c25 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -162,7 +162,7 @@ class G1Element: def get_hash(self) -> bytes32: ... def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: str) -> Self: ... + def from_json_dict(cls, json_dict: Union[str, bytes]) -> Self: ... @final class G2Element: @@ -193,7 +193,7 @@ class G2Element: def get_hash(self) -> bytes32: ... def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: str) -> Self: ... + def from_json_dict(cls, json_dict: Union[str, bytes]) -> Self: ... @final class GTElement: From b0ef5df67496b16e9fc4b49b0b2e2d412a15c336 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 10:54:37 -0400 Subject: [PATCH 10/11] tidy code hack --- wheel/generate_type_stubs.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 5453497a7..1ff2e9562 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -22,7 +22,12 @@ def transform_type(m: str) -> str: def print_class( - file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martial_for_json_hint: Optional[str] = None, unmartial_from_json_hint: Optional[str] = None, + file: TextIO, + name: str, + members: list[str], + extra: Optional[list[str]] = None, + martial_for_json_hint: Optional[str] = None, + unmartial_from_json_hint: Optional[str] = None, ): def add_indent(x: str): return "\n " + x @@ -508,5 +513,9 @@ def __init__( ) for item in classes: - # TODO: yeah... nope, don't do it this way - print_class(file, item[0], item[1], extra_members.get(item[0]), martial_for_json_hint=None if item[0] != "Program" else "str") + # TODO: adjust the system to provide this control via more paths + martial_for_json_hint = None + if item[0] == "Program": + martial_for_json_hint = "str" + + print_class(file, item[0], item[1], extra_members.get(item[0]), martial_for_json_hint=martial_for_json_hint) From 5b85f754988a9d8ad748c24ecc5cc17c99a83457 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 11:10:41 -0400 Subject: [PATCH 11/11] black --- wheel/generate_type_stubs.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 1ff2e9562..169ab53b6 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -518,4 +518,10 @@ def __init__( if item[0] == "Program": martial_for_json_hint = "str" - print_class(file, item[0], item[1], extra_members.get(item[0]), martial_for_json_hint=martial_for_json_hint) + print_class( + file, + item[0], + item[1], + extra_members.get(item[0]), + martial_for_json_hint=martial_for_json_hint, + )