carbon_system_program_decoder/instructions/
allocate.rs1use carbon_core::{borsh, CarbonDeserialize};
2#[derive(
3 CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
4)]
5#[carbon(discriminator = "0x08")]
6pub struct Allocate {
7 pub space: u64,
8}
9
10pub struct AllocateAccounts {
11 pub new_account: solana_sdk::pubkey::Pubkey,
12}
13
14impl carbon_core::deserialize::ArrangeAccounts for Allocate {
15 type ArrangedAccounts = AllocateAccounts;
16
17 fn arrange_accounts(
18 accounts: &[solana_sdk::instruction::AccountMeta],
19 ) -> Option<Self::ArrangedAccounts> {
20 let new_account = accounts.first()?;
21
22 Some(AllocateAccounts {
23 new_account: new_account.pubkey,
24 })
25 }
26}