Skip to content

Commit

Permalink
wip: remoe autocli to test build
Browse files Browse the repository at this point in the history
  • Loading branch information
boodyvo committed Oct 25, 2024
1 parent fb08046 commit 832c489
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 27 deletions.
41 changes: 19 additions & 22 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
package app

import (
"cosmossdk.io/client/v2/autocli"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/x/feegrant"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -55,7 +53,6 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/runtime"
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
"github.com/cosmos/cosmos-sdk/server/api"
"github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
Expand Down Expand Up @@ -903,25 +900,25 @@ func (app *EthermintApp) RegisterNodeService(clientCtx client.Context, cfg confi
}

// AutoCliOpts returns the autocli options for the app.
func (app *EthermintApp) AutoCliOpts() autocli.AppOptions {
modules := make(map[string]appmodule.AppModule, 0)
for _, m := range app.mm.Modules {
if moduleWithName, ok := m.(module.HasName); ok {
moduleName := moduleWithName.Name()
if appModule, ok := moduleWithName.(appmodule.AppModule); ok {
modules[moduleName] = appModule
}
}
}

return autocli.AppOptions{
Modules: modules,
ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.mm.Modules),
AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
}
}
//func (app *EthermintApp) AutoCliOpts() autocli.AppOptions {
// modules := make(map[string]appmodule.AppModule, 0)
// for _, m := range app.mm.Modules {
// if moduleWithName, ok := m.(module.HasName); ok {
// moduleName := moduleWithName.Name()
// if appModule, ok := moduleWithName.(appmodule.AppModule); ok {
// modules[moduleName] = appModule
// }
// }
// }
//
// return autocli.AppOptions{
// Modules: modules,
// ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.mm.Modules),
// AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
// ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
// ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
// }
//}

// RegisterSwaggerAPI registers swagger route with API Server
func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router) {
Expand Down
6 changes: 1 addition & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,13 @@ require (
github.com/stretchr/testify v1.9.0
github.com/tyler-smith/go-bip39 v1.1.0
golang.org/x/net v0.28.0
golang.org/x/sync v0.8.0
google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d
google.golang.org/grpc v1.64.1
google.golang.org/protobuf v1.34.2
sigs.k8s.io/yaml v1.4.0
)

require (
cosmossdk.io/client/v2 v2.0.0-beta.3
golang.org/x/sync v0.8.0
)

require (
cloud.google.com/go v0.115.0 // indirect
cloud.google.com/go/auth v0.6.0 // indirect
Expand Down

0 comments on commit 832c489

Please sign in to comment.