uid for receipt

This commit is contained in:
Sewmina Dilshan 2025-07-29 15:28:51 +05:30
parent 9c17c33e35
commit 230f98975a
2 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,7 @@ pub fn update(ctx: Context<UpdateLeaderboard>, id:u64, player:Pubkey, new_score:
leaderboard.players.push(player); leaderboard.players.push(player);
} }
leaderboard_entry.uid = receipt.uid.clone();
receipt.active = false; receipt.active = false;
msg!("Successfully updated leaderboard with score: {}", new_score); msg!("Successfully updated leaderboard with score: {}", new_score);

View File

@ -4,7 +4,8 @@ use crate::*;
#[account] #[account]
#[derive(InitSpace)] #[derive(InitSpace)]
pub struct LeaderboardEntry{ pub struct LeaderboardEntry{
pub owner: Pubkey, #[max_len(50)]
pub uid: String,
pub highscore: u64, pub highscore: u64,
pub total_tickets: u64 pub total_tickets: u64
} }