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

QA file-restructure #247

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open

QA file-restructure #247

wants to merge 18 commits into from

Conversation

mixmix
Copy link
Contributor

@mixmix mixmix commented Oct 1, 2024

  • a script for testing CLI
  • some gotchas!
  • WIP bugs!

@mixmix mixmix marked this pull request as draft October 1, 2024 04:05
tests/cli.test.sh Outdated Show resolved Hide resolved
src/transfer/command.ts Outdated Show resolved Hide resolved
tests/cli.test.sh Outdated Show resolved Hide resolved
@mixmix mixmix requested a review from frankiebee October 2, 2024 03:16
@mixmix mixmix marked this pull request as ready for review October 2, 2024 03:16
Comment on lines +81 to +88
const accounts = await config.get()
.then(storedConfig => EntropyAccount.list(storedConfig))
.catch((err) => {
if (err.message.includes('currently no accounts')) return []

throw err
})

Copy link
Contributor Author

@mixmix mixmix Oct 2, 2024

Choose a reason for hiding this comment

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

CHANGE: entropy account ls

If I don't have any accounts yet I don't expect an error, I expect []

@@ -35,7 +38,8 @@ function entropyAccountCreate () {

cliWrite({
name: newAccount.name,
address: newAccount.address
address: newAccount.address,
verifyingKeys: []
Copy link
Contributor Author

@mixmix mixmix Oct 2, 2024

Choose a reason for hiding this comment

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

PATCH:

entropy account create
entropy account create

Have them output the same format as entropy account ls
✔️ consistency
✔️ set up expectations that there is something interesting/ important meant to go in here

const fullAccount = keyring.getAccount()
// TODO: sdk should create account on constructor
const { admin } = keyring.getAccount()
const data = fixData(fullAccount)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a bug in the SDK where you are "cloning" with `JSON.parse(JSON.stringify(obj)) and it fucks up the Uint8Array, which then fucks up config, logging etc.

This is a quick hack

@@ -49,7 +49,7 @@ export class EntropyAccount extends EntropyBase {
return accounts.map((account: EntropyAccountConfig) => ({
name: account.name,
address: account.address,
verifyingKeys: account?.data?.admin?.verifyingKeys
verifyingKeys: account?.data?.registration?.verifyingKeys || []
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🔥 CHECK?
I assume verifyingKeys were meant to go under registration and not admin right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AH tests say no. I don't know what the difference is between `admin + registration.
I changed where vks are being pushed into elsewhere in code too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed tests

src/common/masking.ts Outdated Show resolved Hide resolved
src/config/encoding.ts Outdated Show resolved Hide resolved
tests/qa.sh Outdated
Comment on lines 3 to 10
# WARNING - this script nukes your config!
#
# Dependencies
# - internet connection
# - jq - see https://jqlang.github.io/jq
#
# Run
# $ yarn build && ./tests/qa.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty stoked with this. This script allowed me to hammer the CLI repeatedly till I got all the weird lil bugs out.

I imagine this could be the basis for a CLI integration test that uses frankie's new CLI runner in the future so we can check the outputs are good

tests/qa.sh Outdated Show resolved Hide resolved
@mixmix mixmix changed the title WIP: QA file-restructure QA file-restructure Oct 2, 2024
@mixmix
Copy link
Contributor Author

mixmix commented Oct 2, 2024

Checklist

  • fix failing CI
    • clarify where the verifyingKeys should be stored on an account
    • probably document account anatomy
  • deal with argParser / default collision

Base automatically changed from naynay/file-restructure to dev October 2, 2024 21:47
@mixmix mixmix changed the base branch from dev to mixmix/fix-masking October 3, 2024 00:26
Base automatically changed from mixmix/fix-masking to dev October 3, 2024 21:39
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.

1 participant