Skip to content

Commit

Permalink
Test/fix cairo format (#634)
Browse files Browse the repository at this point in the history
fix cairo format
  • Loading branch information
sparqet authored Mar 23, 2024
1 parent 6b3ebe6 commit 9d85b40
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
23 changes: 11 additions & 12 deletions src/withdrawal/withdrawal_utils.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,16 @@ fn execute_withdrawal(

params.event_emitter.emit_withdrawal_executed(params.key);
'emit event withdrawal executed'.print();

// TODO fix pay execution fees
// gas_utils::pay_execution_fee_withdrawal(
// params.data_store,
// params.event_emitter,
// params.withdrawal_vault,
// withdrawal.execution_fee,
// params.starting_gas,
// params.keeper,
// withdrawal.account
// )
// TODO fix pay execution fees
// gas_utils::pay_execution_fee_withdrawal(
// params.data_store,
// params.event_emitter,
// params.withdrawal_vault,
// withdrawal.execution_fee,
// params.starting_gas,
// params.keeper,
// withdrawal.account
// )
}

/// Cancel a withdrawal.
Expand Down Expand Up @@ -464,7 +463,7 @@ fn execute_withdrawal_(
// if the native token was transferred to the receiver in a swap
// it may be possible to invoke external contracts before the validations are called
market_utils::validate_market_token_balance_check(*params.data_store, market);

result
}

Expand Down
18 changes: 12 additions & 6 deletions tests/integration/create_market.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ use satoru::deposit::deposit_vault::{IDepositVaultDispatcher, IDepositVaultDispa
use satoru::deposit::deposit::Deposit;
use satoru::withdrawal::withdrawal::Withdrawal;

use satoru::exchange::withdrawal_handler::{IWithdrawalHandlerDispatcher, IWithdrawalHandlerDispatcherTrait};
use satoru::exchange::withdrawal_handler::{
IWithdrawalHandlerDispatcher, IWithdrawalHandlerDispatcherTrait
};
use satoru::exchange::deposit_handler::{IDepositHandlerDispatcher, IDepositHandlerDispatcherTrait};
use satoru::router::exchange_router::{IExchangeRouterDispatcher, IExchangeRouterDispatcherTrait};
use satoru::mock::referral_storage::{IReferralStorageDispatcher, IReferralStorageDispatcherTrait};
Expand All @@ -40,7 +42,9 @@ use satoru::bank::bank::{IBankDispatcherTrait, IBankDispatcher};
use satoru::bank::strict_bank::{IStrictBankDispatcher, IStrictBankDispatcherTrait};
use satoru::token::erc20::interface::{IERC20Dispatcher, IERC20DispatcherTrait};
use satoru::oracle::oracle::{IOracleDispatcher, IOracleDispatcherTrait};
use satoru::withdrawal::withdrawal_vault::{IWithdrawalVaultDispatcher, IWithdrawalVaultDispatcherTrait};
use satoru::withdrawal::withdrawal_vault::{
IWithdrawalVaultDispatcher, IWithdrawalVaultDispatcherTrait
};
use satoru::data::keys;
use satoru::market::market_utils;
use satoru::price::price::{Price, PriceTrait};
Expand Down Expand Up @@ -606,7 +610,6 @@ fn test_deposit_market_integration() {

// let market_token_dispatcher = IMarketTokenDispatcher { contract_address: market.market_token };


// let balance = market_token_dispatcher.balance_of(user1);

let balance_deposit_vault = IERC20Dispatcher { contract_address: market.short_token }
Expand Down Expand Up @@ -886,7 +889,6 @@ fn test_deposit_withdraw_integration() {
start_roll(withdrawal_handler.contract_address, 1935);
withdrawal_handler.execute_withdrawal(key, price_params_withdrawal);


let not_withdrawal = data_store.get_withdrawal(key);
let default_withdrawal: Withdrawal = Default::default();
assert(not_withdrawal == default_withdrawal, 'Still existing deposit');
Expand Down Expand Up @@ -1820,8 +1822,12 @@ fn setup_contracts() -> (

let referal_storage = IReferralStorageDispatcher { contract_address: referral_storage_address };

let withdrawal_handler = IWithdrawalHandlerDispatcher { contract_address: withdrawal_handler_address };
let withdrawal_vault = IWithdrawalVaultDispatcher { contract_address: withdrawal_vault_address };
let withdrawal_handler = IWithdrawalHandlerDispatcher {
contract_address: withdrawal_handler_address
};
let withdrawal_vault = IWithdrawalVaultDispatcher {
contract_address: withdrawal_vault_address
};
(
contract_address_const::<'caller'>(),
market_factory_address,
Expand Down

0 comments on commit 9d85b40

Please sign in to comment.