From 921387711b6fc88abeaf802fcae53dc0c5185f23 Mon Sep 17 00:00:00 2001 From: Bernd Mueller Date: Wed, 8 May 2024 11:42:39 +0200 Subject: [PATCH] minor change in code example --- docs/docs/adrs/adr-016-securityaggregation.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/docs/adrs/adr-016-securityaggregation.md b/docs/docs/adrs/adr-016-securityaggregation.md index 7b8664ed60..197734faa8 100644 --- a/docs/docs/adrs/adr-016-securityaggregation.md +++ b/docs/docs/adrs/adr-016-securityaggregation.md @@ -71,14 +71,16 @@ feature works. // are used by the mixer. This can be an oracle, staking module or an // IBC connected bridge. type PowerSource interface { - GetValPowers() []abci.ValidatorUpdate + GetValidatorUpdates() []abci.ValidatorUpdate } // MixPowers calculates power updates by mixing validator powers from different sources func (k *Keeper) MixPowers(source ...PowerSource) []abci.ValidatorUpdate { var valUpdate []abci.ValidatorUpdate for _, ps := range source { - valUpdate = mixPower(valUpdate, ps) + // mix powers from two sets of validator updates an return set of validator updates + // with aggregated powers + valUpdate = mixPower(valUpdate, ps.GetValidatorUpdates()) } return valUpdate } @@ -86,7 +88,7 @@ func (k *Keeper) MixPowers(source ...PowerSource) []abci.ValidatorUpdate { func (k *keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { // GetPowerSources (including local staking module) registeredPowerSource := GetPowerSources() - return am.keeper.MixPowers(registeredPowerSource...) + return k.MixPowers(registeredPowerSource...) } ```