Skip to main content

carbon_stake_program_decoder/instructions/
redelegate.rs

1//! This code was AUTOGENERATED using the Codama library.
2use carbon_core::deserialize::ArrangeAccounts;
3#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4#[derive(Debug, Clone, borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq)]
5pub struct Redelegate {}
6
7#[derive(Debug, Clone, PartialEq)]
8#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9pub struct RedelegateInstructionAccounts {}
10
11impl Redelegate {
12    pub fn decode(data: &[u8]) -> Option<Self> {
13        if data.is_empty() {
14            return None;
15        }
16        let discriminator = &data[0..1];
17        if discriminator != [15] {
18            return None;
19        }
20
21        let mut data_slice = data;
22
23        data_slice = &data_slice[1..];
24
25        borsh::BorshDeserialize::deserialize(&mut data_slice).ok()
26    }
27}
28
29impl ArrangeAccounts for Redelegate {
30    type ArrangedAccounts = RedelegateInstructionAccounts;
31
32    fn arrange_accounts(
33        _accounts: &[solana_instruction::AccountMeta],
34    ) -> Option<Self::ArrangedAccounts> {
35        Some(RedelegateInstructionAccounts {})
36    }
37}