gpl_core/state/post.rs
1use anchor_lang::prelude::*;
2
3pub const MAX_LEN_URI: usize = 128;
4
5#[account]
6#[derive(Default, Debug)]
7pub struct Post {
8 pub profile: Pubkey,
9 pub metadata_uri: String,
10 pub random_hash: [u8; 32],
11
12 //Comments are just replies
13 pub reply_to: Option<Pubkey>,
14}
15
16impl Post {
17 pub const LEN: usize = 8 + 32 + std::mem::size_of::<Self>() + MAX_LEN_URI;
18}