Skip to content
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

Generalize PostReaction #763

Closed
bedeho opened this issue Jan 22, 2020 · 1 comment
Closed

Generalize PostReaction #763

bedeho opened this issue Jan 22, 2020 · 1 comment

Comments

@bedeho
Copy link
Member

bedeho commented Jan 22, 2020

Currently, we have

pub enum PostReaction {
    /// No any reaction
    NonReacton,

    /// Thumb up to a post
    ThumbUp,

    /// Thumb down to a post
    ThumbDown,

    /// Like a post
    Like,
}

Now, if anyone wanted to replace the application-level semantics of either variant to something else, such as Like to Hate, then they would either have to accept a naming conflict with the runtime or fork the module. More importantly, if they wanted to increase the number of reaction types, they would have to fork the module. We can treat this a bit more generally by just having the reaction encoded as some integer like type, and accept the number of different reactions accepted as a trait configuration for the module. This would allow for forkless customization without any penalty in clarity of performance.

@bedeho bedeho transferred this issue from Joystream/substrate-forum-module Jun 23, 2020
@bedeho
Copy link
Member Author

bedeho commented Sep 16, 2020

Done.

@bedeho bedeho closed this as completed Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant