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.
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
refactor: Use
VersionedLocation
inRestrictedTransferLocation
#1861refactor: Use
VersionedLocation
inRestrictedTransferLocation
#1861Changes from 8 commits
66886ca
8242a08
995887e
8e5c8d5
1f4c2d7
0c0d53d
6b97978
3e0c342
a7cf00f
15a3f2a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Did you have an error with this? I remember runtime benchmarks not working without 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.
Let me check again with this enabled. I don't know why but recently I am often fooled by my cargo cache which I can only fix by cleaning completely.
This change broke transfer allowlist benchmarks which required
T::AccountId <-> T::Location
conversion. Unfortunately, it was not possible to implementFrom/TryFrom
forAccountId
andRestrictedTransferLocation
because of the the blanket RustFrom<T> for T
implementation which conflicts with any custom implementation involving the same type for bothFrom
andTryFrom
.AFAICT, I could have either added a custom conversion trait or gone with my current proposal. Unfortunately, my proposal required refactoring unit tests which used
u64
asAccountId
and a custom enum forT::Location
which conflicted with my new benchmark restriction ofConfig<AccountId = AccountId, Location = RestrictedTransferLocation
.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 above compiled in
main
IIRC 🤔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.
Apparently, it works for
AccountId32
as part of our current codebase. However, it does not work forAccountId
even though that's the same type under the hood 🤷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.
Reverted in a7cf00f
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 is something I previously battled with. I do not understand why TBH. Even I was not able to find the
impl T for T
implementation runningcargo doc
. There is something weird in the implementation.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 am happy to hear even you don't understand it. It really frustrated me yesterday..
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.
Cool! It seems like the it wanted to be so 👍🏻