-
Notifications
You must be signed in to change notification settings - Fork 17
/
modules.go
177 lines (165 loc) · 5.66 KB
/
modules.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
package app
import (
"github.com/KYVENetwork/chain/x/funders"
fundersTypes "github.com/KYVENetwork/chain/x/funders/types"
"github.com/cosmos/cosmos-sdk/types/module"
// Auth
"github.com/cosmos/cosmos-sdk/x/auth"
authTypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
// Authz
authz "github.com/cosmos/cosmos-sdk/x/authz/module"
// Bank
"github.com/cosmos/cosmos-sdk/x/bank"
// Bundles
"github.com/KYVENetwork/chain/x/bundles"
bundlesTypes "github.com/KYVENetwork/chain/x/bundles/types"
// Capability
"github.com/cosmos/cosmos-sdk/x/capability"
// Consensus
"github.com/cosmos/cosmos-sdk/x/consensus"
// Crisis
"github.com/cosmos/cosmos-sdk/x/crisis"
// Delegation
"github.com/KYVENetwork/chain/x/delegation"
delegationTypes "github.com/KYVENetwork/chain/x/delegation/types"
// Distribution
"github.com/cosmos/cosmos-sdk/x/distribution"
distributionTypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
// Evidence
"github.com/cosmos/cosmos-sdk/x/evidence"
// FeeGrant
feeGrant "github.com/cosmos/cosmos-sdk/x/feegrant/module"
// GenUtil
"github.com/cosmos/cosmos-sdk/x/genutil"
// Global
"github.com/KYVENetwork/chain/x/global"
// Governance
"github.com/cosmos/cosmos-sdk/x/gov"
govClient "github.com/cosmos/cosmos-sdk/x/gov/client"
govTypes "github.com/cosmos/cosmos-sdk/x/gov/types"
// Group
group "github.com/cosmos/cosmos-sdk/x/group/module"
// IBC Core
ibc "github.com/cosmos/ibc-go/v7/modules/core"
ibcClient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client"
// IBC Light Clients
ibcSm "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine"
ibcTm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
// IBC Fee
ibcFee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee"
ibcFeeTypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"
// IBC Transfer
ibcTransfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer"
ibcTransferTypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
// ICA
ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts"
icaTypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"
// Mint
"github.com/cosmos/cosmos-sdk/x/mint"
mintTypes "github.com/cosmos/cosmos-sdk/x/mint/types"
// Parameters
"github.com/cosmos/cosmos-sdk/x/params"
paramsClient "github.com/cosmos/cosmos-sdk/x/params/client"
// PFM
pfm "github.com/strangelove-ventures/packet-forward-middleware/v7/router"
// Pool
"github.com/KYVENetwork/chain/x/pool"
poolTypes "github.com/KYVENetwork/chain/x/pool/types"
// Query
"github.com/KYVENetwork/chain/x/query"
// Slashing
"github.com/cosmos/cosmos-sdk/x/slashing"
// Stakers
"github.com/KYVENetwork/chain/x/stakers"
stakersTypes "github.com/KYVENetwork/chain/x/stakers/types"
// Staking
"github.com/cosmos/cosmos-sdk/x/staking"
stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types"
// Team
"github.com/KYVENetwork/chain/x/team"
teamTypes "github.com/KYVENetwork/chain/x/team/types"
// Upgrade
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeClient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
)
// appModuleBasics returns ModuleBasics for the module BasicManager.
var appModuleBasics = []module.AppModuleBasic{
// Cosmos SDK
auth.AppModuleBasic{},
authz.AppModuleBasic{},
bank.AppModuleBasic{},
capability.AppModuleBasic{},
consensus.AppModuleBasic{},
crisis.AppModuleBasic{},
distribution.AppModuleBasic{},
evidence.AppModuleBasic{},
feeGrant.AppModuleBasic{},
genutil.AppModuleBasic{},
gov.NewAppModuleBasic([]govClient.ProposalHandler{
paramsClient.ProposalHandler,
upgradeClient.LegacyProposalHandler,
upgradeClient.LegacyCancelProposalHandler,
ibcClient.UpdateClientProposalHandler,
ibcClient.UpgradeProposalHandler,
}),
group.AppModuleBasic{},
mint.AppModuleBasic{},
params.AppModuleBasic{},
slashing.AppModuleBasic{},
staking.AppModuleBasic{},
upgrade.AppModuleBasic{},
vesting.AppModuleBasic{},
// IBC
ibc.AppModuleBasic{},
ibcSm.AppModuleBasic{},
ibcTm.AppModuleBasic{},
ibcFee.AppModuleBasic{},
ibcTransfer.AppModuleBasic{},
ica.AppModuleBasic{},
pfm.AppModuleBasic{},
// KYVE
bundles.AppModuleBasic{},
delegation.AppModuleBasic{},
global.AppModuleBasic{},
pool.AppModuleBasic{},
query.AppModuleBasic{},
stakers.AppModuleBasic{},
team.AppModuleBasic{},
funders.AppModuleBasic{},
}
// moduleAccountPermissions ...
var moduleAccountPermissions = map[string][]string{
// Cosmos SDK
authTypes.FeeCollectorName: {authTypes.Burner},
distributionTypes.ModuleName: nil,
govTypes.ModuleName: {authTypes.Burner},
mintTypes.ModuleName: {authTypes.Minter},
stakingTypes.BondedPoolName: {authTypes.Burner, authTypes.Staking},
stakingTypes.NotBondedPoolName: {authTypes.Burner, authTypes.Staking},
// IBC
ibcTransferTypes.ModuleName: {authTypes.Minter, authTypes.Burner},
ibcFeeTypes.ModuleName: nil,
icaTypes.ModuleName: nil,
// KYVE
bundlesTypes.ModuleName: nil,
delegationTypes.ModuleName: nil,
poolTypes.ModuleName: nil,
stakersTypes.ModuleName: nil,
teamTypes.ModuleName: nil,
fundersTypes.ModuleName: nil,
}
// BlockedModuleAccountAddrs returns all the app's blocked module account addresses.
func (app *App) BlockedModuleAccountAddrs() map[string]bool {
modAccAddrs := app.ModuleAccountAddrs()
delete(modAccAddrs, authTypes.NewModuleAddress(govTypes.ModuleName).String())
return modAccAddrs
}
// ModuleAccountAddrs returns all the app's module account addresses.
func (app *App) ModuleAccountAddrs() map[string]bool {
modAccAddrs := make(map[string]bool)
for acc := range moduleAccountPermissions {
modAccAddrs[authTypes.NewModuleAddress(acc).String()] = true
}
return modAccAddrs
}