Commit Graph
133 Commits
Author SHA1 Message Date
Matt HauffandGitHub a05a0c57d2 [CHIA-3707] Port create_new_wallet to @marshal (#20087)
* Add the request types

* Add the request types

* some test fixes

* Add the client ports

* Fix tests

* Add cmd support and fix a test

* Missed a couple

* Add test for `CreateNewWallet.__post_init__()`
2025-12-08 09:31:51 -08:00
Matt HauffandGitHub 40db4635a8 [LABS-245] Enable PEP604 Ruff rules (#20269)
* Enable PEP604 Ruff rules

* Fix harcoded signature in test

* Hack CLVMStreamable test with note to fast follow
2025-11-18 12:34:00 -08:00
Matt HauffandGitHub 590be179fc [LABS-161] Add a method for creating outgoing transactions (#20209)
* Add a method for creating outgoing transactions

* Fix some oversights wrt wallet_id
2025-10-31 08:56:15 -07:00
Matt HauffandGitHub e8e060b533 [CHIA-3419] Remove TransactionRecord.*_json_dict_convenience (#19860)
* Change `TransactionRecord` to use dict instead of list of tuples for memos

* Update streamable and fix tests

* Update test to accidentally fixed memos generation

* Remove `TransactionRecord.*_json_dict_convenience`

* Fix test

* Use AddressType library in WSM method

* Use AddressType library in transaction_store method
2025-08-05 13:10:52 -07:00
Kyle AltendorfandGitHub 7a26610e8f less pre-inting for ints (#19853) 2025-07-23 13:18:04 -07:00
Matt HauffandGitHub 55165b1163 [CHIA-3418] Change TransactionRecord to use dict instead of list of tuples for memos (#19846)
* Change `TransactionRecord` to use dict instead of list of tuples for memos

* Update streamable and fix tests

* Update test to accidentally fixed memos generation
2025-07-23 13:17:41 -07:00
matt-o-howandGitHub 80d38200a3 Migrate away from clvm imports (#19730)
* migrate casts to wallet util

* reset mempool_check_conditions

* ruff to re-order imports

* reset full_node_rpc_api

* add tests for casts

* ruff and type

* move to util to avoid consensus depending on wallet

* ruff again

* add a deterministic seed for random
2025-06-26 10:18:04 -07:00
c0410e97ec Bump chia rs >=0.24, <0.25 (#19615)
* bump chia_rs

* update db_graftroot test

* update SerializedProgram and Program use, to accommodate new chia_rs interface

* review comments

* review comments

---------

Co-authored-by: Matthew Howard <m.o.howard97@gmail.com>
2025-05-29 09:24:08 -07:00
Richard KissandGitHub c800e06ac4 Remove the dependency of chia.consensus on the module chia.types (#19590)
* Move `chia/types/spend_bundle.py` to wallet.

* Move `compute_additions` functions into wallet.

* Move `chia/types/eligible_coin_spends.py` to `chia/full_node`.
2025-05-09 13:56:01 -05:00
Kyle AltendorfandGitHub fcd20ce543 more chia_rs directly (#19520)
* more `chia_rs` directly

* maybe

* undo, kinda
2025-04-21 14:05:05 -05:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Earle Lowe
31a8715919 build(deps): bump ruff from 0.9.6 to 0.11.4 (#19482)
* build(deps): bump ruff from 0.9.6 to 0.11.4

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.9.6 to 0.11.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.9.6...0.11.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.11.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* ruff fixes

* ruff fixes

* ruff fixes

* Address review suggestions

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
2025-04-14 16:09:07 -05:00
Matt HauffandGitHub 85a44bb4ab [CHIA-2636] Remove direct secret key access from pool wallet (#19446)
* Remove direct secret key access from pool wallet

* Remove now unusued cache

* Some hardcoded test fixes

* More test fixes

* Add comment
2025-04-03 15:34:14 -05:00
Matt HauffandGitHub a6a5a35c7d [CHIA-1251] Add puzzle hash generation to action scopes (#19283)
* (squash) Add puzzle hash generation to action scopes

* Add comment for unused/last_index
2025-04-03 15:34:07 -05:00
Kyle AltendorfandGitHub d50b6e0883 use chia_rs directly for sized bytes (#19326) 2025-02-28 09:35:25 -08:00
Kyle AltendorfandGitHub e446d6b726 use chia_rs directly for sized ints (#19303)
* use chia_rs directly for sized ints

* Update data_layer_rpc_api.py
2025-02-24 14:33:09 -08:00
Matt 22b0df5631 Add generate_signed_transaction to WalletProtocol 2025-02-07 15:34:07 -08:00
Matt dd6eef201d Fix the other create_tandem_xch_txs 2025-02-03 08:11:35 -08:00
Matt 7c4b4277a4 Standardize the Wallet API for generate_signed_transaction 2025-01-29 12:42:26 -08:00
matt-o-howandGitHub 8bb8a1b730 Migrate puzzles away from load_clvm to import from chia_puzzles_py (#19055)
* add dependency for chia_puzzles_py

* migrate cat and dao wallets to new repo

* migrate did wallet

* more migration and deduplication

* change singleton launcher hash import in rpc

* stop importing singleton launcher from nft_puzzles in nft_wallet

* remove SINGLETON_LAUNCHER_PUZZLE import from nft_puzzles

* remove unused import

* ruff check and fix

* use graftroot dl offers from chia_puzzles_py

* get rid of more non explicit exports

* remove circular dependency

* ruff check

* migrate py files in puzzles to use chia_puzzles_py

* fix import

* fix more imports

* migrate clawback wallet and fix typo (requires version update of chia_puzzles_py)

* delete puzzles and separate nft puzzles from puzzle_utils

* use 0.19.1 version of chia_puzzles_py

* more nft puzzle detangling

* use latest chia_puzzles_py and migrate pools

* ruff fixes

* delete pool puzzles folder

* remove load_clvm from test_singleton and test_singleton_lifecycle_fast

* mypy fixes

* ruff fixes

* remove manage_clvm check precommit hook

* update version

* update chia_puzzles dependency to 0.19.4

* remove full_node puzzles

* remove test for condition codes

* change generator type to SerializedProgram

* remove remaining load_clvms that can be factored out

* delete consensus puzzles

* fix test_singleton_lifecycle_fast

* cast debug_spend_bundle coin name to bytes32

* ruff debug_spend_bundle

* update chia-puzzles and fix typo

* fix line endings

* fix typo in ROM_BOOTSTRAP_GENERATOR references

* remove bytes32 cast from debug_spend_bundle

* update chia-puzzles-py dependency to version 0.20.1 and refactor ACS_TRANSFER_PROGRAM initialization

* remove unused puzzle files

* singleton_top_layer exports hashs now which are imported from chia_puzzles

* remove .get_tree_hash() in favor of importing the hash

* remaining hash imports

* regenerate poetry.lock and pyproject.toml from main

* import singleton launcher hash from explicit export

* import SINGLETON_LAUNCHER_HASH from chia.wallet.singleton in test_pool_rpc.py

* import SINGLETON_MOD_HASH from chia.wallet.puzzles.singleton_top_layer in test_pool_puzzles_lifecycle.py

* poetry lock --no-update post-rebase

* re-regenerate lock file --no-update

* fix rebased block_tools
2025-01-17 09:58:16 -07:00
Earle LoweandGitHub 7c01e3c483 CHIA-1730: port chia plotnft to @chia_commands framework (#18833)
* chia plotnft CLI improvements

* use CliRpcConnectionError

* add check to show

* fix typo

* Update plotnft CLI to newer framework

* Fix help cut-paste error

* add test using new framework

* some minor fixes

* use click.Choice for pool/local option

* some click options

* Some more plotnft cli tests

* drop test_pool_cmdline from mypy-exclusions

* mypy fixes

* several fixes

* Add leave test

* join tests

* more join tests

* missing await

* Try setting config

* use root_path from NeedsWalletRPC

* linting

* Some cleanup

* Add claim tests

* Improved tests

* refactor some test code

* Add inspect tests

* Skip bad test for now

* Add in change payout tests

* quoting error

* Add test for get_login_link

* Add in a few negative tests for join

* Few more tests

* Experment with clirunner env overrides

* put back chia_root into context dict

* Some cleanup and one more test

* maybe final test

* some updates

* some dedup and reorg of test code

* run trusted and untrusted paramertization

* make reuse puzhash stuff work

* Add in required mock object for test_update_pool_config_new_config

* rearrange code per review comment - limit use of NeedsWalletRPC to chia_command

* Add in plotnft click parsing tests

* added ability to pass in obj to runner invoke

* Add in some more test cases

* fix up create issues with config

* Add in couple more test cases for error conditions

* Minor code cleanup

* Use long options for readability, minor code cleanup

* Use config file for farmer rpc port

* simplify code

* Add testing for prompt cases

* Add mocking for default_root_path

* context cleanup

* temp debugging output

* patch the proper object

* move some wallet fixtures into top level conftest and remove conftest import

* merge to origin/main
2024-12-03 12:33:52 -07:00
Matt HauffandGitHub 3bc2fbff35 [CHIA-1696] Show an INCOMING_TX for pool reward claims (#18887)
* Show an `INCOMING_TX` for pool reward claims

* The last thing worked, but not really
2024-11-19 13:22:19 -07:00
Matt HauffandGitHub 604fc1feb0 [CHIA-1732] Add Ruff specific linting rules (#18845)
* Add Ruff specific linting rules

* Further tighten ignore list

* Address comments by @altendky

* One more comment @altendky
2024-11-14 15:58:12 -07:00
6c90a76b56 Tighten up ruff ignore list (#18837)
* Tighten up ruff ignore list

* Okay that fix was indeed unsafe

* enable type-name-incorrect-variance

* enable literal-membership

* enable non-augmented-assignment

* enable useless-return

* enable global-variable-not-assigned

* -

* fixup

* Clean up roff.toml from annotations

* use ignore instead of explicit re-export

* use more descriptive names

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-11-12 12:19:31 -07:00
Matt HauffandGitHub 2808ee2446 [CHIA-1681] Replace black with Ruff (#18813)
* Replace black with Ruff

* Change build_network_protocol_files.py
2024-11-04 15:22:18 -07:00
Matt HauffandGitHub 73e4a5bbea [CHIA-1680] Finish replacing flake8 with Ruff (#18802)
* Apply ruff unsafe fixes

* Manually fix tuples with `as`

* Remove all references to flake8
2024-11-04 08:59:57 -07:00
Kyle AltendorfandGitHub 9c8557a1f8 Remove Python 3.8 support and update source to 3.9 standards (#18687)
* manual python 3.8 removals

* poetry

* pyupgrade

* black

* isort

* manually tidy imports

* work around shadowed type

* catch up build network protocol files for pyupgrade changes

* placate pylint

* re-enable 20.04

* placate flake8
2024-10-16 14:21:15 -07:00
Felix BruckerandGitHub a617ed5c86 Fix new pool url detection (#18521)
* Fix new pool url detection

* Make flake8 happy

* Make black happy
2024-09-13 11:00:41 -05:00
Amine KhaldiandGitHub 8129b41473 CHIA-210 Introduce WalletSpendBundle and use it across code related to wallets (#18264)
Introduce WalletSpendBundle and use it across code related to wallets.
2024-08-30 21:36:26 +08:00
Matt HauffandGitHub 64003a63f5 [CHIA-1067] Integrate coin selection with action scopes (#18424)
* Add TXConfig to action scopes

* Fix DID test

* Fix CR-CAT method

* Fix NFT offer test

* Utilize streamable for WalletSideEffects serialization

* Integrate coin selection with action scopes

* Fix action scope test

* Fix DID test

* Fix NFT tests

* Fix NFT tests
2024-08-19 09:02:36 -07:00
Kyle AltendorfandGitHub 7d88089e8f more bytes32.from_hexstr() (#18446) 2024-08-14 15:05:41 -07:00
Matt HauffandGitHub 8bc332f95e [CHIA-1037] Add TXConfig to action scopes (#18406)
* Add TXConfig to action scopes

* Fix DID test

* Fix CR-CAT method

* Fix NFT offer test
2024-08-07 11:27:13 -07:00
Adam KellyandGitHub 5462631d99 CHIA-942 Use launcher_id as the primary key when updating (current) pool config. (#18341)
Use launcher_id as the primary key when updating (current) pool config.
Add an error diagnostic for the case where updating fails due to the supplied closure.
2024-07-22 12:30:54 -07:00
Matt HauffandGitHub 055588914e [CHIA-714] Add usage of action scope throughout wallet codebase (#18128)
* Add the concept of 'action scopes'

* Add `WalletActionScope`

* Fix CATWallet pending_change calculation

* Add action_scope: WalletActionScope to all tx endpoints

* Add usage of action scope throughout wallet codebase

* Add the concept of 'action scopes'

* pylint and test coverage

* add try/finally

* add try/except

* Undo giving a variable a name

* Fix CRCAT test

* Fix trade tests

* Fix cat test

* Fix miscellaneous test

* Fix miscellaneous test

* Fix miscellaneous test

* pylint

* Add auto claim test coverage

* Take advantage of extra_spends

* Fix tests

* test fixes

* pylint
2024-07-17 12:17:16 -07:00
Matt HauffandGitHub 4ffb6dfa6f [CHIA-713] Add action_scope: WalletActionScope to all tx endpoints (#18127)
* Add the concept of 'action scopes'

* Add `WalletActionScope`

* Fix CATWallet pending_change calculation

* Add action_scope: WalletActionScope to all tx endpoints

* Add the concept of 'action scopes'

* pylint and test coverage

* add try/finally

* add try/except

* Undo giving a variable a name

* Fix CRCAT test

* Fix trade tests

* Fix cat test

* Fix miscellaneous test

* Fix miscellaneous test

* Fix miscellaneous test

* Add auto claim test coverage
2024-07-16 11:06:01 -07:00
Matt HauffandGitHub a6fca99e6f Remove chia.clvm.singleton (#18163)
Remove chia.clvm.singleton
2024-06-17 11:58:20 -05:00
a58cc334a4 clvm mypie (#16898)
* clvm mypie

* update exclusions

* wip

* some

* undo for now

* more

* more

* drop the program usage in datalayer tests

* ignore tree hash errors

* ignore enough in _sexp_replace...

* again

* almost

* Fix test_singleton.py

* dl fixup

* did fixup

* touchup

* nft fixup

* fixup tests

* Revert "fixup tests"

This reverts commit 5df1a705ec.

* or this i guess

* blah

* Fix get_owner_did

* tidy

* blah

* `.as_atom()`

* `.as_int()`

* Update chia/wallet/nft_wallet/nft_puzzles.py

* `rrrff`

* stop using `CastableType`

* undo stuff around using `CastableType`

* `announcement_assertions: List[Program]`

* Update chia/types/blockchain_format/program.py

* more

* clvm==0.9.10

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
Co-authored-by: Matt <quexington@gmail.com>
2024-05-22 12:28:07 -05:00
Arvid NorbergandGitHub aa576768d6 Puzzle hash optimizations (#17995)
* use the NULL_HASHTREE constant instead of re-computing the hash on the fly

* optimize puzzle hash computations by using shatree_atom() and shatree_pair() directly, rather than constructing a Program to call get_tree_hash() on.

* cache synthetic public keys and private keys

* rename NULL_TREEHASH -> NIL_TREEHASH
2024-05-10 13:45:27 -07:00
Matt HauffandGitHub aefe7fdf28 Observer Mode (#17792)
* Observer Mode

* Address comments by @altendky

* Change RPC default and fix test coverage

* Add test coverage for rpc marshaller

* Fix @marshal util to return proper transactions
2024-05-07 13:39:25 -07:00
Arvid NorbergandGitHub 35851e5122 optimize launcher_id_to_p2_puzzle_hash() (#17961) 2024-05-07 13:38:47 -07:00
Arvid NorbergandGitHub fdb87e656c drop deprecated authentication_public_key from pool config (#17959)
* introduce early exit to dedent for-loop

* remove deprecated authentication_public_key from pool-config
2024-05-04 08:22:24 -07:00
Arvid NorbergandGitHub cb57cc848a remove unused current_inner from PoolState (#17965)
remove unused current_inner from PoolState. We generate this puzzle regularly, it's expensive, and we don't use it
2024-05-04 07:45:13 -07:00
Arvid NorbergandGitHub 47fddc54d6 introduce early continue/exit to reduce the indentation level (#17918) 2024-04-26 08:07:02 -07:00
Amine KhaldiandGitHub a5ae6356a4 Use as_iter instead of as_python in get_delayed_puz_info_from_launcher_spend and construct return values with proper types (#17847)
Use as_iter instead of as_python in get_delayed_puz_info_from_launcher_spend and construct return values with proper types.
2024-04-16 13:54:37 -07:00
Amine KhaldiandGitHub 97cd5a98b4 Improve get_seconds_and_delayed_puzhash_from_p2_singleton_puzzle (#17746)
Improve get_seconds_and_delayed_puzhash_from_p2_singleton_puzzle.

* Construct delayed_puzzle_hash as a proper bytes32 object.
* Mark unused values.
* Handle atom optionality before constructing return values.
2024-03-26 12:47:36 -07:00
Earle LoweandGitHub 48e4039e58 Update black to 24.1.1 and update source as needed (#17499)
* Update source to black 24 spec

* update black to 24.1.1

* update pylint to ignore multiple-statements

* update test file

* black updates

* format updates

* Update test_network_protocol_files.py

* Update test_network_protocol_files.py
2024-03-13 11:08:19 -07:00
Matt HauffandGitHub c6f1a57c56 Unify transaction pushing (#17458)
* Don't autopush transactions by default anywhere

* Remove ignore_max_send_amount

* Use TXConfig instead of pending_transactions for coin exclusion in spend_clawback_coins

* Unify transaction pushing into a single method

* Address offline comments by @emlowe

* Rework max send amount to be based on coin quantity rather than amount

* Inadvertent changes

* Test fixes

* Inadvertent change

* Bad import?

* Inadvertent changes?

* readd missing test
2024-02-05 10:34:47 -08:00
9bdc17868d Stop automatic transaction pushing by wallets (#17436)
* Don't autopush transactions by default anywhere

* Remove ignore_max_send_amount

* Use TXConfig instead of pending_transactions for coin exclusion in spend_clawback_coins

* Address offline comments by @emlowe

* Rework max send amount to be based on coin quantity rather than amount

* merge fixes

* Inadvertent diffs

* Inadvertent change

* Inadvertent diff.

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-01-31 12:33:41 -08:00
Felix BruckerandGitHub 728f956804 Update pool url on redirect (#17384)
* Update pool url on redirect

* Add tests

* Only persist the new url when it's a permanent redirect

* Remove unused pool_info overrides
2024-01-31 09:28:06 -08:00
Matt HauffandGitHub aeecaca663 Remove ignore_max_send_amount (#17418)
* Remove ignore_max_send_amount

* Address offline comments by @emlowe

* Rework max send amount to be based on coin quantity rather than amount
2024-01-29 14:31:42 -08:00
Matt 9a44ca926d Merge commit 'f96aaee604072b83c9aae7bcb03a1e3856f4b4cc' into HEAD 2024-01-22 09:59:43 -08:00