|
29 | 29 | from chia.types.signing_mode import SigningMode |
30 | 30 | from chia.util.bech32m import encode_puzzle_hash |
31 | 31 | from chia.wallet.conditions import Condition, ConditionValidTimes |
| 32 | +from chia.wallet.puzzle_drivers import PuzzleInfo |
32 | 33 | from chia.wallet.trade_record import TradeRecord |
33 | 34 | from chia.wallet.trading.offer import Offer |
34 | 35 | from chia.wallet.trading.trade_status import TradeStatus |
|
49 | 50 | CATSpend, |
50 | 51 | CATSpendResponse, |
51 | 52 | ClawbackPuzzleDecoratorOverride, |
| 53 | + CreateOfferForIDs, |
52 | 54 | CreateOfferForIDsResponse, |
53 | 55 | DeleteUnconfirmedTransactions, |
54 | 56 | ExtendDerivationIndex, |
|
79 | 81 | ) |
80 | 82 | from chia.wallet.wallet_spend_bundle import WalletSpendBundle |
81 | 83 |
|
| 84 | +TEMP = PuzzleInfo( |
| 85 | + { |
| 86 | + "type": "singleton", |
| 87 | + "launcher_id": "0x0101010101010101010101010101010101010101010101010101010101010101", |
| 88 | + "launcher_ph": "0xeff07522495060c066f66f32acc2a77e3a3e737aca8baea4d1a64ea4cdc13da9", |
| 89 | + "also": { |
| 90 | + "type": "metadata", |
| 91 | + "metadata": "", |
| 92 | + "updater_hash": "0x0707070707070707070707070707070707070707070707070707070707070707", |
| 93 | + "also": { |
| 94 | + "type": "ownership", |
| 95 | + "owner": "()", |
| 96 | + "transfer_program": { |
| 97 | + "type": "royalty transfer program", |
| 98 | + "launcher_id": "0x0101010101010101010101010101010101010101010101010101010101010101", |
| 99 | + "royalty_address": "0x0303030303030303030303030303030303030303030303030303030303030303", |
| 100 | + "royalty_percentage": "1000", |
| 101 | + }, |
| 102 | + }, |
| 103 | + }, |
| 104 | + } |
| 105 | +) |
| 106 | + |
82 | 107 | test_offer_file_path = importlib_resources.files(__name__.rpartition(".")[0]).joinpath("test_offer.toffer") |
83 | 108 | test_offer_file_bech32 = test_offer_file_path.read_text(encoding="utf-8") |
84 | 109 | test_offer_id: str = "0xdfb7e8643376820ec995b0bcdb3fc1f764c16b814df5e074631263fcf1e00839" |
@@ -763,17 +788,22 @@ def test_make_offer(capsys: object, get_test_cli_clients: tuple[TestRpcClients, |
763 | 788 | class MakeOfferRpcClient(TestWalletRpcClient): |
764 | 789 | async def create_offer_for_ids( |
765 | 790 | self, |
766 | | - offer_dict: dict[uint32, int], |
| 791 | + request: CreateOfferForIDs, |
767 | 792 | tx_config: TXConfig, |
768 | | - driver_dict: Optional[dict[str, Any]] = None, |
769 | | - solver: Optional[dict[str, Any]] = None, |
770 | | - fee: uint64 = uint64(0), |
771 | | - validate_only: bool = False, |
| 793 | + extra_conditions: tuple[Condition, ...] = tuple(), |
772 | 794 | timelock_info: ConditionValidTimes = ConditionValidTimes(), |
773 | 795 | ) -> CreateOfferForIDsResponse: |
774 | 796 | self.add_to_log( |
775 | 797 | "create_offer_for_ids", |
776 | | - (offer_dict, tx_config, driver_dict, solver, fee, validate_only, timelock_info), |
| 798 | + ( |
| 799 | + request.offer, |
| 800 | + tx_config, |
| 801 | + request.driver_dict, |
| 802 | + request.solver, |
| 803 | + request.fee, |
| 804 | + request.validate_only, |
| 805 | + timelock_info, |
| 806 | + ), |
777 | 807 | ) |
778 | 808 |
|
779 | 809 | created_offer = Offer({}, WalletSpendBundle([], G2Element()), {}) |
@@ -866,35 +896,39 @@ async def create_offer_for_ids( |
866 | 896 | "create_offer_for_ids": [ |
867 | 897 | ( |
868 | 898 | { |
869 | | - 1: -10000000000000, |
870 | | - 3: -100000, |
871 | | - "0404040404040404040404040404040404040404040404040404040404040404": -100000, |
872 | | - "0202020202020202020202020202020202020202020202020202020202020202": 10000, |
873 | | - "0101010101010101010101010101010101010101010101010101010101010101": 1, |
| 899 | + "1": "-10000000000000", |
| 900 | + "3": "-100000", |
| 901 | + "0404040404040404040404040404040404040404040404040404040404040404": "-100000", |
| 902 | + "0202020202020202020202020202020202020202020202020202020202020202": "10000", |
| 903 | + "0101010101010101010101010101010101010101010101010101010101010101": "1", |
874 | 904 | }, |
875 | 905 | DEFAULT_TX_CONFIG.override(reuse_puzhash=True), |
876 | 906 | { |
877 | | - "0101010101010101010101010101010101010101010101010101010101010101": { |
878 | | - "type": "singleton", |
879 | | - "launcher_id": "0x0101010101010101010101010101010101010101010101010101010101010101", |
880 | | - "launcher_ph": "0xeff07522495060c066f66f32acc2a77e3a3e737aca8baea4d1a64ea4cdc13da9", |
881 | | - "also": { |
882 | | - "type": "metadata", |
883 | | - "metadata": "", |
884 | | - "updater_hash": "0x0707070707070707070707070707070707070707070707070707070707070707", |
| 907 | + bytes32([1] * 32): PuzzleInfo( |
| 908 | + { |
| 909 | + "type": "singleton", |
| 910 | + "launcher_id": "0x0101010101010101010101010101010101010101010101010101010101010101", |
| 911 | + "launcher_ph": "0xeff07522495060c066f66f32acc2a77e3a3e737aca8baea4d1a64ea4cdc13da9", |
885 | 912 | "also": { |
886 | | - "type": "ownership", |
887 | | - "owner": "()", |
888 | | - "transfer_program": { |
889 | | - "type": "royalty transfer program", |
890 | | - "launcher_id": "0x0101010101010101010101010101010101010101010101010101010101010101", |
891 | | - "royalty_address": "0x0303030303030303030303030303030303030303030" |
892 | | - "303030303030303030303", |
893 | | - "royalty_percentage": "1000", |
| 913 | + "type": "metadata", |
| 914 | + "metadata": "", |
| 915 | + "updater_hash": "0x0707070707070707070707070707070707070707070707070707070707070707", |
| 916 | + "also": { |
| 917 | + "type": "ownership", |
| 918 | + "owner": "()", |
| 919 | + "transfer_program": { |
| 920 | + "type": "royalty transfer program", |
| 921 | + "launcher_id": ( |
| 922 | + "0x0101010101010101010101010101010101010101010101010101010101010101" |
| 923 | + ), |
| 924 | + "royalty_address": "0x0303030303030303030303030303030303030303030" |
| 925 | + "303030303030303030303", |
| 926 | + "royalty_percentage": "1000", |
| 927 | + }, |
894 | 928 | }, |
895 | 929 | }, |
896 | | - }, |
897 | | - } |
| 930 | + } |
| 931 | + ) |
898 | 932 | }, |
899 | 933 | None, |
900 | 934 | 500000000000, |
|
0 commit comments