-
Notifications
You must be signed in to change notification settings - Fork 39
/
module.go
63 lines (54 loc) · 1.75 KB
/
module.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
54
55
56
57
58
59
60
61
62
63
package wasm
import (
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/spf13/cobra"
"github.com/CosmWasm/wasmd/x/wasm"
"github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/CosmWasm/wasmd/x/wasm/simulation"
"github.com/CosmWasm/wasmd/x/wasm/types"
customcli "github.com/classic-terra/core/v2/custom/wasm/client/cli"
customtypes "github.com/classic-terra/core/v2/custom/wasm/types/legacy"
)
var _ module.AppModuleBasic = AppModuleBasic{}
// AppModuleBasic defines the basic application module used by the wasm module.
type AppModuleBasic struct {
wasm.AppModuleBasic
}
// RegisterInterfaces implements InterfaceModule
func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
// register canonical wasm types
types.RegisterInterfaces(registry)
customtypes.RegisterInterfaces(registry)
}
// GetTxCmd returns the root tx command for the wasm module.
func (b AppModuleBasic) GetTxCmd() *cobra.Command {
return customcli.GetTxCmd()
}
type AppModule struct {
wasm.AppModule
appModuleBasic AppModuleBasic
cdc codec.Codec
keeper *wasm.Keeper
validatorSetSource keeper.ValidatorSetSource
accountKeeper types.AccountKeeper // for simulation
bankKeeper simulation.BankKeeper
}
// NewAppModule creates a new AppModule object
func NewAppModule(
cdc codec.Codec,
keeper *wasm.Keeper,
validatorSetSource keeper.ValidatorSetSource,
ak types.AccountKeeper,
bk simulation.BankKeeper,
) AppModule {
return AppModule{
appModuleBasic: AppModuleBasic{},
cdc: cdc,
keeper: keeper,
validatorSetSource: validatorSetSource,
accountKeeper: ak,
bankKeeper: bk,
}
}