Commit Graph

42 Commits

Author SHA1 Message Date
Kronus91
d5a56f756e
Add type filter for get_transactions (#15196)
* Add type filter for get_transactions

* Resolve comments

* Improve unit test

* Resolve comments

* Resolve comments
2023-05-15 10:19:06 -05:00
dustinface
0c4222f83e
wallet: Implement WalletCoinStore.delete_wallet (#15127) 2023-05-11 19:04:01 -05:00
Amine Khaldi
4b8a6e9b99
Merge commit '138154d5cd14c612036502bb2a7127fcdb2fe8c5' into checkpoint/main_from_release_1.8.0_138154d5cd14c612036502bb2a7127fcdb2fe8c5 2023-05-08 17:57:50 +01:00
dustinface
67910197eb
wallet: Improve WalletCoinStore.get_coin_records (#15099)
Improve `WalletCoinStore.get_coin_records`
2023-05-03 00:31:52 -05:00
dustinface
138154d5cd
wallet: List the columns for INSERT into coin_record (#15159) 2023-05-01 14:09:28 -05:00
dustinface
96cacc8a24
wallet: Revert "Add new coin_type & metadata to coin_records (#15013)" (#15154)
Revert "Add new coin_type & metadata to coin_records (#15013)"

This reverts commit a998ea48d8.
2023-05-01 09:56:48 -05:00
Kronus91
a998ea48d8
Add new coin_type & metadata to coin_records (#15013)
* Add new coin_type & metadata to coin_records

* Remove unrelated changes

* Fix pre-commit

* Remove unrelated changes

* Fix pre-commit

* Add get_coin_records_between

* Fix field data type

* Resolve comments

* Fix unit test

* Remove unrelated changes

* Remove unrelated changes
2023-04-12 11:30:08 -06:00
dustinface
9b608f40f9
wallet: Drop WalletCoinStore.get_multiple_coin_records (#14862) 2023-03-27 10:16:33 -05:00
dustinface
543f8c24eb
wallet: Return a dict in WalletCoinStore.get_coin_records (#14828) 2023-03-20 13:17:59 -05:00
dustinface
62ee1c8766
wallet: Don't just subscribe to all coin ids from the DB (#14813) 2023-03-15 17:52:56 -05:00
Kyle Altendorf
ff5ef6e073
remove leading newlines from indented code blocks (#14653)
* remove leading newlines from indented code blocks

* catch another one
2023-02-23 21:53:48 -06:00
dustinface
8412a9928a
isort: Remove all chia.wallet exceptions and sort the related files (#13977) 2022-11-22 15:33:43 -06:00
Jack Nelson
e8ff7ea9a4
Coin Selection CLI / RPC Expansion (#13325)
* add max coin amount everywhere

* add excluded amounts to bare minimum

offers really does not need it passed.

* add excluded coin ids

* finish rpc stuff

* finalize commands

add coins command group & expand various coin selection methods

* fix argument processing & clean up code

* fix grammer

* small miss

* Update wallet_rpc_api.py

* fix test

* add combination command

* fix error

* move command group

* add new built in funcs for direct wallet coin searches.

* add get coin rpc

* add last command

* switch to pageable function

* fix args

* expand multi rpc call and tests

+ fix other things

* da lint

* add reverse coin sorting and ability to select coins

* Update wallet_state_manager.py

* fix types

* align with protocol

* fix asserts

* fix imports

* isort

* Update wallet_coin_store.py

* Update wallet_rpc_api.py
2022-10-24 14:03:53 -05:00
Amine Khaldi
08442bcffa
Merge commit 'a3fd118487ff572c1bc3983982a7c49339426d8c' into checkpoint/main_from_release_1.6.0_a3fd118487ff572c1bc3983982a7c49339426d8c 2022-09-09 22:59:03 +01:00
Arvid Norberg
a3fd118487
instead of fetching every unspent coin from the DB, just to count how many small unspent coins we have, ask the DB to count directly. It's a lot faster (#13361) 2022-09-07 17:10:14 -05:00
Amine Khaldi
0f4f2dda57
Merge commit '8bc1cc41a5f532765c09c975c515d649ee89ac0e' into checkpoint/main_from_release_1.6.0_8bc1cc41a5f532765c09c975c515d649ee89ac0e 2022-09-02 18:28:57 +01:00
Dan Perry
8bc1cc41a5
Xch spam (#12878)
* Add mariano54s spam filter changes (original PR is #11894)

* Add new spam_filter tests

* remove get_all_coins method and query db directly in test

* Add test to include case where everything gets filtered, even the first coin

* If filter threshold is <= 1, no need to run the filter

* add test of chia.wallet.wallet_coin_store.get_all_unspent_coins

* Add test case for receiving large coin after sending dust coin

* Add NFT test to spam wallet

* resolve merge conflicts with main

* remove unneeded coin store test

* Add black formatting

* split long comments into multiple lines

* Run black, second try

* Manually add black changes

* Black

Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
2022-08-30 17:44:27 -05:00
Arvid Norberg
7617bfdfba
When adding coins to the wallet, lookup the coin records in bulk, rather than one at a time (#13142) 2022-08-25 02:04:18 -05:00
Arvid Norberg
97390eef67
revert change to change OR REPLACE -> OR FAIL in wallet_coin_store. There's not enough test coverage to make this change with confidence, and it's not necessary (#12924) 2022-08-16 03:33:13 -05:00
Arvid Norberg
21e563eb4f
optimize get_coins_to_check() by returning the coin_names directly, rather than allocating full WalletCoinRecords and then compute the names (#12741) 2022-08-02 12:28:08 -05:00
Kyle Altendorf
52e0d430c7
update WalletCoinStore.set_spent() to use DBWrapper2.writer_maybe_transaction() (#12440) 2022-07-16 19:07:25 -05:00
Arvid Norberg
1fddb7aef1
add new_transaction() to DBWrapper2 which creates a nested transaction, and make write_db() just add writes to the existing transaction (#12275) 2022-07-15 21:07:43 -05:00
Arvid Norberg
acc8b7c98d
Optimize wallet set_spent() (#12391)
* optimize WalletCoinStore.set_spent() to just update the required fields in the DB

* overwriting an existing record with WalletCoinStore.add_coin_record() is an error
2022-07-15 17:16:59 -05:00
Arvid Norberg
a7ea13c3cd
remove unused _clear_database() functions (#12334) 2022-07-13 11:45:36 -05:00
Arvid Norberg
8ec56d1901
Wallet dbwrapper 2 (#12234)
* change DBWrapper -> DBWrapper2 in wallet. rip out all transaction tracking threaded through the wallet (because DBWrapper2 uses nested transactions)

* fix logging

* fix pending_changed callback in wallet_node
2022-07-12 19:09:05 -05:00
Arvid Norberg
4a69bc1613
Wallet coin store cache (#12130)
* remove wallet coin store 'cache', where all coins are kept in RAM. Rely on the sqlite DB

* some DB optimizations to WalletCoinStore
2022-06-29 16:50:29 -05:00
Arvid Norberg
2d812c5002
resurrect WalletCoinStore unittest (#12116) 2022-06-29 04:34:14 -05:00
Arvid Norberg
45f2a364e5
remove unused WalletCoinStore.get_unspent_coins_at_height (#12052)
* fix logic error in WalletCoinStore.get_unspent_coins_at_height

* remove unused (and incorrect) get_unspent_coins_at_height function from WalletCoinStore
2022-06-28 11:50:03 -05:00
Mariano Sorgente
a9fa0b0541
Add more optimizations (#11886)
* Add more optimizations

* Fix test and lint

* More lint

* Add a cache for additions
2022-06-13 11:40:58 -05:00
Arvid Norberg
5ae87189c4
Rust coin (#11807)
* use rust implementation of Coin class, from chia_rs

* bump chia_rs dependency
2022-06-13 07:21:04 -05:00
Arvid Norberg
d20cf06f59
fix typo and index issues in wallet database (#10273)
* fix typo in wallet_puzzle_store

* check some SQL statements

* deduplicate name SQL index

* deduplicate wallet_type index

* deduplicate wallet_id index
2022-03-25 09:28:06 -07:00
Yostra
89f15f591c
Merge standalone wallet into main (#9793)
* wallet changes from pac

* cat changes

* pool tests

* pooling tests passing

* offers

* lint

* mempool_mode

* black

* linting

* workflow files

* flake8

* more cleanup

* renamed

* remove obsolete test, don't cast announcement

* memos are not only bytes32

* trade renames

* fix rpcs, block_record

* wallet rpc, recompile settlement clvm

* key derivation

* clvm tests

* lgtm issues and wallet peers

* stash

* rename

* mypy linting

* flake8

* bad initializer

* flaky tests

* Make CAT wallets only create on verified hints (#9651)

* fix clvm tests

* return to log lvl warn

* check puzzle unhardened

* public key, not bytes. api caching change

* precommit changes

* remove unused import

* mypy ci file, tests

* ensure balance before creating a tx

* Remove CAT logic from full node test (#9741)

* Add confirmations and sleeps for wallet (#9742)

* use pool executor

* rever merge mistakes/cleanup

* Fix trade test flakiness (#9751)

* remove precommit

* older version of black

* lint only in super linter

* Make announcements in RPC be objects instead of bytes (#9752)

* Make announcements in RPC be objects instead of bytes

* Lint

* misc hint'ish cleanup (#9753)

* misc hint'ish cleanup

* unremove some ci bits

* Use main cached_bls.py

* Fix bad merge in main_pac (#9774)

* Fix bad merge at 71da0487b9

* Remove unused ignores

* more unused ignores

* Fix bad merge at 3b143e7050

* One more byte32.from_hexstr

* Remove obsolete test

* remove commented out

* remove duplicate payment object

* remove long sync

* remove unused test, noise

* memos type

* bytes32

* make it clear it's a single state at a time

* copy over asset ids from pacr

* file endl linter

* Update chia/server/ws_connection.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: Matt Hauff <quexington@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-01-13 12:08:32 -08:00
Arvid Norberg
e4b9db08cd
execute the sqlite pragmas only once, at the lever where the database is opened. Also, say FULL instead of 2, to make it clearer what the pragma is doing (#5993) 2021-09-15 10:57:13 -07:00
Adam Kelly
89f7a4b3d6
Pools mainnet (#7047)
* added clarifying comments

* WIP test

* added WIP test

* Refine genesis challenge. Remove unnecessary pool_puzzle function

* Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend

* Rename create_member_spend to create_travel_spend

* Add singleton id logging

* Enhance logging for debugging

* renaming

* rephrase inside the puzzle

* fixed signing and added some support functions

* Fix issue with announcement

* Progress spending the singleton

* Fix arguments to pool_state_to_inner_puzzle call

* Fix arguments to pool_state_to_inner_puzzle

* Improve error message when wallet is not running

* Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier

* Fix parent coin info bug

* Multiple state transitions in one block

* Lint

* Remove assert

* Fix incorrect p2_singleton_ph calculation (thanks nil00)

* Update waiting room puzzle to accept genesis_challenge

* Update calls to create_waiting

* Go to waiting state from committed state

* Augment debug_spend_bundle

* fix 2 bugs in wallet

* Fix lint

* fix bad_agg_sig bug

* Tests and lint

* remove breakpoint

* fix clvm tests for new hexs and hashs

* Fixed a bug in the coin store that was probably from merging. (#6577)

* Fixed a bug in the coin store that was probably from merging.

* The exception doesn't need to be there

* CI Lint fix

* Added lifecycle tests for pooling drivers (#6610)

* Ms.poolabsorb (#6615)

* Support for absorbing rewards in pools (untested)

* Style improvements

* More work on absorb

* Revert default root and remove log

* Revert small plots

* Use real sub slot iters

* Update types

* debug1

* Fix bugs

* fix output of agg sig log messages

* Make fewer calls to pw_status in test

* remove old comment

* logging and state management

* logging

* small bug fix & rename for accuracy

* format

* Fix types for uncurry function

* lint

* Update test to use exceptions

* Change assumptions about self-pooling in lifecycle test

* Install types for mypy

* Revert "Install types for mypy"

This reverts commit a82dcb712a.

* install types for mypy

* install types for mypy

* More keys

* Remove flags requiring interactive prompts

* Change initial spend to waiting room if self-pooling

* lint

* lint

* linting

* Refactor test

* Use correct value in log message

* update p2_singleton_or_delated_puzhash

* initial version of pool wallet with p2_singleton_or_delay

* run black formatting

* fix rebase wonkiness

* fix announcement code in p2_singleton_or_delayed

* removed redundant defaulting
standardised hexstr handling

* lint fixes

* Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures

* Signatures validate on this test now although the test still does not check it.

* Lint fix

* Fixed plotnft show and linting errors

* fixed failing farmer/harvester rpc test

* lint fix

* Commenting out some outdated tests

* Updated test coverage

* lint fix

* Some minor P2singleton improvements (#6325)

* Improve some debugging tools.

* Tidy pool clvm.

* Use `SINGLETON_STRUCT`. Remove unused `and` macro.

* Use better name `SINGLETON_MOD_HASH`.

* Finish lifecycle test suite.

* Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72)

Co-authored-by: Matt Hauff <quexington@gmail.com>

* Default delay time was being set incorrectly

* Extracted get_delayed_puz_info_from_launcher_spend to driver code

* Ms.taproot plot2 (#6692)

* Start work on adding taproot to new plots

* Fix issue in block_tools

* new test-cache

* Lint

* DID fixexs

* Fix other tests

* Python black

* Fix full node store test

* Ensure block index <= 128 bits.

* fix test_pool_config test

* fix comments in pool_config and in chialisp files

* self_pool -> pool -> self_pool

* Implement leaving pools

* Fix conflicts with main via mini-rebase

* Fixup rebase mistakes

* Bring in Mariano's node discovery chagnes from pools.dev

* Fix adapters - Thanks Richard

* build tests

* Add pools tests

* Disable DID tests

* farmer|protocol: Some renaming related to the pool protocol

* farmer: Use `None` instead of `{}` and add local `pool_state`

* protocol|farmer: Introduce and use `PoolErrorCode`

* rename: `pool_payout_instructions` -> `payout_instructions`

* refactor: `AuthenticationKeyInfo` -> `authentication_key`

* refactor: Move `launcher_id` up

* rename: Some variable name changes

* rename: `points_balance` -> `points`

* format: Squash aggregation into one line

* farmer: Make `update_pool_state` public

* farmer: Print traceback if `update_pool_state` fails

* farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info`

* farmer: Add `authentication_token_timeout` to `pool_state`

Fetch it from `GET /pool_info`

* protocol|farmer: Implement support for `GET|POST|PUT /farmer`

* farmer: Make use of `GET|POST /farmer`

- To make the farmer known by the pool
- To update local balance/difficulty from the pool periodically

* farmer|protocol: Adjust `POST /partial` to match the latest spec

* farmer: Hash messages before signing

* pools: Drop unused code

* farmer: Fix aggregation of partial signatures

* farmer: support self pooling, don't pool if url==""

* wallet: return uint64 for delay time, instead of bytes

* pool: add error code for delay time too short

* farmer: cleaner logging when no connection to pool

* farmer: add harvester node id to pool protocol

* Rename method (test fix) and lint fix

* Change errors to warnings (pool communication)

* Remove pool callbacks on a reorg

* farmer: Continue earlier when no pool URL is provided

* farmer: Print method in log

* farmer: Handle exceptions for all pool endpoint calls

* farmer|protocol: Keep track of failed requests to the pool

* farmer: Fix typo which caused issue with pooling

* wallet: simplify solution_to_extra_data

* tests: Comment out DID tests which are not working yet

* Remove DID Wallet test workflows

* Return launcher_id when creating Pool Wallet

* Name p2_singleton_puzzle_hash correctly

* Improve 'test_singleton_lifecycle_fast.py'.

* Make test more robust in the face of asynchronous adversity

* Add commandline cmds for joining and leaving pools

* Fix poolnft leave params

* Remove redundant assignment brought in from main

* Remove unneeded code

* Style and parsimony

* pool_puzzles: Check was wrong, and bad naming

* format: Fix linting

* format: Remove log and rename variable

* pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash

* gui: Use pools branch

* format: fix lint

* Remove ununsed code, improve initial_pool_state_from_dict

* farmer: Instantly update the config, when config file changes

* format: Speed up loading of the authentication key

* logging: less annoying logging

* Test pool NFT creation directly to pool

* Test switching pools without self-farming in between

* lint

* pooling: Use integer for protocol version (#6797)

* pooling: Use integer for protocol version

* pooling: Fix import

* Update GUI commit

* Ms.login2 (#6804)

* pooling: Login WIP

* pooling: add RPC for get_link

* dont use timeout

* pooling: rename to get_login_link

* format: remove logging

* Fix SES test

* Required cli argument

Co-authored-by: almog <almogdepaz@gmail.com>

* farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807)

* Fix to farm summary

* Use target_puzzlehash param name in RPC call

* Pool test coverage (#6782)

* Improvement in test coverage and typing

* Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733)

* Added new drivers for the p2_singleton puzzles

* Added new tests and test coverage for singletons

* organize pools testing directory

* black formatting

* black formatting in venv

* lint fix

* Update CI tests

* Fixing tests post rebase

* lint fix

* Minor readability fix

Co-authored-by: matt <matt@chia.net>

* farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816)

* Allow creation of PlotNFTs in self-farming state

* gui: Fix install with more RAM (#6821)

* Allow implicit payout_address in self-pool state, improve error messages and param ergonomics

* print units in non-standard wallets correctly

* Fix farmer import

* Make syncing message in CLI more intuitive like the GUI

* Fix linting and show header hash instead of height

* gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c

* Revert "Merge"

This reverts commit 23a1e688c5, reversing
changes made to a850246c6f.

* Revert "Revert "Merge""

This reverts commit 680331859f.

* Treat tx_record as Dict. Refactor tx submission

* Also add passed-in coin spends when processing new blocks in reconsider_peak

* Test utilities had moved

* Fix import of moved block_tools

* Potentially fix yaml

* Previously didn't take the right part of this change

* Add -y flag, improve commandline plotnft handling

* Fix typo

* Add -y flag to plotnft create

* pool_wallet: Restore from DB properly

* wallet: ignore bad pool configs

* Reduce memory

* pool_wallet: Add claim command

* pool_wallet: Set transaction records to confirmed

* wallet: Fix bug in transaction cache

* Formatting and remove log

* pool_wallet: CLI balance and improvements to plotnft_funcs.py

* pool_wallet: Simplify, and fix issue with double submission

* pool_wallet: Fix tests

* pool_wallet: Don't allow switching before relative lock height

* update gui

* change to 3000 mem

* Correct sense of -y flag for self-pooling

* cli: Display payout instructions for pool

* pool_wallet: Don't create massive transactions

* cli: Improvements to plotnft

* pool_wallet: Get correct pool state

* pool_wallet: Use last transaction block to prevent condition failure

* Add block height for current state

* Add outstanding unconfirmed transactions to pw_status

* Refine command line plotnft show pending transactions

* Fix tests by using the correct output from pw_status

* Try to fix windows build

* Print expected leave height

* label pool urls

* pool_wallet: Don't include pool 1.75 rewards in total

* wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet

* pool_wallet: If farming to a pool, show 0 balance in wallet

* pool_wallet: Show error message if invalid state, in CLI

* pool_wallet: Don't allow switching if there are pending unconfirmed transactions

* tests: Clean up pool test logging

* tests: Fix lint

* Changed the pool innerpuzzes (#6802)

* overload solutions for pool_innerpuz parameters

* Fix tests for reduced size puzzles

* deleted messy deprecated test

* Fix lint.

* fix bug where spend types were the wrong way around

* merge with richard's lint fix

* fix wallet bug
remove unnecessary signature
add defun-inline for clarity

* Swap to defun for absorb case
Use cons box for member innerpuz solution

* fix if statement for cons box p1

* remove unnecessary solution arg

* quick innerpuz fix to make tests pass

* Switch to key-value pairs
Undo cons box solution in pool_member inner puzzle

* fix singleton lifecycle test

* added some comments to calrify the meaning on "ps"

* lint fix

* reduce label size, search for label when reconstructing from solution

* no need to keep looping if `p` found

* lint fix

* Removed unecessary defun-inline and changed hyphens to underscores

* Changed created_coin_value_or_0 to an inline function

* Changed morph_condition to an inline function

* Added a comment for odd_cons_m113

* Rename output_odd and odd_output_found

* Add inline functions to document the lineage proof values

* Stager two rewrite

* Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed

* Extract truth functionality to singleton_truths.clib

* Fix tree hashes

* Changed truths to a struct rather than a list.

* fix test_singletons
update did_innerpuz

* recompile did_innerpuz

* fix a log error

* Renamed variable and factored out code per @richardkiss

* lint fix

* switch launcher extra_data to key_value pairs

* fix parsing of new format of extra_data in launcher solution

* fix broken test for new launcher solution format

* remove bare raise

Co-authored-by: Richard Kiss <him@richardkiss.com>
Co-authored-by: Matt Hauff <quexington@gmail.com>

* Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898)

Co-authored-by: Adam Kelly <aqk>

* Moved debug_spend_bundle and added it to the SpendBundle object (#6840)

* Moved debug_spend_bundle and added it to the SpendBundle object

* Remove problematic typing

* Add testnet config

* wallet: Memory would get corrupted if there was an error (#6902)

* wallet: Memory would get corrupted if there was an error

* wallet: Use block_record

* wallet: Add records in a full fork too

* wallet: remove unnecessary arguments in CC and DID

* add to cache, revert if transaction fails

Co-authored-by: Yostra <straya@chia.net>

* Improve comment

* pool_wallet: Fix driver bug

* wallet: Fix memory corruption

* gui: Update to latest

* Increase memory size

* tests: Add test for absorbing from pool

* small fix in solution_to_extra_data

* Fixed incorrect function name

* pooling: Fix EOS handling in full node

* [pools.testnet9]add post /partial and /farmer header (#6957)

* Update farmer.py

add post header

* Update farmer_api.py

add post header

* Update chia/farmer/farmer.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* Update chia/farmer/farmer_api.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* Fix lint and cleanup farmer.py

* farmer: Fix linting issues (#7010)

* Handle the case of incorrectly formatted PoolState data returned from inner singleton

* wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008)

* Fix lint in pool_puzzles

* pooling: Fix owner private key lookup, and remove unnecessary argument

* pooling: Clear target state on `delete_unconfirmed_transactions`

* Lint

* Fix non-deterministic test

* Slight cleanup clvm driver code (#7028)

* Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data

* lint

Co-authored-by: Adam Kelly <aqk>

* Revert "Add testnet config"

This reverts commit 9812442724.

Co-authored-by: matt <matt@chia.net>
Co-authored-by: Adam Kelly <aqk@aqk.im>
Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
Co-authored-by: Matt Hauff <quexington@gmail.com>
Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com>
Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local>
Co-authored-by: Adam Kelly <aqk>
Co-authored-by: Richard Kiss <him@richardkiss.com>
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
Co-authored-by: almog <almogdepaz@gmail.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: arvidn <arvid@libtorrent.org>
Co-authored-by: willi123yao <willi123yao@gmail.com>
Co-authored-by: arty <art.yerkes@gmail.com>
Co-authored-by: William Blanke <wjb98672@gmail.com>
Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com>
Co-authored-by: Chris Marslender <chrismarslender@gmail.com>
Co-authored-by: Yostra <straya@chia.net>
Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-29 14:21:25 -07:00
Mariano Sorgente
431f15bf1a
Do not assert not spent (#5612) 2021-05-20 10:46:02 -07:00
Yostra
108647112c
Wallet (#4887)
* spent height

* handle generator reorg

* tx cache

* coin cache

* rebuild cache if write fails

* save last few messages new_peak while syncing

* don't use dupe func

* tx reorg test

* lock not needed

* lint

* lock

* modify properly

* this shouldn't hit a disk ever

* use same number

* notify wallet only once, lock when getting a balance

* lock only if unspent coin records is None

* assert spent

* lint

* Add test for prev generator

Co-authored-by: Mariano <sorgente711@gmail.com>
2021-05-19 12:06:48 -07:00
Nikolaj Kuntner
cbc9141689
add all none's (#4503)
Co-authored-by: Nikolaj Kuntner <>
2021-05-10 22:05:45 -07:00
Richard Kiss
b084813b12
Improve streamable (#3031)
* Avoid importing `test_constants` as it takes a long time.

* Factor out `parse_*` functions.

* First crack at refactoring `Streamable.parse`.

* Don't add `_parse_functions` attribute to `Streamable`.

This no longer requires an extra `_parse_functions` attribute on a
`Streamable`, as it may be confusing serializers or other functions
that use `__annotations__`.

* Fix lint problems with `black`.

* Fix `parse_tuple`.

* Defer some parsing failures to parse time rather than class-creation time.

* Tidy up & remove some obsolete stuff.

* Decorate `RequestBlocks` as `streamable`.

* Fix wrong uses of Streamable class

Revert an earlier commit and error out on class creation in case a
Streamable subclass is instantiated incorrectly, e.g. containing a
non-serializable member.

Fix cases where Streamable parent class was forgotten.

* Fix wrong types when creating DerivationRecord and WalletCoinRecord

* additional unit tests for streamable parsers

* add type annotations (#3222)

Co-authored-by: Rostislav <rostislav@users.noreply.github.com>
Co-authored-by: arvidn <arvid@libtorrent.org>
2021-04-30 10:22:11 -07:00
Yostra
f740056fb2
remove commit and not needed query (#3148) 2021-04-30 00:22:18 -04:00
Yostra
773adfade5
Lock for all writes (#1758)
* lock for all writes

* use async  with where convinant

* wrapper

* more

* lint

* update wallet

* rl wallet

* indentation

* fix tests

* bad path merged into main

* wallet lock

* refacoted by mistake

* re-raise

* memory/disk inconsistency

* more inconsitency

* asyncio.cancelled is baseexception in 3.8 and 3.9
2021-04-10 19:07:02 -07:00
Yostra
43c02e513a use wal and full sync mode 2021-04-06 18:22:01 -07:00
Richard Kiss
f2b577dda1 git mv src chia 2021-04-04 21:41:39 -07:00