refactor(x/gov)!: migrate to use env var (#19481)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
samricotta
2024-03-05 06:01:37 +00:00
committed by GitHub
co-authored by Julien Robert
parent 3e63309220
commit afcb62bd9f
26 changed files with 347 additions and 291 deletions
+7 -2
View File
@@ -1,6 +1,7 @@
package params
import (
"context"
"fmt"
errorsmod "cosmossdk.io/errors"
@@ -14,10 +15,14 @@ import (
// NewParamChangeProposalHandler creates a new governance Handler for a ParamChangeProposal
func NewParamChangeProposalHandler(k keeper.Keeper) govtypes.Handler {
return func(ctx sdk.Context, content govtypes.Content) error {
return func(ctx context.Context, content govtypes.Content) error {
// UnwrapSDKContext makes x/params baseapp compatible only and not server/v2
// We should investigate if we want to make x/params server/v2 compatible
sdkCtx := sdk.UnwrapSDKContext(ctx)
switch c := content.(type) {
case *proposal.ParameterChangeProposal:
return handleParameterChangeProposal(ctx, k, c)
return handleParameterChangeProposal(sdkCtx, k, c)
default:
return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized param proposal content type: %T", c)