carbon_points_decoder/instructions/
increment_level.rs

1use super::super::types::*;
2
3use carbon_core::{CarbonDeserialize, account_utils::next_account, borsh};
4
5#[derive(
6    CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
7)]
8#[carbon(discriminator = "0x5d5ce968d27495c4")]
9pub struct IncrementLevel {
10    pub input: IncrementLevelInput,
11}
12
13#[derive(Debug, PartialEq, Eq, Clone, Hash, serde::Serialize, serde::Deserialize)]
14pub struct IncrementLevelInstructionAccounts {
15    pub category: solana_pubkey::Pubkey,
16    pub user_points_account: solana_pubkey::Pubkey,
17    pub points_modifier_account: solana_pubkey::Pubkey,
18}
19
20impl carbon_core::deserialize::ArrangeAccounts for IncrementLevel {
21    type ArrangedAccounts = IncrementLevelInstructionAccounts;
22
23    fn arrange_accounts(
24        accounts: &[solana_instruction::AccountMeta],
25    ) -> Option<Self::ArrangedAccounts> {
26        let mut iter = accounts.iter();
27        let category = next_account(&mut iter)?;
28        let user_points_account = next_account(&mut iter)?;
29        let points_modifier_account = next_account(&mut iter)?;
30
31        Some(IncrementLevelInstructionAccounts {
32            category,
33            user_points_account,
34            points_modifier_account,
35        })
36    }
37}