|
108 | 108 | CATGetAssetID,
|
109 | 109 | CATGetName,
|
110 | 110 | CATSetName,
|
| 111 | + CATSpend, |
111 | 112 | CheckDeleteKey,
|
112 | 113 | CheckOfferValidity,
|
113 | 114 | ClawbackPuzzleDecoratorOverride,
|
@@ -1255,18 +1256,30 @@ async def test_cat_endpoints(wallet_environments: WalletTestFramework, wallet_ty
|
1255 | 1256 | # Test CAT spend without a fee
|
1256 | 1257 | with pytest.raises(ValueError):
|
1257 | 1258 | await env_0.rpc_client.cat_spend(
|
1258 |
| - cat_0_id, |
1259 |
| - DEFAULT_TX_CONFIG.override( |
| 1259 | + CATSpend( |
| 1260 | + wallet_id=cat_0_id, |
| 1261 | + amount=uint64(4), |
| 1262 | + inner_address=addr_1, |
| 1263 | + fee=uint64(0), |
| 1264 | + memos=["the cat memo"], |
| 1265 | + push=False, |
| 1266 | + ), |
| 1267 | + tx_config=wallet_environments.tx_config.override( |
1260 | 1268 | excluded_coin_amounts=[uint64(100)],
|
1261 | 1269 | excluded_coin_ids=[bytes32.zeros],
|
1262 | 1270 | ),
|
1263 |
| - uint64(4), |
1264 |
| - addr_1, |
1265 |
| - uint64(0), |
1266 |
| - ["the cat memo"], |
1267 | 1271 | )
|
| 1272 | + |
1268 | 1273 | tx_res = await env_0.rpc_client.cat_spend(
|
1269 |
| - cat_0_id, wallet_environments.tx_config, uint64(4), addr_1, uint64(0), ["the cat memo"] |
| 1274 | + CATSpend( |
| 1275 | + wallet_id=cat_0_id, |
| 1276 | + amount=uint64(4), |
| 1277 | + inner_address=addr_1, |
| 1278 | + fee=uint64(0), |
| 1279 | + memos=["the cat memo"], |
| 1280 | + push=True, |
| 1281 | + ), |
| 1282 | + tx_config=wallet_environments.tx_config, |
1270 | 1283 | )
|
1271 | 1284 |
|
1272 | 1285 | spend_bundle = tx_res.transaction.spend_bundle
|
@@ -1312,7 +1325,15 @@ async def test_cat_endpoints(wallet_environments: WalletTestFramework, wallet_ty
|
1312 | 1325 |
|
1313 | 1326 | # Test CAT spend with a fee
|
1314 | 1327 | tx_res = await env_0.rpc_client.cat_spend(
|
1315 |
| - cat_0_id, wallet_environments.tx_config, uint64(1), addr_1, uint64(5_000_000), ["the cat memo"] |
| 1328 | + CATSpend( |
| 1329 | + wallet_id=cat_0_id, |
| 1330 | + amount=uint64(1), |
| 1331 | + inner_address=addr_1, |
| 1332 | + fee=uint64(5_000_000), |
| 1333 | + memos=["the cat memo"], |
| 1334 | + push=True, |
| 1335 | + ), |
| 1336 | + wallet_environments.tx_config, |
1316 | 1337 | )
|
1317 | 1338 |
|
1318 | 1339 | spend_bundle = tx_res.transaction.spend_bundle
|
@@ -1379,13 +1400,16 @@ async def test_cat_endpoints(wallet_environments: WalletTestFramework, wallet_ty
|
1379 | 1400 | )
|
1380 | 1401 | )
|
1381 | 1402 | tx_res = await env_0.rpc_client.cat_spend(
|
1382 |
| - cat_0_id, |
| 1403 | + CATSpend( |
| 1404 | + wallet_id=cat_0_id, |
| 1405 | + amount=uint64(1), |
| 1406 | + inner_address=addr_1, |
| 1407 | + fee=uint64(5_000_000), |
| 1408 | + memos=["the cat memo"], |
| 1409 | + coins=select_coins_response.coins, |
| 1410 | + push=True, |
| 1411 | + ), |
1383 | 1412 | wallet_environments.tx_config,
|
1384 |
| - uint64(1), |
1385 |
| - addr_1, |
1386 |
| - uint64(5_000_000), |
1387 |
| - ["the cat memo"], |
1388 |
| - removals=select_coins_response.coins, |
1389 | 1413 | )
|
1390 | 1414 |
|
1391 | 1415 | spend_bundle = tx_res.transaction.spend_bundle
|
@@ -3109,11 +3133,16 @@ async def test_cat_spend_run_tail(wallet_rpc_environment: WalletRpcTestEnvironme
|
3109 | 3133 | # Attempt to melt it fully
|
3110 | 3134 | tx = (
|
3111 | 3135 | await client.cat_spend(
|
3112 |
| - cat_wallet_id, |
3113 |
| - amount=uint64(0), |
| 3136 | + CATSpend( |
| 3137 | + wallet_id=cat_wallet_id, |
| 3138 | + amount=uint64(0), |
| 3139 | + inner_address=encode_puzzle_hash(our_ph, "txch"), |
| 3140 | + extra_delta=str(tx_amount * -1), |
| 3141 | + tail_reveal=b"", |
| 3142 | + tail_solution=b"", |
| 3143 | + push=True, |
| 3144 | + ), |
3114 | 3145 | tx_config=DEFAULT_TX_CONFIG,
|
3115 |
| - inner_address=encode_puzzle_hash(our_ph, "txch"), |
3116 |
| - cat_discrepancy=(tx_amount * -1, Program.to(None), Program.to(None)), |
3117 | 3146 | )
|
3118 | 3147 | ).transaction
|
3119 | 3148 | transaction_id = tx.name
|
|
0 commit comments