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: use latest asset registry #597
Conversation
Crate versions that have been updated:
Runtime version has been increased. |
Codecov ReportBase: 43.89% // Head: 43.73% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #597 +/- ##
==========================================
- Coverage 43.89% 43.73% -0.16%
==========================================
Files 61 61
Lines 4406 4440 +34
==========================================
+ Hits 1934 1942 +8
- Misses 2472 2498 +26
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
can you somehow test scenario where xyk pool is created prior to the feature which offsets the ids ? and that xyk still works correctly ? i don't think xyk constructs the share asset id - only in create pool. but it would be worth to try it. |
I think we can simulate this by creating a pool with given ID which is within the reserved space, and after that create a new pool without specifying ID. What do you think? |
@enthusiastmartin what do you think about it? |
i am sure how you'd create a pool with given id. but you could try to create a pool when the offset is set to 0 first, and then change it to 1_000_000 and continue. |
I don't think it's possible to do it in the integration tests because we don't use a mock runtime, so we can't use the builder pattern. |
asset_ids: vec![ | ||
(b"KSM".to_vec(), 1_000_000u128, 1), | ||
(b"aUSD".to_vec(), 1_000u128, 2), | ||
(b"MOVR".to_vec(), 1_000u128, 3), | ||
(b"NEW_BOOTSRAPPED_TOKEN".to_vec(), 1_000u128, 4), | ||
], |
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.
Same comment as in another PR for hydradx from Martin: Tokens should be in asset_names
XOR asset_ids
, otherwise it will be registered twice. Sorry for making that non-obvious in my changes to the pallet.
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.
adding @enthusiastmartin to the discussion. Which one to use in our mocks and geneses? Do we want to have assets registered from 0, from the offset, or keep existing entries as they are and only offset newly added assets?
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.
adding @enthusiastmartin to the discussion. Which one to use in our mocks and geneses? Do we want to have assets registered from 0, from the offset, or keep existing entries as they are and only offset newly added assets?
with ids. we should remove from registry the other one.
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.
Ok. I'm going to update the pallet so we can include that change in this PR.
@Roznovjak it looks ok to me. however i would like to see a test like mentioned above. where there is a pool with share token not offseted ( like created before this upgrade) i believe you can do that in the actual xyk tests ( not integration tests) since it uses pallet-asset-registry in the tests:
|
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.
LGTM, thanks for doing the update 🙏
Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com>
Fixes: #595