Skip to content

Commit 368f4d4

Browse files
committed
Patch spendbundle to json dict to not use the legacy keys
1 parent 3d4eadc commit 368f4d4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cic/cli/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from datetime import datetime
1616
from operator import attrgetter
1717
from pathlib import Path
18-
from typing import Dict, Iterable, List, Optional, Union
18+
from typing import Any, Dict, Iterable, List, Optional, Union
1919

2020
from chia.types.blockchain_format.coin import Coin
2121
from chia.types.blockchain_format.program import Program, INFINITE_COST
@@ -73,6 +73,13 @@
7373
else:
7474
from cic.cli.clients import get_node_and_wallet_clients, get_node_client, get_additional_data
7575

76+
# Newer versions of chia should use the modern keys and the version bundled here uses the old keys
77+
original_to_json_dict = SpendBundle.to_json_dict
78+
def patched_to_json_dict(self, include_legacy_keys: bool = False, exclude_modern_keys: bool = False) -> Dict[str, Any]:
79+
# Call the original method with different args if needed
80+
return original_to_json_dict(self, include_legacy_keys=include_legacy_keys, exclude_modern_keys=exclude_modern_keys)
81+
SpendBundle.to_json_dict = patched_to_json_dict
82+
7683
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
7784

7885

0 commit comments

Comments
 (0)