Commit Graph

2981 Commits

Author SHA1 Message Date
Amine Khaldi
ac0349f8dc
Simplify request_mempool_transactions() and get_items_not_in_filter() (#14404)
* Only deal with the relevant subset of the MempoolItem (which is SpendBundle here).

* get_items_not_in_filter() doesn't need to be async.

* Use len(items) instead of counter for the limit check.

* Update tests to reflect the improvements.
2023-02-15 22:47:07 -06:00
Adam Kelly
d69ecdda29
Test DID Wallet creation by blockchain singleton update (#14545) 2023-02-13 11:21:32 -06:00
Amine Khaldi
454b1cbc35
Simplify MINTING_COIN and RESERVE_FEE_CONDITION_FAILED unit tests (#14559)
* Simplify MINTING_COIN and RESERVE_FEE_CONDITION_FAILED unit tests now that they're validated in pre_validate_spendbundle.

* Add positive tests.
2023-02-13 11:03:22 -06:00
Arvid Norberg
07450b7dda
use run_block_generator() to run block generators (#14544)
use the new run_block_generator() function from chia_rs
2023-02-13 11:00:21 -06:00
Arvid Norberg
1b6201852a
bump chia_rs to 0.2.2 (#14533)
* bump chia_rs to latest version

* add new error codes for ASSERT_BEFORE_* condition failures, ASSERT_CONCURRENT_SPEND failing, ASSERT_CONCURRENT_PUZZLE_FAILED and for impossible constraints

* add new condition opcodes for ASSERT_BEFORE_*, ASSERT_CONCURRENT_SPEND and ASSERT_CONCURRENT_PUZZLE

* fixup Spend and SpendBundleCondition types

* fixup tests that otherwise fail with MINTING_COIN

* fix test that otherwise would fail with RESERVE_FEE_CONDITION_FAILED

* remove use of NO_NEG_DIV flag. It's now implied

* remove duplicate test parameters
2023-02-10 15:14:56 -06:00
Matt Hauff
59e389968e
Add cost logging to CLVM tests as fixture (#14444) 2023-02-10 15:13:45 -06:00
Kyle Altendorf
6e70868888
move wallet_is_synced/wallets_are_synced to FullNodeSimulator methods (#14403)
* move wallet_is_synced/wallets_are_synced to FullNodeSimulator methods

* black

* gotta catch 'em all
2023-02-10 15:13:23 -06:00
Amine Khaldi
5169f10e50
Merge commit '9cc25cc820accad778bf626500aedd299f62a825' into checkpoint/main_from_release_1.7.0_9cc25cc820accad778bf626500aedd299f62a825 2023-02-09 14:28:39 +01:00
Adam Kelly
d3ad991208
Ak.test nft mint from xch rpc (#14482)
* Mitigate flaky test

* Use already existing wallet_is_synced
2023-02-08 19:44:04 -06:00
Kyle Altendorf
f346de94ba
refactor test_pool_rpc (#14196)
* preliminary test_pool_rpc refactor

* remove todo

* handle some todos

* one more

* wait for wallets to sync in the fixtures

* drop an extra wallet

* drop unused function
2023-02-08 19:43:43 -06:00
Kronus91
67b42c9cc4
Fix get memo API (#14513) 2023-02-07 18:41:02 -06:00
Arvid Norberg
e397aa3abd
remove test aimed at the inital soft-fork to enable transactions (#14477)
remove test aimed at the inital soft-fork to enable transactions, way back in the beginning of time
2023-02-07 18:20:24 -06:00
Amine Khaldi
98d4436f95
Merge commit '9be3c7d00ae99105c40913aff1b07e97657609fb' into checkpoint/main_from_release_1.7.0_9be3c7d00ae99105c40913aff1b07e97657609fb 2023-02-07 21:33:21 +01:00
Amine Khaldi
4ec43caf20
Merge commit '83c864b2f099afcbf93845d9e720a523d11a3eaa' into checkpoint/main_from_release_1.7.0_83c864b2f099afcbf93845d9e720a523d11a3eaa 2023-02-07 17:13:18 +01:00
William Allen
bbf1e1e2d4
checkpoint: into main from release/1.7.0 @ d1a4c579f4 (#14502)
Source hash: d1a4c579f4
Remaining commits: 3
2023-02-07 05:58:38 -06:00
Amine Khaldi
16d76dda9b
Add unit tests for get_items_not_in_filter (#14416)
* Add unit tests for get_items_not_in_filter.

* Adapt the test cases for 0 and negative limits.
2023-02-07 04:31:46 -06:00
Matt Hauff
9cc25cc820
Quex.offer mod tests (#14478)
* add test

* do some forwards compat stuff

* Add a forwards compat example

* fix test

* Add more forwards compat tests

* Add more forwads compat tests

* Add forwards compatibility for nft1s

* add forward compatibility for nft offers

* Add forwards compatibility tests for DL offers

* Update DL test offers

* lint

* isort

* offer mod bytes

* Fix compression test

* isort again

* Add special offers for <=3.7 (CATs)

* Add special offers for <=3.7 (NFT1s)

* Add special offers for <=3.7 (NFT0s)

* Add special offers for <=3.7 (DLs)

* Check for conflicting items during aggregation

* isort

* Return created old offers properly marked
2023-02-06 22:04:39 -06:00
Amine Khaldi
88e2d79905
Merge commit 'd1a4c579f4dd2b058fcd46f2249a876a60b1dec5' into checkpoint/main_from_release_1.7.0_d1a4c579f4dd2b058fcd46f2249a876a60b1dec5 2023-02-06 21:36:02 +01:00
Adam Kelly
9be3c7d00a
Ensure fee estimates monotonically decrease with time (#14368)
* Ensure fee estimates monotonically decrease with time

* Improve function naming and document use

* type checking
2023-02-06 12:53:03 -06:00
Amine Khaldi
09a2c79898
Add unit tests for ephemeral time locks (#14433)
* Add unit tests for ephemeral time locks.

* Make the current block's height and timestamp values clearer in the test.

* Add some comments to explain some cases and opt for an explicit height and timestamp.

* Adapt the test coin timestamp so we can test the ephemeral one with the value we set.

* Document a subtle difference between ASSERT_SECONDS_RELATIVE 0 and ASSERT_HEIGHT_RELATIVE 0.
2023-02-06 03:28:16 -06:00
Arvid Norberg
cbbc8b43b8
make the tests use the real COST_PER_BYTE constant (#14470) 2023-02-04 14:14:52 -06:00
dustinface
3bd6069f04
server: Exclude some attributes from WSChiaConnection.__repr__ (#14466) 2023-02-04 14:14:27 -06:00
Arvid Norberg
2c0dd6b2c1
add unit test for mempool_check_time_locks (#14441) 2023-02-04 14:13:59 -06:00
Sebastjan Trepca
d8d8660dbc
RPC call to reset wallet sync data (#14365)
* Add resync API

* Resolve comments

* Fix precommit

* set_wallet_resync RPC call

* disable resync after reset

* Update chia/wallet/wallet_node.py

Co-authored-by: Jeff <paninaro@gmail.com>

* fixes

* fixes

* rename method

* more tests, schema test

* removed formatting changes in initial-config

* another test case

* another test case

* simplification

* rename fix

* hinting

* added notification id table

---------

Co-authored-by: ytx1991 <t.yu@chia.net>
Co-authored-by: Jeff <paninaro@gmail.com>
2023-02-04 14:12:41 -06:00
Adam Kelly
83c864b2f0
Correct fee estimate calculation to be in mojos, not millimojos (#14474) 2023-02-04 14:09:39 -06:00
Matt Hauff
97230ca3b0
Add a way to import a SpendSim and SimClient as a contextmanager (#14434) 2023-01-31 19:22:06 -06:00
Matt Hauff
d1a4c579f4
Check incoming notification hints (#14450)
* add self notification test

* add a check that hint belongs to us

* lint
2023-01-31 18:58:46 -06:00
Amine Khaldi
b546888614
Merge commit '655eaad639588819beeb8bcac1a2d1ab45acf812' into checkpoint/main_from_release_1.7.0_655eaad639588819beeb8bcac1a2d1ab45acf812 2023-01-31 12:52:52 +01:00
dustinface
c26902a6ec
wallet: Avoid duplicates in get_puzzle_hashes_to_subscribe (#14186)
* wallet: Avoid duplicates in `get_puzzle_hashes_to_subscribe`

We currently store the derived puzzle hashes in both, puzzle store and
interested store and here we combine them as list. There is some code to
mitigate duplicate subscriptions but its based on chunks here
39d733599d/chia/wallet/wallet_node.py (L662)
so if there are less than 1000 puzzle hashes it obviously still can lead
to redundant subscription calls?

* Add `test_unique_puzzle_hash_subscriptions`
2023-01-30 16:23:17 -06:00
William Allen
c1b33a0ddd
checkpoint: into main from release/1.7.0 @ 655f6c2292 (#14429)
Source hash: 655f6c2292
Remaining commits: 1
2023-01-30 16:08:18 -06:00
Arvid Norberg
e9c0fcba06
fix negative tests in test_pool_livecycle (#14425) 2023-01-30 10:55:33 -06:00
Amine Khaldi
3fe53a7acf
Merge commit '655f6c2292fe806a06d2607c5606a5a382861f92' into checkpoint/main_from_release_1.7.0_655f6c2292fe806a06d2607c5606a5a382861f92 2023-01-30 13:02:36 +01:00
Kronus91
655eaad639
Rename notification config (#14397)
* Rename notification config

* Change unit test

* Fix test

* Set minimum required notification amount

---------

Co-authored-by: Matt Hauff <quexington@gmail.com>
2023-01-27 17:20:34 -06:00
Arvid Norberg
68c9aafc0a
move SerializedProgram to its own file (#14391)
* move SerializedProgram into its own file (to fixup type annotations)

* fix type annotations for SerializedProgram

* fixup import statements for new SerializedProgram module
2023-01-27 17:20:23 -06:00
Matt Hauff
655f6c2292
Add a persitent id table to notification store (#14418)
* Add a persitent id table to notification store

* rename table

* Add a test

* lint
2023-01-27 17:20:01 -06:00
Kyle Altendorf
a063d0c224
remove args passed to super() calls (#14407) 2023-01-27 17:19:12 -06:00
Kronus91
c541d49afe
Get memo api (#14377)
* Add NFT bulk transfer API

* Fix pre-commit

* Improve unit test

* Fix precommit

* Improve unit test

* Fix response json serialization

* Fix bulk API missing transaction

* Remove print

* Add get_transaction_memo API

* Add unit test for XCH

* Cover received coins

* Revert test hack

* Remove irrelevant change

* Add parameter override

* Fix pre-commit
2023-01-27 17:16:30 -06:00
Adam Kelly
22dfc83d51
Reorganize reusable singleton wallet code (#14339) 2023-01-27 17:09:13 -06:00
Arvid Norberg
fda2163b6b
remove additions() and reserved_fee() from CoinSpend (#14394) 2023-01-26 11:16:14 -06:00
Matt Hauff
1d4700dceb
Add some extra checks for size and existence to notification backend (#14398)
* Add some extra checks for size and existence to notification backend

* mypy
2023-01-25 23:45:23 -06:00
Almog De Paz
3f97435159
dont announce none response capability to peers (#14386)
* dont announce none response capability to peers

* comment out none response handling

* skip test instead of comment out
2023-01-25 13:53:38 -06:00
Jeff
c107001334
Add SigningMode and update verify_signature RPC to work with sign_message_by_* RPCs (#14213)
* Updated `verify_signature` RPC to support signatures made by `sign_message_by_*` RPCs

* Updated RPC to use "signing_mode" param name with value "chip_0002"
Added CHIP_0002_SIGN_MESSAGE_PREFIX string constant

* Tests for verify_signature

* Update chia/wallet/wallet.py

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

* Adds SigningMode enum with CHIP-0002 and BLS message augmentation schemes
chia keys sign/verify support JSON output
chia keys verify now accepts the -b as_bytes option

* Fix a mypy warning

* Updated link to CHIP-0002

* isort

* Fix tests

* improve error handling

* comment how test data was generated

* Update chia/rpc/wallet_rpc_api.py

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

* Update chia/rpc/wallet_rpc_api.py

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

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-01-25 12:44:37 -06:00
Amine Khaldi
05f1d257b4
Add a unit test for sending a spend bundle twice with a different spends order (and a coin eligible for deduplication) (#14387)
Add a unit test for sending a spend bundle twice with a different spends order (and a coin eligible for deduplication).
2023-01-25 09:59:47 -06:00
Jack Nelson
99fbb056e1
Fix chia wallet coins cli bugs (#14388)
* fix fee bug

The fee should not be taken into account when dealing with CAT's or other non XCH coins.

* fix broken CAT removals

it was never implemented ...

* Update wallet_rpc_api.py
2023-01-24 19:33:25 -06:00
Amine Khaldi
69c7172152
Add a unit test for sending a spend bundle (with a coin eligible for deduplication) twice (#14374)
* Add a unit test for sending a spend bundle (with a coin eligible for deduplication) twice.

* Have spend_bundle_from_conditions take a coin that defaults to TEST_COIN.

* Improve the expected cost readability.

* Prepare get_coin_record_for_test_coins for reuse in future tests.
2023-01-24 12:04:09 -06:00
Adam Kelly
9f0220771f
Limit rate of log messages when farmer is disconnected from pool (#14344)
* Limit rate of spammy log messages when farmer is disconnected from pool

* Remove typo

* Use reliably increasing clock

* Make test faster, more reliable
2023-01-23 16:43:42 -06:00
Geoff Walmsley
b480aded31
Fix target puz hash index for bulk mint nfts with airdrop (#14370)
* fix indexing for target puzhashes in nft bulk minting

* make pylint happy
2023-01-21 13:00:31 -06:00
Kronus91
ad51c3c251
Fix bulk tx (#14372)
* Add NFT bulk transfer API

* Fix pre-commit

* Improve unit test

* Fix precommit

* Improve unit test

* Fix response json serialization

* Fix bulk API missing transaction

* Remove print
2023-01-20 12:02:17 -06:00
Adam Kelly
7bdf7dc478
Change names used to look up estimated spendbundle sizes in get_fee_estimate RPC (#14369)
* Change names used to look up estimated spendbundle sizes in get_fee_estimate RPC

* Update tests

* add test for get_spendbundle_type_cost

* add spend_count to get_fee_estimate

* Update chia/rpc/full_node_rpc_api.py

Co-authored-by: Jeff <jeff@chia.net>

Co-authored-by: Jeff <jeff@chia.net>
2023-01-20 11:59:08 -06:00
Matt Hauff
8e0cabad7e
Add the expected offer ID to some RPCs that take offer blobs (#14366)
* Add the exected offer ID to some RPCs that take offer blobs

* Add ID to client too

* black
2023-01-20 11:58:23 -06:00