-
Notifications
You must be signed in to change notification settings - Fork 22
feat: Add basic support for multiple incentive denoms #199
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
Conversation
797477b
to
59aa76a
Compare
aa37564
to
9c23e56
Compare
/// Returns an iterator over all asset incentives, with optional pagination. | ||
/// Caller should make sure that if start_after_incentive_denom is supplied, then | ||
/// start_after_collateral_denom is also supplied. | ||
pub fn paginate_asset_incentives( |
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 is quite complicated to follow.. What if we simplify an API to paginate incentives per requested collateral? This way we give control to the caller and he can prepare separate msgs to claim rewards.
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 guess really it's up to frontend devs what they prefer. The downside of your suggestion is that they would need to know all collaterals that the user has incentives for. I could imagine that this is hard to keep track of. They can't just query Red Bank since the user can remove collateral and still have unclaimed rewards.
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.
@piobab what do you think? Personally I think current method is better so backend doesn't need to keep track of state
denom: collateral_denom.to_string(), | ||
}, | ||
)?; | ||
let market: red_bank::Market = deps.querier.query_wasm_smart( |
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.
Hmm analyzing this now and if incentives is set for market which is not set in redbank it could fail the whole tx.
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.
Good point. Should we verify that market exists in Red Bank in ExecuteMsg::SetIncentive? It's not possible to remove a market in red bank is it?
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.
No, it is not possible to remove. IMO we should verify in SetIncentive that collateral exists in Red Bank.
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.
Fixed
* Clear empty accounts. * Update schema. * Add tests. Cleanup. * Improve msg. * Update CM with rc. New deployment.
No description provided.