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

Use test dataset from cal instead of hardcoded ones #8196

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

sprohaszka-ledger
Copy link
Contributor

@sprohaszka-ledger sprohaszka-ledger commented Oct 24, 2024

✅ Checklist

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

📝 Description

Remove hardcoded values for currencies for test purposes. Instead, leverage CAL service with test flag.

❓ 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)

Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Copy link

vercel bot commented Oct 24, 2024

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

Name Status Preview Comments Updated (UTC)
web-tools ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 4:23pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Oct 29, 2024 4:23pm
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Oct 29, 2024 4:23pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 29, 2024 4:23pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 29, 2024 4:23pm

@live-github-bot live-github-bot bot added common Has changes in live-common ledgerjs Has changes in the ledgerjs open source libs labels Oct 24, 2024
@sprohaszka-ledger sprohaszka-ledger marked this pull request as ready for review October 25, 2024 09:04
import { getEnv } from "@ledgerhq/live-env";
import network from "@ledgerhq/live-network";

const CAL_BASE_URL = getEnv("CAL_SERVICE_URL");
Copy link
Contributor

Choose a reason for hiding this comment

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

Using getEnv like that means that it won't update if changed in the settings dev tools, not a big deal but something to be aware of

Copy link
Contributor Author

@sprohaszka-ledger sprohaszka-ledger Oct 29, 2024

Choose a reason for hiding this comment

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

You can change this var via the dev tools?

id: string,
env: "prod" | "test" = "prod",
): Promise<CurrencyData> {
const { data: currencyData } = await network<CurrencyDataResponse[]>({
Copy link
Contributor

@Justkant Justkant Oct 29, 2024

Choose a reason for hiding this comment

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

It would be interesting to look at integrating typia to validate and type guard the api calls later on
We could just use zod but you still have to declare a schema while with typia you can just use the type as is and get an optimised validator for it at build time

Justkant
Justkant previously approved these changes Oct 29, 2024
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
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 ledgerjs Has changes in the ledgerjs open source libs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants