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

Convert ChainNetwork type to string. #8843

Merged

Conversation

jnaviask
Copy link
Collaborator

@jnaviask jnaviask commented Aug 14, 2024

Link to Issue

Affects but does not close #8762

Description of Changes

"How We Fixed It"

Converted type to string rather than using an enum type, as arbitrary values are possible and not necessary to account for due to lack of specific logic in most cases.

Test Plan

  • Ensure no type errors result from unknown enum values (the current ChainNetwork enum should capture all explicit uses).
  • Ensure regen loads as expected and no TRPC errors in server console.
  • Ensure communities page functions as expected.

@jnaviask jnaviask self-assigned this Aug 14, 2024
@github-actions github-actions bot marked this pull request as draft August 14, 2024 18:17
@jnaviask jnaviask marked this pull request as ready for review August 14, 2024 18:17
Copy link
Contributor

@mzparacha mzparacha left a comment

Choose a reason for hiding this comment

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

Thanks! Works great on /regen and /communities pages.

I noticed another zod issue with substrate_spec field

err: {
      "type": "ZodError",
      "message": "[\n  {\n    \"code\": \"invalid_type\",\n    \"expected\": \"string\",\n    \"received\": \"object\",\n    \"path\": [\n      \"substrate_spec\"\n    ],\n    \"message\": \"Expected string, received object\"\n  }\n]",
      "stack":
          ZodError: [
            {
              "code": "invalid_type",
              "expected": "string",
              "received": "object",
              "path": [
                "substrate_spec"
              ],
              "message": "Expected string, received object"
            }
          ]

but this is unrelated and can be fixed in 8779 (if you prefer).

@jnaviask
Copy link
Collaborator Author

@mzparacha we can eliminate the substrate spec field entirely. I will make a separate PR for this against master.

@mzparacha mzparacha merged commit 5f9aa16 into malik.8762.community-by-id Aug 14, 2024
9 checks passed
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