Skip to content

Commit

Permalink
Try & hotfix compilation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
adrena-orex committed Aug 20, 2024
1 parent 2792067 commit 37c636c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions programs/thread/src/instructions/thread_kickoff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,14 @@ pub fn handler(ctx: Context<ThreadKickoff>) -> Result<()> {
// PriceUpdateV2::try_deserialize(&mut account_info.data.borrow().as_ref())?;

let data: &[u8] = &account_info.data.borrow()[8..];
let price_update: PriceUpdateV2 = AnchorDeserialize::try_from_slice(data)
.map_err(|_| SablierError::InvalidOracleAccount)?;
let price_update_maybe: std::result::Result<PriceUpdateV2, std::io::Error> =
AnchorDeserialize::try_from_slice(data);

if price_update_maybe.is_err() {
return Err(SablierError::InvalidOracleAccount.into());
}

let price_update = price_update_maybe.unwrap();

let current_price = price_update.get_price_no_older_than(
&Clock::get()?,
Expand Down

0 comments on commit 37c636c

Please sign in to comment.