-
Notifications
You must be signed in to change notification settings - Fork 362
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
test/add-workflow-for-cli-account-management-and-data-sync #9001
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ 4 Skipped Deployments
|
apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts
Outdated
Show resolved
Hide resolved
apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts
Outdated
Show resolved
Hide resolved
apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts
Outdated
Show resolved
Hide resolved
apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts
Outdated
Show resolved
Hide resolved
test.describe(`[${app.name}] Sync Accounts`, () => { | ||
const ledgerKeyRingProtocolArgs = { | ||
pubKey: "", | ||
privateKey: "", | ||
}; | ||
|
||
const ledgerSyncPushDataArgs = { |
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.
Consolidate redundant logic like setting ledgerKeyRingProtocolArgs and ledgerSyncPullDataArgs.
apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts
Outdated
Show resolved
Hide resolved
apps/ledger-live-desktop/tests/specs/speculos/ledgerSync.spec.ts
Outdated
Show resolved
Hide resolved
...LedgerSyncCliHelper.ledgerSyncPullDataArgs, | ||
}); | ||
|
||
let parsedData = typeof pulledData === "string" ? JSON.parse(pulledData) : pulledData; |
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.
let's move data parsing to a separate method in utils class, also let's make sure to handle potential JSON parse errors
try {
parsedData = typeof pulledData === "string" ? JSON.parse(pulledData) : pulledData;
} catch (error) {
throw new Error(`Failed to parse pulledData: ${error.message}`);
}
} | ||
|
||
static async initializeLedgerSync() { | ||
const output = CLI.ledgerKeyRingProtocol({ |
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.
I feel like await is missing here, wdyt?
static async initializeLedgerSync() {
const output = await CLI.ledgerKeyRingProtocol({
getKeyRingTree: true,
...LedgerSyncCliHelper.ledgerKeyRingProtocolArgs,
});
LedgerSyncCliHelper.updateKeysAndArgs(output);
await activateLedgerSync();
return output;
}
β Checklist
npx changeset
was attached.π Description
This test aims to:
β Context
https://ledgerhq.atlassian.net/browse/LIVE-15537
π§ Checklist for the PR Reviewers