-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2925 from irisnet/feature/support-erc20
feat: enhance token module
- Loading branch information
Showing
16 changed files
with
226 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
} |
Oops, something went wrong.