-
Notifications
You must be signed in to change notification settings - Fork 2
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
CurrentAssetInvestmentAllocation Refactor #272
Conversation
…t/improveWithdraw
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…ss it to calculate_asset_amounts_per_vault_shares
@@ -99,13 +108,35 @@ pub fn fetch_current_invested_funds(e: &Env) -> Map<Address, i128> { | |||
/// | |||
/// # Returns | |||
/// * A map where each entry represents an asset's address and its total managed balance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update docs, remove unnecessary comments (like pasting from models)
@@ -0,0 +1,172 @@ | |||
use soroban_sdk::{vec as sorobanvec, String, Vec, Map}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not being run by make test
.
Also, it should be on vault folder
|
||
// test fees are correctly calculated and harvested (todo) | ||
#[test] | ||
fn test_fees() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be on vault folder
|
||
// check total manage funds | ||
|
||
// fn fetch_total_managed_funds(e: &Env) -> Map<Address, CurrentAssetInvestmentAllocation> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unnecesary comments
|
Fixed @chopan123 |
This refactor includes:
Which allows the contract to fetch all this data at the beggining of every function, and then just use that information.
Using this object will avoid to repeat some cross-contract calls and re do calculations