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 20, 2023
1 parent e284686 commit 2ce7dd4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions token-group/example/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ 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)?;
// 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>(false)?;
*member = TokenGroupMember::new(member_mint_info.key, group_info.key, member_number);

Expand Down

0 comments on commit 2ce7dd4

Please sign in to comment.