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

Return -1 value on getvault when tokens are locked #1311

Merged
merged 7 commits into from
May 31, 2022

Conversation

dcorral
Copy link
Contributor

@dcorral dcorral commented May 30, 2022

What kind of PR is this?:

/kind fix

What this PR does / why we need it:

Make getvault return -1 values instead of 0 when any of the tokens in the vault is frozen.

Added functional tests.

@@ -141,6 +142,14 @@ namespace {
collateralRatio = int(rate.val->ratio());
}

bool isVaultTokenLocked {false};
for (const auto& collateral : collaterals->balances) {
Copy link
Member

Choose a reason for hiding this comment

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

Vault will only lock on a loan token being split.

Copy link
Member

Choose a reason for hiding this comment

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

Good call out. Should be harmless for now.

@prasannavl prasannavl merged commit 3db917e into master May 31, 2022
@prasannavl prasannavl deleted the fix-return-on-locked-token branch May 31, 2022 06:43
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.

4 participants