-
Notifications
You must be signed in to change notification settings - Fork 14
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
241 update spacewalk dependencies and configure the lp token for use with the zenlink pallet #246
241 update spacewalk dependencies and configure the lp token for use with the zenlink pallet #246
Conversation
…tId and Spacewalk assets.
deleted unnecessary dependencies.
Updated spacewalk dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it. Thanks for the time and writing the proper tests @adelarja. The tests show quite well how the conversion works.
I left some comments.
…n function for stellar assets.
…token-for-use-with-the-zenlink-pallet' of github.com:pendulum-chain/pendulum into 241-update-spacewalk-dependencies-and-configure-the-lp-token-for-use-with-the-zenlink-pallet
… asset chain_id and the parachain_id are the same.
…and spacewalk asset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general comment: it is super minor but I think we should have standard policy about naming variables. I don't see a need to have some variable names start with an underscore and I don't think that this style is used by the rest of the team.
…tion, allowing us to use a discriminant of 3 for the Zenlink LP token.
LGTM overall. |
…ion to amplitude.
…date-spacewalk-dependencies-and-configure-the-lp-token-for-use-with-the-zenlink-pallet
Signed-off-by: adelarja <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me. I just suggested some changes so that we have it a little easier to see what the raw byte keys of the Stellar assets represent.
I'd say this PR is now ready for merge.
Co-authored-by: Marcel Ebert <[email protected]>
Co-authored-by: Marcel Ebert <[email protected]>
Co-authored-by: Marcel Ebert <[email protected]>
This PR is related to these issues: Add ZenlinkLPToken to CurrencyId enum and Add the conversion functions between Zenlink Assets and Spacewalk Assets.
For more details about how the conversion functions work, read this and this comment.
At the beginning, the conversion functions were developed using the TryFrom trait. For that, a wrapper struct was needed because neither the TryFrom trait nor the CurrencyId enum was defined in our crate. In the end, we also needed to create a function to handle the wrapper type, so I decided to use functions to convert between Spacewalk assets and Zenlink assets.
To enhance code organization and cleanliness, the conversion functions were divided into zenlink_id_to_currency_id and currency_id_to_zenlink_id.
To ensure the code can be used across all our runtimes, it was placed in a separate file within the common directory of the runtime. The currency_id_to_zenlink_id function may not be utilized at the moment, but we can retain it in case it is needed in the future.
Additionally, some unit tests were added to verify the functionality of these functions.
If I'm not mistaken, we'll need this pull request (PR) to be merged before we can merge the current one. I made a local test by merging it into my branch, and it successfully resolved several dependency issues between Spacewalk and Pendulum.