Skip to content

Commit

Permalink
Merge branch 'feat/vesting-delegate' of https://github.com/decentrio/…
Browse files Browse the repository at this point in the history
…mesh-security-sdk into feat/native-immediate-unbonding
  • Loading branch information
neitdung committed Jul 14, 2024
2 parents fb0c152 + 13dbee2 commit a1d5e9c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 463 deletions.
28 changes: 0 additions & 28 deletions docs/proto/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
- [Query](#osmosis.meshsecurityprovider.Query)

- [osmosis/meshsecurityprovider/tx.proto](#osmosis/meshsecurityprovider/tx.proto)
- [MsgTest](#osmosis.meshsecurityprovider.MsgTest)
- [MsgTestResponse](#osmosis.meshsecurityprovider.MsgTestResponse)
- [MsgUpdateParams](#osmosis.meshsecurityprovider.MsgUpdateParams)
- [MsgUpdateParamsResponse](#osmosis.meshsecurityprovider.MsgUpdateParamsResponse)

Expand Down Expand Up @@ -131,31 +129,6 @@ GenesisState defines the meshsecurityprovider module's genesis state.



<a name="osmosis.meshsecurityprovider.MsgTest"></a>

### MsgTest
===================== MsgTest


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `sender` | [string](#string) | | |






<a name="osmosis.meshsecurityprovider.MsgTestResponse"></a>

### MsgTestResponse







<a name="osmosis.meshsecurityprovider.MsgUpdateParams"></a>

### MsgUpdateParams
Expand Down Expand Up @@ -202,7 +175,6 @@ Since: cosmos-sdk 0.47

| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Test` | [MsgTest](#osmosis.meshsecurityprovider.MsgTest) | [MsgTestResponse](#osmosis.meshsecurityprovider.MsgTestResponse) | | |
| `UpdateParams` | [MsgUpdateParams](#osmosis.meshsecurityprovider.MsgUpdateParams) | [MsgUpdateParamsResponse](#osmosis.meshsecurityprovider.MsgUpdateParamsResponse) | UpdateParams defines an operation for updating the module's parameters. Since: cosmos-sdk 0.47 | |

<!-- end services -->
Expand Down
9 changes: 0 additions & 9 deletions proto/osmosis/meshsecurityprovider/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,12 @@ option go_package = "github.com/osmosis-labs/mesh-security-sdk/x/meshsecuritypro

service Msg {
option (cosmos.msg.v1.service) = true;

rpc Test(MsgTest) returns (MsgTestResponse);
// UpdateParams defines an operation for updating the module's
// parameters.
// Since: cosmos-sdk 0.47
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}

// ===================== MsgTest
message MsgTest {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
}

message MsgTestResponse {}

// MsgUpdateParams is the Msg/UpdateParams request type.
//
// Since: cosmos-sdk 0.47
Expand Down
31 changes: 0 additions & 31 deletions x/meshsecurityprovider/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"github.com/spf13/cobra"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"

"github.com/osmosis-labs/mesh-security-sdk/x/meshsecurityprovider/types"
)
Expand All @@ -23,32 +21,3 @@ func NewTxCmd() *cobra.Command {
txCmd.AddCommand()
return txCmd
}

// NewCmdTest broadcasts a Test message.
func NewCmdTest() *cobra.Command {
cmd := &cobra.Command{
Use: "test [flags]",
Short: "test command",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}
sender := clientCtx.GetFromAddress()

msg := &types.MsgTest{
Sender: sender.String(),
}

if err := msg.ValidateBasic(); err != nil {
return err
}

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
}

flags.AddTxFlagsToCmd(cmd)
return cmd
}
4 changes: 0 additions & 4 deletions x/meshsecurityprovider/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ func NewMsgServerImpl(keeper *Keeper) types.MsgServer {

var _ types.MsgServer = msgServer{}

func (ms msgServer) Test(goCtx context.Context, msg *types.MsgTest) (*types.MsgTestResponse, error) {
return &types.MsgTestResponse{}, nil
}

func (ms msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

Expand Down
2 changes: 0 additions & 2 deletions x/meshsecurityprovider/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import (
// RegisterLegacyAminoCodec registers the necessary x/meshsecurityprovider interfaces and concrete types
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgTest{}, "meshsecurityprovider/MsgTest", nil)
}

func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgTest{},
)

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
Expand Down
34 changes: 0 additions & 34 deletions x/meshsecurityprovider/types/msgs.go
Original file line number Diff line number Diff line change
@@ -1,35 +1 @@
package types

import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

const (
TypeMsgTest = "test"
)

var _ sdk.Msg = &MsgTest{}

func (msg MsgTest) Route() string { return ModuleName }
func (msg MsgTest) Type() string { return TypeMsgTest }
func (msg MsgTest) ValidateBasic() error {
_, err := sdk.AccAddressFromBech32(msg.Sender)
if err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
}

return nil
}

func (msg MsgTest) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
}

func (msg MsgTest) GetSigners() []sdk.AccAddress {
sender, err := sdk.AccAddressFromBech32(msg.Sender)
if err != nil {
panic(err)
}
return []sdk.AccAddress{sender}
}
Loading

0 comments on commit a1d5e9c

Please sign in to comment.