Commit Graph
44 Commits
Author SHA1 Message Date
Matt HauffandGitHub 4ace81ae17 [LABS-294] Add kw_only to all wallet RPC types (#20324)
Add `kw_only` to all wallet RPC types
2026-01-21 09:48:44 -08:00
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 1202e933a6 [LABS-293] Ensure wallet is synced for RPC TX endpoints (#20190)
* Ensure wallet is synced for RPC tx endpoints

* Address flakes

* more flakes

* More flakes in DL tests
2025-11-03 09:17:06 -07:00
Matt HauffandGitHub 11696e4b50 [CHIA-3600] Port send_transaction to @marshal (#19960)
* Port `send_transaction`

* Have I mentioned this framework is suboptimal?

* Fix tests
2025-08-19 09:24:36 -07:00
Matt HauffandGitHub 8463909e8f [CHIA-3598] Port easy wallet endpoints to @marshal (#19941)
* Port `get_transaction_count`

* Port `get_next_address`

* Port `delete_unconfirmed_transactions`

* Port `get_current_derivation_index`

* Really disliking this framework FYI

* Port `extend_derivation_index`

* Fix the mock

* Port `delete_notifications`

* Fix the test check

* Store, not RPC

* Port `verify_signature`

* Port `sign_message_by_address`

* Fix tests

* Port `sign_message_by_id`

* fix tests

* fix test

* test coverage

* comments by @altendky
2025-08-18 09:28:21 -07:00
Matt HauffandGitHub a803dc0fa6 [CHIA-3633] August 2025 pass of Ruff linting rules (#19929)
* Enable Ruff `PLR1704` (`redefined-argument-from-local`)

* Enable Ruff `PLR5501` (`collapsible-else-if`)

* Enable Ruff `PLW2901` (`redefined-loop-name`)

* bad change

* Enable Ruff `RUF043` (`pytest-raises-ambiguous-pattern`)

* Enable Ruff `RUF046` (`unnecessary-cast-to-int`)

* Enable Ruff `RUF052` (`used-dummy-variable`)

* Remove unused ignore `UP006`

* One mis-signaled regex

* Comments by @altendky

* bad change, my bad
2025-08-11 14:39:12 -07:00
0a0293f81a [CHIA-3297] Port get_transaction(s) to @marshal (#19775)
* Port `get_transaction(s)`

* simplify class

* undo simplification

* Delete __eq__ and add test coverage

* Less dunder access

* small change

Co-authored-by: Kyle Altendorf <sda@fstab.net>

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-08-11 12:34:37 -07:00
Richard KissandGitHub 4e6038ba3b Simplify dependencies wrt chia.server (#19895)
Remove some dependencies in `chia.server`.
2025-08-06 12:03:47 -07:00
Matt HauffandGitHub 42da90e105 [CHIA-3294] Port get_wallet_balance(s) to @marshal (#19774)
* Port `get_wallet_balance(s)`

* Use Streamable dict functionality
2025-08-05 13:11:24 -07:00
Matt HauffandGitHub 018c3fe46e [CHIA-3293] Port get_wallets to @marshal decorator (#19770)
* Port `get_wallets`

* Suggestion by @altendky
2025-07-16 09:07:56 -07:00
60e4f85515 [CHIA-1314] Port pooling RPC endpoints to @marshal decorator (#19683)
* Port `pw_join_pool`

* fix tests

* fix moar tests

* Port `pw_self_pool`

* Fix test

* Port `pw_absorb_rewards`

* Port `pw_status`

* Simplifications.

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2025-06-25 09:47:03 -07:00
Kyle AltendorfandGitHub 32ca9c0804 by service not layer (#19715)
* by service not layer

* monkey patch fixup
2025-06-16 14:31:51 -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
Earle LoweandGitHub 7f20df6214 Add some checks when trying to join the same pool already joined (#18822)
* Add some checks when trying to join the same pool already joined

* Add test to test the specific cli case

* Remove line added during debugging

* Add test

* misc updates

* remove cli test

* final tests for joining same pool again

* Update check from code review

* update test framework

* Use click.ClickException for error

* Add check for wallet synced up front as the first thing checked for joining a pool

* Add test for unsynced RPC call
2025-04-28 12:22:51 -07:00
Kyle AltendorfandGitHub a90f04ff48 move chia.types.aliases to chia.server.aliases (#19535)
* move `chia.types.aliases` to `chia.server.aliases`

* touchup
2025-04-25 13:15:04 -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
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
Kyle AltendorfandGitHub 30c4ef2689 use chia_rs directly for consensus constants (#19301) 2025-02-21 10:03:17 -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
Kyle AltendorfandGitHub 9a0b5728c5 use a class for the chia cli context data (#18919)
* use a class for the chia cli context data

* actually assign to the context properly...

* handle the not-present case

* catch up

* tidy

* more

* stuff

* ...

* more real

* expected address prefix
2024-12-19 10:44:48 -07:00
Kyle AltendorfandGitHub 45465b4865 move some non-framework items out of chia.cmds.cmd_classes (#19047)
* move some non-framework items out of `chia.cmds.cmd_classes`

* move the other new stuff too
2024-12-17 14:14:13 -07:00
Earle LoweandGitHub 4db4cd9cc1 convert test_change_pools to WalletTestFramework (#18996)
* convert test_change_pools to WalletTestFramework

* add some checks that were in previous test version

* wait for wallet sync

* farm more blocks?
2024-12-12 09:07:12 -07:00
Arvid NorbergandGitHub bc065b5d52 add some validation of fork_info in Blockchain.add_block() (#18981)
* add some validation of fork_info in Blockchain.add_block(). This would have caught the bug introduced in main a while ago

* simplify add_blocks_in_batches
2024-12-10 10:30:43 -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
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
Matt HauffandGitHub 0e703e48e0 (Mostly) Replace flake8 with Ruff (#18801)
* Get flake8 config partially ready

* Mostly remove flake8 config

* Delete arithmetic whitespace ignore

* Delete unused program strings from tests

* Remove unnecessary noqas

* A couple more flake8 warnings
2024-11-01 09:55:16 -07:00
Kyle AltendorfandGitHub 3b6f547d45 bytes zeros (#18475)
* `ZERO_32`

* `bytes(\d+)\(\[0\] \* \1\)`

* `bytes(\d+)\(b"\\(x00|0)" \* \1\)`

* `bytes(\d+)\(b"0" \* \1\)`

* Revert "`bytes(\d+)\(b"0" \* \1\)`"

This reverts commit 2d629dcb0a.
2024-10-22 12:07:07 -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
Matt HauffandGitHub d260e816f0 [CHIA-1033] Fix flaky pool RPC test (#18369)
Fix flaky pool RPC test
2024-07-30 12:28:33 -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
c25eeb08f7 [CHIA-504] Add support for external signers (PLEASE SQUASH) (#18199)
* Repin hsms

* Add to sdist only allowed list

* Signer protocol tweaks

* Convert wallet RPC client to deserialized types

* Introduce @tx_out_cmd decorator

* Make execute_signing_instructions RPC

* Add transport layer support

* Add signer commands

* Rework wallet execute_signing_instructions

* Inadvertent merge changes

* Fix signer command tests

* Try a different approach: recursive flattening

* Bump hsms

* Add comments

* Test coverage

* Coverage ignores

* Remove inadvertent time traveler

* Bring in lost time traveler

* pylint

* Attempt to make qr test less flaky

* Actually test coverage ignore

* Small refactor for test coverage

* transport -> translation

* missed one

* transport -> translation

* Fix asdict error

* coverage

* Forgoe rotation testing for now

* Test coverage

* jsonify_unsigned_txs -> full_jsonify

* Move a class

* Add better type checking to framework

* explicitly state kwargs on _CommandParsingStage

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Address comments by @altendky

* Consolidate add_private_key and add_public_key

* Consolidate get_key_for_fingerprint and get_public_key_for_fingerprint

* Test fix

* Merge fix

* Bad merge

* Bad merge

* oops

* pylint

* Tweak keychain_proxy.get_key_for_fingerprint

* Fix wallet RPC test?

* pragma: no cover

* Redesign clvm_streamable

* Fix test imports

* black

* fix one more test

* Address comments by @altendky

* Test coverage

* bytes32

* Better CLI mnemonic check

* Use functools.partial

* Rename full jsonify to chip 29

* whoops missed a couple

* Better CLI mnemonic check

* black

* pylint

* Missed one

* black

* Farm at least one block

* Revert last change and fix 0 block farming

* black

* bad merge

* Merge fix

* Inadvertent changes

* Inadvertent changes

* Syncronize with quex.tx_out_decorator2

* These are no longer dictionaries.

* Use new clvm_streamable pattern

* Fix offer endpoint

* Add @tx_out_cmd decorator

* Bump ecdsa version

* Fix @marshal util to return proper transactions

* Add get_public_key

* port `chia wallet send` to @tx_out_cmd

* merge fix of puzzle hash derivation

* Port `chia wallet coins` to @tx_out_cmd

* Port chia wallet clawback to @tx_out_cmd

* Port `chia wallet take/cancel_offer` to @tx_out_cmd

* Port `chia wallet did ...` to @tx_out_cmd

* Port `chia wallet nft ...` to @tx_out_cmd

* Port `chia wallet notifications send` to @tx_out_cmd

* Port `chia wallet vcs ...` to @tx_out_cmd

* Port `chia dao ...` to @tx_out_cmd

* Exclude data layer and plotnft functions

* [no ci]

* Address comments by @AmineKhaldi

* Fix rpc util

* add test for BSTLSigningInstructions

* [UNDO] d9c6f54398

* [UNDO] 7fc1d2adfd

* [UNDO] 23c9ee8549

* [UNDO] aacc9f0228

* [UNDO] 548465403b

* Undo unintentional changes

* Stuff that's not part of this

* More stuff that doesn't belong

* One last thing that doesn't belong

* Unintentional change

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-06-26 09:21:33 -07:00
Jack NelsonandGitHub a447734728 Refactor CLI by adding add new click types for fees, amounts, addresses and bytes32 (#15718) 2024-06-24 16:52:40 -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
Amine KhaldiandGitHub 960274899e Move SimulatorFullNodeService type alias to start_simulator (#17875)
Move SimulatorFullNodeService type alias to start_simulator.
2024-04-18 14:26:36 -07:00
Kyle AltendorfandGitHub a89222a428 move tests (#17209)
* prep

* verify source and installed tests match

* move

* remove move script
2024-03-14 10:19:20 -07:00