* make recurse_jsonify() work directly on types, circumventing the dataclasses.asdict() step. This enables simpler integration of non dataclasses into the Streamable and JSON protocols
* add benchmark for Streamable.to_json_dict()
* When prompting to unlock the keyring during daemon launch, it's possible
that the daemon websocket connection will timeout before the user has
entered their passphrase. We can't quickly detect that the connection
has timed-out, so instead we now reconnect after collecting the
passphrase, unlock the keyring, and then close the old connection.
* mypy fix
* Switch to using asyncio.loop.run_in_executor to collect the passphrase on its own thread.
* Use a new ThreadPoolExecutor configured with 1 worker thread.
* add exact match and best exact match algorithms
* optimize algorithm further
this might be good.
* lint
* fix bad logic
* add final algorithms
* delete lint
* oops
* Update coin_selection.py
* simplify and fix knapsack algoritm
* simplify code and correct logic
* make it way better.
* clarify comments and check for edge cases.
* add comments and stuff
* improve coin selection
addressed comments
Thanks!
* add coin_selection rpc tests.
* clean up and add new unit tests
* undo test changes
* add extra test cases
* move coin_selection to its own function and switch to it for cat and main wallet.
* add cat tests
* lint
* make function align with standards
also removed test
* make test better
* add proper types
* Improve code clarity
* wallet: fix coin selection bugs
* wallet: add an assert just in case
* tests: add some sleeps to reduce flakiness
* Isort
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* fix bad merge
* lint
* fix tests
* address aforementioned changes.
* remove wallet test
* isort
* more tests and fixes
* lint
* rename to amount for coin selection rpc
* fix incase we have no smaller coins
* fix tests + lint
* re add asserts
* oops
missed me.
* lint
* fix test
* Squashed commit of the following:
commit 34a2235de5
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Apr 13 10:09:42 2022 -0400
clarify comment
commit adbf7f4f94
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Tue Apr 12 20:27:05 2022 -0400
linty lint
commit 5ebc1ac9fd
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Tue Apr 12 20:17:19 2022 -0400
add failure test and final changes
commit 7e5a21b4c2
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Tue Apr 12 19:35:18 2022 -0400
add descriptions and slim down code
commit 31c95b916d
Merge: d7b91295bd9b0ef5f3
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Mon Apr 11 10:12:05 2022 -0400
Merge branch 'jack-cat-coinselection' into jn_coinselection_dust
commit d7b91295b5
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Sun Apr 10 20:31:09 2022 -0400
lint
commit 30dc7c0ab4
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Sun Apr 10 20:25:52 2022 -0400
fix tests
commit 6c8c2e4874
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Thu Mar 31 15:06:00 2022 -0400
remove duplicate code.
commit 9f79b6f304
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Thu Mar 31 15:01:10 2022 -0400
address more concerns
commit 67c1b3929f
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Thu Mar 31 12:59:05 2022 -0400
fix logic error
commit 2d19a53245
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Thu Mar 31 11:47:52 2022 -0400
simplify and de duplicate code
commit 6ab1cc79bb
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 21:34:50 2022 -0400
add function and select individual coin
commit 582c17aa8d
Merge: ce2165942618fbaeba
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 21:14:37 2022 -0400
Merge branch 'jack-cat-coinselection' into jn_coinselection_dust
commit ce21659429
Merge: 16aabb3fd6daba28db
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 20:53:21 2022 -0400
Merge branch 'jack-cat-coinselection' into jn_coinselection_dust
commit 16aabb3fd5
Merge: 0b9fc28452286fe426
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 20:49:02 2022 -0400
Merge branch 'jack-cat-coinselection' into jn_coinselection_dust
commit 0b9fc28455
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 20:38:12 2022 -0400
lint
commit 62e74c72f4
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 20:34:22 2022 -0400
fix logic and tests
commit e738f44320
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 18:52:05 2022 -0400
deal with dust and add tests
* make sure that we do not use any dust
* minor change
* address concerns
* adjust comments
* adjust comment
Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Uses the new `from_bytes_unchecked` method in blspy, to improve performance
* Update test
* Fix merge conflict
* Use from_bytes_unchecked in post_init and from_json
* More uniform code
* simplify SizedBytes and StructStream
* lint
* super() !!!
* do not pass parameter up to super().__init__()
* Update chia/util/struct_stream.py
Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
* parse fixed-width int data from class name
* add int512 and uint128 .from_bytes(), test .parse() failures
* test serialization against struct.pack()
* use typing_extensions for final
* override ignore
* stop using struct for StructStream
oh the irony
* fixup .to_bytes() to accept parameters again for where we use that
* bring back signed parameter
* format
* adjust tests for new exception
* eliminate custom coding for uint128 and int512
* tidy
* remove unused StructStream.PACK attribute
* add direct tests for parse_metadata_from_name()
* stricter hinting
* remove no-longer-needed typeshed work-around
* apply strict type checking to all touched files
* remove StructStream override of .to_bytes()
* tidy
* types touchup
* add unused parameter comments
Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
Co-authored-by: wjblanke <wjb98672@gmail.com>
* Resend transactions
* Don't recheck transactions more frequently than timeout
* Add wallet resend parameter to config, move timeout code out of tx store, but close to call site
* Add a test for wallet transaction resend
* Add test for wallet retry
* isort new files for precommit and update workflows
* Use correct fixture name
* LGTM - remove unused import
Co-authored-by: Earle Lowe <e.lowe@chia.net>
* Mypy for consensus dir (Except blockchain.py)
* Finish up consensus folder mypy
* Lint
* isort
* lint
* awaitable over coroutine
* less Any
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Test plot sync start and disconnect while a sync is in progress
* Drop `Receiver._lock`, instead wait for `Receiver.sync_active` to clear
* Properly stop the sender and plot manager refreshing on disconnect
* Poll faster, drop the log
* Reset `_sync_id` at the very end of `_finalize_sync`
* Move wallet RPC test setup into a fixture
* Fix `mypy` issues
* Enable `isort`
* Move `tx_in_mempool` out and reuse it instead of `tx_in_mempool_2`
* Introduce `get_confirmed_balance` and `get_unconfirmed_balance`
* Use `pytest.raises`
* Only test with an untrusted full node
* Introduce `generate_funds`
* Drop sleeps and create less blocks
* Recover trusted/untrusted sync parameterization
* Some work on hints
* More cleanup and test_generator_tools
* Change relevant calls
* More refactor and cleanup
* More refactor
* Small fix
* Create wrapper object PeakPostProcessingResult
* Lint and small fix
* Fix a hint bug
* Fix hint update_wallets
* Fix test_full_sync
* pre-commit
* Start with PR review comments
* More efficient iteration
* Remove tx_removals_additions_and_hints
* Revert mozilla ca
* Fix issue with startup
* farmer: Adjust notifications from the farmer to the UI
- Only send the data for the harvester which actually sent an update
- Notify for each loaded batch during initial loading
* Enable improved farmer/harvester GUI
* farmer|rpc|tests: Implement paginated harvester plot endpoints
* Simplify filtering
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Let the API handle the exceptions
* Simplify the other filtering too
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Simplify count assertions
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Refactor `is_filter_match` to `plot_matches_filter`
And just convert to `Plot` in tests.
* Move `chia.util.misc.KeyValue` to `chia.rpc.farmer_rpc_api.FilterItem`
* Rename `peer_id` to `node_id` to be match `get_harvesters_{summary}`
Co-authored-by: Kyle Altendorf <sda@fstab.net>