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: use latest asset registry #597

Merged
merged 7 commits into from Feb 11, 2023
Merged

feat: use latest asset registry #597

merged 7 commits into from Feb 11, 2023

Conversation

Roznovjak
Copy link
Collaborator

Fixes: #595

@Roznovjak Roznovjak self-assigned this Jan 31, 2023
@github-actions
Copy link

github-actions bot commented Jan 31, 2023

Crate versions that have been updated:

  • runtime-integration-tests: v0.8.8 -> v0.9.0
  • parachain-runtime-mock: v0.1.7 -> v0.2.0
  • basilisk: v8.1.3 -> v8.1.4
  • pallet-duster: v3.1.11 -> v3.1.12
  • pallet-lbp: v4.6.6 -> v4.6.7
  • pallet-marketplace: v5.0.8 -> v5.0.9
  • pallet-xyk: v6.1.5 -> v6.2.1
  • pallet-xyk-liquidity-mining: v1.1.2 -> v1.1.3
  • pallet-xyk-liquidity-mining-benchmarking: v1.0.7 -> v1.0.8
  • primitives: v6.4.2 -> v6.4.3
  • basilisk-runtime: v90.0.0 -> v91.0.0
  • common-runtime: v2.3.5 -> v2.3.6
  • testing-basilisk-runtime: v90.0.0 -> v91.0.0

Runtime version has been increased.

@codecov
Copy link

codecov bot commented Jan 31, 2023

Codecov Report

Base: 43.89% // Head: 43.73% // Decreases project coverage by -0.16% ⚠️

Coverage data is based on head (fc7b0b4) compared to base (3a7672d).
Patch coverage: 23.25% of modified lines in pull request are covered.

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     
Impacted Files Coverage Δ
...ntegration-tests/parachain-runtime-mock/src/lib.rs 62.79% <ø> (ø)
node/src/chain_spec.rs 0.00% <0.00%> (ø)
node/src/testing_chain_spec.rs 0.00% <0.00%> (ø)
pallets/xyk/src/lib.rs 83.68% <ø> (ø)
runtime/common/src/lib.rs 33.33% <ø> (ø)
runtime/testing-basilisk/src/lib.rs 11.24% <0.00%> (ø)
...llets/xyk-liquidity-mining/benchmarking/src/lib.rs 86.78% <22.22%> (-5.57%) ⬇️
runtime/basilisk/src/benchmarking/marketplace.rs 100.00% <100.00%> (ø)
runtime/basilisk/src/benchmarking/mod.rs 88.23% <100.00%> (+0.73%) ⬆️
runtime/basilisk/src/lib.rs 20.67% <100.00%> (ø)

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@enthusiastmartin
Copy link
Contributor

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.

@Roznovjak
Copy link
Collaborator Author

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?

@Roznovjak
Copy link
Collaborator Author

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?

@enthusiastmartin
Copy link
Contributor

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.

@Roznovjak
Copy link
Collaborator Author

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.

Comment on lines 194 to 199
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),
],
Copy link
Collaborator

@apopiak apopiak Feb 7, 2023

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.

Copy link
Collaborator Author

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?

Copy link
Contributor

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.

Copy link
Collaborator Author

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.

@enthusiastmartin
Copy link
Contributor

@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:

  1. create a pool
  2. manually change the id of share asset id in the storage to simulate such scenario ( in the registry as well as in the xyk storage )
  3. and make sure it all works with that share asset id.

Copy link
Collaborator

@apopiak apopiak left a 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 🙏

pallets/xyk-liquidity-mining/benchmarking/src/mock.rs Outdated Show resolved Hide resolved
Roznovjak and others added 2 commits February 10, 2023 13:23
Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com>
@Roznovjak Roznovjak merged commit 5818ee3 into master Feb 11, 2023
@Roznovjak Roznovjak deleted the latest_registry branch February 11, 2023 10:27
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.

update to latest registry + integration tests
3 participants