-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support old and new reputation type #1664
Conversation
…been linked to non-current cIndex
bool hasNewReputationType(RuntimeVersion version) { | ||
Log.p('Runtime version ${version.toJson()}'); | ||
if (version.specName == 'encointer-parachain') { | ||
return version.specVersion >= 1002001; |
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.
@brenzi here I need your help. On latest master we have version 1002000 but on your pr we also have encointer/encointer-parachain#216 version 1002000, on rococo it is 1002001. Which spec version will be the one that has reputation v2 on Kusama?
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 had to bump spec version for rococo because the migration wouldn't be applied otherwise. I upgraded two RC's sequentially.
On kusama, 1002000 will be V2
On rococo, 1002000 was V1 1002001 is V2
As we will never see 1002000 on roc again, I think it is safe to assume
=1002000 => V2
The api infers the correct reputation type based on the runtime version's spec name and the spec version. If the chain doesn't support ReputationV2 yet, it will migrate fetched values to V2, where the linked index is going to be the current ceremony index. This essentially preserves the reputation v1 behavior, as any previously linked reputation can't be used again. Closes #1662.
Additionally, I regenerated the polkadart types, as it gave me the draft to use for the new reputation enum.
Tests: