Skip to content

Commit 1b5fda4

Browse files
committed
test coverage
1 parent e5cb31b commit 1b5fda4

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

chia/_tests/wallet/rpc/test_dl_wallet_rpc.py

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
from chia._tests.util.time_out_assert import time_out_assert
1414
from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
1515
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
1717
from chia.simulator.simulator_protocol import FarmNewBlockProtocol
1818
from chia.types.peer_info import PeerInfo
1919
from chia.wallet.db_wallet.db_wallet_puzzles import create_mirror_puzzle
20+
from chia.wallet.puzzle_drivers import Solver
2021
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG
2122
from chia.wallet.wallet_request_types import (
2223
CreateNewDL,
24+
CreateOfferForIDs,
2325
DLDeleteMirror,
2426
DLGetMirrors,
2527
DLGetMirrorsResponse,
@@ -32,6 +34,7 @@
3234
DLUpdateMultiple,
3335
DLUpdateMultipleUpdates,
3436
DLUpdateRoot,
37+
GetOfferSummary,
3538
LauncherRootPair,
3639
)
3740
from chia.wallet.wallet_rpc_client import WalletRpcClient
@@ -302,6 +305,39 @@ async def is_singleton_generation(rpc_client: WalletRpcClient, lid: bytes32, gen
302305
await asyncio.sleep(0.5)
303306
await time_out_assert(15, client.dl_get_mirrors, DLGetMirrorsResponse([]), DLGetMirrors(launcher_id))
304307

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+
305341
@pytest.mark.parametrize("trusted", [True, False])
306342
@pytest.mark.anyio
307343
async def test_wallet_dl_verify_proof(

0 commit comments

Comments
 (0)