carbon-pump-swap-decoder 1.0.0

PumpSwap Decoder
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! This code was AUTOGENERATED using the Codama library.
#[derive(Debug, Clone, Copy, PartialEq, borsh::BorshSerialize)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
pub struct OptionBool(pub bool);

impl borsh::BorshDeserialize for OptionBool {
    fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
        let mut buf = [0u8; 1];
        match reader.read(&mut buf)? {
            0 => Ok(OptionBool(false)),
            _ => Ok(OptionBool(buf[0] != 0)),
        }
    }
}