Closed ramakser closed 6 months ago
It took a little while to understand this PR. I'm not too happy about the duplication this introduces and feel like it could have been done in a simpler way: For example you could have constructed the stream in such a way that the final result handled in
sink
included the appropriateCommissionRates
value. Based on whether the account is a baker or not that object would have been created from the pool info or crypto params earlier in the pipeline (likedelegatedCapital
was).But it appears to be correct as it is, so I'm approving and letting you decide.
updated ^
Purpose
Commission rates are set to 100% in case they are not explicitly set in the validators transaction. Prevent changing commission rates while updates validator stake
Changes
Add
private func loadPoolParameters(for bakerID: Int) {...}
method to retrieve validator pool commissionRates in case if profile isvalidator
, or load them from chain parameters like it was before. So in this case there will not be changes rates to 100%, while user change only validator stake.