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

Add api unit tests #74

Merged
merged 15 commits into from
Jun 3, 2024
Merged

Add api unit tests #74

merged 15 commits into from
Jun 3, 2024

Conversation

kylewandishin
Copy link
Collaborator

@dawsbot please review this commit

scripts/fetch-all.ts Outdated Show resolved Hide resolved
@kylewandishin
Copy link
Collaborator Author

@dawsbot i have changed the code relating to all your feedback. please review the recent commits

scripts/ApiParser/ApiParser.ts Outdated Show resolved Hide resolved
scripts/ApiParser/ApiParser.ts Outdated Show resolved Hide resolved
@@ -63,7 +85,7 @@ export abstract class ApiParser {
public convertToTokenRows(data: ApiResponse): TokenRows {
const tokens = data.d.data.map((obj) => ({
tokenName: obj.tokenName,
tokenSymbol: obj.tokenSymbol,
tokenSymbol: "",
Copy link
Owner

Choose a reason for hiding this comment

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

How come the tokenSymbol is an empty string here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i found that token symbol is not on the API response and removed it from the type we made. this made it so that i could not just leave it as obj.tokenSymbol. it was essentially a blank string before as well because it is assigned in the filter data step.

Copy link
Owner

Choose a reason for hiding this comment

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

A more future-proof method in the future would be to leave out tokenSymbol from this atall since it's hydrated later and create a new TS type here so that we lean on TS to enforce we hydrate tokenSymbol in a later stage.

But in the effort to not over-complicate this is fine for now

scripts/ApiParser/EtherscanApiParser.ts Outdated Show resolved Hide resolved
@dawsbot dawsbot merged commit 0101b4f into v1 Jun 3, 2024
@dawsbot dawsbot deleted the add-api-unit-tests branch June 3, 2024 20:29
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.

None yet

2 participants