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

fix: support not defined contractType for NFT types. #673

Merged
merged 5 commits into from
Sep 22, 2022

Conversation

b4rtaz
Copy link
Collaborator

@b4rtaz b4rtaz commented Sep 15, 2022

@changeset-bot
Copy link

changeset-bot bot commented Sep 15, 2022

🦋 Changeset detected

Latest commit: 39f1025

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@moralisweb3/evm-api Patch
@moralisweb3/evm-utils Patch
moralis Patch
@moralisweb3/core Patch
@moralisweb3/auth Patch
@moralisweb3/streams Patch
@moralisweb3/api-utils Patch
@moralisweb3/sol-utils Patch
@moralisweb3/sol-api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@b4rtaz b4rtaz requested review from ErnoW and sogunshola September 15, 2022 08:43
@@ -53,7 +53,7 @@ export class EvmNft implements MoralisDataObject {
static parse = (data: EvmNftInput, core: MoralisCore): EvmNftData => ({
...data,
chain: EvmChain.create(data.chain, core),
contractType: validateValidEvmContractType(data.contractType),
contractType: noramlizeEvmNftContractType(data.contractType),
Copy link
Member

Choose a reason for hiding this comment

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

Could we not just something like:

    contractType: maybe(data.contractType, validateValidEvmContractType),

Copy link
Collaborator Author

@b4rtaz b4rtaz Sep 16, 2022

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe it's not needed.

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've standardized the code.

contractType: maybe(data.contractType, normalizeEvmNftContractType),

@b4rtaz b4rtaz requested a review from ErnoW September 21, 2022 10:03
@b4rtaz b4rtaz enabled auto-merge (squash) September 21, 2022 10:05
@b4rtaz b4rtaz merged commit 6227567 into main Sep 22, 2022
@b4rtaz b4rtaz deleted the fix/undefined-contract-type branch September 22, 2022 09:32
This was referenced Sep 22, 2022
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.

2 participants