-
Notifications
You must be signed in to change notification settings - Fork 127
/
farm.go
53 lines (43 loc) · 1.6 KB
/
farm.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package wrapper
import (
"github.com/cosmos/cosmos-sdk/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
farmkeeper "github.com/irisnet/irismod/modules/farm/keeper"
)
var _ govtypes.GovHooks = farmGovHook{}
type farmGovHook struct {
gh farmkeeper.GovHook
}
// NewFarmGovHook creates a new farmGovHook instance.
//
// It takes a parameter of type farmkeeper.GovHook and returns a farmGovHook.
func NewFarmGovHook(gh farmkeeper.GovHook) govtypes.GovHooks {
return farmGovHook{
gh: gh,
}
}
// AfterProposalDeposit implements types.GovHooks.
func (f farmGovHook) AfterProposalDeposit(ctx types.Context, proposalID uint64, depositorAddr types.AccAddress) error {
f.gh.AfterProposalDeposit(ctx, proposalID, depositorAddr)
return nil
}
// AfterProposalFailedMinDeposit implements types.GovHooks.
func (f farmGovHook) AfterProposalFailedMinDeposit(ctx types.Context, proposalID uint64) error {
f.gh.AfterProposalFailedMinDeposit(ctx, proposalID)
return nil
}
// AfterProposalSubmission implements types.GovHooks.
func (f farmGovHook) AfterProposalSubmission(ctx types.Context, proposalID uint64) error {
f.gh.AfterProposalSubmission(ctx, proposalID)
return nil
}
// AfterProposalVote implements types.GovHooks.
func (f farmGovHook) AfterProposalVote(ctx types.Context, proposalID uint64, voterAddr types.AccAddress) error {
f.gh.AfterProposalVote(ctx, proposalID,voterAddr)
return nil
}
// AfterProposalVotingPeriodEnded implements types.GovHooks.
func (f farmGovHook) AfterProposalVotingPeriodEnded(ctx types.Context, proposalID uint64) error {
f.gh.AfterProposalVotingPeriodEnded(ctx, proposalID)
return nil
}