Skip to content

Commit

Permalink
fix: admin initializer (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 authored Aug 10, 2023
1 parent 2293433 commit cab53f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/oracle/oracle.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,12 @@ mod Oracle {
#[constructor]
fn constructor(
ref self: ContractState,
admin_address: ContractAddress,
publisher_registry_address: ContractAddress,
currencies: Span<Currency>,
pairs: Span<Pair>
) {
self.set_admin_address(admin_address);
self.oracle_publisher_registry_address_storage.write(publisher_registry_address);
self._set_keys_currencies(currencies);
self._set_keys_pairs(pairs);
Expand Down
3 changes: 2 additions & 1 deletion src/tests/test_oracle.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn setup() -> (IPublisherRegistryABIDispatcher, IOracleABIDispatcher) {
);

let admin = contract_address_const::<0x123456789>();
set_caller_address(admin);
set_contract_address(admin);
set_block_timestamp(BLOCK_TIMESTAMP);
set_chain_id(CHAIN_ID);
let now = 100000;
Expand All @@ -144,6 +144,7 @@ fn setup() -> (IPublisherRegistryABIDispatcher, IOracleABIDispatcher) {

//Deploy the oracle
let mut oracle_calldata = ArrayTrait::<felt252>::new();
admin.serialize(ref oracle_calldata);
publisher_registry_address.serialize(ref oracle_calldata);
currencies.serialize(ref oracle_calldata);
pairs.serialize(ref oracle_calldata);
Expand Down
3 changes: 2 additions & 1 deletion src/tests/test_summary_stats.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn setup() -> (ISummaryStatsABIDispatcher, IOracleABIDispatcher) {
);

let admin = contract_address_const::<0x123456789>();
set_caller_address(admin);
set_contract_address(admin);
set_block_timestamp(BLOCK_TIMESTAMP);
set_chain_id(CHAIN_ID);
let now = 100000;
Expand All @@ -124,6 +124,7 @@ fn setup() -> (ISummaryStatsABIDispatcher, IOracleABIDispatcher) {

//Deploy the oracle
let mut oracle_calldata = ArrayTrait::<felt252>::new();
admin.serialize(ref oracle_calldata);
publisher_registry_address.serialize(ref oracle_calldata);
currencies.serialize(ref oracle_calldata);
pairs.serialize(ref oracle_calldata);
Expand Down

0 comments on commit cab53f7

Please sign in to comment.