Skip to content

Commit

Permalink
add multi-group comment
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Oct 19, 2023
1 parent 4dc5b48 commit c2a8050
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion token-group/example/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ pub fn process_initialize_member(_program_id: &Pubkey, accounts: &[AccountInfo])
// Allocate a TLV entry for the space and write it in
let mut buffer = member_info.try_borrow_mut_data()?;
let mut state = TlvStateMut::unpack(&mut buffer)?;
let (member, _) = state.init_value::<TokenGroupMember>(false)?;
// Note if `allow_repetition: true` is instead used here, one can initialize
// the same token as a member of multiple groups!
let (member, _) = state.init_value::<TokenGroupMember>(/* allow_repetition */ false)?;
*member = TokenGroupMember::new(*group_info.key, member_number);

Ok(())
Expand Down

0 comments on commit c2a8050

Please sign in to comment.