Skip to content

Commit 7114078

Browse files
Merge pull request #87 from Chia-Network/dependabot/pip/chia-blockchain-2.5.1
Bump chia-blockchain from 2.5.0 to 2.5.1
2 parents 5be49e3 + ce8e7c2 commit 7114078

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

cats/cats.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import click
1212
from chia.cmds.cmds_util import get_wallet_client
13+
from chia.rpc.wallet_request_types import PushTX
1314
from chia.rpc.wallet_rpc_client import WalletRpcClient
1415
from chia.types.blockchain_format.program import Program
1516
from chia.types.blockchain_format.sized_bytes import bytes32
@@ -40,7 +41,7 @@ async def get_context_manager(
4041
) -> AsyncIterator[tuple[WalletRpcClient, int, dict[str, Any]]]:
4142
config = load_config(root_path, "config.yaml")
4243
wallet_rpc_port = config["wallet"]["rpc_port"] if wallet_rpc_port is None else wallet_rpc_port
43-
async with get_wallet_client(wallet_rpc_port, root_path=root_path, fingerprint=fingerprint) as args:
44+
async with get_wallet_client(root_path=root_path, wallet_rpc_port=wallet_rpc_port, fingerprint=fingerprint) as args:
4445
yield args
4546

4647

@@ -74,7 +75,7 @@ async def push_tx(
7475
wallet_client, _, _ = client_etc
7576
if wallet_client is None:
7677
raise ValueError("Error getting wallet client. Make sure wallet is running.")
77-
return await wallet_client.push_tx(bundle)
78+
return await wallet_client.push_tx(PushTX(bundle))
7879

7980

8081
# The clvm loaders in this library automatically search for includable files in the directory './include'
@@ -439,10 +440,12 @@ async def cmd_func(
439440
"Yes",
440441
}
441442
if confirmation:
442-
response = await push_tx(wallet_rpc_port, fingerprint, final_bundle, Path(root_path))
443-
if "error" in response:
444-
print(f"Error pushing transaction: {response['error']}")
443+
try:
444+
await push_tx(wallet_rpc_port, fingerprint, final_bundle, Path(root_path))
445+
except Exception as e:
446+
print(f"Error pushing transaction: {e}")
445447
return
448+
446449
print("Successfully pushed the transaction to the network")
447450

448451
print(f"Asset ID: {curried_tail.get_tree_hash().hex()}")

cats/unwind_the_bag.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import click
1111
from chia.cmds.cmds_util import get_wallet
1212
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
13-
from chia.rpc.wallet_request_types import LogIn
13+
from chia.rpc.wallet_request_types import LogIn, PushTX
1414
from chia.rpc.wallet_rpc_client import WalletRpcClient
1515
from chia.types.announcement import Announcement
1616
from chia.types.blockchain_format.program import Program
@@ -303,13 +303,17 @@ async def app(
303303
raise Exception("No spend bundle created")
304304

305305
await wallet_client.push_tx(
306-
WalletSpendBundle(
307-
cat_spend.coin_spends + fees_tx.signed_tx.spend_bundle.coin_spends,
308-
fees_tx.signed_tx.spend_bundle.aggregated_signature,
306+
PushTX(
307+
WalletSpendBundle(
308+
cat_spend.coin_spends + fees_tx.signed_tx.spend_bundle.coin_spends,
309+
fees_tx.signed_tx.spend_bundle.aggregated_signature,
310+
)
309311
)
310312
)
311313
else:
312-
await wallet_client.push_tx(WalletSpendBundle(cat_spend.coin_spends, cat_spend.aggregated_signature))
314+
await wallet_client.push_tx(
315+
PushTX(WalletSpendBundle(cat_spend.coin_spends, cat_spend.aggregated_signature))
316+
)
313317

314318
print("Transaction pushed to full node")
315319

@@ -404,13 +408,17 @@ async def app(
404408
raise Exception("No spend bundle created")
405409

406410
await wallet_client.push_tx(
407-
WalletSpendBundle(
408-
bundle_spends + fees_tx.signed_tx.spend_bundle.coin_spends,
409-
fees_tx.signed_tx.spend_bundle.aggregated_signature,
411+
PushTX(
412+
WalletSpendBundle(
413+
bundle_spends + fees_tx.signed_tx.spend_bundle.coin_spends,
414+
fees_tx.signed_tx.spend_bundle.aggregated_signature,
415+
)
410416
)
411417
)
412418
else:
413-
await wallet_client.push_tx(WalletSpendBundle(bundle_spends, cat_spend.aggregated_signature))
419+
await wallet_client.push_tx(
420+
PushTX(WalletSpendBundle(bundle_spends, cat_spend.aggregated_signature))
421+
)
414422

415423
print(
416424
f"Transaction containing {len(bundle_spends)} coin spends "

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
long_description = fh.read()
99

1010
dependencies = [
11-
"chia-blockchain==2.5.0",
11+
"chia-blockchain==2.5.1",
1212
]
1313

1414
dev_dependencies = [

0 commit comments

Comments
 (0)