diff --git a/proto/tokenfactory/tx.proto b/proto/tokenfactory/tx.proto index 7610c2e99..9740da05e 100644 --- a/proto/tokenfactory/tx.proto +++ b/proto/tokenfactory/tx.proto @@ -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 @@ -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 { diff --git a/x/tokenfactory/client/cli/tx.go b/x/tokenfactory/client/cli/tx.go index acfcba7f9..70c0af335 100644 --- a/x/tokenfactory/client/cli/tx.go +++ b/x/tokenfactory/client/cli/tx.go @@ -31,7 +31,6 @@ func GetTxCmd() *cobra.Command { NewCreateDenomCmd(), NewMintCmd(), NewBurnCmd(), - // NewForceTransferCmd(), NewChangeAdminCmd(), NewSetDenomMetadataCmd(), ) diff --git a/x/tokenfactory/keeper/bankactions.go b/x/tokenfactory/keeper/bankactions.go index 2c783c3ff..21cc1c420 100644 --- a/x/tokenfactory/keeper/bankactions.go +++ b/x/tokenfactory/keeper/bankactions.go @@ -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)) -// } diff --git a/x/tokenfactory/types/codec.go b/x/tokenfactory/types/codec.go index 71b09e888..c182eea77 100644 --- a/x/tokenfactory/types/codec.go +++ b/x/tokenfactory/types/codec.go @@ -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) } @@ -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) } diff --git a/x/tokenfactory/types/msgs.go b/x/tokenfactory/types/msgs.go index 220a8ba36..826039416 100644 --- a/x/tokenfactory/types/msgs.go +++ b/x/tokenfactory/types/msgs.go @@ -11,7 +11,6 @@ const ( TypeMsgCreateDenom = "create_denom" TypeMsgMint = "mint" TypeMsgBurn = "burn" - TypeMsgForceTransfer = "force_transfer" TypeMsgChangeAdmin = "change_admin" TypeMsgSetDenomMetadata = "set_denom_metadata" ) @@ -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