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

[Coin Modularization] Solana #6721

Merged
merged 13 commits into from May 3, 2024
Merged

Conversation

sprohaszka-ledger
Copy link
Contributor

@sprohaszka-ledger sprohaszka-ledger commented Apr 22, 2024

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

📝 Description

Extract Solana as a module

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copy link

vercel bot commented Apr 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 0:49am
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 0:49am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 0:49am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 0:49am
web-tools ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 0:49am

@live-github-bot
Copy link
Contributor

live-github-bot bot commented Apr 22, 2024

Desktop Bundle Checks

Comparing 0a9f26f against 4d1d7bb.

✅ Previous issues have all been fixed.

Mobile Bundle Checks

Comparing 0a9f26f against 4d1d7bb.

✅ Previous issues have all been fixed.

@@ -16,6 +16,8 @@ import { getEnv } from "@ledgerhq/live-env";
import { Awaited } from "../../logic";
import { NetworkError } from "@ledgerhq/errors";

export const LATEST_BLOCKHASH_MOCK = "EEbZs6DmDyDjucyYbo3LwVJU7pQYuVopYcYTSEZXskW3";
Copy link
Contributor

Choose a reason for hiding this comment

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

why is it here ? Is it a random hash ?

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 don't know its purpose.
I move it for convient reason, as it is used within api calls.

Copy link
Contributor

Choose a reason for hiding this comment

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

This file looks like a "fourre tout". I think we should clearer names and put functions in more specific files.
Maybe helpers/address helpers/token helpers/staking

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right about staking.
I am adding this file.
But I will not going beyond as we need a better separation about what needs to be imported by the UI what doesn't.

memo?: string;
};

export type TokenCreateATACommand = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe types.ts files are also too much like a "fourre tout". I think it could be nice to have things organized by purpose/role.

Like a token.ts with the type, the helper functions, etc

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 don't want to refacto this coin-module for the time being.
The only purpose is to separate the code from LLC, as we have done for Algorand, Near and Bitcoin.

libs/ledger-live-common/src/families/solana/bridge/mock.ts Outdated Show resolved Hide resolved
@sprohaszka-ledger sprohaszka-ledger changed the title Solana modularization [Coin Modularization] Solana Apr 26, 2024
Copy link

socket-security bot commented Apr 29, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

View full report↗︎

@@ -2,7 +2,7 @@ import { Account, AccountLike } from "@ledgerhq/types-live";
import invariant from "invariant";
import flatMap from "lodash/flatMap";
import { getAccountCurrency } from "../../account";
import { TokenAccount } from "../solana/api/chain/account/token";
Copy link
Contributor

@gre gre Apr 30, 2024

Choose a reason for hiding this comment

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

Cardano depends on Solana?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It surprised me too.
The fix will be part of Cardano modularization...

gre
gre previously approved these changes Apr 30, 2024
Copy link
Contributor

@gre gre left a comment

Choose a reason for hiding this comment

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

lgtm for hub scope.
one possible (historical?) mistake on cardano->solana dep

Copy link

github-actions bot commented May 2, 2024

[Bot] Testing with 'Nitrogen' ($0.00) ⏲ 10min 2s

What is the bot and how does it work? Everything is documented here!

1 critical spec errors

Spec Solana failed!

Error: scan accounts timeout for currency Solana
Details of the 0 mutations

Spec Solana (failed)


Details of the 8 uncovered mutations

Spec Solana (8)

  • Transfer ~50%:
  • Transfer Max:
  • Delegate:
  • Deactivate Activating Delegation:
  • Deactivate Active Delegation:
  • Reactivate Deactivating Delegation:
  • Activate Inactive Delegation:
  • Withdraw Delegation:
Portfolio ($0.00) – Details of the 1 currencies
Spec (accounts) State Remaining Runs (est) funds?
Solana (0) 0 ops , 🤷‍♂️ ``

Performance ⏲ 10min 2s

Time spent for each spec: (total across mutations)

Spec (accounts) preload scan re-sync tx status sign op broadcast test destination test
TOTAL 150ms N/A N/A N/A N/A N/A N/A N/A
Solana (0) 150ms N/A N/A N/A N/A N/A N/A N/A

What is the bot and how does it work? Everything is documented here!

Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
@sprohaszka-ledger sprohaszka-ledger merged commit 1cee8ff into develop May 3, 2024
58 checks passed
@sprohaszka-ledger sprohaszka-ledger deleted the feat/LIVE-8175-solana branch May 3, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common desktop Has changes in LLD mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants