diff --git a/x/evidence/keeper/infraction.go b/x/evidence/keeper/infraction.go index e9655ccbd8b8..a98fe5995574 100644 --- a/x/evidence/keeper/infraction.go +++ b/x/evidence/keeper/infraction.go @@ -29,7 +29,7 @@ func (k Keeper) handleEquivocationEvidence(ctx context.Context, evidence *types. logger := k.Logger(ctx) consAddr := evidence.GetConsensusAddress() - validator, err := k.stakingKeeper.ValidatorByConsAddr(ctx, consAddr) + validator, err := k.validatorStore.ValidatorByConsAddr(ctx, consAddr) if err != nil { return err } diff --git a/x/evidence/keeper/keeper.go b/x/evidence/keeper/keeper.go index 399ca5db0d2e..b98cb42a90d9 100644 --- a/x/evidence/keeper/keeper.go +++ b/x/evidence/keeper/keeper.go @@ -15,6 +15,7 @@ import ( "cosmossdk.io/x/evidence/exported" "cosmossdk.io/x/evidence/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -26,7 +27,7 @@ type Keeper struct { cdc codec.BinaryCodec storeService store.KVStoreService router types.Router - stakingKeeper types.StakingKeeper + validatorStore baseapp.ValidatorStore slashingKeeper types.SlashingKeeper addressCodec address.Codec @@ -38,14 +39,14 @@ type Keeper struct { // NewKeeper creates a new Keeper object. func NewKeeper( - cdc codec.BinaryCodec, storeService store.KVStoreService, stakingKeeper types.StakingKeeper, + cdc codec.BinaryCodec, storeService store.KVStoreService, validatorStore baseapp.ValidatorStore, slashingKeeper types.SlashingKeeper, ac address.Codec, ci comet.BlockInfoService, ) *Keeper { sb := collections.NewSchemaBuilder(storeService) k := &Keeper{ cdc: cdc, storeService: storeService, - stakingKeeper: stakingKeeper, + validatorStore: validatorStore, slashingKeeper: slashingKeeper, addressCodec: ac, cometInfo: ci, diff --git a/x/evidence/types/expected_keepers.go b/x/evidence/types/expected_keepers.go index e29b2c44b2cf..a59cb56a6f70 100644 --- a/x/evidence/types/expected_keepers.go +++ b/x/evidence/types/expected_keepers.go @@ -17,7 +17,6 @@ type ( // evidence module. StakingKeeper interface { ValidatorByConsAddr(context.Context, sdk.ConsAddress) (stakingtypes.ValidatorI, error) - GetParams(ctx context.Context) (params stakingtypes.Params, err error) } // SlashingKeeper defines the slashing module interface contract needed by the diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 6f19007c043d..0bc99653d509 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -48,6 +48,7 @@ func (keeper Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr s sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeProposalVote, + sdk.NewAttribute(types.AttributeKeyVoter, voterAddr.String()), sdk.NewAttribute(types.AttributeKeyOption, options.String()), sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), ), diff --git a/x/gov/types/events.go b/x/gov/types/events.go index c7f895234f0b..96ccc5577e33 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -10,6 +10,7 @@ const ( EventTypeCancelProposal = "cancel_proposal" AttributeKeyProposalResult = "proposal_result" + AttributeKeyVoter = "voter" AttributeKeyOption = "option" AttributeKeyProposalID = "proposal_id" AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal