Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch spendbundle to_json_dict to not use the legacy keys #68

Merged
merged 5 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ permissions:
jobs:
build-wheels:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_24_x86_64
container: quay.io/pypa/manylinux_2_28_x86_64

steps:
- name: Add safe git directory
uses: Chia-Network/actions/git-mark-workspace-safe@main

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- build-wheels
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
13 changes: 12 additions & 1 deletion cic/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from datetime import datetime
from operator import attrgetter
from pathlib import Path
from typing import Dict, Iterable, List, Optional, Union
from typing import Any, Dict, Iterable, List, Optional, Union

from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.program import Program, INFINITE_COST
Expand Down Expand Up @@ -73,6 +73,17 @@
else:
from cic.cli.clients import get_node_and_wallet_clients, get_node_client, get_additional_data

# Newer versions of chia should use the modern keys and the version bundled here uses the old keys
original_to_json_dict = SpendBundle.to_json_dict


def patched_to_json_dict(self, include_legacy_keys: bool = False, exclude_modern_keys: bool = False) -> Dict[str, Any]:
# Call the original method with different defaults
return original_to_json_dict(self, include_legacy_keys=include_legacy_keys, exclude_modern_keys=exclude_modern_keys)


SpendBundle.to_json_dict = patched_to_json_dict

CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])


Expand Down
Loading