Skip to content

Commit

Permalink
fix set prices in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sparqet committed May 4, 2024
1 parent 45ed156 commit 756a3d5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
7 changes: 5 additions & 2 deletions tests/integration/swap_test.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ fn test_deposit_market_integration() {
keys::max_pool_amount_key(market.market_token, market.short_token), 500000000000000000
);

oracle.set_price_testing_eth(5000);
oracle.set_primary_prices(market.long_token, 5000);
oracle.set_primary_prices(market.short_token, 1);

// Fill the pool.
IERC20Dispatcher { contract_address: market.long_token }.mint(market.market_token, 50000000000);
IERC20Dispatcher { contract_address: market.short_token }
Expand Down Expand Up @@ -427,7 +429,8 @@ fn test_swap_18_deposit_market_integration() {
2500000000000000000000000000000000000000000000
);

oracle.set_price_testing_eth(5000);
oracle.set_primary_prices(market.long_token, 5000);
oracle.set_primary_prices(market.short_token, 1);

'fill the pool'.print();
// Fill the pool.
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/test_deposit_withdrawal.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ fn test_deposit_market_integration() {
keys::max_pool_amount_key(market.market_token, market.short_token), 500000000000000000
);

oracle.set_price_testing_eth(5000);
oracle.set_primary_prices(market.long_token, 5000);
oracle.set_primary_prices(market.short_token, 1);

// Fill the pool.
IERC20Dispatcher { contract_address: market.long_token }.mint(market.market_token, 50000000000);
Expand Down Expand Up @@ -685,7 +686,8 @@ fn test_deposit_withdraw_integration() {
keys::max_pool_amount_key(market.market_token, market.short_token), 500000000000000000
);

oracle.set_price_testing_eth(5000);
oracle.set_primary_prices(market.long_token, 5000);
oracle.set_primary_prices(market.short_token, 1);

// Fill the pool.
IERC20Dispatcher { contract_address: market.long_token }.mint(market.market_token, 50000000000);
Expand Down
10 changes: 6 additions & 4 deletions tests/integration/test_long_integration.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const INITIAL_TOKENS_MINTED: felt252 = 1000;
// keys::max_pool_amount_key(market.market_token, market.short_token), 500000000000000000
// );

// oracle.set_price_testing_eth(5000);
// oracle.set_primary_prices(market.long_token, 5000);

// // Fill the pool.
// IERC20Dispatcher { contract_address: market.long_token }.mint(market.market_token, 50000000000);
Expand Down Expand Up @@ -382,7 +382,8 @@ const INITIAL_TOKENS_MINTED: felt252 = 1000;
// .balance_of(caller_address);
// 'balance of mkt before'.print();
// balance_of_mkt_before.print();
// oracle.set_price_testing_eth(6000);
// oracle.set_primary_prices(market.long_token, 6000);


// start_prank(market.market_token, caller_address);
// start_prank(market.long_token, caller_address);
Expand Down Expand Up @@ -527,7 +528,8 @@ fn test_long_decimals_market_integration() {
50000000000000000000000000000000000000000000000
);

oracle.set_price_testing_eth(5000);
oracle.set_primary_prices(market.long_token, 5000);
oracle.set_primary_prices(market.short_token, 1);

'fill the pool'.print();
// Fill the pool.
Expand Down Expand Up @@ -788,7 +790,7 @@ fn test_long_decimals_market_integration() {
'size in usd'.print();
first_position.size_in_usd.print();
'OKAAAAAYYYYYY'.print();
oracle.set_price_testing_eth(6000);
oracle.set_primary_prices(market.long_token, 6000);
let first_position_after_pump = data_store.get_position(position_key_1);
'size tokens after pump'.print();
first_position_after_pump.size_in_tokens.print();
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/test_short_integration.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ fn test_short_market_integration() {
keys::max_pool_amount_key(market.market_token, market.short_token), 500000000000000000
);

oracle.set_price_testing_eth(5000);
oracle.set_primary_prices(market.long_token, 5000);
oracle.set_primary_prices(market.short_token, 1);

// Fill the pool.
IERC20Dispatcher { contract_address: market.long_token }.mint(market.market_token, 50000000000);
Expand Down

0 comments on commit 756a3d5

Please sign in to comment.