Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
uint committed Nov 15, 2023
1 parent 1dfb124 commit 3f5759f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contracts/consumer/remote-price-feed/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ pub struct RemotePriceFeedContract {
pub scheduler: Scheduler<Box<dyn Action>>,
}

impl Default for RemotePriceFeedContract {
fn default() -> Self {
Self::new()
}
}

#[cfg_attr(not(feature = "library"), sylvia::entry_points)]
#[contract]
#[error(ContractError)]
Expand All @@ -37,7 +43,7 @@ impl RemotePriceFeedContract {
price_info: Item::new("price"),
price_info_ttl_in_secs: Item::new("price_ttl"),
// TODO: the indirection can be removed once Sylvia supports
// generics
// generics. The constructor can then probably be constant
scheduler: Scheduler::new(Box::new(handle_epoch)),
}
}
Expand Down
1 change: 1 addition & 0 deletions contracts/consumer/remote-price-feed/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ mod tests {
assert_fired(&scheduler, deps.as_mut(), &env);
env.block.time = env.block.time.plus_seconds(5);
assert_noop(&scheduler, deps.as_mut(), &env);
assert_noop(&scheduler, deps.as_mut(), &env);
env.block.time = env.block.time.plus_seconds(5);
assert_fired(&scheduler, deps.as_mut(), &env);
}
Expand Down

0 comments on commit 3f5759f

Please sign in to comment.