Skip to content

Conversation

@mnaamani
Copy link
Member

Implements #243

@mnaamani mnaamani changed the title Content wg replace lead Add replace_lead() to content working group Mar 26, 2020
@mnaamani mnaamani requested a review from bedeho March 26, 2020 16:34

// Update next lead counter
<NextLeadId<T>>::mutate(|id| *id += <LeadId<T> as One>::one());

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, assert() can be replaced with "?" function invocation. Code reordering is required.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats a good point, I think this is the new convention we decided on. However here I avoided changing the implementation of set_lead and unset_lead I just relocated them and converted them from being dispatchables to be private methods on the Module.

I can update it not much extra work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in e4f57a2


let unregistered_role = <members::Module<T>>::unregister_role(current_lead_role).is_ok();

assert!(unregistered_role);
Copy link
Contributor

@shamil-gadelshin shamil-gadelshin Mar 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, assert() can be replaced with "?" function invocation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in e4f57a2

also drop call to can_register_role_on_member() it is called by register_role_on_member()
Copy link
Contributor

@shamil-gadelshin shamil-gadelshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shamil-gadelshin shamil-gadelshin merged commit f3ce4e2 into Joystream:development Mar 27, 2020
@mnaamani mnaamani deleted the content-wg-replace-lead branch May 21, 2020 16:20
bedeho pushed a commit that referenced this pull request May 29, 2020
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.

2 participants