-
Notifications
You must be signed in to change notification settings - Fork 46
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 #272 from bianjieai/cyl/reform
Added registration Module, AnteHandler, and Upgrade func
- Loading branch information
Showing
2 changed files
with
61 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package app | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
|
||
appante "github.com/bianjieai/irita/app/ante" | ||
) | ||
|
||
type AddModuleFun func(app *IritaApp, mm *module.Manager, keys map[string]*sdk.KVStoreKey) | ||
type AnteHandlerFun func(app *IritaApp, handlerOptions appante.HandlerOptions) sdk.AnteHandler | ||
type RegisterUpgradePlanFun func(app *IritaApp, configurator module.Configurator, mm *module.Manager) | ||
|
||
type IritaAppOptions struct { | ||
addModule AddModuleFun | ||
anteHandler AnteHandlerFun | ||
upgradePlan RegisterUpgradePlanFun | ||
} | ||
|
||
func NewAppOptions(addModule AddModuleFun, anteHandler AnteHandlerFun, registerUpgradePlan RegisterUpgradePlanFun, modules ...module.AppModuleBasic) { | ||
for _, moduleBasic := range modules { | ||
ModuleBasics[moduleBasic.Name()] = moduleBasic | ||
} | ||
appOptions = IritaAppOptions{ | ||
addModule: addModule, | ||
anteHandler: anteHandler, | ||
upgradePlan: registerUpgradePlan, | ||
} | ||
} |