Skip to content

Commit

Permalink
Pin to chia-blockchain/main temporarily and see that we can't import …
Browse files Browse the repository at this point in the history
…the simulator due to no access to tests/
  • Loading branch information
hoffmang9 committed Dec 15, 2023
1 parent df71c30 commit 1e9658e
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 60 deletions.
29 changes: 21 additions & 8 deletions cats/cats.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ async def get_signed_tx(
"Error getting wallet client. Make sure wallet is running."
)
return await wallet_client.create_signed_transaction(
[{"puzzle_hash": ph, "amount": amt}], DEFAULT_TX_CONFIG, fee=fee # TODO: no default tx config
[{"puzzle_hash": ph, "amount": amt}],
DEFAULT_TX_CONFIG,
fee=fee, # TODO: no default tx config
)


Expand Down Expand Up @@ -197,7 +199,7 @@ def parse_program(program: Union[str, Program], include: Iterable[str] = []) ->
"Specify a list of flags to check a VC for in order to authorize this CR-CAT. "
"Specifying this option requires a value for --authorized-providers. "
"Cannot be used if a custom --proofs-checker is specified."
)
),
)
@click.option(
"-f",
Expand Down Expand Up @@ -340,19 +342,23 @@ async def cmd_func(
elif len(cr_flag) > 0:
proofs_checker = ProofsChecker(list(cr_flag)).as_program()
else:
print("Must specify either --proofs-checker or --cr-flag if specifying --authorized-provider")
print(
"Must specify either --proofs-checker or --cr-flag if specifying --authorized-provider"
)
return
extra_conditions.append(Program.to(
[1, inner_address, ap_bytes, proofs_checker]
))
extra_conditions.append(
Program.to([1, inner_address, ap_bytes, proofs_checker])
)
address = construct_cr_layer(
ap_bytes,
proofs_checker,
inner_address, # type: ignore
).get_tree_hash_precalc(inner_address)

elif proofs_checker is not None or len(cr_flag) > 0:
print("Cannot specify --proofs-checker or --cr-flag without values for --authorized-provider")
print(
"Cannot specify --proofs-checker or --cr-flag without values for --authorized-provider"
)
return

aggregated_signature = G2Element()
Expand All @@ -375,7 +381,14 @@ async def cmd_func(

# Construct the intermediate puzzle
p2_puzzle = Program.to(
(1, [[51, 0, -113, curried_tail, solution], [51, address, amount, [inner_address]], *extra_conditions])
(
1,
[
[51, 0, -113, curried_tail, solution],
[51, address, amount, [inner_address]],
*extra_conditions,
],
)
)

# Wrap the intermediate puzzle in a CAT wrapper
Expand Down
105 changes: 54 additions & 51 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
#!/usr/bin/env python

from setuptools import setup, find_packages

with open("README.md", "rt") as fh:
long_description = fh.read()

dependencies = [
"chia-blockchain==2.1.2",
]

dev_dependencies = [
"black==23.7.0",
"pytest",
"pytest-asyncio",
"pytest-env",
]

setup(
name="CAT_admin_tool",
version="0.0.1",
author="Quexington",
packages=find_packages(exclude=("tests",)),
entry_points={
"console_scripts": [
"cats = cats.cats:main",
"secure_the_bag = cats.secure_the_bag:main",
"unwind_the_bag = cats.unwind_the_bag:main"
],
},
author_email="[email protected]",
setup_requires=["setuptools_scm"],
install_requires=dependencies,
url="https://github.com/Chia-Network",
license="https://opensource.org/licenses/Apache-2.0",
description="Tools to administer issuance and redemption of a Chia Asset Token or CAT",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: Apache Software License",
"Topic :: Security :: Cryptography",
],
extras_require=dict(
dev=dev_dependencies,
),
project_urls={
"Bug Reports": "https://github.com/Chia-Network/cat-admin-tool",
"Source": "https://github.com/Chia-Network/cat-admin-tool",
},
)
#!/usr/bin/env python

from setuptools import setup, find_packages

with open("README.md", "rt") as fh:
long_description = fh.read()

# dependencies = [
# "chia-blockchain==2.1.2",
# ]
dependencies = [
"chia-blockchain @ git+ssh://[email protected]/Chia-Network/chia-blockchain.git",
]

dev_dependencies = [
"black==23.7.0",
"pytest",
"pytest-asyncio",
"pytest-env",
]

setup(
name="CAT_admin_tool",
version="0.0.1",
author="Quexington",
packages=find_packages(exclude=("tests",)),
entry_points={
"console_scripts": [
"cats = cats.cats:main",
"secure_the_bag = cats.secure_the_bag:main",
"unwind_the_bag = cats.unwind_the_bag:main",
],
},
author_email="[email protected]",
setup_requires=["setuptools_scm"],
install_requires=dependencies,
url="https://github.com/Chia-Network",
license="https://opensource.org/licenses/Apache-2.0",
description="Tools to administer issuance and redemption of a Chia Asset Token or CAT",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: Apache Software License",
"Topic :: Security :: Cryptography",
],
extras_require=dict(
dev=dev_dependencies,
),
project_urls={
"Bug Reports": "https://github.com/Chia-Network/cat-admin-tool",
"Source": "https://github.com/Chia-Network/cat-admin-tool",
},
)
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest_asyncio

from chia.simulator.block_tools import test_constants
from chia.simulator.setup_nodes import setup_simulators_and_wallets_service
from tests.util.setup_nodes import setup_simulators_and_wallets_service
from chia.wallet.wallet_node import WalletNode
from chia.wallet.wallet_node_api import WalletNodeAPI

Expand Down

0 comments on commit 1e9658e

Please sign in to comment.