Skip to content

Commit

Permalink
fix chainlink feed (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaviderb authored Aug 5, 2022
1 parent 8bf82d1 commit b941666
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion programs/oracle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub mod oracle {
pub fn create_oracle(ctx: Context<CreateOracle>, _oracle_id: i64) -> Result<()> {
let timestamp = Clock::get()?.unix_timestamp;
ctx.accounts.oracle_item.authority = ctx.accounts.oracle_authorizer.key();
ctx.accounts.oracle_item.chainlink_feed = ctx.accounts.feed_account.key();
ctx.accounts.oracle_item.started_at = timestamp;
ctx.accounts.oracle_item.closed_at =
timestamp + ctx.accounts.oracle_authorizer.closed_seconds;
Expand Down Expand Up @@ -57,7 +58,7 @@ pub mod oracle {
return err!(Errors::OracleExpired);
}

if oracle_item.closed_at > timestamp {
if oracle_item.finished_at > timestamp {
return err!(Errors::TimeInvalid);
}

Expand Down

0 comments on commit b941666

Please sign in to comment.