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

chore: remove unneeded code #17741

Merged
merged 5 commits into from
Sep 14, 2023
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: 0 additions & 6 deletions runtime/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/event"
"cosmossdk.io/core/genesis"
"cosmossdk.io/core/header"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
Expand Down Expand Up @@ -71,7 +70,6 @@ func init() {
ProvideMemoryStoreService,
ProvideTransientStoreService,
ProvideEventService,
ProvideHeaderInfoService,
ProvideBasicManager,
ProvideAppVersionModifier,
ProvideAddressCodec,
Expand Down Expand Up @@ -245,10 +243,6 @@ func ProvideEventService() event.Service {
return EventService{}
}

func ProvideHeaderInfoService(app *AppBuilder) header.Service {
return headerInfoService{}
}

func ProvideBasicManager(app *AppBuilder) module.BasicManager {
return app.app.basicManager
}
Expand Down
12 changes: 0 additions & 12 deletions runtime/services.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package runtime

import (
"context"

appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
"cosmossdk.io/core/header"

"github.com/cosmos/cosmos-sdk/runtime/services"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
)

Expand All @@ -25,11 +21,3 @@ func (a *App) registerRuntimeServices(cfg module.Configurator) error {

return nil
}

var _ header.Service = headerInfoService{}

type headerInfoService struct{}

func (headerInfoService) GetHeaderInfo(ctx context.Context) header.Info {
return sdk.UnwrapSDKContext(ctx).HeaderInfo()
}
2 changes: 1 addition & 1 deletion x/circuit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## [Unreleased]
## [Unreleased]
16 changes: 13 additions & 3 deletions x/circuit/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ func AuthorizeCircuitBreakerCmd() *cobra.Command {

permission := types.Permissions{Level: types.Permissions_Level(lvl.Uint64()), LimitTypeUrls: typeUrls}

msg := types.NewMsgAuthorizeCircuitBreaker(clientCtx.GetFromAddress().String(), grantee.String(), &permission)
msg := &types.MsgAuthorizeCircuitBreaker{
Granter: clientCtx.GetFromAddress().String(),
Grantee: grantee.String(),
Permissions: &permission,
}

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
Expand All @@ -92,7 +96,10 @@ func TripCircuitBreakerCmd() *cobra.Command {
return err
}

msg := types.NewMsgTripCircuitBreaker(clientCtx.GetFromAddress().String(), strings.Split(args[0], ","))
msg := &types.MsgTripCircuitBreaker{
Authority: clientCtx.GetFromAddress().String(),
MsgTypeUrls: strings.Split(args[0], ","),
}

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
Expand All @@ -118,7 +125,10 @@ func ResetCircuitBreakerCmd() *cobra.Command {

msgTypeUrls := strings.Split(args[0], ",")

msg := types.NewMsgResetCircuitBreaker(clientCtx.GetFromAddress().String(), msgTypeUrls)
msg := &types.MsgResetCircuitBreaker{
Authority: clientCtx.GetFromAddress().String(),
MsgTypeUrls: msgTypeUrls,
}

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
Expand Down
7 changes: 2 additions & 5 deletions x/circuit/keeper/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"cosmossdk.io/x/circuit/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/query"
)

Expand All @@ -22,15 +21,13 @@ func NewQueryServer(keeper Keeper) types.QueryServer {
}

// Account returns account permissions.
func (qs QueryServer) Account(c context.Context, req *types.QueryAccountRequest) (*types.AccountResponse, error) {
sdkCtx := sdk.UnwrapSDKContext(c)

func (qs QueryServer) Account(ctx context.Context, req *types.QueryAccountRequest) (*types.AccountResponse, error) {
add, err := qs.keeper.addressCodec.StringToBytes(req.Address)
if err != nil {
return nil, err
}

perms, err := qs.keeper.Permissions.Get(sdkCtx, add)
perms, err := qs.keeper.Permissions.Get(ctx, add)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion x/circuit/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (AppModuleBasic) Name() string { return types.ModuleName }

// RegisterLegacyAminoCodec registers the circuit module's types on the LegacyAmino codec.
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
types.RegisterLegacyAminoCodec(cdc)
}

// DefaultGenesis returns default genesis state as raw bytes for the circuit
Expand Down
10 changes: 0 additions & 10 deletions x/circuit/types/codec.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
package types

import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/legacy"
types "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
)

// RegisterLegacyAminoCodec registers the necessary circuit interfaces and concrete types
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
legacy.RegisterAminoMsg(cdc, &MsgAuthorizeCircuitBreaker{}, "cosmos-sdk/MsgAuthorizeCircuitBreaker")
legacy.RegisterAminoMsg(cdc, &MsgResetCircuitBreaker{}, "cosmos-sdk/MsgResetCircuitBreaker")
legacy.RegisterAminoMsg(cdc, &MsgTripCircuitBreaker{}, "cosmos-sdk/MsgTripCircuitBreaker")
}

// RegisterInterfaces registers the interfaces types with the interface registry.
func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
Expand Down
36 changes: 0 additions & 36 deletions x/circuit/types/msgs.go

This file was deleted.

Loading