Skip to content

Commit

Permalink
Remove dead unused code (#1568)
Browse files Browse the repository at this point in the history
Remove dead code
  • Loading branch information
philipsu522 authored Apr 19, 2024
1 parent 98bad22 commit c59b0bf
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 89 deletions.
18 changes: 0 additions & 18 deletions proto/tokenfactory/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ service Msg {
rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse);
rpc SetDenomMetadata(MsgSetDenomMetadata)
returns (MsgSetDenomMetadataResponse);

// ForceTransfer is deactivated for now because we need to think through edge
// cases rpc ForceTransfer(MsgForceTransfer) returns
// (MsgForceTransferResponse);
}

// MsgCreateDenom defines the message structure for the CreateDenom gRPC service
Expand Down Expand Up @@ -79,20 +75,6 @@ message MsgChangeAdmin {
// MsgChangeAdmin message.
message MsgChangeAdminResponse {}

// message MsgForceTransfer {
// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
// cosmos.base.v1beta1.Coin amount = 2 [
// (gogoproto.moretags) = "yaml:\"amount\"",
// (gogoproto.nullable) = false
// ];
// string transferFromAddress = 3
// [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ];
// string transferToAddress = 4
// [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ];
// }

// message MsgForceTransferResponse {}

// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set
// the denom's bank metadata
message MsgSetDenomMetadata {
Expand Down
1 change: 0 additions & 1 deletion x/tokenfactory/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func GetTxCmd() *cobra.Command {
NewCreateDenomCmd(),
NewMintCmd(),
NewBurnCmd(),
// NewForceTransferCmd(),
NewChangeAdminCmd(),
NewSetDenomMetadataCmd(),
)
Expand Down
20 changes: 0 additions & 20 deletions x/tokenfactory/keeper/bankactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,3 @@ func (k Keeper) burnFrom(ctx sdk.Context, amount sdk.Coin, burnFrom string) erro
ctx.Logger().Info(fmt.Sprintf("Burning amount=%s from module=%s", amount.String(), types.ModuleName))
return k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(amount))
}

// func (k Keeper) forceTransfer(ctx sdk.Context, amount sdk.Coin, fromAddr string, toAddr string) error {
// // verify that denom is an x/tokenfactory denom
// _, _, err := types.DeconstructDenom(amount.Denom)
// if err != nil {
// return err
// }

// fromSdkAddr, err := sdk.AccAddressFromBech32(fromAddr)
// if err != nil {
// return err
// }

// toSdkAddr, err := sdk.AccAddressFromBech32(toAddr)
// if err != nil {
// return err
// }

// return k.bankKeeper.SendCoins(ctx, fromSdkAddr, toSdkAddr, sdk.NewCoins(amount))
// }
4 changes: 0 additions & 4 deletions x/tokenfactory/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ func RegisterCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgCreateDenom{}, "tokenfactory/create-denom", nil)
cdc.RegisterConcrete(&MsgMint{}, "tokenfactory/mint", nil)
cdc.RegisterConcrete(&MsgBurn{}, "tokenfactory/burn", nil)
// cdc.RegisterConcrete(&MsgForceTransfer{}, "tokenfactory/force-transfer", nil)
cdc.RegisterConcrete(&MsgChangeAdmin{}, "tokenfactory/change-admin", nil)
}

Expand All @@ -30,9 +29,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgChangeAdmin{},
)
// registry.RegisterImplementations((*govtypes.Content)(nil),
// &MsgForceTransfer{},
// )

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
Expand Down
46 changes: 0 additions & 46 deletions x/tokenfactory/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const (
TypeMsgCreateDenom = "create_denom"
TypeMsgMint = "mint"
TypeMsgBurn = "burn"
TypeMsgForceTransfer = "force_transfer"
TypeMsgChangeAdmin = "change_admin"
TypeMsgSetDenomMetadata = "set_denom_metadata"
)
Expand Down Expand Up @@ -119,51 +118,6 @@ func (m MsgBurn) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{sender}
}

// var _ sdk.Msg = &MsgForceTransfer{}

// // NewMsgForceTransfer creates a transfer funds from one account to another
// func NewMsgForceTransfer(sender string, amount sdk.Coin, fromAddr, toAddr string) *MsgForceTransfer {
// return &MsgForceTransfer{
// Sender: sender,
// Amount: amount,
// TransferFromAddress: fromAddr,
// TransferToAddress: toAddr,
// }
// }

// func (m MsgForceTransfer) Route() string { return RouterKey }
// func (m MsgForceTransfer) Type() string { return TypeMsgForceTransfer }
// func (m MsgForceTransfer) ValidateBasic() error {
// _, err := sdk.AccAddressFromBech32(m.Sender)
// if err != nil {
// return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
// }

// _, err = sdk.AccAddressFromBech32(m.TransferFromAddress)
// if err != nil {
// return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
// }
// _, err = sdk.AccAddressFromBech32(m.TransferToAddress)
// if err != nil {
// return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
// }

// if !m.Amount.IsValid() {
// return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String())
// }

// return nil
// }

// func (m MsgForceTransfer) GetSignBytes() []byte {
// return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
// }

// func (m MsgForceTransfer) GetSigners() []sdk.AccAddress {
// sender, _ := sdk.AccAddressFromBech32(m.Sender)
// return []sdk.AccAddress{sender}
// }

var _ sdk.Msg = &MsgChangeAdmin{}

// NewMsgChangeAdmin creates a message to change admin for a denom
Expand Down

0 comments on commit c59b0bf

Please sign in to comment.