Skip to content

Commit 449503b

Browse files
authored
fix: access control conversion rate (#143)
* fix: access control conversion rate * feat: get_data_median refactor
1 parent 794b864 commit 449503b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pragma-oracle/src/oracle/oracle.cairo

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,7 @@ mod Oracle {
487487
// @param data_type: an enum of DataType (e.g : DataType::SpotEntry(ASSET_ID) or DataType::FutureEntry((ASSSET_ID, expiration_timestamp)))
488488
// @returns a PragmaPricesResponse, a structure providing the main information for an asset (see entry/structs for details)
489489
fn get_data_median(self: @ContractState, data_type: DataType) -> PragmaPricesResponse {
490-
let sources = IOracleABI::get_all_sources(self, data_type);
491-
let prices_response: PragmaPricesResponse = IOracleABI::get_data_for_sources(
492-
self, data_type, AggregationMode::Median(()), sources
493-
);
494-
prices_response
490+
IOracleABI::get_data(self, data_type, AggregationMode::Median(()))
495491
}
496492

497493
// @notice aggregate the entries for specific sources, for a given data type, using MEDIAN as aggregation mode
@@ -1614,6 +1610,7 @@ mod Oracle {
16141610
// @notice add a new pair to the list of registered conversion rate pairs
16151611
// @param new_pair_id: the pair id to be added
16161612
fn add_registered_conversion_rate_pair(ref self: ContractState, new_pair_id: felt252) {
1613+
OracleInternal::assert_only_admin();
16171614
let mut registered_pairs = self.conversion_rate_compatible_pairs.read();
16181615
registered_pairs.append(new_pair_id);
16191616
}

0 commit comments

Comments
 (0)