Skip to content

Commit

Permalink
Final refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ebma committed Sep 7, 2023
1 parent 760e28d commit c2d84b1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion pallets/oracle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ impl<T: Config> Pallet<T> {
let Some(price) = price else{
continue;
};
// Here, no outdated values are found although one price should be expired in the test
let is_outdated = current_time > price.timestamp + max_delay;
if !is_outdated {
updated_items.push((key.clone(), price.value));
Expand Down
4 changes: 2 additions & 2 deletions pallets/oracle/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ mod oracle_offline_detection {
Oracle::get_max_delay.mock_safe(move || MockResult::Return(10));

set_time(0);
feed_value_with_value(CurrencyId::XCM(0), OracleA, 3);
feed_value(CurrencyId::XCM(0), OracleA);
assert_eq!(SecurityPallet::parachain_status(), StatusCode::Running);

set_time(5);
feed_value(CurrencyId::XCM(1), OracleA);

set_time(7);
feed_value_with_value(CurrencyId::XCM(0), OracleB, 2);
feed_value(CurrencyId::XCM(0), OracleB);

// OracleA's DOT submission expires at 10, but OracleB's only at 17. However, KSM
// expires at 15:
Expand Down
6 changes: 0 additions & 6 deletions pallets/vault-registry/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,6 @@ where
UnsignedFixedPoint::one(),
)
.unwrap();
<oracle::Pallet<Test>>::_set_exchange_rate(
1,
DEFAULT_NATIVE_CURRENCY,
UnsignedFixedPoint::one(),
)
.unwrap();
test();
});

Expand Down

0 comments on commit c2d84b1

Please sign in to comment.