Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inclusion of authz module to the hid-node CLI #107

Merged
merged 1 commit into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ WORKDIR /usr/local/app
# Add source files
COPY . .

# Install minimum necessary dependencies, build persistenceCore, remove packages
# Install minimum necessary dependencies and build hid-node
RUN apk add --no-cache $PACKAGES && make build

# Install ca-certificates
RUN apk add --update ca-certificates

# Run hid-noded by default, omit entrypoint to ease using container with cli
# Setup the node
RUN bash ./scripts/docker-node/setup.sh

# Entry for containers
# Entry for containers, Run the single-node script
ENTRYPOINT [ "bash", "./scripts/docker-node/start.sh" ]

# Expose Ports
Expand Down
12 changes: 11 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
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"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand Down Expand Up @@ -142,6 +144,7 @@ var (
evidence.AppModuleBasic{},
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
authzmodule.AppModuleBasic{},
ssimodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
)
Expand Down Expand Up @@ -207,6 +210,7 @@ type App struct {
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
AuthzKeeper authzkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -248,7 +252,7 @@ func New(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, authzkeeper.StoreKey,
ssimoduletypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
)
Expand Down Expand Up @@ -320,6 +324,11 @@ func New(
appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper,
)

authzKeeper := authzkeeper.NewKeeper(
keys[authzkeeper.StoreKey], appCodec, app.MsgServiceRouter(),
)
app.AuthzKeeper = authzKeeper

// register the proposal types
govRouter := govtypes.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
Expand Down Expand Up @@ -379,6 +388,7 @@ func New(
encodingConfig.TxConfig,
),
auth.NewAppModule(appCodec, app.AccountKeeper, nil),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
capability.NewAppModule(appCodec, *app.CapabilityKeeper),
Expand Down