seeds constants
This commit is contained in:
parent
230f98975a
commit
20184fdc48
|
|
@ -9,3 +9,14 @@ pub const FEE_COLLECTOR: &str= "9esrj2X33pr5og6fdkDMjaW6fdnnb9hT1cWshamxTdL4";
|
|||
#[constant]
|
||||
pub const TICKET_SALE_VAULT_ADDRESS: &str= "9esrj2X33pr5og6fdkDMjaW6fdnnb9hT1cWshamxTdL4";
|
||||
|
||||
#[constant]
|
||||
pub const RECEIPT_ACCOUNT_SEED: &[u8] = b"receipt_account";
|
||||
|
||||
#[constant]
|
||||
pub const TICKET_LEADERBOARD_LIST_SEED: &[u8] = b"ticket_leaderboards_list";
|
||||
|
||||
#[constant]
|
||||
pub const TICKET_LEADERBOARD_SEED: &[u8] = b"ticket_leaderboard";
|
||||
|
||||
#[constant]
|
||||
pub const LEADERBOARD_ENTRY_SEED: &[u8] = b"leaderboard_entry";
|
||||
|
|
@ -32,7 +32,7 @@ pub fn buy(ctx: Context<BuyTickets>, amount: u64) -> Result<()> {
|
|||
};
|
||||
|
||||
let seeds = &[
|
||||
b"ticket_leaderboards_list".as_ref(),
|
||||
TICKET_LEADERBOARD_LIST_SEED.as_ref(),
|
||||
&[ctx.bumps.ticket_leaderboard_list][..]
|
||||
];
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ pub struct BuyTickets<'info>{
|
|||
|
||||
#[account(
|
||||
mut,
|
||||
seeds = [b"ticket_leaderboards_list"],
|
||||
seeds = [TICKET_LEADERBOARD_LIST_SEED],
|
||||
bump
|
||||
)]
|
||||
pub ticket_leaderboard_list: Account<'info, TicketLeaderboardList>,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pub struct CreateLeaderboard<'info>{
|
|||
|
||||
#[account(
|
||||
mut,
|
||||
seeds = [b"ticket_leaderboards_list"],
|
||||
seeds = [TICKET_LEADERBOARD_LIST_SEED],
|
||||
bump
|
||||
)]
|
||||
pub ticket_leaderboard_list: Account<'info, TicketLeaderboardList>,
|
||||
|
|
@ -34,7 +34,7 @@ pub struct CreateLeaderboard<'info>{
|
|||
init,
|
||||
payer = payer,
|
||||
space = 8 + TicketLeaderboard::INIT_SPACE,
|
||||
seeds = [b"ticket_leaderboard", id.to_le_bytes().as_ref()],
|
||||
seeds = [TICKET_LEADERBOARD_SEED, id.to_le_bytes().as_ref()],
|
||||
bump
|
||||
)]
|
||||
pub ticket_leaderboard: Account<'info, TicketLeaderboard>,
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ pub struct EnterLeaderboard<'info>{
|
|||
|
||||
#[account(
|
||||
mut,
|
||||
seeds = [b"ticket_leaderboard", id.to_le_bytes().as_ref()],
|
||||
seeds = [TICKET_LEADERBOARD_SEED, id.to_le_bytes().as_ref()],
|
||||
bump
|
||||
)]
|
||||
pub ticket_leaderboard: Account<'info, TicketLeaderboard>,
|
||||
|
|
@ -45,8 +45,8 @@ pub struct EnterLeaderboard<'info>{
|
|||
init_if_needed,
|
||||
payer= payer,
|
||||
space = 8 + TicketReceiptVault::INIT_SPACE,
|
||||
seeds = [b"receipt", payer.key().as_ref()],
|
||||
bump
|
||||
seeds = [RECEIPT_ACCOUNT_SEED, payer.key().as_ref()],
|
||||
bump,
|
||||
)]
|
||||
pub receipt_account: Account<'info, TicketReceiptVault>,
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ pub struct InitLeaderboardList<'info>{
|
|||
init,
|
||||
payer = payer,
|
||||
space = 8 + TicketLeaderboardList::INIT_SPACE,
|
||||
seeds = [b"ticket_leaderboards_list"],
|
||||
seeds = [TICKET_LEADERBOARD_LIST_SEED],
|
||||
bump
|
||||
)]
|
||||
pub ticket_leaderboard_list: Account<'info, TicketLeaderboardList>,
|
||||
|
|
|
|||
|
|
@ -21,14 +21,14 @@ pub struct RemoveLeaderboard<'info>{
|
|||
|
||||
#[account(
|
||||
mut,
|
||||
seeds = [b"ticket_leaderboards_list"],
|
||||
seeds = [TICKET_LEADERBOARD_LIST_SEED],
|
||||
bump
|
||||
)]
|
||||
pub ticket_leaderboard_list: Account<'info, TicketLeaderboardList>,
|
||||
|
||||
#[account(
|
||||
mut,
|
||||
seeds = [b"ticket_leaderboard", id.to_le_bytes().as_ref()],
|
||||
seeds = [TICKET_LEADERBOARD_SEED, id.to_le_bytes().as_ref()],
|
||||
bump
|
||||
)]
|
||||
pub ticket_leaderboard: Account<'info, TicketLeaderboard>,
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ pub struct UpdateLeaderboard<'info>{
|
|||
|
||||
#[account(
|
||||
mut,
|
||||
seeds = [b"ticket_leaderboard", id.to_le_bytes().as_ref()],
|
||||
seeds = [TICKET_LEADERBOARD_SEED, id.to_le_bytes().as_ref()],
|
||||
bump
|
||||
)]
|
||||
pub ticket_leaderboard: Account<'info, TicketLeaderboard>,
|
||||
|
|
@ -51,14 +51,14 @@ pub struct UpdateLeaderboard<'info>{
|
|||
init_if_needed,
|
||||
payer= payer,
|
||||
space = 8 + LeaderboardEntry::INIT_SPACE,
|
||||
seeds = [b"leaderboard_entry", ticket_leaderboard.key().as_ref(), player.as_ref()],
|
||||
seeds = [LEADERBOARD_ENTRY_SEED, ticket_leaderboard.key().as_ref(), player.as_ref()],
|
||||
bump
|
||||
)]
|
||||
pub leaderboard_entry: Account<'info, LeaderboardEntry>,
|
||||
|
||||
#[account(
|
||||
mut,
|
||||
seeds = [b"receipt", player.as_ref()],
|
||||
seeds = [RECEIPT_ACCOUNT_SEED, player.as_ref()],
|
||||
bump
|
||||
)]
|
||||
pub receipt_account: Account<'info, TicketReceiptVault>,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user