From 77bf4df2726d342acdda828cd5094008a855d2a5 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 18 Oct 2024 11:27:46 -0700 Subject: [PATCH] fix tests --- tests/test_cat_workflow.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/test_cat_workflow.py b/tests/test_cat_workflow.py index 5a17a76..19a6cc4 100644 --- a/tests/test_cat_workflow.py +++ b/tests/test_cat_workflow.py @@ -7,6 +7,7 @@ import pytest from chia._tests.wallet.rpc.test_wallet_rpc import WalletRpcTestEnvironment, farm_transaction, generate_funds +from chia.rpc.wallet_request_types import GetPrivateKey from chia.rpc.wallet_rpc_client import WalletRpcClient from chia.simulator.full_node_simulator import FullNodeSimulator from chia.types.blockchain_format.sized_bytes import bytes32 @@ -103,10 +104,9 @@ async def test_cat_tokenization_workflow( await generate_funds(full_node_api, env.wallet_1) - fingerprint: int = await wallet_client_1.get_logged_in_fingerprint() - result = await wallet_client_1.get_private_key(fingerprint=fingerprint) - master_secret_key: PrivateKey = PrivateKey.from_bytes(bytes.fromhex(result["sk"])) - root_secret_key: PrivateKey = master_sk_to_root_sk(master_secret_key) + fingerprint = (await wallet_client_1.get_logged_in_fingerprint()).fingerprint + result = await wallet_client_1.get_private_key(GetPrivateKey(fingerprint=fingerprint)) + root_secret_key: PrivateKey = master_sk_to_root_sk(result.private_key.sk) token_index = ClimateTokenIndex( org_uid=org_uid, @@ -163,10 +163,9 @@ async def test_cat_detokenization_workflow( full_node_api: FullNodeSimulator = env.full_node.api - fingerprint: int = await wallet_client_1.get_logged_in_fingerprint() - result = await wallet_client_1.get_private_key(fingerprint=fingerprint) - master_secret_key: PrivateKey = PrivateKey.from_bytes(bytes.fromhex(result["sk"])) - root_secret_key: PrivateKey = master_sk_to_root_sk(master_secret_key) + fingerprint = (await wallet_client_1.get_logged_in_fingerprint()).fingerprint + result = await wallet_client_1.get_private_key(GetPrivateKey(fingerprint=fingerprint)) + root_secret_key: PrivateKey = master_sk_to_root_sk(result.private_key.sk) # block: initial fund deposits @@ -257,10 +256,9 @@ async def test_cat_permissionless_retirement_workflow( full_node_api: FullNodeSimulator = env.full_node.api full_node_client = env.full_node.rpc_client - fingerprint: int = await wallet_client_1.get_logged_in_fingerprint() - result = await wallet_client_1.get_private_key(fingerprint=fingerprint) - master_secret_key = PrivateKey.from_bytes(bytes.fromhex(result["sk"])) - root_secret_key = master_sk_to_root_sk(master_secret_key) + fingerprint = (await wallet_client_1.get_logged_in_fingerprint()).fingerprint + result = await wallet_client_1.get_private_key(GetPrivateKey(fingerprint=fingerprint)) + root_secret_key = master_sk_to_root_sk(result.private_key.sk) # block: initial fund deposits