-
Notifications
You must be signed in to change notification settings - Fork 0
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 #219
Conversation
- 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
…updated changelog
Co-authored-by: mix irving <mix@protozoa.nz>
…xyz/cli into naynay/base-plus-balance
…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/balance directory
- 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: Transfer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inquirer
is in the command files which means for programmatic cli we will be loading it and not using it. Lets find a way that we can leave it out of command.ts
files
yeah that's an artifact of e.g. that |
src/cli.ts
Outdated
.hook('preAction', async (_thisCommand, actionCommand) => { | ||
if (!entropy || (entropy.keyring.accounts.registration.address !== actionCommand.args[0] || entropy.keyring.accounts.registration.address !== actionCommand.opts().account)) { | ||
// balance includes an address argument, use that address to instantiate entropy | ||
// can keep the conditional to check for length of args, and use the first index since it is our pattern to have the address as the first argument | ||
if (RESTRUCTURED_COMMANDS.includes(actionCommand.name()) && actionCommand.args.length) { | ||
await loadEntropy(actionCommand.args[0], actionCommand.opts().endpoint, actionCommand.opts().password) | ||
} else { | ||
// if address is not an argument, use the address from the option | ||
await loadEntropy(actionCommand.opts().account, actionCommand.opts().endpoint, actionCommand.opts().password) | ||
} | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mixmix this is the abstraction of entropy I had implemented, where we use the pre action hook to initialize/load entropy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rh0delta cool!
Why would the account address ever be args[0]
? I would have expected it to be an option... also is this stuff gonna change when we get into CLI sessions?
* [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
…yz/cli into naynay/file-restructure
* 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
This PR is for the restructure of the code base to allow it to be more flexible.