From d12ab8d300552cb4b820d62852b2340895d6cf42 Mon Sep 17 00:00:00 2001 From: Geoff Walmsley Date: Thu, 17 Oct 2024 19:10:48 +0300 Subject: [PATCH 1/3] update to 2.4.4 and remove python 3.8 --- chianft/util/mint.py | 16 +++++++++------- setup.py | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/chianft/util/mint.py b/chianft/util/mint.py index 6142eaf..26142cf 100644 --- a/chianft/util/mint.py +++ b/chianft/util/mint.py @@ -7,6 +7,7 @@ from chia.consensus.default_constants import DEFAULT_CONSTANTS from chia.rpc.full_node_rpc_client import FullNodeRpcClient +from chia.rpc.wallet_request_types import NFTMintBulkResponse from chia.rpc.wallet_rpc_client import WalletRpcClient from chia.types.blockchain_format.coin import Coin from chia.types.blockchain_format.program import INFINITE_COST @@ -136,7 +137,7 @@ async def create_spend_bundles( assert royalty_percentage is not None assert royalty_address is not None for i in range(0, mint_total, chunk): - resp = await self.wallet_client.nft_mint_bulk( + resp: NFTMintBulkResponse = await self.wallet_client.nft_mint_bulk( wallet_id=self.nft_wallet_id, metadata_list=metadata_list[i : i + chunk], target_list=target_list[i : i + chunk], @@ -151,12 +152,12 @@ async def create_spend_bundles( mint_from_did=mint_from_did, tx_config=DEFAULT_TX_CONFIG, ) - if not resp["success"]: + if not resp: raise ValueError( "SpendBundle could not be created for metadata rows: %s to %s" % (i, i + chunk) ) - sb = SpendBundle.from_json_dict(resp["spend_bundle"]) + sb = resp.spend_bundle spend_bundles.append(bytes(sb)) next_coin = [ c for c in sb.additions() if c.puzzle_hash == funding_coin.puzzle_hash @@ -223,7 +224,7 @@ async def add_fee_to_spend( return spend, 0 total_fee = sb_cost * (fee_per_cost * attempt) print("Fee for inclusion: {}".format(total_fee)) - fee_tx = await self.wallet_client.create_signed_transaction( + fee_tx = await self.wallet_client.create_signed_transactions( additions=[ { "amount": fee_coin.amount - total_fee, @@ -234,8 +235,8 @@ async def add_fee_to_spend( fee=uint64(total_fee), tx_config=DEFAULT_TX_CONFIG, ) - assert fee_tx.spend_bundle is not None - spend_with_fee = SpendBundle.aggregate([fee_tx.spend_bundle, spend]) + assert fee_tx.signed_tx.spend_bundle is not None + spend_with_fee = SpendBundle.aggregate([fee_tx.signed_tx.spend_bundle, spend]) return spend_with_fee, total_fee async def sb_in_mempool(self, sb_name: bytes32) -> bool: @@ -365,11 +366,12 @@ async def create_offer( } for i in range(10): try: - offer, tr = await self.wallet_client.create_offer_for_ids( + offer_resp = await self.wallet_client.create_offer_for_ids( offer_dict, fee=0, tx_config=DEFAULT_TX_CONFIG, ) + offer = offer_resp.offer filepath = "offers/{}.offer".format(launcher_id) assert offer is not None with open(Path(filepath), "w") as file: diff --git a/setup.py b/setup.py index db3d862..4d87f8f 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ long_description = fh.read() dependencies = [ - "chia-blockchain==2.4.2", + "chia-blockchain==2.4.4", ] dev_dependencies = [ @@ -44,9 +44,9 @@ long_description_content_type="text/markdown", classifiers=[ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "License :: OSI Approved :: Apache Software License", "Topic :: Security :: Cryptography", ], From 5320202120997b9773149b0b5600327fd7256ab7 Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Thu, 17 Oct 2024 15:53:32 -0700 Subject: [PATCH 2/3] Update to macos-13 runners and remove python 3.8 --- .github/workflows/pre-commit.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 4ef0976..da47020 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -28,8 +28,8 @@ jobs: - name: macOS matrix: macos runs-on: - intel: macos-12 - arm: [macos, arm64] + intel: macos-13 + arm: macos-13-arm64 - name: Windows matrix: windows runs-on: @@ -40,7 +40,6 @@ jobs: - name: Intel matrix: intel python: - - major_dot_minor: "3.8" - major_dot_minor: "3.9" - major_dot_minor: "3.10" - major_dot_minor: "3.11" From b443f9c09a0e339a660ded416dbc687de51a0d5e Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Thu, 17 Oct 2024 16:17:14 -0700 Subject: [PATCH 3/3] Try upgrading pip on windows --- .github/workflows/run-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 359b30e..c68f2ba 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -52,6 +52,7 @@ jobs: python3 -m venv venv if [[ ${{ matrix.os.runs-on }} == windows-latest ]]; then source ./venv/Scripts/activate + python -m pip install --upgrade pip else . ./venv/bin/activate fi