Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: algokit task - wallet aliasing #313

Merged
merged 14 commits into from
Sep 27, 2023

Conversation

aorumbayev
Copy link
Collaborator

@aorumbayev aorumbayev commented Sep 25, 2023

Proposed Changes

  • Introduces wallet aliasing task
  • Supports add, list, remove, reset, get operations
  • Capping max number of aliases to have in keyring at a time to 50 (as discussed with @Loedn)

TODO

  • snapshot tests

Further notes

Refactoring deploy command to support aliases are to be addressed in a separate PR

@aorumbayev
Copy link
Collaborator Author

aorumbayev commented Sep 25, 2023

@neilcampbell @robdmoore @Loedn

Open questions

  • Windows cred manager has a limit on password length, i am storing kv pairs of alias : {account entity} along with a separate static kv pair where v is [str] of all aliases (otherwise i'd have to store alias keys elsewhere and things can get a bit awkward). Currently works fine but need to figure out what is max limit in chars in windows if its a large value > 1500 chars are we ok with putting a warning (specific to windows users) that they reached max amount of aliases to be stored and in as such they need to clean some aliases before creating new ones?

@github-actions
Copy link

github-actions bot commented Sep 25, 2023

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit
   __init__.py15753%6–13, 17–24, 32–34
   __main__.py220%1–3
src/algokit/cli
   completions.py105298%80, 95
   deploy.py56591%34–36, 78, 96
   doctor.py48394%142–144
   generate.py57198%116
   goal.py39197%57
   init.py1901692%268–269, 319, 322–324, 335, 379, 405, 445, 454–456, 459–464, 477
   localnet.py93397%162, 183–184
src/algokit/cli/tasks
   wallet.py87693%20, 35–36, 78, 148, 174
src/algokit/core
   bootstrap.py1612485%103–104, 126, 149, 214, 217, 223–237, 246–251
   conf.py54885%10, 24, 28, 36, 38, 71–73
   deploy.py691184%61–64, 73–75, 79, 84, 91–93
   doctor.py65789%67–69, 92–94, 134
   generate.py41295%68, 86
   goal.py56395%27–28, 38
   log_handlers.py68790%50–51, 63, 112–116, 125
   proc.py45198%98
   sandbox.py1811592%100–107, 118, 278, 294, 309–311, 327
   typed_client_generation.py80594%55–57, 70, 75
   version_prompt.py73889%27–28, 40, 59–62, 80, 109
src/algokit/core/tasks
   wallet.py71593%37, 129, 155–157
TOTAL182914292% 

Tests Skipped Failures Errors Time
267 0 💤 0 ❌ 0 🔥 17.180s ⏱️

@aorumbayev
Copy link
Collaborator Author

aorumbayev commented Sep 25, 2023

@neilcampbell @robdmoore @Loedn, update so apparently max password len on windows is 1280 chars which is roughly ~60 aliases assuming worst case when max alias len used is 20 chars. I think 60 aliases is pretty reasonable amount - are we ok with throwing a warning that max number of aliases to persist is exhausted or we want unlimited storage for aliases? Storing it in keyring might get a bit tricky in case we want to remove limits

--- Reply from @Loedn -> we will cap it at 50 aliases per user

@aorumbayev aorumbayev marked this pull request as ready for review September 26, 2023 13:07
docs/cli/index.md Outdated Show resolved Hide resolved
docs/cli/index.md Outdated Show resolved Hide resolved
docs/features/tasks/wallet.md Outdated Show resolved Hide resolved
docs/features/tasks/wallet.md Outdated Show resolved Hide resolved
src/algokit/cli/task.py Outdated Show resolved Hide resolved
src/algokit/cli/tasks/wallet.py Outdated Show resolved Hide resolved
src/algokit/cli/tasks/wallet.py Outdated Show resolved Hide resolved
src/algokit/cli/tasks/wallet.py Outdated Show resolved Hide resolved
src/algokit/core/tasks/wallet.py Outdated Show resolved Hide resolved
@aorumbayev aorumbayev merged commit 4cc5589 into feature/tasks Sep 27, 2023
@aorumbayev aorumbayev deleted the feature/task-wallet-aliasing branch September 27, 2023 09:14
aorumbayev added a commit that referenced this pull request Oct 25, 2023
* feat: algokit task - wallet aliasing (#313)

* feat: task wallet aliasing (add, get, remove, reset, list)

* docs: regen docs

* chore: minor tweaks

* chore: pip-audit

* chore: pip audit

* chore: refining aliasing, initial tests

* tests: extra snapshot tests

* docs: adding docs and force flags

* chore: typo fixes

* chore: addressing pr comments

* chore: tweaking docs

* chore: updating docs

* chore: adding extra docs

* chore: fixing artifacts

* feat: algokit task - vanity address (#314)

* feat: implement task vanity_address

* feat: adding logs in the process

* refactor: minor changes on showing result

* chore: fixing mypy

* fix: using mnemonic instead of private key

* test: adding some tests

* chore: updating poetry lock file

* docs: updating generated docs

* test: updating generated tests

* test: updating generated tests

* docs: updating docs

* test: add a test and updating other tests

* chore: fixing tests

* chore: extra tweaks in tests

* test: some minor changes

* chore: minor black formatting

* test: fix the test for windows

* chore: refining codebase; fixing multithreading

* docs: initial docs; to be refined post aliasing pr merge

* chore: fixing windows test

* chore: addressing pr comments

---------

Co-authored-by: Altynbek Orumbayev <altynbek.orumbayev@makerx.com.au>

* refactor: adding support for storing vanity to aliases

* docs: refreshing autogenerated docs

* refactor: performance improvements for vanity; swifter termination handling (#319)

* refactor: performance improvements for vanity; swifter termination handling

* chore: graceful termination handling

* chore: fixing test

* feat: algokit task - transfer algo|asa (#315)

* feat: implement task transfer

* chore: fixing typo

* feat: transfer command

* chore: wip refactoring

* feat: unit tests & docs

* chore: poetry tweaks

* chore: updating docs

* chore: minor tweaks

* chore: improving tests; smoke testing

* docs: regen docs

* chore: minor improvements

* build: lock file maintenance

* chore: minor improvements

---------

Co-authored-by: inaie ignacio <inaie.ignacio@makerx.com.au>

* feat: transaction signing task; polishing tasks (#324)

* feat: transaction signing task; polishing tasks

* docs: adding docstrings; refining task utils

* test: adding snapshot tests

* chore: regen docs

* docs: adding docs

* feat: deploy aliasing support (#323)

* feat: adding aliasing support for deploy command

* docs: updating docs

* docs: regen docs

* chore: minor polishing of click types on tasks

* feat: dispenser fund command aliasing support (#325)

* feat: task send transaction(s) (#326)

* feat: send transaction task

* test: snapshot tests

* docs: regen docs

* docs: adding command docs

* fix: fixing decoding of dictified txns in sign method to support AppCall txns

* chore: addressing pr comments

* feat: ipfs upload (#327)

* feat: ipfs upload

* docs: adding snapshot tests and docs

* docs: regen docs

* chore: mypy tweaks

* chore: pr comment

* feat: nfd domains lookups (#328)

* feat: nfd domains lookups

* chore: pr comments

* docs: regen docs

* chore: mypy tweaks

* feat: task `mint` (arc3 or arc19 compliant) (#329)

* chore: wip arc19 minting

* feat: draft implementation of minting using either arc3 or arc19

* chore: replacing py-multiformats-cid with multiformats

* refactor: addressing pr comments

* test: adding snapshot tests

* docs: adding user facing docs

* feat: task opt in and opt out (#331)

* feat: adding initial optin command

* fix: add network option

* fix: adding help to the opt-in command

* fix: adding network as an argument.

* feat: adding opt in and opt out commands

* chore: update urllib3 for pip audit

* fix: fixing error handling, command order, tests

* docs: updating documents

* test: fixing tests

* refactor: improving tests, adding docs and etc

---------

Co-authored-by: Altynbek Orumbayev <altynbek.orumbayev@makerx.com.au>

* chore: minor tweaks in vanity address performance (#333)

* refactor: vanity generation

* chore: wip

* refactor: vanity generation

* chore: refactor vanity generation

* refactor: minor improvements in shared enums; docs

* chore: bumping algokit-utils

* docs: minor adjustments in transfer argument help str

* chore: adjusting docs

* chore: updating lockfile

* chore: apply suggestions from code review

Co-authored-by: Neil Campbell <neil@codecise.com>

---------

Co-authored-by: Negar <negar.abbasi@makerx.com.au>
Co-authored-by: inaie ignacio <inaie.ignacio@makerx.com.au>
Co-authored-by: Neil Campbell <neil@codecise.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants