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(processor): fix generic enum names #179

Merged
merged 2 commits into from
Jan 16, 2025
Merged

fix(processor): fix generic enum names #179

merged 2 commits into from
Jan 16, 2025

Conversation

acdibble
Copy link
Collaborator

No description provided.

@acdibble acdibble requested a review from a team as a code owner January 16, 2025 12:33
@@ -74,7 +74,7 @@ export default class Parser extends BaseParser {

const result: EnumType = {
type: 'enum',
name: uncapitalize(type.lookupName),
name: uncapitalize(type.lookupName).replace('IngressEgress', this.getPalletName()),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the fix

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name: uncapitalize(type.lookupName).replace('IngressEgress', this.getPalletName()),
name: uncapitalize(type.lookupName).replace(/^IngressEgress/, this.getPalletName()),

is it necessary to make it a bit more strict maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no this should be ok, the name looks like PalletCfIngressEgressDepositFailedDetails and we just need to insert the chain in there somewhere to make it distinct

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the pallet name is like SolanaIngressEgress, so it just adds the chain name

@@ -74,7 +74,7 @@ export default class Parser extends BaseParser {

const result: EnumType = {
type: 'enum',
name: uncapitalize(type.lookupName),
name: uncapitalize(type.lookupName).replace('IngressEgress', this.getPalletName()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name: uncapitalize(type.lookupName).replace('IngressEgress', this.getPalletName()),
name: uncapitalize(type.lookupName).replace(/^IngressEgress/, this.getPalletName()),

is it necessary to make it a bit more strict maybe?

@acdibble acdibble merged commit 0ad97ec into main Jan 16, 2025
@acdibble acdibble deleted the fix/generic-enum branch January 16, 2025 12:47
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.

3 participants