diff --git a/mock-sep-40/src/storage.rs b/mock-sep-40/src/storage.rs index 27691f9..c0e9a38 100644 --- a/mock-sep-40/src/storage.rs +++ b/mock-sep-40/src/storage.rs @@ -1,14 +1,11 @@ use sep_40_oracle::Asset; -use soroban_sdk::{ - panic_with_error, unwrap::UnwrapOptimized, Address, Env, Symbol, Vec, -}; +use soroban_sdk::{panic_with_error, unwrap::UnwrapOptimized, Address, Env, Symbol, Vec}; use crate::error::PriceOracleError; pub(crate) const LEDGER_THRESHOLD: u32 = 120960; // 7 days at 5s a block pub(crate) const LEDGER_BUMP: u32 = 138240; // 8 days at 5s a block - pub fn bump_instance(env: &Env) { env.storage().instance().bump(LEDGER_THRESHOLD, LEDGER_BUMP); } diff --git a/mock-sep-40/src/test.rs b/mock-sep-40/src/test.rs index 585e5ba..5224356 100644 --- a/mock-sep-40/src/test.rs +++ b/mock-sep-40/src/test.rs @@ -1,7 +1,10 @@ #![cfg(test)] use sep_40_oracle::Asset; -use soroban_sdk::{testutils::{Address as _, Ledger, LedgerInfo}, Address, Env, Vec, vec, Symbol}; +use soroban_sdk::{ + testutils::{Address as _, Ledger, LedgerInfo}, + vec, Address, Env, Symbol, Vec, +}; use super::*; @@ -20,7 +23,6 @@ fn setup_price_feed_oracle<'a>( (oracle_id, oracle_client) } - #[test] fn test_stable_price_feed() { let env = Env::default(); @@ -55,7 +57,7 @@ fn test_stable_price_feed() { let prices: Vec = vec![&env, 94_234_1234567, 1_1021304]; oracle_client.set_price_stable(&prices); - // verify price data can be fetched + // verify price data can be fetched let price_1 = oracle_client.lastprice(&asset_1).unwrap(); assert_eq!(price_1.price, prices.get_unchecked(0)); assert_eq!(price_1.timestamp, start_time); @@ -120,7 +122,7 @@ fn test_price_feed() { let prices_1: Vec = vec![&env, 94_234_1234567, 1_1021304]; oracle_client.set_price(&prices_1, &start_time); - // verify price data can be fetched + // verify price data can be fetched let result_1 = oracle_client.lastprice(&asset_1).unwrap(); assert_eq!(result_1.price, prices_1.get_unchecked(0)); assert_eq!(result_1.timestamp, start_time); @@ -190,4 +192,4 @@ fn test_price_feed() { let result_2_1 = result_2_vec.get_unchecked(1); assert_eq!(result_2_1.price, prices_1.get_unchecked(1)); assert_eq!(result_2_1.timestamp, start_time); -} \ No newline at end of file +} diff --git a/sep-40/src/testutils/mod.rs b/sep-40/src/testutils/mod.rs index 2424c2a..2423032 100644 --- a/sep-40/src/testutils/mod.rs +++ b/sep-40/src/testutils/mod.rs @@ -2,4 +2,7 @@ mod wasm { soroban_sdk::contractimport!(file = "./src/testutils/mock_sep_40_oracle.wasm"); } -pub use wasm::{Client as MockPriceOracleClient, Contract as MockPriceOracle, PriceOracleError, WASM as MockPriceOracleWASM}; \ No newline at end of file +pub use wasm::{ + Asset, Client as MockPriceOracleClient, Contract as MockPriceOracle, PriceOracleError, + WASM as MockPriceOracleWASM, +};