Commit Graph

635 Commits

Author SHA1 Message Date
Matt Hauff
201f4e459d
Fix vcs get command when no proofs exist yet (#15432) 2023-06-02 17:54:31 -05:00
Jeff
73c6d303e0
Update --fee options to indicate units are in XCH (#15327) 2023-05-19 19:14:44 -05:00
Peter Tripp
c8c04f6717
Improve help text for deprecated 'chia show' commands. (#15297) 2023-05-16 12:30:25 -05:00
Matt Hauff
c1c4f99f6c
Introduce Verifiable Credentials Primitive (#15059)
* First crack at VC puzzles

* Add p2_puzzle_or_hidden_puzzle

* First crack at drivers

* Basic test infra

* compile clsp and test covenant layer

* lint

* Add test for match_covenant_layer

* Add tests for DID TP

* Add tests for DID backdoor

* Add tests for p2_puzzle_or_hidden_puzzle

* Change DID backdoor -> p2_puzzle_w_auth + did_puzzle_authorizer

* Add a VerifiedCredential class

* Make p2_puz_or_hidden_puz viral

* Add morpher solution to covenant layer

* Add capability to update the proofs of a VC

* update_proofs -> do_spend

* Finish lifecycle of VC

* Make backdoor puzzle, remove p2_puzzle_w_auth from stack

* Extract p2_puzzle_w_auth to its own files

* lint

* rework launch process so it works after revocation

* Add some extra tests for the final state after revocation

* Add cost logging

* slight opimizations

* python comments and ergonomic improvements

* Comments for chialisp

* Add VC wallet and store infra

* Add a negative test for updating proofs w/o DID

* First crack at CR CAT

* Turn two hashes into one

* Extract some shatrees out of puzzle hash creation

* Add a stager function

* Precalculate initial_singleton_inner_puzhash_hash

* Add another stager

* Refine stagers

* Add cost logging and assert provider is authorized

* Add sketched out CRCAT class

* black

* Test most of CRCAT drivers

* lint

* Remove an unnecessary param

* Don't commit to singleton ID in parent morpher

* Extract DID to ownership layer

* lint

* use intitial puzzle hash for covenant as proof to morpher

* Collapse hash of parent morhper

* Remove stagers

* Rename some params

* Use SELF_HASH construct

* remove dependency on shatree

* Minor optimization of curried hashes

* Balance tree

* hint -> remark

* Make a v2 ownership layer for cost-sake

* (WIP) Migrate to tp hash at ownership layer

* (WIP) Return tp_hash from tp

* use a stager again

* use constants for ints

* use more constants

* inline a function, get rid of constant

* Switch to tree metadata on ownership layer

* Impelement wallet launch vc

* Minor fixes and rename a bunch of stuff

* lint

* Fix tests

* First crack at proof checking

* Remove unused imports

* Merge tests to get better coverageg

* Fix is_vc methods

* pre-commit

* pre-commit again

* Implement VC spend

* make sql pre-commit check work with git worktrees

* CRCATWallet

* Comment reasoning in script file

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

* Add a concept of VCProofs

* Show proofs in vc_get_vc_list as well

* Implememnt CRCAT wallet

* Extend lineage store

* Make tests pass

* WalletIdentifier fix

* Add revocation RPC

* forgotten bytes32

* Return coin name with vc record

* First crack at adding VC authorizations to offers

* Add CROuterPuzzle

* Fix wallet_funcs.py

* VCWallet changes only

* Fix wallet db schema test

* Add RPC client methods and tests

* Allow a path for user to clear VC

* Mint VC command

* Get VCs command

* Forgotten hex compilation

* Automatically fetch DID when we have it

* Update Proofs command

* Add Proof Reveal command

* Get Proofs For Root command

* Revoke VC command

* Chialisp pre-commit cleanup

* Deprecate as_python()

* Add a limit to some sql queries

* Fix some bad imports

* Fix changed wallet sync function

* Check for tail condition amounts in CAT spending

* Add RPC docs

* only need one mojo for a singleton

* Fix comment

* remove create_puzhash from add_new_wallet

* Remove create_tandam_xch_tx

* fix wallet_state_manager hinting

* Rename RPCs

* Use streamable classes for RPC request parsing

* add back accidentally deleted method call

* Remove unnecessary copy() call

* Add negative test for using wrong DID to update proofs/revoke vc

* Add negative test for making sure invalid proofs can't be proven

* Add negative test for trying to piggyback on top an unrelated VC spend

* Make output_amount a uint64

* some chialisp bug fixes

* chialisp readability improvements

* Force same provider on provider update of DID

* typo in EML

* Add vc_wallet folders to package list

* mypy

* Increase test coverage a bit

* Add a bit more coverage

* rework wallet creation

* Delete is_addition_relevant

* Coveralls ignores

* remove brick reference

* coveralls-ignore --> pragma: no cover

* Couple more ignores

* typo corrections

---------

Co-authored-by: ytx1991 <t.yu@chia.net>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-05-11 19:09:05 -05:00
Joseph Chiocchi
50c1ea9679
Fix #13393 offer shows network's XCH like TXCH on testnet10 (#15224)
* a naive first-pass at resolving #13393

- attempts to use `AddressType` with `config` already being loaded
- assumptions made of internal structures being built where the asset type and lookups with literal `XCH`|`xch` can be swapped out 
- value of `txch`|`xch` is set to `network_xch` calling `AddressType.XCH.hrp(config)` 1x

* fix roughing-in typos

* remove most assumptions except literal in format str

* whoops - using the wrong lookup enum

* revert literal "xch"

* trying a signature change of `print_offer_summary`

* fmt: blacken
2023-05-10 19:19:26 -05:00
Joseph Chiocchi
0b07370e81
Fix chia wallet make_offer short-option collision on -r (#15182)
a potential solution to #14874

with feedback from #15182
- drop short option, `-r`, everywhere where `--reuse` is an option to `chia wallet` commands
2023-05-04 21:19:08 -05:00
Kronus91
b0f65a1539
Fix typo and duplicate options (#15177) 2023-05-04 13:17:00 -05:00
Kyle Altendorf
1228892c43
force \n/lf line endings in pre-commit (#15036)
* force \n/lf line endings in pre-commit

* more

* set -o pipefail

* Revert "set -o pipefail"

This reverts commit b359ec806b.
2023-05-03 00:29:31 -05:00
Kyle Altendorf
7f7bce8677
help= not short_help= (#15076)
* help= not short_help=

* oops

* more

* more
2023-05-03 00:29:13 -05:00
Kyle Altendorf
2e9647e32a
extract wallet specific behavior from get any service client (#15086)
* extract wallet behavior from get_any_service_client()

* another

* style
2023-04-24 12:50:40 -06:00
Kyle Altendorf
264941eddf
hint chia.rpc.full_node_rpc_client (#14705)
hint chia.rpc.rull_node_rpc_client
2023-04-24 12:45:57 -06:00
Kronus91
24019e35bb
Add DID CLI (#15065)
* Add DID CLI

* minor fixes

* build fix

* resolving comments

---------

Co-authored-by: Sebastjan Trepca <trepca@gmail.com>
2023-04-24 12:44:43 -06:00
Jack Nelson
872f939132
Add Chia Simulator tools directly Into Chia Blockchain (#15005)
* add simulator tool + tests into chia blockchain

add chia dev ...

* isort

* make sim chia root use normal chia root as a part of it

* fix starting path for tests

* cleanup start and stop + cli

* add extra env message

* fix cmds

* update test

* add existing_plots arg

* change to consume_errors

* fix tests

* cleanup cmds_util.py

* cleanup click

* clean up block_tools

dataclass + logic cleanup & tests

* isort block_tools.py
2023-04-19 19:48:21 -05:00
Matt Hauff
e5dfac4708
Check for directory existence before creating offer (#14990)
Check for dir existence before creating offer
2023-04-19 10:55:17 -05:00
Earle Lowe
433a414496
Add plugin_info and healthz endpoints to s3 plugin service, add chia data plugins check cli (#15028)
* Add plugin_id and healthz endpoints to s3 plugin service

* Add `chia data plugins check` cli

* plugin_id -> plugin_info

* updates based on reviews

* Use gather to run the lookups

* Update chia/data_layer/data_layer.py

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

* Fix typo

* short_help -> help

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-04-18 18:45:35 -05:00
Justin England
0022ce797d
Small improvements to trusted peer check to include IPv6 addresses and add tests (#14626)
Refactor function `is_trusted_peer` to a standalone easily testable
function. Leverage the existing `is_localhost` function to extend
coverage to IPv6 local address for the trusted peer check

Added tests for the new standalone function
2023-04-11 14:36:37 -06:00
Justin England
93ba5127ba
hint chia.cmds.passphrase, passphrase_funcs (#14736)
<!-- Merging Requirements:
- Please give your PR a title that is release-note friendly
- In order to be merged, you must add the most appropriate category
Label (Added, Changed, Fixed) to your PR
-->
<!-- Explain why this is an improvement (Does this add missing
functionality, improve performance, or reduce complexity?) -->
### Purpose:



<!-- Does this PR introduce a breaking change? -->
### Current Behavior:



### New Behavior:



<!-- As we aim for complete code coverage, please include details
regarding unit, and regression tests -->
### Testing Notes:



<!-- Attach any visual examples, or supporting evidence (attach any
.gif/video/console output below) -->
2023-04-11 14:32:41 -06:00
Adam Kelly
2c25a79612
Update Wallet command line help for key fingerprints (#14982) 2023-04-05 15:09:54 -05:00
Kyle Altendorf
d9f7d01e3a
Merge branch 'main' into hint_chia_cmds_passphrase 2023-03-29 22:17:32 -04:00
Earle Lowe
b8e5aebf54
Fixed windows issues with passphrase prompt on CLI by flushing prompt (#14904)
flush prompt on windows
2023-03-25 00:26:03 -05:00
William Allen
090caf0f08
Added chia completion command (#14782)
* adding 'chia completion' command

* fixing lint

* Fixing isort

* Update chia/cmds/completion.py

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

* Update chia/cmds/completion.py

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

* Cleanup completions command

* formatting with black

* Update chia/cmds/completion.py

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

* Update chia/cmds/completion.py

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

* Update chia/cmds/completion.py

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

* Update chia/cmds/completion.py

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

* Update chia/cmds/completion.py

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

* fixup my mistakes

* just ["chia"]

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-03-16 12:50:30 -05:00
Kronus91
95d05b72c4
Stop sending change to a new address (#14422)
* Stop sending change to a new address

* Fix bug

* Add config & unit tests

* Resolve comments

* Refine based on the requirements

* Change config to str

* Disable addr reuse for unit test since the hardcode offer doesn't compatible with it

* Cover offer trade

* Add unit test and RPC support

* Add reuse option for cli

* Enhance unit test

* Fix unit test
2023-03-09 18:32:21 -06:00
Kyle Altendorf
d84917f5df
hint chia.plotting.create_plots (#14692)
* hint chia.plotting.create_plots

* correct the import

* fixup

* imports

* get final from typing_extensions
2023-03-08 12:57:50 -06:00
Kyle Altendorf
83fd8898ce
fixup the last few 2023-03-07 22:55:18 -05:00
Kyle Altendorf
109f446b27
Merge branch 'main' into hint_chia_cmds_passphrase 2023-03-07 22:39:50 -05:00
Kyle Altendorf
542522e39d
hint chia.cmds.plotnft, plotnft_funcs (#14737) 2023-03-06 11:42:29 -06:00
Kyle Altendorf
31c25d7e78
hint chia.cmds.keys, keys_funcs (#14735) 2023-03-06 11:37:49 -06:00
Kyle Altendorf
96638628ff
hint chia.cmds.farm_funcs (#14734) 2023-03-06 11:37:21 -06:00
Kyle Altendorf
3efadeb738
hint chia.cmds.passphrase, passphrase_funcs 2023-03-03 19:28:48 -05:00
Earle Lowe
3e13236eef
Merge remote-tracking branch 'origin/main' into EL.trusted_peer_fix 2023-03-02 13:07:23 -08:00
Zachary Brown
c8149c4b28
Refine help text for chia peer -a (#14563)
* update help text for chia peer -a

* further chia peer -a language refinement
2023-02-28 14:26:03 -06:00
Kyle Altendorf
381d1317de
hint chia.cmds.init, chia.cmds.init_funcs (#14682)
* hint chia.cmds.init, chia.cmds.init_funcs

* optional for now at least

* we will update mypy.ini later
2023-02-28 03:04:08 -06:00
Kyle Altendorf
4243603b3a
hint chia.cmds.db_upgrade_func (#14680)
* hint chia.cmds.db_upgrade_func

* we will update mypy.ini later
2023-02-28 03:03:47 -06:00
Kyle Altendorf
e0005ce6f9
hint chia.cmds.db (#14679)
* hint chia.cmds.db

* we will update mypy.ini later
2023-02-28 03:03:21 -06:00
Kyle Altendorf
73eb73bd4c
hint chia.cmds.configure (#14678)
* hint chia.cmds.configure

* we will update mypy.ini later
2023-02-28 03:02:53 -06:00
Kyle Altendorf
91a717b5f3
add hinting around get_any_service_client() (#14681) 2023-02-27 23:49:47 -06:00
Adam Kelly
94b60f153f
Improve chia wallet check help and diagnostic messages (#14688) 2023-02-27 16:51:34 -06: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
Kyle Altendorf
96dad39392
remove unneeded parentheses (#14654) 2023-02-23 10:42:44 -06:00
Kyle Altendorf
c678f00acb
cleanup adjacent string literals (#14650) 2023-02-22 17:16:07 -06:00
Kyle Altendorf
41ca9622a3
close the keychain proxy in more failure and cancellation cases (#14415) 2023-02-22 02:51:26 -06:00
Adam Kelly
db19671827
Check Wallet DB integrity (#14401)
* Check Wallet DB integrity

* Update command line help

* Improve duplicate DerivationPath index error message

* Move tests to chia/tests

* lint

* py init file

* Print WalletType names

* Don't complain about wallets not having derivation entries that don't need them

* Validate addresses used in order

* Update tests with new error output

* Fix check_addresses_used_contiguous in the case when the last address of the previous wallet was unused
2023-02-21 18:35:15 -06:00
Earle Lowe
7cb0344be8
remove unneeded function and use is_trusted_peer 2023-02-20 15:29:08 -08:00
Amine Khaldi
8fd9940d59
Ignore unused config value in the DataLayer CLI commands (#14584)
Ignore unused config value in the DataLayer CLI commands.
2023-02-16 14:02:44 -06:00
Zachary Brown
2e34cc5fe8
Improve the help text for the peer command (#14542) 2023-02-10 17:33:34 -06:00
Arvid Norberg
91923ef8fa
optimize offers (#14531)
cache addition coins in offers, rather than executing the clvm puzzles repeatedly
2023-02-10 15:14:23 -06:00
Jeff
440abe1438
Offer CLI command help now shows --fee units as XCH (#14529)
specify XCH for --fee option to offer commands
show included fees when making an offer with a fee > 0
2023-02-09 16:40:35 -06:00
Adam Kelly
3b932a2c5b
Output proper json (#14451) 2023-02-07 18:23:37 -06:00
Adam Kelly
83c864b2f0
Correct fee estimate calculation to be in mojos, not millimojos (#14474) 2023-02-04 14:09:39 -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