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

feat: add static chains config #1103

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Conversation

mateuszjasiuk
Copy link
Collaborator

The most basic stuff.
We can move registry to separate package also

Copy link
Contributor

@pedrorezende pedrorezende left a comment

Choose a reason for hiding this comment

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

Nice one! :) I've just left some comments because maybe we won't need this new atom

return loadedConfigs[index];
}

export function chainConfigByName(name: string): ChainConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we improve name type to enforce only the available keys?

Copy link
Collaborator Author

@mateuszjasiuk mateuszjasiuk Sep 13, 2024

Choose a reason for hiding this comment

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

I think we can define type like:
type ChainName = 'cosmoshub' | 'namada';
At this point I'm not sure though if we will always have every json loaded so it might be undefined anyways.
OR to be more precise at first I thought this type will grow a lot :D but now I'm not sure about this loading thing also.
WDYT?

Copy link
Contributor

@pedrorezende pedrorezende Sep 17, 2024

Choose a reason for hiding this comment

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

I think this works for now :) let's keep it in mind so we can scale it in a better way

@@ -81,3 +84,7 @@ export const chainParametersAtom = atomWithQuery<ChainParameters>((get) => {
},
};
});

export const chainConfigAtom = atomFamily((chainName: string) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need an atom for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nah :)

Copy link
Contributor

@pedrorezende pedrorezende left a comment

Choose a reason for hiding this comment

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

Thanks, @mateuszjasiuk! :D LGTM!

Copy link
Collaborator

@jurevans jurevans left a comment

Choose a reason for hiding this comment

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

LGTM!

@pedrorezende pedrorezende merged commit dcb53aa into main Sep 19, 2024
10 checks passed
@pedrorezende pedrorezende deleted the feat/add-static-chain-configs branch September 19, 2024 18:38
pedrorezende added a commit that referenced this pull request Sep 19, 2024
@pedrorezende pedrorezende restored the feat/add-static-chain-configs branch September 19, 2024 19:52
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