/
hooks.go
27 lines (21 loc) 路 1 KB
/
hooks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
)
// Wrapper struct
type Hooks struct {
k Keeper
}
var _ govtypes.GovHooks = Hooks{}
// Create new distribution hooks
func (k Keeper) Hooks() Hooks { return Hooks{k} }
func (h Hooks) AfterProposalSubmission(_ sdk.Context, _ uint64) {}
func (h Hooks) AfterProposalDeposit(_ sdk.Context, _ uint64, _ sdk.AccAddress) {}
func (h Hooks) AfterProposalVote(_ sdk.Context, _ uint64, _ sdk.AccAddress) {}
func (h Hooks) AfterProposalFailedMinDeposit(_ sdk.Context, _ uint64) {}
func (h Hooks) AfterProposalVotingPeriodEnded(_ sdk.Context, _ uint64) {}
// SetAdditionalVotingPowers calculates and sets voting powers of the person who participated in liquid staking voters in votes.
func (h Hooks) SetAdditionalVotingPowers(ctx sdk.Context, votes govtypes.Votes, votingPowers *govtypes.AdditionalVotingPowers) {
h.k.SetLiquidStakingVotingPowers(ctx, votes, votingPowers)
}