From 128a406158843b0513f4de2e8e380605502c0f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eckel?= Date: Thu, 5 Oct 2023 17:13:45 +0200 Subject: [PATCH] ignite scaffold message --module dao reissueRDDLResult proposer:string tx-id:string block-height:uint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Eckel --- docs/static/openapi.yml | 2 + proto/planetmintgo/dao/tx.proto | 12 +- x/dao/client/cli/tx.go | 1 + x/dao/client/cli/tx_reissue_rddl_result.go | 50 ++ .../keeper/msg_server_reissue_rddl_result.go | 17 + x/dao/module_simulation.go | 23 + x/dao/simulation/reissue_rddl_result.go | 29 + x/dao/types/codec.go | 4 + x/dao/types/message_reissue_rddl_result.go | 48 ++ .../types/message_reissue_rddl_result_test.go | 40 ++ x/dao/types/tx.pb.go | 511 +++++++++++++++++- 11 files changed, 713 insertions(+), 24 deletions(-) create mode 100644 x/dao/client/cli/tx_reissue_rddl_result.go create mode 100644 x/dao/keeper/msg_server_reissue_rddl_result.go create mode 100644 x/dao/simulation/reissue_rddl_result.go create mode 100644 x/dao/types/message_reissue_rddl_result.go create mode 100644 x/dao/types/message_reissue_rddl_result_test.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index be748e1..4a42a43 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -75818,6 +75818,8 @@ definitions: type: object planetmintgo.dao.MsgReissueRDDLProposalResponse: type: object + planetmintgo.dao.MsgReissueRDDLResultResponse: + type: object planetmintgo.dao.Params: type: object description: Params defines the parameters for the module. diff --git a/proto/planetmintgo/dao/tx.proto b/proto/planetmintgo/dao/tx.proto index f62d85a..eb87d55 100644 --- a/proto/planetmintgo/dao/tx.proto +++ b/proto/planetmintgo/dao/tx.proto @@ -9,7 +9,8 @@ option go_package = "github.com/planetmint/planetmint-go/x/dao/types"; // Msg defines the Msg service. service Msg { rpc ReissueRDDLProposal (MsgReissueRDDLProposal) returns (MsgReissueRDDLProposalResponse); - rpc MintToken (MsgMintToken) returns (MsgMintTokenResponse); + rpc MintToken (MsgMintToken ) returns (MsgMintTokenResponse ); + rpc ReissueRDDLResult (MsgReissueRDDLResult ) returns (MsgReissueRDDLResultResponse ); } message MsgReissueRDDLProposal { string creator = 1; @@ -27,3 +28,12 @@ message MsgMintToken { message MsgMintTokenResponse {} +message MsgReissueRDDLResult { + string creator = 1; + string proposer = 2; + string txId = 3; + uint64 blockHeight = 4; +} + +message MsgReissueRDDLResultResponse {} + diff --git a/x/dao/client/cli/tx.go b/x/dao/client/cli/tx.go index 6abed9f..65f7b48 100644 --- a/x/dao/client/cli/tx.go +++ b/x/dao/client/cli/tx.go @@ -27,6 +27,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdReissueRDDLProposal()) cmd.AddCommand(CmdMintToken()) + cmd.AddCommand(CmdReissueRDDLResult()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/dao/client/cli/tx_reissue_rddl_result.go b/x/dao/client/cli/tx_reissue_rddl_result.go new file mode 100644 index 0000000..84aa763 --- /dev/null +++ b/x/dao/client/cli/tx_reissue_rddl_result.go @@ -0,0 +1,50 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/planetmint/planetmint-go/x/dao/types" + "github.com/spf13/cast" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdReissueRDDLResult() *cobra.Command { + cmd := &cobra.Command{ + Use: "reissue-rddl-result [proposer] [tx-id] [block-height]", + Short: "Broadcast message reissueRDDLResult", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argProposer := args[0] + argTxId := args[1] + argBlockHeight, err := cast.ToUint64E(args[2]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgReissueRDDLResult( + clientCtx.GetFromAddress().String(), + argProposer, + argTxId, + argBlockHeight, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/dao/keeper/msg_server_reissue_rddl_result.go b/x/dao/keeper/msg_server_reissue_rddl_result.go new file mode 100644 index 0000000..f619f53 --- /dev/null +++ b/x/dao/keeper/msg_server_reissue_rddl_result.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/planetmint/planetmint-go/x/dao/types" +) + +func (k msgServer) ReissueRDDLResult(goCtx context.Context, msg *types.MsgReissueRDDLResult) (*types.MsgReissueRDDLResultResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgReissueRDDLResultResponse{}, nil +} diff --git a/x/dao/module_simulation.go b/x/dao/module_simulation.go index 8ae471d..c2501e4 100644 --- a/x/dao/module_simulation.go +++ b/x/dao/module_simulation.go @@ -28,6 +28,10 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgReissueRDDLProposal int = 100 + opWeightMsgReissueRDDLResult = "op_weight_msg_reissue_rddl_result" + // TODO: Determine the simulation weight value + defaultWeightMsgReissueRDDLResult int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -67,6 +71,17 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp daosimulation.SimulateMsgReissueRDDLProposal(am.accountKeeper, am.bankKeeper, am.keeper), )) + var weightMsgReissueRDDLResult int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgReissueRDDLResult, &weightMsgReissueRDDLResult, nil, + func(_ *rand.Rand) { + weightMsgReissueRDDLResult = defaultWeightMsgReissueRDDLResult + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgReissueRDDLResult, + daosimulation.SimulateMsgReissueRDDLResult(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations @@ -83,6 +98,14 @@ func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.Wei return nil }, ), + simulation.NewWeightedProposalMsg( + opWeightMsgReissueRDDLResult, + defaultWeightMsgReissueRDDLResult, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + daosimulation.SimulateMsgReissueRDDLResult(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/dao/simulation/reissue_rddl_result.go b/x/dao/simulation/reissue_rddl_result.go new file mode 100644 index 0000000..ff2c880 --- /dev/null +++ b/x/dao/simulation/reissue_rddl_result.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/planetmint/planetmint-go/x/dao/keeper" + "github.com/planetmint/planetmint-go/x/dao/types" +) + +func SimulateMsgReissueRDDLResult( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgReissueRDDLResult{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the ReissueRDDLResult simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "ReissueRDDLResult simulation not implemented"), nil, nil + } +} diff --git a/x/dao/types/codec.go b/x/dao/types/codec.go index b323dd3..1cf46a3 100644 --- a/x/dao/types/codec.go +++ b/x/dao/types/codec.go @@ -10,6 +10,7 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgReissueRDDLProposal{}, "dao/ReissueRDDLProposal", nil) cdc.RegisterConcrete(&MsgMintToken{}, "dao/MintToken", nil) + cdc.RegisterConcrete(&MsgReissueRDDLResult{}, "dao/ReissueRDDLResult", nil) // this line is used by starport scaffolding # 2 } @@ -18,6 +19,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgReissueRDDLProposal{}, &MsgMintToken{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgReissueRDDLResult{}, + ) // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/dao/types/message_reissue_rddl_result.go b/x/dao/types/message_reissue_rddl_result.go new file mode 100644 index 0000000..ea3fb08 --- /dev/null +++ b/x/dao/types/message_reissue_rddl_result.go @@ -0,0 +1,48 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgReissueRDDLResult = "reissue_rddl_result" + +var _ sdk.Msg = &MsgReissueRDDLResult{} + +func NewMsgReissueRDDLResult(creator string, proposer string, txId string, blockHeight uint64) *MsgReissueRDDLResult { + return &MsgReissueRDDLResult{ + Creator: creator, + Proposer: proposer, + TxId: txId, + BlockHeight: blockHeight, + } +} + +func (msg *MsgReissueRDDLResult) Route() string { + return RouterKey +} + +func (msg *MsgReissueRDDLResult) Type() string { + return TypeMsgReissueRDDLResult +} + +func (msg *MsgReissueRDDLResult) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgReissueRDDLResult) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgReissueRDDLResult) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} diff --git a/x/dao/types/message_reissue_rddl_result_test.go b/x/dao/types/message_reissue_rddl_result_test.go new file mode 100644 index 0000000..a4b5c0a --- /dev/null +++ b/x/dao/types/message_reissue_rddl_result_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/planetmint/planetmint-go/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgReissueRDDLResult_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgReissueRDDLResult + err error + }{ + { + name: "invalid address", + msg: MsgReissueRDDLResult{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgReissueRDDLResult{ + Creator: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/dao/types/tx.pb.go b/x/dao/types/tx.pb.go index 8b52527..85be508 100644 --- a/x/dao/types/tx.pb.go +++ b/x/dao/types/tx.pb.go @@ -219,39 +219,148 @@ func (m *MsgMintTokenResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMintTokenResponse proto.InternalMessageInfo +type MsgReissueRDDLResult struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` + TxId string `protobuf:"bytes,3,opt,name=txId,proto3" json:"txId,omitempty"` + BlockHeight uint64 `protobuf:"varint,4,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"` +} + +func (m *MsgReissueRDDLResult) Reset() { *m = MsgReissueRDDLResult{} } +func (m *MsgReissueRDDLResult) String() string { return proto.CompactTextString(m) } +func (*MsgReissueRDDLResult) ProtoMessage() {} +func (*MsgReissueRDDLResult) Descriptor() ([]byte, []int) { + return fileDescriptor_7117c47dbc1828c7, []int{4} +} +func (m *MsgReissueRDDLResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReissueRDDLResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReissueRDDLResult.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgReissueRDDLResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReissueRDDLResult.Merge(m, src) +} +func (m *MsgReissueRDDLResult) XXX_Size() int { + return m.Size() +} +func (m *MsgReissueRDDLResult) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReissueRDDLResult.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReissueRDDLResult proto.InternalMessageInfo + +func (m *MsgReissueRDDLResult) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgReissueRDDLResult) GetProposer() string { + if m != nil { + return m.Proposer + } + return "" +} + +func (m *MsgReissueRDDLResult) GetTxId() string { + if m != nil { + return m.TxId + } + return "" +} + +func (m *MsgReissueRDDLResult) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +type MsgReissueRDDLResultResponse struct { +} + +func (m *MsgReissueRDDLResultResponse) Reset() { *m = MsgReissueRDDLResultResponse{} } +func (m *MsgReissueRDDLResultResponse) String() string { return proto.CompactTextString(m) } +func (*MsgReissueRDDLResultResponse) ProtoMessage() {} +func (*MsgReissueRDDLResultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7117c47dbc1828c7, []int{5} +} +func (m *MsgReissueRDDLResultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReissueRDDLResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReissueRDDLResultResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgReissueRDDLResultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReissueRDDLResultResponse.Merge(m, src) +} +func (m *MsgReissueRDDLResultResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgReissueRDDLResultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReissueRDDLResultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReissueRDDLResultResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgReissueRDDLProposal)(nil), "planetmintgo.dao.MsgReissueRDDLProposal") proto.RegisterType((*MsgReissueRDDLProposalResponse)(nil), "planetmintgo.dao.MsgReissueRDDLProposalResponse") proto.RegisterType((*MsgMintToken)(nil), "planetmintgo.dao.MsgMintToken") proto.RegisterType((*MsgMintTokenResponse)(nil), "planetmintgo.dao.MsgMintTokenResponse") + proto.RegisterType((*MsgReissueRDDLResult)(nil), "planetmintgo.dao.MsgReissueRDDLResult") + proto.RegisterType((*MsgReissueRDDLResultResponse)(nil), "planetmintgo.dao.MsgReissueRDDLResultResponse") } func init() { proto.RegisterFile("planetmintgo/dao/tx.proto", fileDescriptor_7117c47dbc1828c7) } var fileDescriptor_7117c47dbc1828c7 = []byte{ - // 341 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xc1, 0x4a, 0xf3, 0x40, - 0x10, 0xee, 0xb6, 0xe5, 0xff, 0xed, 0x54, 0x44, 0x56, 0x29, 0x31, 0xe0, 0x12, 0x22, 0x48, 0x2f, - 0x26, 0x52, 0x1f, 0x40, 0x90, 0x5e, 0x04, 0x03, 0xb2, 0x7a, 0xf2, 0x22, 0x69, 0xbb, 0x6c, 0x43, - 0xdb, 0x4c, 0xba, 0xbb, 0x85, 0x78, 0xf3, 0x11, 0x7c, 0x2c, 0x2f, 0x42, 0x8f, 0x1e, 0xa5, 0x7d,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, 0x74, 0x0a, 0x47, 0x65, 0xb7, 0x6a, 0x97, 0xac, 0x28, - 0xf5, 0x64, 0x5f, 0xfe, 0x95, 0x99, 0xaf, 0xa6, 0x0f, 0xd0, 0xd8, 0x5a, 0x67, 0xa5, 0xed, 0x1b, - 0xdc, 0x3e, 0xdf, 0x8d, 0xe7, 0x43, 0x6f, 0x6e, 0xdf, 0x17, 0x8c, 0xcc, 0x17, 0x8c, 0x7c, 0x2d, - 0x18, 0x79, 0x5b, 0xb2, 0xca, 0x7c, 0xc9, 0x2a, 0x9f, 0x4b, 0x56, 0x79, 0xf2, 0x65, 0x64, 0x86, - 0xb3, 0x9e, 0xd7, 0xc7, 0x89, 0xbf, 0x9d, 0x55, 0x08, 0x2f, 0x24, 0xfa, 0xe9, 0xfa, 0xf9, 0x5e, - 0x12, 0xa1, 0x7b, 0xff, 0xb2, 0x4f, 0xba, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x39, 0x2e, 0x48, - 0xa1, 0x9d, 0x02, 0x00, 0x00, + // 400 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xc1, 0x6a, 0xdb, 0x40, + 0x10, 0xf5, 0xca, 0xa6, 0xad, 0xc7, 0xa5, 0xb4, 0xdb, 0x62, 0x54, 0xd1, 0x2e, 0x42, 0x01, 0xe3, + 0x4b, 0xa4, 0xe0, 0x7c, 0x40, 0x20, 0xf8, 0x10, 0x43, 0x04, 0x61, 0x93, 0x53, 0x2e, 0x41, 0xb6, + 0x17, 0x59, 0x58, 0xd6, 0xca, 0xda, 0x15, 0x28, 0xb7, 0x90, 0x2f, 0xc8, 0xf7, 0xe4, 0x0b, 0x72, + 0xf4, 0x31, 0xc7, 0x60, 0xff, 0x48, 0xb0, 0x14, 0xc9, 0x22, 0x16, 0x8e, 0xc9, 0x6d, 0x76, 0xde, + 0x9b, 0x9d, 0x37, 0x6f, 0x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0xf8, 0xcd, 0xa7, 0x34, 0x2e, 0x9c, + 0x3a, 0xdb, 0x76, 0x2a, 0x4b, 0x19, 0x04, 0xfe, 0x55, 0x69, 0xc8, 0x45, 0xf6, 0x1e, 0x15, 0xa8, + 0xdb, 0xc2, 0xc5, 0x73, 0xf8, 0x5d, 0xb5, 0xd0, 0x6e, 0x85, 0x0f, 0x95, 0xc6, 0x6b, 0x47, 0xfb, + 0x32, 0xf3, 0xd6, 0xf8, 0x12, 0x9a, 0x9b, 0xfd, 0x90, 0xca, 0xf2, 0x02, 0xd7, 0x3a, 0xbb, 0xf1, + 0xe2, 0xd3, 0x29, 0xfc, 0xda, 0x36, 0xbc, 0xf3, 0x91, 0xb6, 0x8c, 0xa7, 0x99, 0xfb, 0xf1, 0xf2, + 0x66, 0xa7, 0x83, 0xa7, 0x25, 0x41, 0x8b, 0x25, 0x41, 0x2f, 0x4b, 0x82, 0x1e, 0x56, 0xa4, 0xb6, + 0x58, 0x91, 0xda, 0xf3, 0x8a, 0xd4, 0xae, 0x2d, 0xd7, 0x93, 0x93, 0x78, 0x68, 0x8e, 0xf8, 0xcc, + 0xda, 0xfc, 0x59, 0x0a, 0x0f, 0x5d, 0x6e, 0x25, 0xd9, 0x39, 0xde, 0x86, 0x4c, 0x0c, 0xbf, 0xa4, + 0xb7, 0x75, 0xfc, 0x1a, 0x00, 0x00, 0xff, 0xff, 0x42, 0x3f, 0x72, 0xd4, 0xaf, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -268,6 +377,7 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { ReissueRDDLProposal(ctx context.Context, in *MsgReissueRDDLProposal, opts ...grpc.CallOption) (*MsgReissueRDDLProposalResponse, error) MintToken(ctx context.Context, in *MsgMintToken, opts ...grpc.CallOption) (*MsgMintTokenResponse, error) + ReissueRDDLResult(ctx context.Context, in *MsgReissueRDDLResult, opts ...grpc.CallOption) (*MsgReissueRDDLResultResponse, error) } type msgClient struct { @@ -296,10 +406,20 @@ func (c *msgClient) MintToken(ctx context.Context, in *MsgMintToken, opts ...grp return out, nil } +func (c *msgClient) ReissueRDDLResult(ctx context.Context, in *MsgReissueRDDLResult, opts ...grpc.CallOption) (*MsgReissueRDDLResultResponse, error) { + out := new(MsgReissueRDDLResultResponse) + err := c.cc.Invoke(ctx, "/planetmintgo.dao.Msg/ReissueRDDLResult", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { ReissueRDDLProposal(context.Context, *MsgReissueRDDLProposal) (*MsgReissueRDDLProposalResponse, error) MintToken(context.Context, *MsgMintToken) (*MsgMintTokenResponse, error) + ReissueRDDLResult(context.Context, *MsgReissueRDDLResult) (*MsgReissueRDDLResultResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -312,6 +432,9 @@ func (*UnimplementedMsgServer) ReissueRDDLProposal(ctx context.Context, req *Msg func (*UnimplementedMsgServer) MintToken(ctx context.Context, req *MsgMintToken) (*MsgMintTokenResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MintToken not implemented") } +func (*UnimplementedMsgServer) ReissueRDDLResult(ctx context.Context, req *MsgReissueRDDLResult) (*MsgReissueRDDLResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReissueRDDLResult not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -353,6 +476,24 @@ func _Msg_MintToken_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Msg_ReissueRDDLResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReissueRDDLResult) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ReissueRDDLResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/planetmintgo.dao.Msg/ReissueRDDLResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ReissueRDDLResult(ctx, req.(*MsgReissueRDDLResult)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "planetmintgo.dao.Msg", HandlerType: (*MsgServer)(nil), @@ -365,6 +506,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MintToken", Handler: _Msg_MintToken_Handler, }, + { + MethodName: "ReissueRDDLResult", + Handler: _Msg_ReissueRDDLResult_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "planetmintgo/dao/tx.proto", @@ -507,6 +652,78 @@ func (m *MsgMintTokenResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgReissueRDDLResult) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgReissueRDDLResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReissueRDDLResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x20 + } + if len(m.TxId) > 0 { + i -= len(m.TxId) + copy(dAtA[i:], m.TxId) + i = encodeVarintTx(dAtA, i, uint64(len(m.TxId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgReissueRDDLResultResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgReissueRDDLResultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReissueRDDLResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -577,6 +794,39 @@ func (m *MsgMintTokenResponse) Size() (n int) { return n } +func (m *MsgReissueRDDLResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.TxId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BlockHeight != 0 { + n += 1 + sovTx(uint64(m.BlockHeight)) + } + return n +} + +func (m *MsgReissueRDDLResultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -966,6 +1216,221 @@ func (m *MsgMintTokenResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgReissueRDDLResult) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgReissueRDDLResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReissueRDDLResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgReissueRDDLResultResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgReissueRDDLResultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReissueRDDLResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0