chia-dev-tools 1.2.4__tar.gz → 1.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/workflows/precommit.yml +4 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/workflows/super-linter.yml +0 -2
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.pre-commit-config.yaml +5 -0
- chia_dev_tools-1.2.6/.repo-content-updater.yml +2 -0
- {chia_dev_tools-1.2.4/chia_dev_tools.egg-info → chia_dev_tools-1.2.6}/PKG-INFO +3 -3
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/activated.sh +5 -2
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/cmds/chia_inspect.py +7 -6
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/examples/tests/test_piggybank.py +6 -6
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/test/__init__.py +24 -29
- {chia_dev_tools-1.2.4/tests → chia_dev_tools-1.2.6/cdv/test}/test_skeleton.py +4 -4
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6/chia_dev_tools.egg-info}/PKG-INFO +3 -3
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/chia_dev_tools.egg-info/SOURCES.txt +1 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/chia_dev_tools.egg-info/requires.txt +2 -2
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/setup.py +2 -2
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spendbundles/spendbundle.json +1 -1
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spends/spend.json +1 -1
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spends/spend_2.json +1 -1
- {chia_dev_tools-1.2.4/cdv/test → chia_dev_tools-1.2.6/tests}/test_skeleton.py +4 -4
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.flake8 +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/actions/install/action.yml +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/actions/install/install.ps1 +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/actions/install/install.sh +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/dependabot.yml +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/workflows/codeql-analysis.yml +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/workflows/dependency-review.yml +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/workflows/publish-to-pypi.yml +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/workflows/run-test-suite.yml +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.github/workflows/test-blockchain-main.yml +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.gitignore +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.isort.cfg +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/.markdown-lint.yml +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/LICENSE +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/README.md +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/activated.ps1 +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/activated.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/clibs/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/clibs/condition_codes.clib +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/clibs/curry_and_treehash.clib +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/clibs/sha256tree.clib +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/clibs/singleton_truths.clib +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/clibs/utility_macros.clib +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/cmds/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/cmds/cli.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/cmds/clsp.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/cmds/rpc.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/cmds/util.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/examples/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/examples/clsp/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/examples/clsp/piggybank.clsp +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/examples/clsp/piggybank.clsp.hex +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/examples/clvm/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/examples/drivers/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/examples/drivers/piggybank_drivers.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/util/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/util/keys.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/cdv/util/load_clvm.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/chia_dev_tools.egg-info/dependency_links.txt +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/chia_dev_tools.egg-info/entry_points.txt +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/chia_dev_tools.egg-info/top_level.txt +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/mypy.ini +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/pyproject.toml +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/pytest.ini +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/setup.cfg +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/build-init-files.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/__init__.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coinrecords/coinrecord.hex +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coinrecords/coinrecord.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coinrecords/coinrecord_invalid.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coinrecords/coinrecord_metadata.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coins/coin.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coins/coin_invalid.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coins/coin_metadata.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spendbundles/spendbundle.hex +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spendbundles/spendbundle_invalid.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spendbundles/spendbundle_metadata.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spends/spend.hex +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spends/spend_invalid.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spends/spend_metadata.json +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/test_cdv.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/test_clsp.py +0 -0
- {chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/test_inspect.py +0 -0
|
@@ -53,6 +53,10 @@ jobs:
|
|
|
53
53
|
- name: Add safe git directory
|
|
54
54
|
uses: Chia-Network/actions/git-mark-workspace-safe@main
|
|
55
55
|
|
|
56
|
+
- name: disable git autocrlf
|
|
57
|
+
run: |
|
|
58
|
+
git config --global core.autocrlf false
|
|
59
|
+
|
|
56
60
|
- uses: actions/checkout@v4
|
|
57
61
|
|
|
58
62
|
- uses: Chia-Network/actions/setup-python@main
|
|
@@ -63,10 +63,8 @@ jobs:
|
|
|
63
63
|
VALIDATE_POWERSHELL: true
|
|
64
64
|
VALIDATE_PYTHON: true
|
|
65
65
|
VALIDATE_PYTHON_PYLINT: true
|
|
66
|
-
VALIDATE_PYTHON_FLAKE8: true
|
|
67
66
|
VALIDATE_PYTHON_ISORT: true
|
|
68
67
|
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
|
|
69
|
-
VALIDATE_SHELL_SHFMT: true
|
|
70
68
|
VALIDATE_TYPESCRIPT_ES: true
|
|
71
69
|
VALIDATE_YAML: true
|
|
72
70
|
DISABLE_ERRORS: false
|
|
@@ -28,6 +28,11 @@ repos:
|
|
|
28
28
|
args: ['--filter-files']
|
|
29
29
|
minimum_pre_commit_version: '2.9.2'
|
|
30
30
|
additional_dependencies: [isort==5.10.1]
|
|
31
|
+
- repo: https://github.com/scop/pre-commit-shfmt
|
|
32
|
+
rev: v3.8.0-1
|
|
33
|
+
hooks:
|
|
34
|
+
- id: shfmt
|
|
35
|
+
args: ["--diff", "--write", "-i", "2"]
|
|
31
36
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
32
37
|
rev: v4.0.1
|
|
33
38
|
hooks:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chia_dev_tools
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.6
|
|
4
4
|
Summary: Chia development commands
|
|
5
5
|
Home-page: https://github.com/Chia-Network
|
|
6
6
|
Author: Quexington
|
|
@@ -20,12 +20,12 @@ Requires-Dist: pytest
|
|
|
20
20
|
Requires-Dist: pytest-asyncio
|
|
21
21
|
Requires-Dist: pytimeparse
|
|
22
22
|
Requires-Dist: anyio
|
|
23
|
-
Requires-Dist: chia-blockchain==2.
|
|
23
|
+
Requires-Dist: chia-blockchain==2.3.0
|
|
24
24
|
Provides-Extra: dev
|
|
25
25
|
Requires-Dist: anyio; extra == "dev"
|
|
26
26
|
Requires-Dist: flake8; extra == "dev"
|
|
27
27
|
Requires-Dist: mypy; extra == "dev"
|
|
28
|
-
Requires-Dist: black==24.4.
|
|
28
|
+
Requires-Dist: black==24.4.2; extra == "dev"
|
|
29
29
|
Requires-Dist: types-aiofiles; extra == "dev"
|
|
30
30
|
Requires-Dist: types-click; extra == "dev"
|
|
31
31
|
Requires-Dist: types-cryptography; extra == "dev"
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
set -o errexit
|
|
4
4
|
|
|
5
|
-
SCRIPT_DIRECTORY=$(
|
|
5
|
+
SCRIPT_DIRECTORY=$(
|
|
6
|
+
cd -- "$(dirname -- "$0")"
|
|
7
|
+
pwd
|
|
8
|
+
)
|
|
6
9
|
# shellcheck disable=SC1091
|
|
7
10
|
if [ -d "${SCRIPT_DIRECTORY}/venv" ]; then # CI does not use venv
|
|
8
|
-
source "${SCRIPT_DIRECTORY}/venv/bin/activate"
|
|
11
|
+
source "${SCRIPT_DIRECTORY}/venv/bin/activate"
|
|
9
12
|
fi
|
|
10
13
|
"$@"
|
|
@@ -15,7 +15,7 @@ from chia.types.blockchain_format.coin import Coin
|
|
|
15
15
|
from chia.types.blockchain_format.program import INFINITE_COST, Program
|
|
16
16
|
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
17
17
|
from chia.types.coin_record import CoinRecord
|
|
18
|
-
from chia.types.coin_spend import CoinSpend
|
|
18
|
+
from chia.types.coin_spend import CoinSpend, make_spend
|
|
19
19
|
from chia.types.generator_types import BlockGenerator
|
|
20
20
|
from chia.types.spend_bundle import SpendBundle
|
|
21
21
|
from chia.util.byte_types import hexstr_to_bytes
|
|
@@ -164,6 +164,7 @@ def inspect_any_cmd(ctx: click.Context, objects: Tuple[str]):
|
|
|
164
164
|
assert isinstance(obj, Coin) # mypy otherwise complains that obj is a str
|
|
165
165
|
do_inspect_coin_cmd(ctx, [obj])
|
|
166
166
|
elif type(obj) == CoinSpend: # type: ignore[comparison-overlap]
|
|
167
|
+
assert isinstance(obj, CoinSpend)
|
|
167
168
|
do_inspect_coin_spend_cmd(ctx, [obj])
|
|
168
169
|
elif type(obj) == SpendBundle: # type: ignore[comparison-overlap]
|
|
169
170
|
do_inspect_spend_bundle_cmd(ctx, [obj])
|
|
@@ -272,7 +273,7 @@ def do_inspect_coin_spend_cmd(
|
|
|
272
273
|
# If they specified the coin components
|
|
273
274
|
if (not kwargs["coin"]) and all([kwargs["parent_id"], kwargs["puzzle_hash"], kwargs["amount"]]):
|
|
274
275
|
coin_spend_objs: List[CoinSpend] = [
|
|
275
|
-
|
|
276
|
+
make_spend(
|
|
276
277
|
Coin(
|
|
277
278
|
bytes32.from_hexstr(kwargs["parent_id"]),
|
|
278
279
|
bytes32.from_hexstr(kwargs["puzzle_hash"]),
|
|
@@ -285,7 +286,7 @@ def do_inspect_coin_spend_cmd(
|
|
|
285
286
|
# If they specifed a coin object to parse
|
|
286
287
|
elif kwargs["coin"]:
|
|
287
288
|
coin_spend_objs = [
|
|
288
|
-
|
|
289
|
+
make_spend(
|
|
289
290
|
do_inspect_coin_cmd(ctx, [kwargs["coin"]], print_results=False)[0],
|
|
290
291
|
parse_program(kwargs["puzzle_reveal"]),
|
|
291
292
|
parse_program(kwargs["solution"]),
|
|
@@ -321,7 +322,7 @@ def do_inspect_coin_spend_cmd(
|
|
|
321
322
|
mempool_mode=True,
|
|
322
323
|
constants=DEFAULT_CONSTANTS,
|
|
323
324
|
)
|
|
324
|
-
cost
|
|
325
|
+
cost = int(0 if npc_result.conds is None else npc_result.conds.cost)
|
|
325
326
|
if ignore_byte_cost:
|
|
326
327
|
cost -= len(bytes(coin_spend.puzzle_reveal)) * DEFAULT_CONSTANTS.COST_PER_BYTE
|
|
327
328
|
print(f"Cost: {cost}")
|
|
@@ -412,7 +413,7 @@ def do_inspect_spend_bundle_cmd(
|
|
|
412
413
|
mempool_mode=True,
|
|
413
414
|
constants=DEFAULT_CONSTANTS,
|
|
414
415
|
)
|
|
415
|
-
cost
|
|
416
|
+
cost = int(0 if npc_result.conds is None else npc_result.conds.cost)
|
|
416
417
|
if kwargs["ignore_byte_cost"]:
|
|
417
418
|
for coin_spend in spend_bundle.coin_spends:
|
|
418
419
|
cost -= len(bytes(coin_spend.puzzle_reveal)) * DEFAULT_CONSTANTS.COST_PER_BYTE
|
|
@@ -435,7 +436,7 @@ def do_inspect_spend_bundle_cmd(
|
|
|
435
436
|
for obj in spend_bundle_objs:
|
|
436
437
|
for coin_spend in obj.coin_spends:
|
|
437
438
|
conditions_dict = conditions_dict_for_solution(
|
|
438
|
-
coin_spend.puzzle_reveal, coin_spend.solution, INFINITE_COST
|
|
439
|
+
coin_spend.puzzle_reveal.to_program(), coin_spend.solution.to_program(), INFINITE_COST
|
|
439
440
|
)
|
|
440
441
|
if conditions_dict is None:
|
|
441
442
|
print(f"Generating conditions failed, con:{conditions_dict}")
|
|
@@ -21,9 +21,9 @@ from cdv.test import setup as setup_test
|
|
|
21
21
|
class TestStandardTransaction:
|
|
22
22
|
@pytest_asyncio.fixture(scope="function")
|
|
23
23
|
async def setup(self):
|
|
24
|
-
network, alice, bob
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
async with setup_test() as (network, alice, bob):
|
|
25
|
+
await network.farm_block()
|
|
26
|
+
yield network, alice, bob
|
|
27
27
|
|
|
28
28
|
async def make_and_spend_piggybank(self, network, alice, bob, CONTRIBUTION_AMOUNT) -> Dict[str, List[Coin]]:
|
|
29
29
|
# Get our alice wallet some money
|
|
@@ -87,7 +87,7 @@ class TestStandardTransaction:
|
|
|
87
87
|
)
|
|
88
88
|
assert len(filtered_result) == 1
|
|
89
89
|
finally:
|
|
90
|
-
|
|
90
|
+
pass
|
|
91
91
|
|
|
92
92
|
@pytest.mark.asyncio
|
|
93
93
|
async def test_piggybank_completion(self, setup):
|
|
@@ -118,7 +118,7 @@ class TestStandardTransaction:
|
|
|
118
118
|
)
|
|
119
119
|
assert len(filtered_result) == 1
|
|
120
120
|
finally:
|
|
121
|
-
|
|
121
|
+
pass
|
|
122
122
|
|
|
123
123
|
@pytest.mark.asyncio
|
|
124
124
|
async def test_piggybank_stealing(self, setup):
|
|
@@ -130,4 +130,4 @@ class TestStandardTransaction:
|
|
|
130
130
|
"GENERATOR_RUNTIME_ERROR" in result["error"]
|
|
131
131
|
) # This fails during puzzle execution, not in driver code
|
|
132
132
|
finally:
|
|
133
|
-
|
|
133
|
+
pass
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import binascii
|
|
4
|
+
import contextlib
|
|
4
5
|
import datetime
|
|
5
6
|
import struct
|
|
6
|
-
from
|
|
7
|
+
from contextlib import asynccontextmanager
|
|
8
|
+
from typing import AsyncIterator, Dict, List, Optional, Tuple, Type, TypeVar, Union
|
|
7
9
|
|
|
8
10
|
import pytimeparse
|
|
9
11
|
from chia.clvm.spend_sim import SimClient, SpendSim
|
|
@@ -12,7 +14,7 @@ from chia.types.blockchain_format.coin import Coin
|
|
|
12
14
|
from chia.types.blockchain_format.program import Program
|
|
13
15
|
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
14
16
|
from chia.types.coin_record import CoinRecord
|
|
15
|
-
from chia.types.coin_spend import CoinSpend
|
|
17
|
+
from chia.types.coin_spend import CoinSpend, make_spend
|
|
16
18
|
from chia.types.spend_bundle import SpendBundle
|
|
17
19
|
from chia.util.condition_tools import ConditionOpcode
|
|
18
20
|
from chia.util.hash import std_hash
|
|
@@ -453,13 +455,7 @@ class Wallet:
|
|
|
453
455
|
)
|
|
454
456
|
|
|
455
457
|
spend_bundle = SpendBundle(
|
|
456
|
-
[
|
|
457
|
-
CoinSpend(
|
|
458
|
-
found_coin.coin, # Coin to spend
|
|
459
|
-
self.puzzle, # Puzzle used for found_coin
|
|
460
|
-
solution, # The solution to the puzzle locking found_coin
|
|
461
|
-
)
|
|
462
|
-
],
|
|
458
|
+
[make_spend(found_coin.coin, self.puzzle, solution)],
|
|
463
459
|
signature,
|
|
464
460
|
)
|
|
465
461
|
pushed: Dict[str, Union[str, List[Coin]]] = await self.parent.push_tx(spend_bundle)
|
|
@@ -533,11 +529,7 @@ class Wallet:
|
|
|
533
529
|
delegated_puzzle_solution = Program.to(kwargs["args"])
|
|
534
530
|
solution = delegated_puzzle_solution
|
|
535
531
|
|
|
536
|
-
solution_for_coin =
|
|
537
|
-
coin.coin,
|
|
538
|
-
coin.puzzle(),
|
|
539
|
-
solution,
|
|
540
|
-
)
|
|
532
|
+
solution_for_coin = make_spend(coin.coin, coin.puzzle(), solution)
|
|
541
533
|
|
|
542
534
|
# The reason this use of sign_coin_spends exists is that it correctly handles
|
|
543
535
|
# the signing for non-standard coins. I don't fully understand the difference but
|
|
@@ -564,6 +556,9 @@ class Wallet:
|
|
|
564
556
|
return spend_bundle
|
|
565
557
|
|
|
566
558
|
|
|
559
|
+
_T_Network = TypeVar("_T_Network", bound="Network")
|
|
560
|
+
|
|
561
|
+
|
|
567
562
|
# A user oriented (domain specific) view of the chia network.
|
|
568
563
|
class Network:
|
|
569
564
|
"""An object that owns a simulation, responsible for managing Wallet actors,
|
|
@@ -576,18 +571,17 @@ class Network:
|
|
|
576
571
|
nobody: Wallet
|
|
577
572
|
|
|
578
573
|
@classmethod
|
|
579
|
-
|
|
574
|
+
@contextlib.asynccontextmanager
|
|
575
|
+
async def managed(cls: Type[_T_Network]) -> AsyncIterator[_T_Network]:
|
|
580
576
|
self = cls()
|
|
581
577
|
self.time = datetime.timedelta(days=18750, seconds=61201) # Past the initial transaction freeze
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
async def close(self):
|
|
590
|
-
await self.sim.close()
|
|
578
|
+
async with SpendSim.managed() as sim:
|
|
579
|
+
self.sim = sim
|
|
580
|
+
self.sim_client = SimClient(self.sim)
|
|
581
|
+
self.wallets = {}
|
|
582
|
+
self.nobody = self.make_wallet("nobody")
|
|
583
|
+
self.wallets[str(self.nobody.pk())] = self.nobody
|
|
584
|
+
yield self
|
|
591
585
|
|
|
592
586
|
# Have the system farm one block with a specific beneficiary (nobody if not specified).
|
|
593
587
|
async def farm_block(self, **kwargs) -> Tuple[List[Coin], List[Coin]]:
|
|
@@ -716,8 +710,9 @@ class Network:
|
|
|
716
710
|
}
|
|
717
711
|
|
|
718
712
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
713
|
+
@asynccontextmanager
|
|
714
|
+
async def setup() -> AsyncIterator[Tuple[Network, Wallet, Wallet]]:
|
|
715
|
+
async with Network.managed() as network:
|
|
716
|
+
alice = network.make_wallet("alice")
|
|
717
|
+
bob = network.make_wallet("bob")
|
|
718
|
+
yield network, alice, bob
|
|
@@ -9,9 +9,9 @@ from cdv.test import setup as setup_test
|
|
|
9
9
|
class TestSomething:
|
|
10
10
|
@pytest_asyncio.fixture(scope="function")
|
|
11
11
|
async def setup(self):
|
|
12
|
-
network, alice, bob
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
async with setup_test() as (network, alice, bob):
|
|
13
|
+
await network.farm_block()
|
|
14
|
+
yield network, alice, bob
|
|
15
15
|
|
|
16
16
|
@pytest.mark.asyncio
|
|
17
17
|
async def test_something(self, setup):
|
|
@@ -19,4 +19,4 @@ class TestSomething:
|
|
|
19
19
|
try:
|
|
20
20
|
pass
|
|
21
21
|
finally:
|
|
22
|
-
|
|
22
|
+
pass
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chia_dev_tools
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.6
|
|
4
4
|
Summary: Chia development commands
|
|
5
5
|
Home-page: https://github.com/Chia-Network
|
|
6
6
|
Author: Quexington
|
|
@@ -20,12 +20,12 @@ Requires-Dist: pytest
|
|
|
20
20
|
Requires-Dist: pytest-asyncio
|
|
21
21
|
Requires-Dist: pytimeparse
|
|
22
22
|
Requires-Dist: anyio
|
|
23
|
-
Requires-Dist: chia-blockchain==2.
|
|
23
|
+
Requires-Dist: chia-blockchain==2.3.0
|
|
24
24
|
Provides-Extra: dev
|
|
25
25
|
Requires-Dist: anyio; extra == "dev"
|
|
26
26
|
Requires-Dist: flake8; extra == "dev"
|
|
27
27
|
Requires-Dist: mypy; extra == "dev"
|
|
28
|
-
Requires-Dist: black==24.4.
|
|
28
|
+
Requires-Dist: black==24.4.2; extra == "dev"
|
|
29
29
|
Requires-Dist: types-aiofiles; extra == "dev"
|
|
30
30
|
Requires-Dist: types-click; extra == "dev"
|
|
31
31
|
Requires-Dist: types-cryptography; extra == "dev"
|
|
@@ -13,14 +13,14 @@ dependencies = [
|
|
|
13
13
|
"pytest-asyncio",
|
|
14
14
|
"pytimeparse",
|
|
15
15
|
"anyio",
|
|
16
|
-
"chia-blockchain==2.
|
|
16
|
+
"chia-blockchain==2.3.0",
|
|
17
17
|
]
|
|
18
18
|
|
|
19
19
|
dev_dependencies = [
|
|
20
20
|
"anyio",
|
|
21
21
|
"flake8",
|
|
22
22
|
"mypy",
|
|
23
|
-
"black==24.4.
|
|
23
|
+
"black==24.4.2",
|
|
24
24
|
"types-aiofiles",
|
|
25
25
|
"types-click",
|
|
26
26
|
"types-cryptography",
|
{chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spendbundles/spendbundle.json
RENAMED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"parent_coin_info": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
6
6
|
"puzzle_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"},
|
|
7
7
|
"puzzle_reveal": "0x01",
|
|
8
|
-
"solution": "
|
|
8
|
+
"solution": "0x80"}
|
|
9
9
|
],
|
|
10
10
|
"aggregated_signature": "c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
|
11
11
|
}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
"parent_coin_info": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
3
3
|
"puzzle_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"},
|
|
4
4
|
"puzzle_reveal": "0x01",
|
|
5
|
-
"solution": "
|
|
5
|
+
"solution": "0xffff32ffb080df54b2a616f5c79baaed254134ae5dfc6e24e2d8e1165b251601ceb67b1886db50aacf946eb20f00adc303e7534dd0ff2480ffff32ffb080df54b2a616f5c79baaed254134ae5dfc6e24e2d8e1165b251601ceb67b1886db50aacf946eb20f00adc303e7534dd0ff248080"}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
"parent_coin_info": "0x0000000000000000000000000000000000000000000000000000000000000001",
|
|
3
3
|
"puzzle_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"},
|
|
4
4
|
"puzzle_reveal": "0x01",
|
|
5
|
-
"solution": "
|
|
5
|
+
"solution": "0xffff32ffb080df54b2a616f5c79baaed254134ae5dfc6e24e2d8e1165b251601ceb67b1886db50aacf946eb20f00adc303e7534dd0ff248080"}
|
|
@@ -9,9 +9,9 @@ from cdv.test import setup as setup_test
|
|
|
9
9
|
class TestSomething:
|
|
10
10
|
@pytest_asyncio.fixture(scope="function")
|
|
11
11
|
async def setup(self):
|
|
12
|
-
network, alice, bob
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
async with setup_test() as (network, alice, bob):
|
|
13
|
+
await network.farm_block()
|
|
14
|
+
yield network, alice, bob
|
|
15
15
|
|
|
16
16
|
@pytest.mark.asyncio
|
|
17
17
|
async def test_something(self, setup):
|
|
@@ -19,4 +19,4 @@ class TestSomething:
|
|
|
19
19
|
try:
|
|
20
20
|
pass
|
|
21
21
|
finally:
|
|
22
|
-
|
|
22
|
+
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coinrecords/coinrecord.hex
RENAMED
|
File without changes
|
{chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coinrecords/coinrecord.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coins/coin_invalid.json
RENAMED
|
File without changes
|
{chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/coins/coin_metadata.json
RENAMED
|
File without changes
|
{chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spendbundles/spendbundle.hex
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spends/spend_invalid.json
RENAMED
|
File without changes
|
{chia_dev_tools-1.2.4 → chia_dev_tools-1.2.6}/tests/cmds/object_files/spends/spend_metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|