-
Notifications
You must be signed in to change notification settings - Fork 6
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
[ABW-2889] properly compute unstake values. #777
Conversation
ced05a9
to
7453d87
Compare
val ownedAccount = getProfileUseCase.accountOnCurrentNetwork(depositsPerAddress.key) ?: error("No account found") | ||
val deposits = depositsPerAddress.value.map { deposit -> | ||
val resourceAddress = deposit.resourceAddress | ||
val contributions = classification.poolContributions.filter { | ||
it.poolUnitsResourceAddress.addressString() == resourceAddress | ||
} | ||
if (contributions.isEmpty()) { | ||
resolveGeneralAsset(deposit, summary, assets, defaultDepositGuarantee) | ||
resolveGeneralAsset(deposit, this, assets, defaultDepositGuarantee) | ||
} else { | ||
val pool = involvedPools.find { it.address == contributions.first().poolAddress.addressString() } |
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.
Improvement for the future:
These 6 lines could be also replaced if you didn't filter for involved pools only.
You could just find the pool unit by the resource address. Inside the pool unit object you have all you need.
- pool (with metadata and associated dapps)
- associated resources
- unit fungible
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.
makes sense. please verify if the recent change reflect what you had in mind
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.
I see wrong claim values again deposited to the accounts
Screen_recording_20240131_111029.webm
Quality Gate failedFailed conditions 0.0% Coverage on New Code (required ≥ 40%) |
Description
resolveAssetsFromAddressUseCase
inPoolContributionProcessor
, drop separate calls to fetch poolsHow to test
Screenshot
PR submission checklist