-
Notifications
You must be signed in to change notification settings - Fork 327
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
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
import { getEnv } from "@ledgerhq/live-env"; | ||
import network from "@ledgerhq/live-network"; | ||
|
||
const CAL_BASE_URL = getEnv("CAL_SERVICE_URL"); |
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.
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
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.
You can change this var via the dev tools?
id: string, | ||
env: "prod" | "test" = "prod", | ||
): Promise<CurrencyData> { | ||
const { data: currencyData } = await network<CurrencyDataResponse[]>({ |
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.
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
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
✅ Checklist
npx changeset
was attached.📝 Description
Remove hardcoded values for currencies for test purposes. Instead, leverage CAL service with test flag.
❓ Context
🧐 Checklist for the PR Reviewers