Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
dlaciport committed Mar 7, 2025
1 parent f46aab8 commit 3d93354
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions margin/src/margin.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ pub mod Margin {
let token_symbol_u256: u256 = token_symbol.into();
let pair_id = BitShift::shl(token_symbol_u256, 4) + '/USD';

// oracle_dispatcher.get_asset_data(pair_id)
return mock_get_data_median(
1234, DataType::SpotEntry(pair_id.try_into().expect('pair id overflows')),
);
Expand Down
14 changes: 14 additions & 0 deletions margin/tests/test_pragma.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const DEPOSIT_MOCK_USER: felt252 =
0x0038925b0bcf4dce081042ca26a96300d9e181b910328db54a6c89e5451503f5;
const HYPOTHETICAL_OWNER_ADDR: felt252 =
0x059a943ca214c10234b9a3b61c558ac20c005127d183b86a99a8f3c60a08b4ff;

#[test]
fn test_pragma() {
let suite = setup_test_suite(HYPOTHETICAL_OWNER_ADDR.try_into().unwrap(), deploy_erc20_mock());

let margin_contract = suite.margin;

// No error
let _ = margin_contract.get_asset_data();
}

0 comments on commit 3d93354

Please sign in to comment.