Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dev0xstar committed Jun 10, 2024
1 parent 2e0dd74 commit 8eea6fd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions stable-swap-anchor/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,12 @@ impl anchor_lang::AccountSerialize for SwapInfo {
}
}

impl anchor_lang::AccountDeserialize for SwapInfo {
fn try_deserialize(buf: &mut &[u8]) -> Result<Self> {
SwapInfo::try_deserialize_unchecked(buf)
}

fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self> {
Ok(stable_swap_client::state::SwapInfo::unpack(buf).map(SwapInfo)?)
}
}

0 comments on commit 8eea6fd

Please sign in to comment.