/
config.go
135 lines (125 loc) · 4.47 KB
/
config.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
package app
import (
simparams "github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/std"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/capability"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
"github.com/cosmos/cosmos-sdk/x/evidence"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module"
"github.com/cosmos/cosmos-sdk/x/genutil"
"github.com/cosmos/cosmos-sdk/x/gov"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/mint"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/cosmos/cosmos-sdk/x/params"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/cosmos/cosmos-sdk/x/slashing"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
appparams "github.com/akash-network/node/app/params"
)
var mbasics = module.NewBasicManager(
append([]module.AppModuleBasic{
// accounts, fees.
auth.AppModuleBasic{},
// authorizations
authzmodule.AppModuleBasic{},
// genesis utilities
genutil.AppModuleBasic{},
// tokens, token balance.
bank.AppModuleBasic{},
capability.AppModuleBasic{},
// validator staking
staking.AppModuleBasic{},
// inflation
mint.AppModuleBasic{},
// distribution of fess and inflation
distr.AppModuleBasic{},
// governance functionality (voting)
gov.NewAppModuleBasic(
paramsclient.ProposalHandler, distrclient.ProposalHandler,
upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler,
ibcclient.UpdateClientProposalHandler, ibcclient.UpgradeProposalHandler,
),
// chain parameters
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
ibc.AppModuleBasic{},
upgrade.AppModuleBasic{},
evidence.AppModuleBasic{},
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
},
// akash
akashModuleBasics()...,
)...,
)
// ModuleBasics returns all app modules basics
func ModuleBasics() module.BasicManager {
return mbasics
}
// MakeEncodingConfig creates an EncodingConfig for testing
func MakeEncodingConfig() simparams.EncodingConfig {
encodingConfig := appparams.MakeEncodingConfig()
std.RegisterLegacyAminoCodec(encodingConfig.Amino)
std.RegisterInterfaces(encodingConfig.InterfaceRegistry)
mbasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
mbasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
return encodingConfig
}
func kvStoreKeys() map[string]*sdk.KVStoreKey {
return sdk.NewKVStoreKeys(
append([]string{
authtypes.StoreKey,
feegrant.StoreKey,
authzkeeper.StoreKey,
banktypes.StoreKey,
stakingtypes.StoreKey,
minttypes.StoreKey,
distrtypes.StoreKey,
slashingtypes.StoreKey,
govtypes.StoreKey,
paramstypes.StoreKey,
ibchost.StoreKey,
upgradetypes.StoreKey,
evidencetypes.StoreKey,
ibctransfertypes.StoreKey,
capabilitytypes.StoreKey,
},
akashKVStoreKeys()...,
)...,
)
}
func transientStoreKeys() map[string]*sdk.TransientStoreKey {
return sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
}
func memStoreKeys() map[string]*sdk.MemoryStoreKey {
return sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
}