-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: LIDO-76. Strategy contract #17
Conversation
3e8b226
to
3a5b908
Compare
3a5b908
to
ee8b76e
Compare
contracts/strategy/src/contract.rs
Outdated
let validator_denom_delegation = account_delegations | ||
.delegations | ||
.iter() | ||
.find(|delegation| { | ||
delegation.validator == validator.valoper_address | ||
&& delegation.amount.denom == denom | ||
}) | ||
.map(|delegation| delegation.amount.amount) | ||
.unwrap_or_default(); |
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.
not critical: it would be a bit optimal ( O(N^2) -> O(N) ) to prepare set of delegations into a Map<String, UInt128> before this cycle
|
||
use lido_staking_base::{ | ||
msg::validatorsstats::{ExecuteMsg, InstantiateMsg, MigrateMsg}, | ||
state::validatorsstats::QueryMsg, |
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.
let's move messages into messages
https://hadronlabs.atlassian.net/browse/LIDO-76