|
13 | 13 | from chia._tests.util.time_out_assert import time_out_assert |
14 | 14 | from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward |
15 | 15 | from chia.data_layer.data_layer_util import DLProof, HashOnlyProof, ProofLayer, StoreProofsHashes |
16 | | -from chia.data_layer.data_layer_wallet import Mirror |
| 16 | +from chia.data_layer.data_layer_wallet import DataLayerSummary, Mirror, SingletonDependencies, SingletonSummary |
17 | 17 | from chia.simulator.simulator_protocol import FarmNewBlockProtocol |
18 | 18 | from chia.types.peer_info import PeerInfo |
19 | 19 | from chia.wallet.db_wallet.db_wallet_puzzles import create_mirror_puzzle |
| 20 | +from chia.wallet.puzzle_drivers import Solver |
20 | 21 | from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG |
21 | 22 | from chia.wallet.wallet_request_types import ( |
22 | 23 | CreateNewDL, |
| 24 | + CreateOfferForIDs, |
23 | 25 | DLDeleteMirror, |
24 | 26 | DLGetMirrors, |
25 | 27 | DLGetMirrorsResponse, |
|
32 | 34 | DLUpdateMultiple, |
33 | 35 | DLUpdateMultipleUpdates, |
34 | 36 | DLUpdateRoot, |
| 37 | + GetOfferSummary, |
35 | 38 | LauncherRootPair, |
36 | 39 | ) |
37 | 40 | from chia.wallet.wallet_rpc_client import WalletRpcClient |
@@ -302,6 +305,39 @@ async def is_singleton_generation(rpc_client: WalletRpcClient, lid: bytes32, gen |
302 | 305 | await asyncio.sleep(0.5) |
303 | 306 | await time_out_assert(15, client.dl_get_mirrors, DLGetMirrorsResponse([]), DLGetMirrors(launcher_id)) |
304 | 307 |
|
| 308 | + offer_creation_response = await client.create_offer_for_ids( |
| 309 | + CreateOfferForIDs( |
| 310 | + {launcher_id.hex(): "-1", launcher_id_2.hex(): "1"}, |
| 311 | + driver_dict={}, |
| 312 | + solver=Solver( |
| 313 | + { |
| 314 | + "0x" + launcher_id.hex(): { |
| 315 | + "new_root": "0x" + bytes32.zeros.hex(), |
| 316 | + "dependencies": [ |
| 317 | + { |
| 318 | + "launcher_id": "0x" + launcher_id_2.hex(), |
| 319 | + "values_to_prove": ["0x" + bytes32.zeros.hex()], |
| 320 | + } |
| 321 | + ], |
| 322 | + } |
| 323 | + } |
| 324 | + ), |
| 325 | + ), |
| 326 | + tx_config=DEFAULT_TX_CONFIG, |
| 327 | + ) |
| 328 | + |
| 329 | + assert ( |
| 330 | + await client.get_offer_summary(GetOfferSummary(offer=offer_creation_response.offer.to_bech32())) |
| 331 | + ).data_layer_summary == DataLayerSummary( |
| 332 | + [ |
| 333 | + SingletonSummary( |
| 334 | + launcher_id=launcher_id, |
| 335 | + new_root=bytes32.zeros, |
| 336 | + dependencies=[SingletonDependencies(launcher_id_2, [bytes(32)])], |
| 337 | + ) |
| 338 | + ] |
| 339 | + ) |
| 340 | + |
305 | 341 | @pytest.mark.parametrize("trusted", [True, False]) |
306 | 342 | @pytest.mark.anyio |
307 | 343 | async def test_wallet_dl_verify_proof( |
|
0 commit comments