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

[NayNay] CLI/TUI File Restructure #231

Merged
merged 35 commits into from
Oct 2, 2024
Merged

[NayNay] CLI/TUI File Restructure #231

merged 35 commits into from
Oct 2, 2024

Conversation

rh0delta
Copy link
Contributor

Related Issue(s)

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Checklist

  • I have performed a self-review of my code.
  • I have added tests.
  • I have commented my code.
  • I have included a CHANGELOG.md entry.
  • I have updated documentation in github.com:entropyxyz/entropy-docs, where necessary.

rh0delta and others added 30 commits July 31, 2024 15:46
- created new base entropy class to handle the shared nature of the intended use of the class
- restructured balance to be in its own parent directory in the root of src
- created command and util file to contain pure functions and controller functions
Co-authored-by: mix irving <mix@protozoa.nz>
…ance on every command; used to be passed down to each of the commands; added new option to define new address as selected account
- removed flows/entropyTransfer
- created new root directory for transfer to house utils, new command file, and types
- updated tui and cli with new transfer method
* [NayNay] File Restructure: Signing Restructure

- created new file structure for signing flow
- updated tui/cli with new changes

* some cleanup; fixed sign tests

* removed inquirer input from commands file, added file inoput back to signing

* added raw sign back in

* wip: raw sign stuff

* wip: finished off last changes for raw sign but need to test

* wip: porting to newly defined structure

* updated signing to new structure, and added utils-cli from mix pr

* updated file structure for balance

* updated file structure for transfer

* pr review updates

* updated to sign not signing

* signing-restructure tweeeeks (#220)

* tweeeeks

* more tweeks

* fix tests

* rename test

* fix maskPayload

* test fix

* change sign command to just return sig

* stdout cleanup for balance and sign

* tweeks

* fix transfer to allow decimal transfers

---------

Co-authored-by: mix irving <mix@protozoa.nz>
* [NayNay] File Restructure: Accounts Restructure

- refactoring file structure + flow of accounts in cli/tui

* updated new account, list account and selected account with new file structure; still need to update tests

* finished updated manage accoutns stuff, updated tests too

* updated register flow and moved methods to accounts namespace

* updated register tests

* cleanup from smoke test

* updated changelog

* start refactor

* WIP: part way refactored account stuff

* cleaning up the cleanup for accounts restructure;

* forgot something

* updated accounts restructure, continuing from mixs changes

* Update main.ts

* Update manage-accounts.test.ts

* fixups

* WIP

* fixups

* compleeeete

* get working for fresh install. see WIP

* fixed fresh install and using tui, might have fixed cli not sure

* updated initialization of entropy and formt of how we instantiate commands

* skipping faucet test for now, shenanigans occurring

* fixed faucet test

* updated tests;

* Update command.ts

Co-authored-by: mix irving <mix@protozoa.nz>

* pr review updates

* Update src/cli.ts

* account-restructure tweaks (#226)

---------

Co-authored-by: mixmix <mix@protozoa.nz>
* get all config.get* methods fail safely

* fix getSync so that it mkdirps
* fix config (again), rename > accountOption

* Update src/cli.ts
* add deploy to CLI, including start of CLI refactor

* refactor

* tweaks

* some renames

* migrate program => new structure

* fix bugs: no initial account, missing ProgramInfo interface

* update config to be more safe

* fix config (again), rename > accountOption
* [NayNay] File Restructure: Faucet

- restructured faucet to match the new structure

* completed restructure, working on tests

* updated faucet tests

* updated recursion for faucet retry mechanism, reduce calls to the chain

* documented some of the methods used for the faucet

* added changelog
@rh0delta rh0delta marked this pull request as ready for review September 24, 2024 19:44
@frankiebee
Copy link
Collaborator

src
├── account
│   ├── command.ts
│   ├── constants.ts
│   ├── interaction.ts
│   ├── main.ts
│   ├── types.ts
│   └── utils.ts
├── balance
│   ├── command.ts
│   ├── interaction.ts
│   ├── main.ts
│   ├── types.ts
│   └── utils.ts
├── cli.ts
├── common
│   ├── ascii.ts
│   ├── entropy-base.ts
│   ├── initializeEntropy.ts
│   ├── logger.ts
│   ├── masking.ts
│   ├── progress.ts
│   ├── prompts.ts
│   ├── utils-cli.ts
│   └── utils.ts
├── config
│   ├── encoding.ts
│   ├── index.ts
│   ├── migrations
│   │   ├── 00.ts
│   │   ├── 01.ts
│   │   ├── 02.ts
│   │   └── index.ts
│   └── types.ts
├── faucet
│   ├── helpers
│   │   └── signer.ts
│   ├── interaction.ts
│   ├── main.ts
│   ├── types.ts
│   └── utils.ts
├── flags
├── flows
│   └── password
│       └── index.ts
├── program
│   ├── command.ts
│   ├── constants.ts
│   ├── interaction.ts
│   ├── main.ts
│   ├── types.ts
│   └── utils.ts
├── sign
│   ├── command.ts
│   ├── constants.ts
│   ├── interaction.ts
│   ├── main.ts
│   ├── types.ts
│   └── utils.ts
├── transfer
│   ├── command.ts
│   ├── constants.ts
│   ├── interaction.ts
│   ├── main.ts
│   ├── types.ts
│   └── utils.ts
├── tui.ts
└── types
    └── index.ts

@frankiebee
Copy link
Collaborator

frankiebee commented Sep 24, 2024

QA fail 🔥 :

? Select Action Manage Accounts
? interactionChoice: List Accounts
There are currently no accounts available, please create or import a new account using the Manage Accounts feature
? Return to main menu? Yes
? Select Action Manage Accounts
? interactionChoice: Create/Import Account
? Would you like to import your own seed? No
? name: Test 1
? Return to main menu? Yes
? Select Action Entropy Faucet
There was an issue with running the faucet TypeError: Cannot read properties of undefined (reading 'registrationManager')
    at entropyFaucet (file:///Users/frankie/work/entropyxyz/cli/dist/cli.js:11433:16)
    at main (file:///Users/frankie/work/entropyxyz/cli/dist/cli.js:11709:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
? Return to main menu? Yes
? Select Action Balance
There was an error retrieving balance TypeError: Cannot read properties of undefined (reading 'substrate')
    at EntropyBalance.getBalance (file:///Users/frankie/work/entropyxyz/cli/dist/cli.js:11001:44)
    at entropyBalance (file:///Users/frankie/work/entropyxyz/cli/dist/cli.js:11024:42)
    at main (file:///Users/frankie/work/entropyxyz/cli/dist/cli.js:11696:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
? Return to main menu? Yes
? Select Action 
❯ Manage Accounts 
  Balance 
  Register 
  Sign 
  Transfer 
  Deploy Program 
  User Programs 
  Entropy Faucet 
  Exit 

@frankiebee
Copy link
Collaborator

frankiebee commented Sep 24, 2024

QA requirements of CLI

- [ ] cp -R  ~/Library/Preferences/entropy-cryptography ~/Library/Preferences/backup-entropy-cryptography
- [ ] rm -rf  ~/Library/Preferences/entropy-cryptography
- [ ] rm -rf node_modules && yarn && yarn build:global
- [ ] Basic first flow(with faucet): `entropy -d`
  - [ ] list accounts (their should be none)
  - [ ] create account
  - [ ] get faucet funds
  - [ ] check balance
  - [ ] register
  - [ ] get signature 'hello world' and other variations

after QA:
- [ ] cp -R  ~/Library/Preferences/backup-entropy-cryptography ~/Library/Preferences/entropy-cryptography

…ate first account, updated choices to be array and removed noop fns
@frankiebee
Copy link
Collaborator

QA results:
yes everything is their and seems to function to the "best of it's ability"
out of this though i did run into some issues that i'm calling out of scope for this PR:
#235
#236
#237
#238

Copy link
Collaborator

@frankiebee frankiebee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a QA of thir branch and did a lighter code review sense we reviewed code more in smaller PR's

@frankiebee frankiebee merged commit dd751e4 into dev Oct 2, 2024
2 checks passed
@frankiebee frankiebee deleted the naynay/file-restructure branch October 2, 2024 21:47
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants