Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit/minor changes #48

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions src/oracle/oracle.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,6 @@ mod Oracle {
aggregation_mode: AggregationMode,
sources: Span<felt252>
) -> PragmaPricesResponse {
let mut entries = ArrayTrait::<PossibleEntries>::new();

let (entries, last_updated_timestamp) = IOracleABI::get_data_entries_for_sources(
self, data_type, sources
);
Expand Down Expand Up @@ -1960,16 +1958,6 @@ mod Oracle {
return ();
}

// @notice add pair to the oracle, admin checkup done in the implementation
// @param pair: new pair to be added
fn add_pair(ref self: ContractState, pair: Pair) {
EvolveArt marked this conversation as resolved.
Show resolved Hide resolved
let check_pair = self.oracle_pairs_storage.read(pair.id);
assert(check_pair.id == 0, 'Pair with this key registered');
self.emit(Event::SubmittedPair(SubmittedPair { pair }));
self.oracle_pairs_storage.write(pair.id, pair);
self.oracle_pair_id_storage.write((pair.quote_currency_id, pair.base_currency_id), pair.id);
return ();
}

// @notice set source threshold
// @param the threshold to be set
Expand Down Expand Up @@ -2121,9 +2109,7 @@ mod Oracle {
}
match data_type {
DataType::SpotEntry(pair_id) => {
let new_source = self
.oracle_sources_storage
.read((pair_id, SPOT, idx.into(), 0));
let new_source = self.oracle_sources_storage.read((pair_id, SPOT, idx, 0));

sources.append(new_source);
},
Expand All @@ -2132,13 +2118,11 @@ mod Oracle {
)) => {
let new_source = self
.oracle_sources_storage
.read((pair_id, FUTURE, idx.into(), expiration_timestamp));
.read((pair_id, FUTURE, idx, expiration_timestamp));
sources.append(new_source);
},
DataType::GenericEntry(key) => {
let new_source = self
.oracle_sources_storage
.read((key, GENERIC, idx.into(), 0));
let new_source = self.oracle_sources_storage.read((key, GENERIC, idx, 0));
sources.append(new_source);
}
}
Expand Down
Loading