Skip to content

Commit

Permalink
remove msg
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCherepovskyi committed Jul 5, 2024
1 parent deaf79f commit e1478a4
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 339 deletions.
25 changes: 16 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/iavl v0.19.6
github.com/cosmos/ibc-go/v6 v6.1.1
github.com/cosmos/ledger-cosmos-go v0.12.2
github.com/gogo/gateway v1.1.0
github.com/gogo/protobuf v1.3.3
Expand Down Expand Up @@ -53,7 +54,8 @@ require (
github.com/tidwall/btree v1.5.0
golang.org/x/crypto v0.21.0
golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9
golang.org/x/net v0.23.0
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237
google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.34.1
pgregory.net/rapid v0.5.5
Expand All @@ -63,7 +65,6 @@ require (

require (
cloud.google.com/go v0.112.1 // indirect
cloud.google.com/go/compute v1.25.1 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.38.0 // indirect
Expand All @@ -78,9 +79,7 @@ require (
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cometbft/cometbft-db v0.7.0 // indirect
github.com/cosmos/gogoproto v1.4.8 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/ibc-go/v6 v6.1.1 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -96,13 +95,15 @@ require (
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand Down Expand Up @@ -147,14 +148,20 @@ require (
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/net v0.23.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/api v0.169.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -168,7 +175,7 @@ replace (
// TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2

// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Expand Down
107 changes: 52 additions & 55 deletions go.sum

Large diffs are not rendered by default.

17 changes: 2 additions & 15 deletions x/accumulator/handler.go
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
package accumulator

import (
"fmt"
"github.com/cosmos/cosmos-sdk/x/accumulator/keeper"
"github.com/cosmos/cosmos-sdk/x/accumulator/types"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/accumulator/keeper"
)

// NewHandler ...
func NewHandler(k keeper.Keeper) sdk.Handler {
msgServer := keeper.NewMsgServerImpl(k)
// this line is used by starport scaffolding # handler/msgServer

return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
ctx = ctx.WithEventManager(sdk.NewEventManager())

switch msg := msg.(type) {
case *types.DistributeTokensRequest:
res, err := msgServer.DistributeTokens(sdk.WrapSDKContext(ctx), msg)
return sdk.WrapServiceResult(ctx, res, err)
default:
errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg)
return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)
}
return nil, nil
}

// this line is used by starport scaffolding # 1
Expand Down
1 change: 0 additions & 1 deletion x/accumulator/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func NewAppModule(

// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterMsgServiceServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
}

Expand Down
8 changes: 0 additions & 8 deletions x/accumulator/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@ package types
import (
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
)

func RegisterCodec(cdc *codec.LegacyAmino) {
// this line is used by starport scaffolding # 2
cdc.RegisterConcrete(&DistributeTokensRequest{}, "accumulator/DistributeTokens", nil)
}

func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
// this line is used by starport scaffolding # 3

registry.RegisterImplementations((*sdk.Msg)(nil),
&DistributeTokensRequest{},
)

msgservice.RegisterMsgServiceDesc(registry, &_MsgService_serviceDesc)
}
5 changes: 0 additions & 5 deletions x/distribution/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ func (s *IntegrationTestSuite) SetupSuite() {
var mintData minttypes.GenesisState
s.Require().NoError(s.cfg.Codec.UnmarshalJSON(genesisState[minttypes.ModuleName], &mintData))

inflation := sdk.MustNewDecFromStr("1.0")
mintData.Minter.Inflation = inflation
mintData.Params.InflationMin = inflation
mintData.Params.InflationMax = inflation

mintDataBz, err := s.cfg.Codec.MarshalJSON(&mintData)
s.Require().NoError(err)
genesisState[minttypes.ModuleName] = mintDataBz
Expand Down
18 changes: 0 additions & 18 deletions x/mint/client/testutil/cli_test.go

This file was deleted.

64 changes: 0 additions & 64 deletions x/mint/client/testutil/grpc.go

This file was deleted.

Loading

0 comments on commit e1478a4

Please sign in to comment.