Skip to content

asset-registry: Pass Asset Id to AuthorityOrigin #762

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

Merged

Conversation

NunoAlexandre
Copy link
Contributor

@NunoAlexandre NunoAlexandre commented Jun 6, 2022

Different AssetId's may require different origin checks, which is currently not supported.

The changes proposed here make the switch to use EnsureOriginWithArg to allow users of this pallet to tailor the origin check to take the asset_id itself in consideration when choosing the specific EnsureOrigin implementation to be applied.

Fwiw, this feature is a must for our use case at Centrifuge where we need to have a tailored origin check when registering/updating tranche tokens.

Different AssetId's may require different origin checks, which is
currently not possible. These changes use EnsureOriginWithArg to allow
users of this pallet to tailor the origin check to take the `asset_id`
itself in consideration when choosing the specific `EnsureOrigin`
implementation to be applied.
@codecov-commenter
Copy link

Codecov Report

Merging #762 (ca00b06) into master (954cc7d) will increase coverage by 0.13%.
The diff coverage is 74.00%.

@@            Coverage Diff             @@
##           master     #762      +/-   ##
==========================================
+ Coverage   77.90%   78.04%   +0.13%     
==========================================
  Files         100      100              
  Lines        9665     9728      +63     
==========================================
+ Hits         7530     7592      +62     
- Misses       2135     2136       +1     
Impacted Files Coverage Δ
xtokens/src/lib.rs 65.38% <40.00%> (+0.89%) ⬆️
xcm-support/src/currency_adapter.rs 51.16% <66.66%> (+6.00%) ⬆️
asset-registry/src/lib.rs 93.82% <100.00%> (ø)
asset-registry/src/mock/para.rs 72.97% <100.00%> (+6.30%) ⬆️
asset-registry/src/tests.rs 97.13% <100.00%> (+0.17%) ⬆️
xcm-support/src/lib.rs 75.00% <0.00%> (-10.72%) ⬇️
tokens/src/tests.rs 99.82% <0.00%> (-0.18%) ⬇️
payments/src/mock.rs 95.83% <0.00%> (ø)
currencies/src/mock.rs 94.73% <0.00%> (ø)
xtokens/src/mock/para.rs 75.75% <0.00%> (ø)
... and 5 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@NunoAlexandre
Copy link
Contributor Author

@xlc I will fix the git conflicts and the compilation errors around successful_origin.

@xlc xlc merged commit 5600d1c into open-web3-stack:master Jun 8, 2022
@NunoAlexandre NunoAlexandre deleted the asset-registry/authority-with-arg branch June 9, 2022 01: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.

4 participants