Skip to content

fix: remove 'Codec' import from template files in generated/types dir#513

Merged
zeeshanakram3 merged 1 commit intoJoystream:masterfrom
zeeshanakram3:fix_removeUnusedCodecImport
Jan 11, 2023
Merged

fix: remove 'Codec' import from template files in generated/types dir#513
zeeshanakram3 merged 1 commit intoJoystream:masterfrom
zeeshanakram3:fix_removeUnusedCodecImport

Conversation

@zeeshanakram3
Copy link
Copy Markdown
Contributor

@zeeshanakram3 zeeshanakram3 commented Jan 10, 2023

Problem

In module.hbs file in hydra-typegen package, there is an unused Codex import as: import { Codec } from "@polkadot/types/types";. This template file is being used to generate Events classes for each module inside query-node/mappings/generated/types/. The problem is if any event contains a param which is of codex type, then Codec is imported again, which leads to duplicate imports error while building the QN.

For example, in Joystream/joystream#4517 the type of optional payment parameter in the MemberRemarked event is Option<[AccountId32, u128] & Codec>

Solution

Remove unused Codec import from the template file.

affects: @joystream/hydra-typegen

Copy link
Copy Markdown

@Lezek123 Lezek123 left a comment

Choose a reason for hiding this comment

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

LGTM

@zeeshanakram3 zeeshanakram3 merged commit 51c7810 into Joystream:master Jan 11, 2023
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