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

Add "to do" tests #307

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add "to do" tests #307

wants to merge 4 commits into from

Conversation

MattPoblete
Copy link
Collaborator

This PR implements all to-do tests:

  • test::vault::deposit_and_invest::one_asset_several_strategies
  • test::vault::deposit_and_invest::deposit_simple_then_deposit_and_invest
  • test::vault::get_asset_amounts_per_shares::deposit_and_invest_several_assets_get_asset_amounts_per_shares
  • test::vault::withdraw::from_strategies_one_asset_two_strategies_success
  • test::vault::withdraw::from_strategy_success_no_mock_all_auths
  • test::vault::initialize::with_one_asset_and_several_strategies
  • test::vault::invest::one_asset_several_strategies

Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
defindex-dapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 0:48am
defindex-landing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 0:48am
defindex-rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 0:48am

@MattPoblete MattPoblete linked an issue Dec 16, 2024 that may be closed by this pull request
6 tasks
let invested_funds = defindex_contract.fetch_current_invested_funds().get(test.token0.address.clone()).unwrap();
let idle_funds = defindex_contract.fetch_current_idle_funds().get(test.token0.address.clone()).unwrap();
assert_eq!(invested_funds, (amount_to_invest * 4));
assert_eq!(idle_funds, deposit_amount - (amount_to_invest * 4));


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a deposit(,,_,true) here


assert_eq!(invested_funds, total_invested);
assert_eq!(idle_funds, total_deposit - total_invested);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a deposit(,,_,false) here

let strategy_params = create_strategy_params_token0(&test);

// initialize with 1 asset, 3 strategies
let assets: Vec<AssetStrategySet> = sorobanvec![
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make several assets, several strategies ?


//withdraw from strategy
let withdraw_amount = 2_00_000;
let withdraw_result = strategy_client_1.withdraw(&withdraw_amount, &defindex_contract.address);
Copy link
Member

@chopan123 chopan123 Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me parece extraño que se pueda hacer esto @joaquinsoza @esteblock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 [Vault] Add Tests in TODO
2 participants