Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions crates/parser/src/token_program/account_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ pub enum TokenProgramState {
impl TokenProgramState {
pub fn try_unpack(data_bytes: &[u8]) -> ParseResult<Self> {
let acc = match data_bytes.len() {
Mint::LEN => Mint::unpack(data_bytes).map(Self::Mint).map_err(Into::into),
Account::LEN => Account::unpack(data_bytes)
Mint::LEN => Mint::unpack_from_slice(data_bytes).map(Self::Mint).map_err(Into::into),
Account::LEN => Account::unpack_from_slice(data_bytes)
.map(Self::TokenAccount)
.map_err(Into::into),
Multisig::LEN => Multisig::unpack(data_bytes)
Multisig::LEN => Multisig::unpack_from_slice(data_bytes)
.map(Self::Multisig)
.map_err(Into::into),
_ => Err(ParseError::from("Invalid Account data length".to_owned())),
_ => return Err(ParseError::Filtered)
};

#[cfg(feature = "tracing")]
Expand Down Expand Up @@ -172,4 +172,4 @@ mod tests {

assert_eq!(mint.decimals, 10);
}
}
}
Loading