Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

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 4dc5b48 commit d2916be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion token-group/example/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Crate defining an example program for creating SPL token collections
//! Crate defining an example program for creating SPL token groups
//! using the SPL Token Group interface.
#![deny(missing_docs)]
Expand Down
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 d2916be

Please sign in to comment.