From 2b807f934c58eda5be2dd00cf647b38fbb05ad49 Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Wed, 14 Feb 2024 20:28:34 +0800 Subject: [PATCH] simplification --- x/oracle/abci/proposal.go | 4 +--- x/oracle/abci/vote_extensions.go | 3 +-- x/oracle/keeper/keeper.go | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/x/oracle/abci/proposal.go b/x/oracle/abci/proposal.go index 8dc863de..13b1d433 100644 --- a/x/oracle/abci/proposal.go +++ b/x/oracle/abci/proposal.go @@ -178,9 +178,7 @@ func (h *ProposalHandler) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeB } // set oracle prices using the passed in context, which will make these prices available in the current block - if err := h.keeper.SetOraclePrices(ctx, injectedVoteExtTx.StakeWeightedPrices); err != nil { - return nil, err - } + h.keeper.SetOraclePrices(ctx, injectedVoteExtTx.StakeWeightedPrices) // Do slash who did miss voting over threshold and // reset miss counters of all validators at the last block of slash window diff --git a/x/oracle/abci/vote_extensions.go b/x/oracle/abci/vote_extensions.go index c362764b..5fe0d60e 100644 --- a/x/oracle/abci/vote_extensions.go +++ b/x/oracle/abci/vote_extensions.go @@ -106,8 +106,7 @@ func (h *VoteExtHandler) VerifyVoteExtensionHandler(_ OracleConfig) sdk.VerifyVo } // Verify incoming prices from a validator are valid. Note, verification during - // VerifyVoteExtensionHandler MUST be deterministic. For brevity and demo - // purposes, we omit implementation. + // VerifyVoteExtensionHandler MUST be deterministic. if err := h.verifyOraclePrices(ctx, voteExt.Prices); err != nil { return nil, fmt.Errorf("failed to verify oracle prices from validator %X: %w", req.ValidatorAddress, err) } diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index c67e82b1..ae76b43c 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -179,11 +179,10 @@ func (k Keeper) GetSubspace() paramstypes.Subspace { return k.paramSpace } -func (k Keeper) SetOraclePrices(ctx sdk.Context, prices map[string]math.LegacyDec) error { +func (k Keeper) SetOraclePrices(ctx sdk.Context, prices map[string]math.LegacyDec) { for b, q := range prices { k.SetExchangeRateWithEvent(ctx, b, q) } - return nil } type (