feat: Add proxy list, proxy reject, and proxy remove --all#833
feat: Add proxy list, proxy reject, and proxy remove --all#833MkDev11 wants to merge 2 commits intoopentensor:stagingfrom
Conversation
26c1aad to
3e45257
Compare
|
@thewhaleking could you please review the PR and let me know your feedback? |
2b62ff5 to
adf8647
Compare
thewhaleking
left a comment
There was a problem hiding this comment.
I think overall this is fine, but I need some time to do some deeper review/testing, as it's a large PR. I'll make it a point to do this next week.
603b8f2 to
348a330
Compare
thanks for your feedback 👍 |
348a330 to
45e79f2
Compare
38894bb to
ca00a67
Compare
|
CI test errors are gone. please review the changes when you are available. thanks. |
17258de to
5570fc3
Compare
- _parse_proxy_storage + list_proxies: query Proxy.Proxies, display table or JSON - reject_announcement: submit Proxy.reject_announcement with DB integration - CLI: register proxy list and proxy reject commands - Adapt proxy_remove to upstream all_ parameter - Tests: 7 parse_proxy, list/reject function, CLI handler - E2E: test_proxy_list
5570fc3 to
d21c21a
Compare
|
CI error is a flaky issue not related to my PR. |
|
hi @thewhaleking sorry to bother you, can you review the PR and let me know the result? |
Hi, not sure it makes sense to add this right now. Code seems fine. Just still developing the architecture for btcli 10.0 |
|
Thanks for the reply. Totally get that 10.0 is still taking shape. |
Description
Closes #742
Adds the missing proxy commands and flag from issue #742.
New commands:
btcli proxy list— Lists proxies for an account by querying chain storageProxy.Proxies. Optional--address(defaults to selected wallet). Supports--json-output.btcli proxy reject— Rejects a previously announced proxy call viaProxy.reject_announcement. Optional--delegate(defaults to wallet coldkey). Resolves--call-hashfrom the ProxyAnnouncements table when available and marks the announcement as executed on success (same flow asbtcli proxy execute).Modified command:
btcli proxy remove— Added--allflag to remove every proxy for the account in one call (Proxy.remove_proxies).--alland--delegateare mutually exclusive; one is required.Changes
bittensor_cli/src/commands/proxy.py: Added_parse_proxy_storage,list_proxies,reject_announcement,remove_all_proxies; handles nested substrate response formats usingdecode_account_id.bittensor_cli/cli.py: Registeredproxy listandproxy reject; extendedproxy_removewith--allflag (mutually exclusive with--delegate);proxy_rejectintegrates with ProxyAnnouncements (resolve call_hash, mark_as_executed on success).tests/unit_tests/test_cli.py: 7 tests for_parse_proxy_storage(None, non-sequence, dict format, dict proxy_type, tuple unwrap, empty list, malformed entries, delegatee key); tests forlist_proxies(success, JSON, empty, error); tests forremove_all_proxies(success, prompt declined, unlock failure); tests forreject_announcement(success, JSON, prompt declined, failure); CLI handler tests forproxy_remove(mutual exclusivity, require delegate or all, --all vs --delegate),proxy_list(with/without address),proxy_reject.tests/e2e_tests/test_proxy.py: E2E testtest_proxy_list(add proxy, list, verify delegate in output, cleanup).Testing
pytest tests/unit_tests/test_cli.py— 55 passed.ruff check bittensor_cli/src/commands/proxy.py bittensor_cli/cli.py tests/unit_tests/test_cli.py tests/e2e_tests/test_proxy.py— all checks passed.pytest tests/e2e_tests/test_proxy.py -v -k "test_proxy_list".Checklist
staging(or target staging when opening the PR).