-
Notifications
You must be signed in to change notification settings - Fork 103
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
Refactoring create asset and add CI tests to cover #1112
Closed
Closed
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1be0f8e
Runtime test for create asset in AH
yrong 0aa33d0
Merge branch 'main' into ron/asset-hub-runtime-tests
yrong d085897
Move call index back to runtime
yrong 37aa97e
Refactoring with CallInfo data structure
yrong 25933c9
Merge branch 'main' into ron/asset-hub-runtime-tests
yrong 474abe0
Merge branch 'main' into ron/asset-hub-runtime-tests
yrong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think the pallet index should stay configured in the runtime config. What happens if the ForeignAssets pallet indexes are different per runtime? I think they are the same and that is the convention, but I still think this is runtime related and shouldn't live in the snowbridge crates.
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.
Yeah, that's the precondition, checked that all the same in multiple runtimes(e.g. polkadot/kusama). I do not see a reason why they need to break this rule in the future so prefer to make things simple at this moment.
But I'm open if you all think that's a problem and will make some changes accordingly.
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.
Maybe we can add a test to make sure they are in line?
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.
Ah I see a test is added. Ignore this.
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 agree with Clara here, I am a bit uncomfortable with baking runtime configuration inside our pallets & primitives crate.
Secondly, I am sensitive about changing code unnecessarily at this point. Our next audit is scheduled for Feb 8, and this change will increase the scope of the audit.
I want to reserve any scope increases to accommodate for the second round of code review that the Parity bridges team is going to perform soon.
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.
The initial intention of this PR is for the comment to add the call index to some primitives which can be referenced/checked in the AH runtime tests.
So @vgeddes do we still need this PR? I think we already have the emulated test register token to cover this use case so maybe the refactoring here and the unit test added in AH may not be necessary at all?
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 think Slava wanted us to move those constants here:
polkadot-sdk/bridges/primitives/chain-asset-hub-rococo
. I think it is fine to move the pallet index, but not to our crates. It should still be in the polkadot-sdk, and it should be configured per testnet. I think it can actually go here too:polkadot-sdk/cumulus/parachains/common/src/rococo.rs
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.
Thanks Clara and that makes sense! So do you think also better to move the hard-coded weight to some common runtime config?
Also noticed that Vincent mentioned to
reserve any scope increases to accommodate for the second round of code review
then not sure if it's the right time to do the refactoring.So I'll convert the PR as draft and let the team decide whether to continue with the change or not.
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.
@claravanstaden Some refactoring in 37aa97e as you suggested.