Skip to content
2 changes: 2 additions & 0 deletions chia/_tests/cmds/cmd_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ async def get_transaction(self, transaction_id: bytes32) -> TransactionRecord:
confirmed_at_height=uint32(1),
created_at_time=uint64(1234),
to_puzzle_hash=bytes32([1] * 32),
to_address=encode_puzzle_hash(bytes32([1] * 32), "xch"),
amount=uint64(12345678),
fee_amount=uint64(1234567),
confirmed=False,
Expand Down Expand Up @@ -271,6 +272,7 @@ async def send_transaction_multi(
confirmed_at_height=uint32(1),
created_at_time=uint64(1234),
to_puzzle_hash=bytes32([1] * 32),
to_address=encode_puzzle_hash(bytes32([1] * 32), "xch"),
amount=uint64(12345678),
fee_amount=uint64(1234567),
confirmed=False,
Expand Down
2 changes: 2 additions & 0 deletions chia/_tests/cmds/wallet/test_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from chia_rs.sized_bytes import bytes32
from chia_rs.sized_ints import uint32, uint64

from chia.util.bech32m import encode_puzzle_hash
from chia.wallet.conditions import ConditionValidTimes
from chia.wallet.signer_protocol import KeyHints, SigningInstructions, TransactionInfo, UnsignedTransaction
from chia.wallet.transaction_record import TransactionRecord
Expand All @@ -27,6 +28,7 @@ def get_bytes32(bytes_index: int) -> bytes32:
confirmed_at_height=uint32(1),
created_at_time=uint64(1234),
to_puzzle_hash=get_bytes32(1),
to_address=encode_puzzle_hash(get_bytes32(1), "xch"),
amount=uint64(12345678),
fee_amount=uint64(1234567),
confirmed=False,
Expand Down
7 changes: 1 addition & 6 deletions chia/_tests/cmds/wallet/test_did.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from chia.types.blockchain_format.program import NIL, Program
from chia.types.signing_mode import SigningMode
from chia.util.bech32m import encode_puzzle_hash
from chia.util.config import load_config
from chia.wallet.conditions import Condition, ConditionValidTimes, CreateCoinAnnouncement, CreatePuzzleAnnouncement
from chia.wallet.did_wallet.did_info import did_recovery_is_nil
from chia.wallet.util.curry_and_treehash import NIL_TREEHASH
Expand Down Expand Up @@ -421,14 +420,10 @@ async def did_transfer_did(
"150",
]
# these are various things that should be in the output
config = load_config(
root_dir,
"config.yaml",
)
assert_list = [
f"Successfully transferred DID to {t_address}",
f"Transaction ID: {get_bytes32(2).hex()}",
f"Transaction: {STD_TX.to_json_dict_convenience(config)}",
f"Transaction: {STD_TX.to_json_dict()}",
]
run_cli_command_and_assert(capsys, root_dir, command_args, assert_list)
expected_calls: logType = {
Expand Down
11 changes: 3 additions & 8 deletions chia/_tests/cmds/wallet/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ async def get_transactions(
confirmed_at_height=uint32(1 + i),
created_at_time=uint64(1234 + i),
to_puzzle_hash=bytes32([1 + i] * 32),
to_address=encode_puzzle_hash(bytes32([1 + i] * 32), "xch"),
amount=uint64(12345678 + i),
fee_amount=uint64(1234567 + i),
confirmed=False,
Expand Down Expand Up @@ -340,6 +341,7 @@ async def send_transaction(
confirmed_at_height=uint32(1),
created_at_time=uint64(1234),
to_puzzle_hash=get_bytes32(1),
to_address=encode_puzzle_hash(get_bytes32(1), "xch"),
amount=uint64(12345678),
fee_amount=uint64(1234567),
confirmed=False,
Expand Down Expand Up @@ -529,14 +531,7 @@ async def spend_clawback_coins(
tx_hex_list = [get_bytes32(6).hex(), get_bytes32(7).hex(), get_bytes32(8).hex()]
return {
"transaction_ids": tx_hex_list,
"transactions": [
STD_TX.to_json_dict_convenience(
{
"selected_network": "mainnet",
"network_overrides": {"config": {"mainnet": {"address_prefix": "xch"}}},
}
)
],
"transactions": [STD_TX.to_json_dict()],
}

inst_rpc_client = ClawbackWalletRpcClient()
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/core/data_layer/test_data_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ async def is_transaction_confirmed(api: WalletRpcApi, tx_id: bytes32) -> bool:
except ValueError: # pragma: no cover
return False

return True if TransactionRecord.from_json_dict_convenience(val["transaction"]).confirmed else False # mypy
return True if TransactionRecord.from_json_dict(val["transaction"]).confirmed else False # mypy


async def farm_block_with_spend(
Expand Down
8 changes: 3 additions & 5 deletions chia/_tests/wallet/rpc/test_wallet_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ async def test_send_transaction(wallet_rpc_environment: WalletRpcTestEnvironment
},
)
assert response["success"]
tx = TransactionRecord.from_json_dict_convenience(response["transactions"][0])
tx = TransactionRecord.from_json_dict(response["transactions"][0])
[
byte_deserialize_clvm_streamable(
bytes.fromhex(utx), UnsignedTransaction, translation_layer=BLIND_SIGNER_TRANSLATION
Expand Down Expand Up @@ -458,9 +458,7 @@ async def test_push_transactions(wallet_rpc_environment: WalletRpcTestEnvironmen
PushTransactions(transactions=[tx], fee=uint64(10)),
DEFAULT_TX_CONFIG,
)
resp = await client.fetch(
"push_transactions", {"transactions": [tx.to_json_dict_convenience(wallet_node.config)], "fee": 10}
)
resp = await client.fetch("push_transactions", {"transactions": [tx.to_json_dict()], "fee": 10})
assert resp["success"]
resp = await client.fetch("push_transactions", {"transactions": [bytes(tx).hex()], "fee": 10})
assert resp["success"]
Expand Down Expand Up @@ -914,7 +912,7 @@ async def test_spend_clawback_coins(wallet_rpc_environment: WalletRpcTestEnviron
assert resp["success"]
assert len(resp["transaction_ids"]) == 2
for _tx in resp["transactions"]:
clawback_tx = TransactionRecord.from_json_dict_convenience(_tx)
clawback_tx = TransactionRecord.from_json_dict(_tx)
if clawback_tx.spend_bundle is not None:
await time_out_assert_not_none(
10, full_node_api.full_node.mempool_manager.get_spendbundle, clawback_tx.spend_bundle.name()
Expand Down
Loading
Loading