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

feature: integrate publication contract with community & channel cont… #130

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

codeWhizperer
Copy link
Collaborator

…ract

jolt_type: JoltType::Tip,
recipient: profile_address,
memo: "Tip User",
amount: current_tip_amount + amount,
Copy link
Collaborator

Choose a reason for hiding this comment

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

mentioned this earlier, but the amount should be just amount. there's no need to add anything here.

> of IKarstPublications<ComponentState<TContractState>> {
// *************************************************************************
// PUBLISHING FUNCTIONS
// *************************************************************************
/// @notice performs post action
/// @param contentURI uri of the content to be posted
/// @param profile_address address of profile performing the post action
fn post(ref self: ComponentState<TContractState>, post_params: PostParams) -> u256 {
fn post(ref self: ComponentState<TContractState>, mut post_params: PostParams) -> u256 {
// Initialize approval flag as false
Copy link
Collaborator

Choose a reason for hiding this comment

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

after a few more research, it will be easier for us to make pub id unique from the get go, tying it to the profile address is not the most scalable approach. Let's just have a publication counter and increase it anytime a post, comment, repost is made

ref self: ComponentState<TContractState>,
profile_address: ContractAddress,
pub_id: u256,
channel_id: u256,
Copy link
Collaborator

Choose a reason for hiding this comment

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

you don't need to pass in the channel and community id, as these are already stored in the publication struct. retrieve the publication using the pub id and get the channel id and community id from there

profile_address: ContractAddress,
pub_id: u256,
channel_id: u256,
Copy link
Collaborator

Choose a reason for hiding this comment

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

get these ids from the publication struct

@Darlington02 Darlington02 merged commit 12ee6ff into main Oct 24, 2024
4 checks passed
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