From 8971cbbc4875982b710513ea3534e9b7a754cb62 Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Thu, 21 Oct 2021 04:02:25 -0500 Subject: [PATCH 01/10] Send: scaffold msg & datatype for Send. Fuse voter. We used to have two set of proto message; one datatype and one voter. Here we try to reduce that to 1. --- cmd/metaclientd/tx.go | 2 +- cmd/metaclientd/voter_test.go | 2 +- docs/static/openapi.yml | 331 +++++ proto/metacore/genesis.proto | 2 + proto/metacore/query.proto | 28 + proto/metacore/send.proto | 22 + proto/metacore/tx.proto | 20 + x/metacore/client/cli/query.go | 3 + x/metacore/client/cli/query_send.go | 71 ++ x/metacore/client/cli/query_send_test.go | 140 +++ x/metacore/client/cli/tx.go | 2 + x/metacore/client/cli/tx_send.go | 82 ++ x/metacore/client/cli/tx_send_test.go | 168 +++ .../client/cli/tx_txout_confirmation_voter.go | 2 +- x/metacore/genesis.go | 12 + x/metacore/handler.go | 4 + x/metacore/keeper/grpc_query_send.go | 54 + x/metacore/keeper/grpc_query_send_test.go | 104 ++ x/metacore/keeper/msg_server_send.go | 37 + x/metacore/keeper/msg_server_send_test.go | 119 ++ .../msg_server_txout_confirmation_voter.go | 1 - x/metacore/keeper/send.go | 49 + x/metacore/keeper/send_test.go | 46 + x/metacore/types/codec.go | 5 + x/metacore/types/genesis.go | 10 + x/metacore/types/genesis.pb.go | 109 +- x/metacore/types/keys.go | 4 + x/metacore/types/messages_send.go | 55 + x/metacore/types/query.pb.go | 1088 +++++++++++++++-- x/metacore/types/query.pb.gw.go | 184 +++ x/metacore/types/send.pb.go | 907 ++++++++++++++ x/metacore/types/tx.pb.go | 1041 +++++++++++++++- 32 files changed, 4495 insertions(+), 209 deletions(-) create mode 100644 proto/metacore/send.proto create mode 100644 x/metacore/client/cli/query_send.go create mode 100644 x/metacore/client/cli/query_send_test.go create mode 100644 x/metacore/client/cli/tx_send.go create mode 100644 x/metacore/client/cli/tx_send_test.go create mode 100644 x/metacore/keeper/grpc_query_send.go create mode 100644 x/metacore/keeper/grpc_query_send_test.go create mode 100644 x/metacore/keeper/msg_server_send.go create mode 100644 x/metacore/keeper/msg_server_send_test.go create mode 100644 x/metacore/keeper/send.go create mode 100644 x/metacore/keeper/send_test.go create mode 100644 x/metacore/types/messages_send.go create mode 100644 x/metacore/types/send.pb.go diff --git a/cmd/metaclientd/tx.go b/cmd/metaclientd/tx.go index 4d24239ad5..7e2b22c664 100644 --- a/cmd/metaclientd/tx.go +++ b/cmd/metaclientd/tx.go @@ -38,7 +38,7 @@ func (b *MetachainBridge) PostTxoutConfirmation(txoutId uint64, txHash string, m } // Get all current Txout from MetaCore -func (b *MetachainBridge) GetAllTxout() ([]*types.Txout, error){ +func (b *MetachainBridge) GetAllTxout() ([]*types.Txout, error) { client := types.NewQueryClient(b.grpcConn) resp, err := client.TxoutAll(context.Background(), &types.QueryAllTxoutRequest{}) if err != nil { diff --git a/cmd/metaclientd/voter_test.go b/cmd/metaclientd/voter_test.go index 5f5597133b..9aa794ba2f 100644 --- a/cmd/metaclientd/voter_test.go +++ b/cmd/metaclientd/voter_test.go @@ -100,7 +100,7 @@ func (s *VoterSuite) TestObservedTxIn(c *C) { txouts, err := b1.GetAllTxout() c.Assert(err, IsNil) log.Info().Msgf("txouts: %v", txouts) - c.Assert(len(txouts) >=1, Equals, true) + c.Assert(len(txouts) >= 1, Equals, true) txout := txouts[0] tid := txout.Id diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 8876011513..77c143520b 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -19332,6 +19332,209 @@ paths: type: string tags: - Query + /Meta-Protocol/metacore/metacore/send: + get: + summary: Queries a list of send items. + operationId: MetaProtocolMetacoreMetacoreSendAll + responses: + '200': + description: A successful response. + schema: + type: object + properties: + Send: + type: array + items: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + format: uint64 + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 + pagination: + type: object + properties: + nextKey: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.countTotal + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + tags: + - Query + '/Meta-Protocol/metacore/metacore/send/{index}': + get: + summary: Queries a send by index. + operationId: MetaProtocolMetacoreMetacoreSend + responses: + '200': + description: A successful response. + schema: + type: object + properties: + Send: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + format: uint64 + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: index + in: path + required: true + type: string + tags: + - Query /Meta-Protocol/metacore/metacore/txin: get: summary: Queries a list of txin items. @@ -30325,6 +30528,8 @@ definitions: description: |- Version defines the versioning scheme used to negotiate the IBC verison in the connection handshake. + MetaProtocol.metacore.metacore.MsgCreateSendResponse: + type: object MetaProtocol.metacore.metacore.MsgCreateTxinVoterResponse: type: object MetaProtocol.metacore.metacore.MsgSetNodeKeysResponse: @@ -30427,6 +30632,67 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + MetaProtocol.metacore.metacore.QueryAllSendResponse: + type: object + properties: + Send: + type: array + items: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + format: uint64 + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 + pagination: + type: object + properties: + nextKey: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } MetaProtocol.metacore.metacore.QueryAllTxinResponse: type: object properties: @@ -30709,6 +30975,40 @@ definitions: - Active - Disabled default: Unknown + MetaProtocol.metacore.metacore.QueryGetSendResponse: + type: object + properties: + Send: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + format: uint64 + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 MetaProtocol.metacore.metacore.QueryGetTxinResponse: type: object properties: @@ -30858,6 +31158,37 @@ definitions: Height: type: string format: uint64 + MetaProtocol.metacore.metacore.Send: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + format: uint64 + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 MetaProtocol.metacore.metacore.Txin: type: object properties: diff --git a/proto/metacore/genesis.proto b/proto/metacore/genesis.proto index 44376be0c8..39dbfe5615 100644 --- a/proto/metacore/genesis.proto +++ b/proto/metacore/genesis.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package MetaProtocol.metacore.metacore; // this line is used by starport scaffolding # genesis/proto/import +import "metacore/send.proto"; import "metacore/txout_confirmation.proto"; import "metacore/txout.proto"; import "metacore/node_account.proto"; @@ -13,6 +14,7 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; // GenesisState defines the metacore module's genesis state. message GenesisState { // this line is used by starport scaffolding # genesis/proto/state + repeated Send sendList = 7; // this line is used by starport scaffolding # genesis/proto/stateField repeated TxoutConfirmation txoutConfirmationList = 6; // this line is used by starport scaffolding # genesis/proto/stateField repeated Txout txoutList = 4; // this line is used by starport scaffolding # genesis/proto/stateField uint64 txoutCount = 5; // this line is used by starport scaffolding # genesis/proto/stateField diff --git a/proto/metacore/query.proto b/proto/metacore/query.proto index 585beb7e34..e9e793a9df 100644 --- a/proto/metacore/query.proto +++ b/proto/metacore/query.proto @@ -4,6 +4,7 @@ package MetaProtocol.metacore.metacore; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; // this line is used by starport scaffolding # 1 +import "metacore/send.proto"; import "metacore/txout_confirmation.proto"; import "metacore/txout.proto"; import "metacore/node_account.proto"; @@ -16,6 +17,17 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; service Query { // this line is used by starport scaffolding # 2 + // Queries a send by index. + rpc Send(QueryGetSendRequest) returns (QueryGetSendResponse) { + option (google.api.http).get = "/Meta-Protocol/metacore/metacore/send/{index}"; + } + + // Queries a list of send items. + rpc SendAll(QueryAllSendRequest) returns (QueryAllSendResponse) { + option (google.api.http).get = "/Meta-Protocol/metacore/metacore/send"; + } + + // Queries a txoutConfirmation by index. rpc TxoutConfirmation(QueryGetTxoutConfirmationRequest) returns (QueryGetTxoutConfirmationResponse) { option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txoutConfirmation/{index}"; @@ -79,6 +91,22 @@ service Query { } // this line is used by starport scaffolding # 3 +message QueryGetSendRequest { + string index = 1; +} + +message QueryGetSendResponse { + Send Send = 1; +} + +message QueryAllSendRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllSendResponse { + repeated Send Send = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} message QueryGetTxoutConfirmationRequest { string index = 1; } diff --git a/proto/metacore/send.proto b/proto/metacore/send.proto new file mode 100644 index 0000000000..cb4c4fb39c --- /dev/null +++ b/proto/metacore/send.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package MetaProtocol.metacore.metacore; + +option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; + +import "gogoproto/gogo.proto"; + +message Send { + string creator = 1; + string index = 2; + string sender = 3; + string senderChain = 4; + string receiver = 5; + string receiverChain = 6; + string mBurnt = 7; + string mMint = 8; + string message = 9; + string inTxHash = 10; + uint64 inBlockHeight = 11; + string outTxHash = 12; + uint64 outBlockHeight = 13; +} diff --git a/proto/metacore/tx.proto b/proto/metacore/tx.proto index 13905b885c..4ace778f95 100644 --- a/proto/metacore/tx.proto +++ b/proto/metacore/tx.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package MetaProtocol.metacore.metacore; // this line is used by starport scaffolding # proto/tx/import +import "metacore/send.proto"; import "metacore/txin_voter.proto"; import "common/common.proto"; @@ -10,12 +11,31 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; // Msg defines the Msg service. service Msg { // this line is used by starport scaffolding # proto/tx/rpc + rpc CreateSend(MsgCreateSend) returns (MsgCreateSendResponse); rpc TxoutConfirmationVoter(MsgTxoutConfirmationVoter) returns (MsgTxoutConfirmationVoterResponse); rpc SetNodeKeys(MsgSetNodeKeys) returns (MsgSetNodeKeysResponse); rpc CreateTxinVoter(MsgCreateTxinVoter) returns (MsgCreateTxinVoterResponse); } // this line is used by starport scaffolding # proto/tx/message +message MsgCreateSend { + string creator = 1; + string index = 2; + string sender = 3; + string senderChain = 4; + string receiver = 5; + string receiverChain = 6; + string mBurnt = 7; + string mMint = 8; + string message = 9; + string inTxHash = 10; + uint64 inBlockHeight = 11; + string outTxHash = 12; + uint64 outBlockHeight = 13; +} +message MsgCreateSendResponse { } + + message MsgTxoutConfirmationVoter { string creator = 1; uint64 txoutId = 2; diff --git a/x/metacore/client/cli/query.go b/x/metacore/client/cli/query.go index 6649d43b38..3b70c21836 100644 --- a/x/metacore/client/cli/query.go +++ b/x/metacore/client/cli/query.go @@ -26,6 +26,9 @@ func GetQueryCmd(queryRoute string) *cobra.Command { // this line is used by starport scaffolding # 1 + cmd.AddCommand(CmdListSend()) + cmd.AddCommand(CmdShowSend()) + cmd.AddCommand(CmdListTxoutConfirmation()) cmd.AddCommand(CmdShowTxoutConfirmation()) diff --git a/x/metacore/client/cli/query_send.go b/x/metacore/client/cli/query_send.go new file mode 100644 index 0000000000..220e29a653 --- /dev/null +++ b/x/metacore/client/cli/query_send.go @@ -0,0 +1,71 @@ +package cli + +import ( + "context" + + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +func CmdListSend() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-send", + Short: "list all Send", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllSendRequest{ + Pagination: pageReq, + } + + res, err := queryClient.SendAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowSend() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-send [index]", + Short: "shows a Send", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetSendRequest{ + Index: args[0], + } + + res, err := queryClient.Send(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/metacore/client/cli/query_send_test.go b/x/metacore/client/cli/query_send_test.go new file mode 100644 index 0000000000..34782ccbf4 --- /dev/null +++ b/x/metacore/client/cli/query_send_test.go @@ -0,0 +1,140 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/Meta-Protocol/metacore/testutil/network" + "github.com/Meta-Protocol/metacore/x/metacore/client/cli" + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func networkWithSendObjects(t *testing.T, n int) (*network.Network, []*types.Send) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + for i := 0; i < n; i++ { + state.SendList = append(state.SendList, &types.Send{Creator: "ANY", Index: strconv.Itoa(i)}) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.SendList +} + +func TestShowSend(t *testing.T) { + net, objs := networkWithSendObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + id string + args []string + err error + obj *types.Send + }{ + { + desc: "found", + id: objs[0].Index, + args: common, + obj: objs[0], + }, + { + desc: "not found", + id: "not_found", + args: common, + err: status.Error(codes.InvalidArgument, "not found"), + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + args := []string{tc.id} + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowSend(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetSendResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Send) + require.Equal(t, tc.obj, resp.Send) + } + }) + } +} + +func TestListSend(t *testing.T) { + net, objs := networkWithSendObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListSend(), args) + require.NoError(t, err) + var resp types.QueryAllSendResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + for j := i; j < len(objs) && j < i+step; j++ { + assert.Equal(t, objs[j], resp.Send[j-i]) + } + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListSend(), args) + require.NoError(t, err) + var resp types.QueryAllSendResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + for j := i; j < len(objs) && j < i+step; j++ { + assert.Equal(t, objs[j], resp.Send[j-i]) + } + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListSend(), args) + require.NoError(t, err) + var resp types.QueryAllSendResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.Equal(t, objs, resp.Send) + }) +} diff --git a/x/metacore/client/cli/tx.go b/x/metacore/client/cli/tx.go index 6a4a254a66..e925954c1f 100644 --- a/x/metacore/client/cli/tx.go +++ b/x/metacore/client/cli/tx.go @@ -30,6 +30,8 @@ func GetTxCmd() *cobra.Command { } // this line is used by starport scaffolding # 1 + cmd.AddCommand(CmdCreateSend()) + cmd.AddCommand(CmdTxoutConfirmationVoter()) cmd.AddCommand(CmdSetNodeKeys()) diff --git a/x/metacore/client/cli/tx_send.go b/x/metacore/client/cli/tx_send.go new file mode 100644 index 0000000000..39643bfe41 --- /dev/null +++ b/x/metacore/client/cli/tx_send.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/spf13/cobra" + + "github.com/spf13/cast" + + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" +) + +func CmdCreateSend() *cobra.Command { + cmd := &cobra.Command{ + Use: "create-send [index] [sender] [senderChain] [receiver] [receiverChain] [mBurnt] [mMint] [message] [inTxHash] [inBlockHeight] [outTxHash] [outBlockHeight]", + Short: "Create a new Send", + Args: cobra.ExactArgs(12), + RunE: func(cmd *cobra.Command, args []string) error { + index := args[0] + argsSender, err := cast.ToStringE(args[1]) + if err != nil { + return err + } + argsSenderChain, err := cast.ToStringE(args[2]) + if err != nil { + return err + } + argsReceiver, err := cast.ToStringE(args[3]) + if err != nil { + return err + } + argsReceiverChain, err := cast.ToStringE(args[4]) + if err != nil { + return err + } + argsMBurnt, err := cast.ToStringE(args[5]) + if err != nil { + return err + } + argsMMint, err := cast.ToStringE(args[6]) + if err != nil { + return err + } + argsMessage, err := cast.ToStringE(args[7]) + if err != nil { + return err + } + argsInTxHash, err := cast.ToStringE(args[8]) + if err != nil { + return err + } + argsInBlockHeight, err := cast.ToUint64E(args[9]) + if err != nil { + return err + } + argsOutTxHash, err := cast.ToStringE(args[10]) + if err != nil { + return err + } + argsOutBlockHeight, err := cast.ToUint64E(args[11]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCreateSend(clientCtx.GetFromAddress().String(), index, argsSender, argsSenderChain, argsReceiver, argsReceiverChain, argsMBurnt, argsMMint, argsMessage, argsInTxHash, argsInBlockHeight, argsOutTxHash, argsOutBlockHeight) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/metacore/client/cli/tx_send_test.go b/x/metacore/client/cli/tx_send_test.go new file mode 100644 index 0000000000..c8f7fb0e87 --- /dev/null +++ b/x/metacore/client/cli/tx_send_test.go @@ -0,0 +1,168 @@ +package cli_test + +import ( + "fmt" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + + "github.com/Meta-Protocol/metacore/testutil/network" + "github.com/Meta-Protocol/metacore/x/metacore/client/cli" +) + +func TestCreateSend(t *testing.T) { + net := network.New(t) + val := net.Validators[0] + ctx := val.ClientCtx + id := "0" + + fields := []string{"xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz"} + for _, tc := range []struct { + desc string + id string + args []string + err error + code uint32 + }{ + { + id: id, + desc: "valid", + args: []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdk.NewInt(10))).String()), + }, + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + args := []string{tc.id} + args = append(args, fields...) + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateSend(), args) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + var resp sdk.TxResponse + require.NoError(t, ctx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &resp)) + require.Equal(t, tc.code, resp.Code) + } + }) + } +} + +func TestUpdateSend(t *testing.T) { + net := network.New(t) + val := net.Validators[0] + ctx := val.ClientCtx + id := "0" + + fields := []string{"xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz"} + common := []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdk.NewInt(10))).String()), + } + args := []string{id} + args = append(args, fields...) + args = append(args, common...) + _, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateSend(), args) + require.NoError(t, err) + + for _, tc := range []struct { + desc string + id string + args []string + code uint32 + err error + }{ + { + desc: "valid", + id: id, + args: common, + }, + { + desc: "key not found", + id: "1", + args: common, + code: sdkerrors.ErrKeyNotFound.ABCICode(), + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + args := []string{tc.id} + args = append(args, fields...) + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdUpdateSend(), args) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + var resp sdk.TxResponse + require.NoError(t, ctx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &resp)) + require.Equal(t, tc.code, resp.Code) + } + }) + } +} + +func TestDeleteSend(t *testing.T) { + net := network.New(t) + + val := net.Validators[0] + ctx := val.ClientCtx + id := "0" + + fields := []string{"xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz"} + common := []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdk.NewInt(10))).String()), + } + args := []string{id} + args = append(args, fields...) + args = append(args, common...) + _, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateSend(), args) + require.NoError(t, err) + + for _, tc := range []struct { + desc string + id string + args []string + code uint32 + err error + }{ + { + desc: "valid", + id: id, + args: common, + }, + { + desc: "key not found", + id: "1", + args: common, + code: sdkerrors.ErrKeyNotFound.ABCICode(), + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdDeleteSend(), append([]string{tc.id}, tc.args...)) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + var resp sdk.TxResponse + require.NoError(t, ctx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &resp)) + require.Equal(t, tc.code, resp.Code) + } + }) + } +} diff --git a/x/metacore/client/cli/tx_txout_confirmation_voter.go b/x/metacore/client/cli/tx_txout_confirmation_voter.go index be3a31f9bb..fb0bdfa3c4 100644 --- a/x/metacore/client/cli/tx_txout_confirmation_voter.go +++ b/x/metacore/client/cli/tx_txout_confirmation_voter.go @@ -24,7 +24,7 @@ func CmdTxoutConfirmationVoter() *cobra.Command { return err } argsTxHash := args[1] - argsMMint,err := cast.ToUint64E(args[2]) + argsMMint, err := cast.ToUint64E(args[2]) if err != nil { return err } diff --git a/x/metacore/genesis.go b/x/metacore/genesis.go index c2ee29e0ac..793786d3c2 100644 --- a/x/metacore/genesis.go +++ b/x/metacore/genesis.go @@ -10,6 +10,11 @@ import ( // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { // this line is used by starport scaffolding # genesis/module/init + // Set all the send + for _, elem := range genState.SendList { + k.SetSend(ctx, *elem) + } + // Set all the txoutConfirmation for _, elem := range genState.TxoutConfirmationList { k.SetTxoutConfirmation(ctx, *elem) @@ -46,6 +51,13 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() // this line is used by starport scaffolding # genesis/module/export + // Get all send + sendList := k.GetAllSend(ctx) + for _, elem := range sendList { + elem := elem + genesis.SendList = append(genesis.SendList, &elem) + } + // Get all txoutConfirmation txoutConfirmationList := k.GetAllTxoutConfirmation(ctx) for _, elem := range txoutConfirmationList { diff --git a/x/metacore/handler.go b/x/metacore/handler.go index 8b816aa47e..b5c69cefd9 100644 --- a/x/metacore/handler.go +++ b/x/metacore/handler.go @@ -18,6 +18,10 @@ func NewHandler(k keeper.Keeper) sdk.Handler { switch msg := msg.(type) { // this line is used by starport scaffolding # 1 + case *types.MsgCreateSend: + res, err := msgServer.CreateSend(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgTxoutConfirmationVoter: res, err := msgServer.TxoutConfirmationVoter(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) diff --git a/x/metacore/keeper/grpc_query_send.go b/x/metacore/keeper/grpc_query_send.go new file mode 100644 index 0000000000..11c3172cb6 --- /dev/null +++ b/x/metacore/keeper/grpc_query_send.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "context" + + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) SendAll(c context.Context, req *types.QueryAllSendRequest) (*types.QueryAllSendResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var sends []*types.Send + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + sendStore := prefix.NewStore(store, types.KeyPrefix(types.SendKey)) + + pageRes, err := query.Paginate(sendStore, req.Pagination, func(key []byte, value []byte) error { + var send types.Send + if err := k.cdc.UnmarshalBinaryBare(value, &send); err != nil { + return err + } + + sends = append(sends, &send) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllSendResponse{Send: sends, Pagination: pageRes}, nil +} + +func (k Keeper) Send(c context.Context, req *types.QueryGetSendRequest) (*types.QueryGetSendResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetSend(ctx, req.Index) + if !found { + return nil, status.Error(codes.InvalidArgument, "not found") + } + + return &types.QueryGetSendResponse{Send: &val}, nil +} diff --git a/x/metacore/keeper/grpc_query_send_test.go b/x/metacore/keeper/grpc_query_send_test.go new file mode 100644 index 0000000000..540c7103b8 --- /dev/null +++ b/x/metacore/keeper/grpc_query_send_test.go @@ -0,0 +1,104 @@ +package keeper + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func TestSendQuerySingle(t *testing.T) { + keeper, ctx := setupKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNSend(keeper, ctx, 2) + for _, tc := range []struct { + desc string + request *types.QueryGetSendRequest + response *types.QueryGetSendResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetSendRequest{Index: msgs[0].Index}, + response: &types.QueryGetSendResponse{Send: &msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetSendRequest{Index: msgs[1].Index}, + response: &types.QueryGetSendResponse{Send: &msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetSendRequest{Index: "missing"}, + err: status.Error(codes.InvalidArgument, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Send(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.Equal(t, tc.response, response) + } + }) + } +} + +func TestSendQueryPaginated(t *testing.T) { + keeper, ctx := setupKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNSend(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllSendRequest { + return &types.QueryAllSendRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.SendAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + for j := i; j < len(msgs) && j < i+step; j++ { + assert.Equal(t, &msgs[j], resp.Send[j-i]) + } + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.SendAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + for j := i; j < len(msgs) && j < i+step; j++ { + assert.Equal(t, &msgs[j], resp.Send[j-i]) + } + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.SendAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.SendAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/metacore/keeper/msg_server_send.go b/x/metacore/keeper/msg_server_send.go new file mode 100644 index 0000000000..5f89895b4d --- /dev/null +++ b/x/metacore/keeper/msg_server_send.go @@ -0,0 +1,37 @@ +package keeper + +import ( + "context" + "github.com/Meta-Protocol/metacore/x/metacore/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) CreateSend(goCtx context.Context, msg *types.MsgCreateSend) (*types.MsgCreateSendResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // index should be inTxHash + send, isFound := k.GetSend(ctx, msg.Index) + if !isFound { + send = types.Send{ + Index: msg.Index, + Creator: msg.Creator, + Sender: msg.Sender, + SenderChain: msg.SenderChain, + Receiver: msg.Receiver, + ReceiverChain: msg.ReceiverChain, + MBurnt: msg.MBurnt, + MMint: msg.MMint, + Message: msg.Message, + InTxHash: msg.InTxHash, + InBlockHeight: msg.InBlockHeight, + OutTxHash: msg.OutTxHash, + OutBlockHeight: msg.OutBlockHeight, + } + } + + + k.SetSend(ctx, send) + + + return &types.MsgCreateSendResponse{}, nil +} diff --git a/x/metacore/keeper/msg_server_send_test.go b/x/metacore/keeper/msg_server_send_test.go new file mode 100644 index 0000000000..66b244e2cf --- /dev/null +++ b/x/metacore/keeper/msg_server_send_test.go @@ -0,0 +1,119 @@ +package keeper + +import ( + "fmt" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func TestSendMsgServerCreate(t *testing.T) { + keeper, ctx := setupKeeper(t) + srv := NewMsgServerImpl(*keeper) + wctx := sdk.WrapSDKContext(ctx) + creator := "A" + for i := 0; i < 5; i++ { + idx := fmt.Sprintf("%d", i) + expected := &types.MsgCreateSend{Creator: creator, Index: idx} + _, err := srv.CreateSend(wctx, expected) + require.NoError(t, err) + rst, found := keeper.GetSend(ctx, expected.Index) + require.True(t, found) + assert.Equal(t, expected.Creator, rst.Creator) + } +} + +func TestSendMsgServerUpdate(t *testing.T) { + creator := "A" + index := "any" + + for _, tc := range []struct { + desc string + request *types.MsgUpdateSend + err error + }{ + { + desc: "Completed", + request: &types.MsgUpdateSend{Creator: creator, Index: index}, + }, + { + desc: "Unauthorized", + request: &types.MsgUpdateSend{Creator: "B", Index: index}, + err: sdkerrors.ErrUnauthorized, + }, + { + desc: "KeyNotFound", + request: &types.MsgUpdateSend{Creator: creator, Index: "missing"}, + err: sdkerrors.ErrKeyNotFound, + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + keeper, ctx := setupKeeper(t) + srv := NewMsgServerImpl(*keeper) + wctx := sdk.WrapSDKContext(ctx) + expected := &types.MsgCreateSend{Creator: creator, Index: index} + _, err := srv.CreateSend(wctx, expected) + require.NoError(t, err) + + _, err = srv.UpdateSend(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + rst, found := keeper.GetSend(ctx, expected.Index) + require.True(t, found) + assert.Equal(t, expected.Creator, rst.Creator) + } + }) + } +} + +func TestSendMsgServerDelete(t *testing.T) { + creator := "A" + index := "any" + + for _, tc := range []struct { + desc string + request *types.MsgDeleteSend + err error + }{ + { + desc: "Completed", + request: &types.MsgDeleteSend{Creator: creator, Index: index}, + }, + { + desc: "Unauthorized", + request: &types.MsgDeleteSend{Creator: "B", Index: index}, + err: sdkerrors.ErrUnauthorized, + }, + { + desc: "KeyNotFound", + request: &types.MsgDeleteSend{Creator: creator, Index: "missing"}, + err: sdkerrors.ErrKeyNotFound, + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + keeper, ctx := setupKeeper(t) + srv := NewMsgServerImpl(*keeper) + wctx := sdk.WrapSDKContext(ctx) + + _, err := srv.CreateSend(wctx, &types.MsgCreateSend{Creator: creator, Index: index}) + require.NoError(t, err) + _, err = srv.DeleteSend(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + _, found := keeper.GetSend(ctx, tc.request.Index) + require.False(t, found) + } + }) + } +} diff --git a/x/metacore/keeper/msg_server_txout_confirmation_voter.go b/x/metacore/keeper/msg_server_txout_confirmation_voter.go index cbd32b1117..287e8fc7e1 100644 --- a/x/metacore/keeper/msg_server_txout_confirmation_voter.go +++ b/x/metacore/keeper/msg_server_txout_confirmation_voter.go @@ -44,7 +44,6 @@ func (k msgServer) TxoutConfirmationVoter(goCtx context.Context, msg *types.MsgT k.SetTxoutConfirmation(ctx, txoutConf) - if len(txoutConf.Signers) == 2 { // TODO: fix threshold txoutConf.FinalizedHeight = uint64(ctx.BlockHeader().Height) k.RemoveTxout(ctx, txoutConf.TxoutId) diff --git a/x/metacore/keeper/send.go b/x/metacore/keeper/send.go new file mode 100644 index 0000000000..6a27c47946 --- /dev/null +++ b/x/metacore/keeper/send.go @@ -0,0 +1,49 @@ +package keeper + +import ( + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetSend set a specific send in the store from its index +func (k Keeper) SetSend(ctx sdk.Context, send types.Send) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SendKey)) + b := k.cdc.MustMarshalBinaryBare(&send) + store.Set(types.KeyPrefix(send.Index), b) +} + +// GetSend returns a send from its index +func (k Keeper) GetSend(ctx sdk.Context, index string) (val types.Send, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SendKey)) + + b := store.Get(types.KeyPrefix(index)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshalBinaryBare(b, &val) + return val, true +} + +// RemoveSend removes a send from the store +func (k Keeper) RemoveSend(ctx sdk.Context, index string) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SendKey)) + store.Delete(types.KeyPrefix(index)) +} + +// GetAllSend returns all send +func (k Keeper) GetAllSend(ctx sdk.Context) (list []types.Send) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SendKey)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Send + k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/metacore/keeper/send_test.go b/x/metacore/keeper/send_test.go new file mode 100644 index 0000000000..838c8d7986 --- /dev/null +++ b/x/metacore/keeper/send_test.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "fmt" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/assert" + + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func createNSend(keeper *Keeper, ctx sdk.Context, n int) []types.Send { + items := make([]types.Send, n) + for i := range items { + items[i].Creator = "any" + items[i].Index = fmt.Sprintf("%d", i) + keeper.SetSend(ctx, items[i]) + } + return items +} + +func TestSendGet(t *testing.T) { + keeper, ctx := setupKeeper(t) + items := createNSend(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetSend(ctx, item.Index) + assert.True(t, found) + assert.Equal(t, item, rst) + } +} +func TestSendRemove(t *testing.T) { + keeper, ctx := setupKeeper(t) + items := createNSend(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveSend(ctx, item.Index) + _, found := keeper.GetSend(ctx, item.Index) + assert.False(t, found) + } +} + +func TestSendGetAll(t *testing.T) { + keeper, ctx := setupKeeper(t) + items := createNSend(keeper, ctx, 10) + assert.Equal(t, items, keeper.GetAllSend(ctx)) +} diff --git a/x/metacore/types/codec.go b/x/metacore/types/codec.go index e011d33616..86b27ceccb 100644 --- a/x/metacore/types/codec.go +++ b/x/metacore/types/codec.go @@ -9,6 +9,8 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { // this line is used by starport scaffolding # 2 + cdc.RegisterConcrete(&MsgCreateSend{}, "metacore/CreateSend", nil) + cdc.RegisterConcrete(&MsgTxoutConfirmationVoter{}, "metacore/TxoutConfirmationVoter", nil) cdc.RegisterConcrete(&MsgSetNodeKeys{}, "metacore/SetNodeKeys", nil) @@ -19,6 +21,9 @@ func RegisterCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { // this line is used by starport scaffolding # 3 + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCreateSend{}, + ) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgTxoutConfirmationVoter{}, ) diff --git a/x/metacore/types/genesis.go b/x/metacore/types/genesis.go index 8d284300af..bc56c8fd4b 100644 --- a/x/metacore/types/genesis.go +++ b/x/metacore/types/genesis.go @@ -13,6 +13,7 @@ func DefaultGenesis() *GenesisState { return &GenesisState{ // this line is used by starport scaffolding # ibc/genesistype/default // this line is used by starport scaffolding # genesis/types/default + SendList: []*Send{}, TxoutConfirmationList: []*TxoutConfirmation{}, TxoutList: []*Txout{}, NodeAccountList: []*NodeAccount{}, @@ -27,6 +28,15 @@ func (gs GenesisState) Validate() error { // this line is used by starport scaffolding # ibc/genesistype/validate // this line is used by starport scaffolding # genesis/types/validate + // Check for duplicated index in send + sendIndexMap := make(map[string]bool) + + for _, elem := range gs.SendList { + if _, ok := sendIndexMap[elem.Index]; ok { + return fmt.Errorf("duplicated index for send") + } + sendIndexMap[elem.Index] = true + } // Check for duplicated index in txoutConfirmation txoutConfirmationIndexMap := make(map[string]bool) diff --git a/x/metacore/types/genesis.pb.go b/x/metacore/types/genesis.pb.go index 17ad7ccbef..05783594ef 100644 --- a/x/metacore/types/genesis.pb.go +++ b/x/metacore/types/genesis.pb.go @@ -25,6 +25,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the metacore module's genesis state. type GenesisState struct { // this line is used by starport scaffolding # genesis/proto/state + SendList []*Send `protobuf:"bytes,7,rep,name=sendList,proto3" json:"sendList,omitempty"` TxoutConfirmationList []*TxoutConfirmation `protobuf:"bytes,6,rep,name=txoutConfirmationList,proto3" json:"txoutConfirmationList,omitempty"` TxoutList []*Txout `protobuf:"bytes,4,rep,name=txoutList,proto3" json:"txoutList,omitempty"` TxoutCount uint64 `protobuf:"varint,5,opt,name=txoutCount,proto3" json:"txoutCount,omitempty"` @@ -66,6 +67,13 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo +func (m *GenesisState) GetSendList() []*Send { + if m != nil { + return m.SendList + } + return nil +} + func (m *GenesisState) GetTxoutConfirmationList() []*TxoutConfirmation { if m != nil { return m.TxoutConfirmationList @@ -115,29 +123,30 @@ func init() { func init() { proto.RegisterFile("metacore/genesis.proto", fileDescriptor_c68bd28f2e9a7fbf) } var fileDescriptor_c68bd28f2e9a7fbf = []byte{ - // 338 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcb, 0x4a, 0x03, 0x31, - 0x14, 0x86, 0x3b, 0xb6, 0x16, 0x8d, 0x8a, 0x10, 0x2f, 0xd4, 0x0a, 0xa1, 0x8a, 0x42, 0x45, 0x9c, - 0x62, 0x7d, 0x01, 0xb5, 0x0b, 0x37, 0xf5, 0x42, 0xbc, 0x2c, 0xdc, 0x94, 0x69, 0x8c, 0x35, 0x60, - 0x93, 0x32, 0x73, 0x46, 0xea, 0x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87, 0xd3, 0x46, 0x5d, 0xa5, 0x36, 0x3a, - 0xc9, 0xc0, 0xd7, 0x68, 0x45, 0x67, 0xf8, 0xa0, 0xd3, 0x35, 0xd0, 0x39, 0x03, 0x3d, 0x98, 0xbe, - 0x7f, 0x64, 0xa2, 0x79, 0x3f, 0x3e, 0x45, 0x0b, 0x5a, 0x30, 0x2c, 0xcb, 0xb0, 0xf6, 0x66, 0x61, - 0xd1, 0xc4, 0x75, 0xde, 0xfe, 0x1a, 0x13, 0x6b, 0x34, 0x26, 0xd6, 0xcf, 0x98, 0x58, 0x1f, 0x01, - 0x29, 0x8c, 0x02, 0x52, 0xf8, 0x0e, 0x48, 0xe1, 0xb1, 0xd9, 0x13, 0xf0, 0xe2, 0x77, 0x6d, 0xa6, - 0xfa, 0x0d, 0xcd, 0x3c, 0x8a, 0xa1, 0x8d, 0xe4, 0x20, 0x86, 0x69, 0x09, 0xef, 0x03, 0xee, 0x75, - 0xcb, 0xe6, 0x3a, 0x4e, 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x07, 0xc5, 0x14, 0xdd, 0x02, - 0x00, 0x00, + // 363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcd, 0x4e, 0xc2, 0x40, + 0x10, 0xc7, 0xa9, 0x20, 0xea, 0xaa, 0x31, 0x59, 0xd4, 0x20, 0x26, 0x1b, 0x34, 0x9a, 0x60, 0x8c, + 0x25, 0xe2, 0x0b, 0xa8, 0x1c, 0xbc, 0xe0, 0x47, 0x16, 0xf5, 0xe0, 0x85, 0x94, 0xb2, 0x62, 0x13, + 0xd9, 0x25, 0xed, 0xd4, 0xe0, 0x1b, 0x78, 0xf4, 0xb1, 0x3c, 0x72, 0xf4, 0x68, 0xe0, 0x45, 0xcc, + 0x4e, 0xcb, 0xf2, 0x11, 0x63, 0xb9, 0x4d, 0xfe, 0x33, 0xff, 0xdf, 0xcc, 0xec, 0x2c, 0xd9, 0xee, + 0x08, 0x70, 0x5c, 0xe5, 0x8b, 0x72, 0x5b, 0x48, 0x11, 0x78, 0x81, 0xdd, 0xf5, 0x15, 0x28, 0xca, + 0xae, 0x05, 0x38, 0x77, 0x3a, 0x74, 0xd5, 0xab, 0x3d, 0x2a, 0x32, 0x41, 0x21, 0x67, 0x7c, 0x81, + 0x90, 0xad, 0xc8, 0x54, 0xd8, 0x33, 0x22, 0xf4, 0x54, 0x08, 0x0d, 0x57, 0xc9, 0x67, 0xcf, 0xef, + 0x38, 0xe0, 0x29, 0x19, 0x97, 0x6c, 0x4e, 0x97, 0xc4, 0xea, 0xae, 0x51, 0xa5, 0x6a, 0x89, 0x86, + 0xe3, 0xba, 0x2a, 0x94, 0xa3, 0xe4, 0xce, 0x84, 0xc5, 0x93, 0x8d, 0x37, 0x05, 0xc2, 0x8f, 0x53, + 0xb9, 0xa9, 0x54, 0x24, 0xee, 0x7f, 0x64, 0xc8, 0xda, 0x55, 0xb4, 0x4c, 0x1d, 0x1c, 0x10, 0xf4, + 0x9c, 0x2c, 0xeb, 0x21, 0x6b, 0x5e, 0x00, 0xf9, 0xa5, 0x62, 0xba, 0xb4, 0x5a, 0x39, 0xb0, 0xff, + 0x5f, 0xcf, 0xae, 0x0b, 0xd9, 0xe2, 0xc6, 0x45, 0xdb, 0x64, 0x0b, 0xc7, 0xad, 0x4e, 0x2c, 0x84, + 0xb8, 0x2c, 0xe2, 0x4e, 0x93, 0x70, 0xf7, 0xb3, 0x66, 0xfe, 0x37, 0x8f, 0x56, 0xc9, 0x0a, 0x26, + 0x10, 0x9e, 0x41, 0xf8, 0xe1, 0x5c, 0x70, 0x3e, 0xf6, 0x51, 0x46, 0x48, 0x4c, 0x0f, 0x25, 0xe4, + 0x17, 0x8b, 0x56, 0x29, 0xc3, 0x27, 0x14, 0xfa, 0x40, 0x36, 0xf4, 0x33, 0x5f, 0x44, 0xaf, 0x8c, + 0xad, 0xd2, 0xd8, 0xea, 0x38, 0xa9, 0xd5, 0xcd, 0xd8, 0xc6, 0x67, 0x19, 0xf4, 0x96, 0xac, 0xeb, + 0x2b, 0x3c, 0xea, 0xfb, 0x20, 0x74, 0x01, 0xa1, 0x47, 0xc9, 0xf3, 0xc7, 0x26, 0x3e, 0xed, 0xd7, + 0x77, 0xd3, 0x02, 0xb2, 0xac, 0xf9, 0xee, 0xa6, 0x59, 0xdc, 0xb8, 0x2e, 0x6b, 0x5f, 0x03, 0x66, + 0xf5, 0x07, 0xcc, 0xfa, 0x19, 0x30, 0xeb, 0x73, 0xc8, 0x52, 0xfd, 0x21, 0x4b, 0x7d, 0x0f, 0x59, + 0xea, 0xa9, 0xd2, 0xf6, 0xe0, 0x25, 0x6c, 0xda, 0xae, 0xea, 0x94, 0x35, 0xf3, 0x64, 0x04, 0x2d, + 0x9b, 0x2f, 0xd5, 0x1b, 0x87, 0xf0, 0xde, 0x15, 0x41, 0x33, 0x8b, 0xff, 0xeb, 0xec, 0x37, 0x00, + 0x00, 0xff, 0xff, 0x13, 0x34, 0x55, 0xa6, 0x34, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -160,6 +169,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SendList) > 0 { + for iNdEx := len(m.SendList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } if len(m.TxoutConfirmationList) > 0 { for iNdEx := len(m.TxoutConfirmationList) - 1; iNdEx >= 0; iNdEx-- { { @@ -288,6 +311,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.SendList) > 0 { + for _, e := range m.SendList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -515,6 +544,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendList = append(m.SendList, &Send{}) + if err := m.SendList[len(m.SendList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/metacore/types/keys.go b/x/metacore/types/keys.go index 25b1950754..01765f9408 100644 --- a/x/metacore/types/keys.go +++ b/x/metacore/types/keys.go @@ -45,3 +45,7 @@ const ( const ( TxoutConfirmationKey = "TxoutConfirmation-value-" ) + +const ( + SendKey = "Send-value-" +) diff --git a/x/metacore/types/messages_send.go b/x/metacore/types/messages_send.go new file mode 100644 index 0000000000..125ff8187e --- /dev/null +++ b/x/metacore/types/messages_send.go @@ -0,0 +1,55 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgCreateSend{} + +func NewMsgCreateSend(creator string, index string, sender string, senderChain string, receiver string, receiverChain string, mBurnt string, mMint string, message string, inTxHash string, inBlockHeight uint64, outTxHash string, outBlockHeight uint64) *MsgCreateSend { + return &MsgCreateSend{ + Creator: creator, + Index: index, + Sender: sender, + SenderChain: senderChain, + Receiver: receiver, + ReceiverChain: receiverChain, + MBurnt: mBurnt, + MMint: mMint, + Message: message, + InTxHash: inTxHash, + InBlockHeight: inBlockHeight, + OutTxHash: outTxHash, + OutBlockHeight: outBlockHeight, + } +} + +func (msg *MsgCreateSend) Route() string { + return RouterKey +} + +func (msg *MsgCreateSend) Type() string { + return "CreateSend" +} + +func (msg *MsgCreateSend) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgCreateSend) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCreateSend) 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/metacore/types/query.pb.go b/x/metacore/types/query.pb.go index 835cff8be6..3a420760dc 100644 --- a/x/metacore/types/query.pb.go +++ b/x/metacore/types/query.pb.go @@ -30,6 +30,190 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // this line is used by starport scaffolding # 3 +type QueryGetSendRequest struct { + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +} + +func (m *QueryGetSendRequest) Reset() { *m = QueryGetSendRequest{} } +func (m *QueryGetSendRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetSendRequest) ProtoMessage() {} +func (*QueryGetSendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{0} +} +func (m *QueryGetSendRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSendRequest.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 *QueryGetSendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSendRequest.Merge(m, src) +} +func (m *QueryGetSendRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSendRequest proto.InternalMessageInfo + +func (m *QueryGetSendRequest) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +type QueryGetSendResponse struct { + Send *Send `protobuf:"bytes,1,opt,name=Send,proto3" json:"Send,omitempty"` +} + +func (m *QueryGetSendResponse) Reset() { *m = QueryGetSendResponse{} } +func (m *QueryGetSendResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetSendResponse) ProtoMessage() {} +func (*QueryGetSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{1} +} +func (m *QueryGetSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSendResponse.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 *QueryGetSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSendResponse.Merge(m, src) +} +func (m *QueryGetSendResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSendResponse proto.InternalMessageInfo + +func (m *QueryGetSendResponse) GetSend() *Send { + if m != nil { + return m.Send + } + return nil +} + +type QueryAllSendRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllSendRequest) Reset() { *m = QueryAllSendRequest{} } +func (m *QueryAllSendRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllSendRequest) ProtoMessage() {} +func (*QueryAllSendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{2} +} +func (m *QueryAllSendRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllSendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllSendRequest.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 *QueryAllSendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllSendRequest.Merge(m, src) +} +func (m *QueryAllSendRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllSendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllSendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllSendRequest proto.InternalMessageInfo + +func (m *QueryAllSendRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllSendResponse struct { + Send []*Send `protobuf:"bytes,1,rep,name=Send,proto3" json:"Send,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllSendResponse) Reset() { *m = QueryAllSendResponse{} } +func (m *QueryAllSendResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllSendResponse) ProtoMessage() {} +func (*QueryAllSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{3} +} +func (m *QueryAllSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllSendResponse.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 *QueryAllSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllSendResponse.Merge(m, src) +} +func (m *QueryAllSendResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllSendResponse proto.InternalMessageInfo + +func (m *QueryAllSendResponse) GetSend() []*Send { + if m != nil { + return m.Send + } + return nil +} + +func (m *QueryAllSendResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + type QueryGetTxoutConfirmationRequest struct { Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` } @@ -38,7 +222,7 @@ func (m *QueryGetTxoutConfirmationRequest) Reset() { *m = QueryGetTxoutC func (m *QueryGetTxoutConfirmationRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTxoutConfirmationRequest) ProtoMessage() {} func (*QueryGetTxoutConfirmationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{0} + return fileDescriptor_dc2a1267d2da6377, []int{4} } func (m *QueryGetTxoutConfirmationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -82,7 +266,7 @@ func (m *QueryGetTxoutConfirmationResponse) Reset() { *m = QueryGetTxout func (m *QueryGetTxoutConfirmationResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTxoutConfirmationResponse) ProtoMessage() {} func (*QueryGetTxoutConfirmationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{1} + return fileDescriptor_dc2a1267d2da6377, []int{5} } func (m *QueryGetTxoutConfirmationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -126,7 +310,7 @@ func (m *QueryAllTxoutConfirmationRequest) Reset() { *m = QueryAllTxoutC func (m *QueryAllTxoutConfirmationRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllTxoutConfirmationRequest) ProtoMessage() {} func (*QueryAllTxoutConfirmationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{2} + return fileDescriptor_dc2a1267d2da6377, []int{6} } func (m *QueryAllTxoutConfirmationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -171,7 +355,7 @@ func (m *QueryAllTxoutConfirmationResponse) Reset() { *m = QueryAllTxout func (m *QueryAllTxoutConfirmationResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllTxoutConfirmationResponse) ProtoMessage() {} func (*QueryAllTxoutConfirmationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{3} + return fileDescriptor_dc2a1267d2da6377, []int{7} } func (m *QueryAllTxoutConfirmationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -222,7 +406,7 @@ func (m *QueryGetTxoutRequest) Reset() { *m = QueryGetTxoutRequest{} } func (m *QueryGetTxoutRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTxoutRequest) ProtoMessage() {} func (*QueryGetTxoutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{4} + return fileDescriptor_dc2a1267d2da6377, []int{8} } func (m *QueryGetTxoutRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -266,7 +450,7 @@ func (m *QueryGetTxoutResponse) Reset() { *m = QueryGetTxoutResponse{} } func (m *QueryGetTxoutResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTxoutResponse) ProtoMessage() {} func (*QueryGetTxoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{5} + return fileDescriptor_dc2a1267d2da6377, []int{9} } func (m *QueryGetTxoutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -310,7 +494,7 @@ func (m *QueryAllTxoutRequest) Reset() { *m = QueryAllTxoutRequest{} } func (m *QueryAllTxoutRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllTxoutRequest) ProtoMessage() {} func (*QueryAllTxoutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{6} + return fileDescriptor_dc2a1267d2da6377, []int{10} } func (m *QueryAllTxoutRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -355,7 +539,7 @@ func (m *QueryAllTxoutResponse) Reset() { *m = QueryAllTxoutResponse{} } func (m *QueryAllTxoutResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllTxoutResponse) ProtoMessage() {} func (*QueryAllTxoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{7} + return fileDescriptor_dc2a1267d2da6377, []int{11} } func (m *QueryAllTxoutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -406,7 +590,7 @@ func (m *QueryGetNodeAccountRequest) Reset() { *m = QueryGetNodeAccountR func (m *QueryGetNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountRequest) ProtoMessage() {} func (*QueryGetNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{8} + return fileDescriptor_dc2a1267d2da6377, []int{12} } func (m *QueryGetNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,7 +634,7 @@ func (m *QueryGetNodeAccountResponse) Reset() { *m = QueryGetNodeAccount func (m *QueryGetNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountResponse) ProtoMessage() {} func (*QueryGetNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{9} + return fileDescriptor_dc2a1267d2da6377, []int{13} } func (m *QueryGetNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -494,7 +678,7 @@ func (m *QueryAllNodeAccountRequest) Reset() { *m = QueryAllNodeAccountR func (m *QueryAllNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountRequest) ProtoMessage() {} func (*QueryAllNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{10} + return fileDescriptor_dc2a1267d2da6377, []int{14} } func (m *QueryAllNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -539,7 +723,7 @@ func (m *QueryAllNodeAccountResponse) Reset() { *m = QueryAllNodeAccount func (m *QueryAllNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountResponse) ProtoMessage() {} func (*QueryAllNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{11} + return fileDescriptor_dc2a1267d2da6377, []int{15} } func (m *QueryAllNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -589,7 +773,7 @@ func (m *QueryLastMetaHeightRequest) Reset() { *m = QueryLastMetaHeightR func (m *QueryLastMetaHeightRequest) String() string { return proto.CompactTextString(m) } func (*QueryLastMetaHeightRequest) ProtoMessage() {} func (*QueryLastMetaHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{12} + return fileDescriptor_dc2a1267d2da6377, []int{16} } func (m *QueryLastMetaHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -626,7 +810,7 @@ func (m *QueryLastMetaHeightResponse) Reset() { *m = QueryLastMetaHeight func (m *QueryLastMetaHeightResponse) String() string { return proto.CompactTextString(m) } func (*QueryLastMetaHeightResponse) ProtoMessage() {} func (*QueryLastMetaHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{13} + return fileDescriptor_dc2a1267d2da6377, []int{17} } func (m *QueryLastMetaHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -670,7 +854,7 @@ func (m *QueryGetTxinVoterRequest) Reset() { *m = QueryGetTxinVoterReque func (m *QueryGetTxinVoterRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTxinVoterRequest) ProtoMessage() {} func (*QueryGetTxinVoterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{14} + return fileDescriptor_dc2a1267d2da6377, []int{18} } func (m *QueryGetTxinVoterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -714,7 +898,7 @@ func (m *QueryGetTxinVoterResponse) Reset() { *m = QueryGetTxinVoterResp func (m *QueryGetTxinVoterResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTxinVoterResponse) ProtoMessage() {} func (*QueryGetTxinVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{15} + return fileDescriptor_dc2a1267d2da6377, []int{19} } func (m *QueryGetTxinVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -758,7 +942,7 @@ func (m *QueryAllTxinVoterRequest) Reset() { *m = QueryAllTxinVoterReque func (m *QueryAllTxinVoterRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllTxinVoterRequest) ProtoMessage() {} func (*QueryAllTxinVoterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{16} + return fileDescriptor_dc2a1267d2da6377, []int{20} } func (m *QueryAllTxinVoterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -803,7 +987,7 @@ func (m *QueryAllTxinVoterResponse) Reset() { *m = QueryAllTxinVoterResp func (m *QueryAllTxinVoterResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllTxinVoterResponse) ProtoMessage() {} func (*QueryAllTxinVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{17} + return fileDescriptor_dc2a1267d2da6377, []int{21} } func (m *QueryAllTxinVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -854,7 +1038,7 @@ func (m *QueryGetTxinRequest) Reset() { *m = QueryGetTxinRequest{} } func (m *QueryGetTxinRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTxinRequest) ProtoMessage() {} func (*QueryGetTxinRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{18} + return fileDescriptor_dc2a1267d2da6377, []int{22} } func (m *QueryGetTxinRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -898,7 +1082,7 @@ func (m *QueryGetTxinResponse) Reset() { *m = QueryGetTxinResponse{} } func (m *QueryGetTxinResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTxinResponse) ProtoMessage() {} func (*QueryGetTxinResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{19} + return fileDescriptor_dc2a1267d2da6377, []int{23} } func (m *QueryGetTxinResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -942,7 +1126,7 @@ func (m *QueryAllTxinRequest) Reset() { *m = QueryAllTxinRequest{} } func (m *QueryAllTxinRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllTxinRequest) ProtoMessage() {} func (*QueryAllTxinRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{20} + return fileDescriptor_dc2a1267d2da6377, []int{24} } func (m *QueryAllTxinRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -987,7 +1171,7 @@ func (m *QueryAllTxinResponse) Reset() { *m = QueryAllTxinResponse{} } func (m *QueryAllTxinResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllTxinResponse) ProtoMessage() {} func (*QueryAllTxinResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{21} + return fileDescriptor_dc2a1267d2da6377, []int{25} } func (m *QueryAllTxinResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1031,6 +1215,10 @@ func (m *QueryAllTxinResponse) GetPagination() *query.PageResponse { } func init() { + proto.RegisterType((*QueryGetSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetSendRequest") + proto.RegisterType((*QueryGetSendResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetSendResponse") + proto.RegisterType((*QueryAllSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllSendRequest") + proto.RegisterType((*QueryAllSendResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllSendResponse") proto.RegisterType((*QueryGetTxoutConfirmationRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetTxoutConfirmationRequest") proto.RegisterType((*QueryGetTxoutConfirmationResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetTxoutConfirmationResponse") proto.RegisterType((*QueryAllTxoutConfirmationRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllTxoutConfirmationRequest") @@ -1058,69 +1246,74 @@ func init() { func init() { proto.RegisterFile("metacore/query.proto", fileDescriptor_dc2a1267d2da6377) } var fileDescriptor_dc2a1267d2da6377 = []byte{ - // 980 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x98, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xc7, 0x3b, 0xc9, 0x76, 0x61, 0x67, 0x51, 0x05, 0xb3, 0x01, 0xed, 0x66, 0x57, 0xd1, 0x76, - 0x44, 0x7f, 0xd0, 0x36, 0x36, 0xf9, 0x51, 0x08, 0x69, 0x0f, 0xa4, 0x48, 0x94, 0x43, 0x8b, 0x4a, - 0x54, 0x71, 0x40, 0x82, 0xc8, 0x89, 0x87, 0xd4, 0xc8, 0xf1, 0xa4, 0xb1, 0x53, 0xb5, 0xaa, 0x7a, - 0x41, 0xfc, 0x01, 0x48, 0x9c, 0x38, 0x70, 0xe2, 0x00, 0x1c, 0xe0, 0x86, 0xb8, 0x20, 0x21, 0x21, - 0x0e, 0x5c, 0x90, 0x2a, 0x71, 0x80, 0x03, 0x07, 0xd4, 0xf2, 0x87, 0x20, 0x8f, 0x9f, 0x1d, 0x3b, - 0x71, 0x1d, 0x3b, 0xf5, 0x2d, 0x1e, 0xcf, 0x7b, 0xef, 0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0x63, 0x86, 0xc8, 0x19, 0x3e, 0x31, 0x10, 0xeb, 0xed, 0xa2, 0x9f, 0x10, 0x7e, 0xce, 0xcb, - 0x68, 0xef, 0xa1, 0x5a, 0xfc, 0x43, 0x38, 0x13, 0x41, 0x58, 0xdf, 0x42, 0xcb, 0x82, 0x60, 0x83, - 0xac, 0xc5, 0x27, 0x20, 0xdf, 0x22, 0xe7, 0x8e, 0x25, 0x95, 0x24, 0xce, 0xb9, 0x62, 0xab, 0xc9, - 0x82, 0x40, 0xe7, 0xa6, 0xd0, 0x29, 0x93, 0x62, 0x2c, 0x9d, 0x9e, 0xc9, 0x5f, 0x23, 0xfc, 0x8c, - 0x9d, 0xc7, 0xf6, 0xb7, 0x92, 0xc4, 0xa5, 0x64, 0x6a, 0xc7, 0x9a, 0x10, 0x5a, 0x14, 0x6a, 0x57, - 0xc8, 0x52, 0x2c, 0xb5, 0x3b, 0x7b, 0xbf, 0x5f, 0x15, 0xd0, 0xe5, 0x55, 0x01, 0xfd, 0x7b, 0x55, - 0x40, 0x9f, 0x5f, 0x17, 0xe6, 0x2e, 0xaf, 0x0b, 0x73, 0x7f, 0x5f, 0x17, 0xe6, 0x3e, 0x28, 0x77, - 0x35, 0xeb, 0x68, 0xd8, 0x96, 0x3a, 0xbc, 0x77, 0x53, 0xaa, 0x53, 0x5f, 0xb2, 0xb3, 0x3e, 0x33, - 0xdb, 0x77, 0xc5, 0x7f, 0x27, 0x95, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x95, 0x3a, 0x52, 0x16, - 0x43, 0x12, 0x00, 0x00, + // 1064 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, + 0x18, 0xcd, 0xc4, 0x4d, 0xa1, 0x53, 0x14, 0x89, 0xa9, 0x41, 0xad, 0x5b, 0x59, 0xed, 0x88, 0xa6, + 0xa5, 0x69, 0x76, 0x89, 0xe3, 0x40, 0x48, 0x7b, 0xa8, 0x8b, 0x44, 0x38, 0xb4, 0x28, 0x98, 0x8a, + 0x03, 0x12, 0x44, 0x6b, 0xef, 0xe0, 0x2e, 0xda, 0xec, 0xb8, 0xde, 0x75, 0x95, 0xaa, 0xea, 0x05, + 0xf1, 0x07, 0x20, 0x71, 0xe2, 0xc0, 0x89, 0x03, 0x70, 0xe0, 0x88, 0xb8, 0x20, 0x21, 0x21, 0x0e, + 0x5c, 0x90, 0x2a, 0x71, 0x80, 0x03, 0x07, 0x94, 0xf0, 0x7f, 0x80, 0x66, 0xf6, 0xdb, 0xf5, 0xfe, + 0xb2, 0x77, 0xc6, 0x59, 0x6e, 0xde, 0xd9, 0x79, 0xdf, 0xf7, 0xde, 0xfb, 0x66, 0x36, 0x4f, 0xc1, + 0xf5, 0x7d, 0x16, 0x58, 0x7d, 0x3e, 0x62, 0xe6, 0x83, 0x31, 0x1b, 0x3d, 0x32, 0x86, 0x23, 0x1e, + 0x70, 0xd2, 0xbc, 0xcb, 0x02, 0x6b, 0x57, 0xfc, 0xec, 0x73, 0xd7, 0x88, 0xb6, 0xc4, 0x3f, 0x1a, + 0x17, 0x06, 0x9c, 0x0f, 0x5c, 0x66, 0x5a, 0x43, 0xc7, 0xb4, 0x3c, 0x8f, 0x07, 0x56, 0xe0, 0x70, + 0xcf, 0x0f, 0xd1, 0x8d, 0x6b, 0x7d, 0xee, 0xef, 0x73, 0xdf, 0xec, 0x59, 0x3e, 0x94, 0x35, 0x1f, + 0xae, 0xf7, 0x58, 0x60, 0xad, 0x9b, 0x43, 0x6b, 0xe0, 0x78, 0x72, 0x33, 0xec, 0x3d, 0x13, 0xf7, + 0xf7, 0x99, 0x67, 0xc3, 0xe2, 0xa5, 0x78, 0x31, 0x38, 0xe0, 0xe3, 0x60, 0xaf, 0xcf, 0xbd, 0x8f, + 0x9c, 0xd1, 0x7e, 0x12, 0x57, 0x4f, 0x6f, 0x81, 0xd5, 0x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 0xb9, 0xb8, 0xa2, 0x38, 0x43, 0x5b, 0xea, 0x97, 0x70, 0x2e, 0x05, 0x45, 0x41, 0x90, 0xb6, 0xa4, + 0x82, 0xeb, 0xe4, 0x9a, 0xba, 0x02, 0x19, 0x13, 0x64, 0x04, 0xd9, 0xd0, 0x71, 0x4e, 0x3b, 0x26, + 0x24, 0x73, 0x92, 0x46, 0x4c, 0x10, 0x3c, 0x53, 0x31, 0x41, 0xd4, 0xd1, 0x8a, 0x09, 0xfa, 0x6c, + 0x33, 0xa9, 0x4e, 0x23, 0x26, 0x08, 0xb6, 0xb7, 0xef, 0xfc, 0x7a, 0xd8, 0x44, 0x4f, 0x0f, 0x9b, + 0xe8, 0xef, 0xc3, 0x26, 0xfa, 0xec, 0xa8, 0xb9, 0xf0, 0xf4, 0xa8, 0xb9, 0xf0, 0xe7, 0x51, 0x73, + 0xe1, 0xfd, 0xd6, 0xc0, 0x09, 0xee, 0x8f, 0x7b, 0x46, 0x9f, 0xef, 0x4f, 0x2b, 0x75, 0x90, 0x28, + 0xf6, 0x68, 0xc8, 0xfc, 0xde, 0x49, 0xf9, 0x6f, 0xc0, 0x8d, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x66, 0x04, 0x66, 0xda, 0x23, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1135,6 +1328,10 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { + // Queries a send by index. + Send(ctx context.Context, in *QueryGetSendRequest, opts ...grpc.CallOption) (*QueryGetSendResponse, error) + // Queries a list of send items. + SendAll(ctx context.Context, in *QueryAllSendRequest, opts ...grpc.CallOption) (*QueryAllSendResponse, error) // Queries a txoutConfirmation by index. TxoutConfirmation(ctx context.Context, in *QueryGetTxoutConfirmationRequest, opts ...grpc.CallOption) (*QueryGetTxoutConfirmationResponse, error) // Queries a list of txoutConfirmation items. @@ -1167,6 +1364,24 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } +func (c *queryClient) Send(ctx context.Context, in *QueryGetSendRequest, opts ...grpc.CallOption) (*QueryGetSendResponse, error) { + out := new(QueryGetSendResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/Send", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SendAll(ctx context.Context, in *QueryAllSendRequest, opts ...grpc.CallOption) (*QueryAllSendResponse, error) { + out := new(QueryAllSendResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/SendAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) TxoutConfirmation(ctx context.Context, in *QueryGetTxoutConfirmationRequest, opts ...grpc.CallOption) (*QueryGetTxoutConfirmationResponse, error) { out := new(QueryGetTxoutConfirmationResponse) err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/TxoutConfirmation", in, out, opts...) @@ -1268,6 +1483,10 @@ func (c *queryClient) TxinAll(ctx context.Context, in *QueryAllTxinRequest, opts // QueryServer is the server API for Query service. type QueryServer interface { + // Queries a send by index. + Send(context.Context, *QueryGetSendRequest) (*QueryGetSendResponse, error) + // Queries a list of send items. + SendAll(context.Context, *QueryAllSendRequest) (*QueryAllSendResponse, error) // Queries a txoutConfirmation by index. TxoutConfirmation(context.Context, *QueryGetTxoutConfirmationRequest) (*QueryGetTxoutConfirmationResponse, error) // Queries a list of txoutConfirmation items. @@ -1296,6 +1515,12 @@ type QueryServer interface { type UnimplementedQueryServer struct { } +func (*UnimplementedQueryServer) Send(ctx context.Context, req *QueryGetSendRequest) (*QueryGetSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} +func (*UnimplementedQueryServer) SendAll(ctx context.Context, req *QueryAllSendRequest) (*QueryAllSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendAll not implemented") +} func (*UnimplementedQueryServer) TxoutConfirmation(ctx context.Context, req *QueryGetTxoutConfirmationRequest) (*QueryGetTxoutConfirmationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmation not implemented") } @@ -1334,6 +1559,42 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } +func _Query_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetSendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/MetaProtocol.metacore.metacore.Query/Send", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Send(ctx, req.(*QueryGetSendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SendAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllSendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SendAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/MetaProtocol.metacore.metacore.Query/SendAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SendAll(ctx, req.(*QueryAllSendRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_TxoutConfirmation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetTxoutConfirmationRequest) if err := dec(in); err != nil { @@ -1536,6 +1797,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "MetaProtocol.metacore.metacore.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "Send", + Handler: _Query_Send_Handler, + }, + { + MethodName: "SendAll", + Handler: _Query_SendAll_Handler, + }, { MethodName: "TxoutConfirmation", Handler: _Query_TxoutConfirmation_Handler, @@ -1585,7 +1854,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "metacore/query.proto", } -func (m *QueryGetTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetSendRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1595,12 +1864,12 @@ func (m *QueryGetTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetSendRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1615,7 +1884,7 @@ func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryGetTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetSendResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1625,19 +1894,19 @@ func (m *QueryGetTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetSendResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.TxoutConfirmation != nil { + if m.Send != nil { { - size, err := m.TxoutConfirmation.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Send.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1650,7 +1919,7 @@ func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *QueryAllTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllSendRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1660,12 +1929,12 @@ func (m *QueryAllTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllSendRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1685,7 +1954,7 @@ func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryAllTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllSendResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1695,12 +1964,12 @@ func (m *QueryAllTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllSendResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1717,10 +1986,10 @@ func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i i-- dAtA[i] = 0x12 } - if len(m.TxoutConfirmation) > 0 { - for iNdEx := len(m.TxoutConfirmation) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Send) > 0 { + for iNdEx := len(m.Send) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TxoutConfirmation[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Send[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1734,7 +2003,7 @@ func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *QueryGetTxoutRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1744,25 +2013,27 @@ func (m *QueryGetTxoutRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryGetTxoutResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1772,19 +2043,19 @@ func (m *QueryGetTxoutResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Txout != nil { + if m.TxoutConfirmation != nil { { - size, err := m.Txout.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TxoutConfirmation.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1797,7 +2068,7 @@ func (m *QueryGetTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllTxoutRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1807,12 +2078,12 @@ func (m *QueryAllTxoutRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1832,7 +2103,7 @@ func (m *QueryAllTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllTxoutResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1842,12 +2113,159 @@ func (m *QueryAllTxoutResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.TxoutConfirmation) > 0 { + for iNdEx := len(m.TxoutConfirmation) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TxoutConfirmation[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetTxoutRequest) 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 *QueryGetTxoutRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetTxoutResponse) 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 *QueryGetTxoutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Txout != nil { + { + size, err := m.Txout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllTxoutRequest) 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 *QueryAllTxoutRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllTxoutResponse) 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 *QueryAllTxoutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2390,6 +2808,64 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryGetSendRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Send != nil { + l = m.Send.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllSendRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Send) > 0 { + for _, e := range m.Send { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryGetTxoutConfirmationRequest) Size() (n int) { if m == nil { return 0 @@ -2706,6 +3182,380 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryGetSendRequest) 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 ErrIntOverflowQuery + } + 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: QueryGetSendRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetSendResponse) 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 ErrIntOverflowQuery + } + 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: QueryGetSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Send", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Send == nil { + m.Send = &Send{} + } + if err := m.Send.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllSendRequest) 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 ErrIntOverflowQuery + } + 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: QueryAllSendRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllSendResponse) 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 ErrIntOverflowQuery + } + 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: QueryAllSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Send", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Send = append(m.Send, &Send{}) + if err := m.Send[len(m.Send)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryGetTxoutConfirmationRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/metacore/types/query.pb.gw.go b/x/metacore/types/query.pb.gw.go index 9f92800041..5b57d88688 100644 --- a/x/metacore/types/query.pb.gw.go +++ b/x/metacore/types/query.pb.gw.go @@ -33,6 +33,96 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +func request_Query_Send_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetSendRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + msg, err := client.Send(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Send_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetSendRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + msg, err := server.Send(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SendAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SendAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllSendRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SendAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SendAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllSendRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SendAll(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_TxoutConfirmation_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetTxoutConfirmationRequest var metadata runtime.ServerMetadata @@ -507,6 +597,52 @@ func local_request_Query_TxinAll_0(ctx context.Context, marshaler runtime.Marsha // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + mux.Handle("GET", pattern_Query_Send_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Send_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Send_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SendAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SendAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SendAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_TxoutConfirmation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -801,6 +937,46 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + mux.Handle("GET", pattern_Query_Send_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Send_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Send_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SendAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SendAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SendAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_TxoutConfirmation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1025,6 +1201,10 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( + pattern_Query_Send_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "send", "index"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_SendAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "send"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_TxoutConfirmation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "txoutConfirmation", "index"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_TxoutConfirmationAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "txoutConfirmation"}, "", runtime.AssumeColonVerbOpt(true))) @@ -1049,6 +1229,10 @@ var ( ) var ( + forward_Query_Send_0 = runtime.ForwardResponseMessage + + forward_Query_SendAll_0 = runtime.ForwardResponseMessage + forward_Query_TxoutConfirmation_0 = runtime.ForwardResponseMessage forward_Query_TxoutConfirmationAll_0 = runtime.ForwardResponseMessage diff --git a/x/metacore/types/send.pb.go b/x/metacore/types/send.pb.go new file mode 100644 index 0000000000..eaa5df2a4a --- /dev/null +++ b/x/metacore/types/send.pb.go @@ -0,0 +1,907 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: metacore/send.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Send struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + SenderChain string `protobuf:"bytes,4,opt,name=senderChain,proto3" json:"senderChain,omitempty"` + Receiver string `protobuf:"bytes,5,opt,name=receiver,proto3" json:"receiver,omitempty"` + ReceiverChain string `protobuf:"bytes,6,opt,name=receiverChain,proto3" json:"receiverChain,omitempty"` + MBurnt string `protobuf:"bytes,7,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` + MMint string `protobuf:"bytes,8,opt,name=mMint,proto3" json:"mMint,omitempty"` + Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` + InTxHash string `protobuf:"bytes,10,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` + InBlockHeight uint64 `protobuf:"varint,11,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` + OutTxHash string `protobuf:"bytes,12,opt,name=outTxHash,proto3" json:"outTxHash,omitempty"` + OutBlockHeight uint64 `protobuf:"varint,13,opt,name=outBlockHeight,proto3" json:"outBlockHeight,omitempty"` +} + +func (m *Send) Reset() { *m = Send{} } +func (m *Send) String() string { return proto.CompactTextString(m) } +func (*Send) ProtoMessage() {} +func (*Send) Descriptor() ([]byte, []int) { + return fileDescriptor_c81f0328df818595, []int{0} +} +func (m *Send) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Send) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Send.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 *Send) XXX_Merge(src proto.Message) { + xxx_messageInfo_Send.Merge(m, src) +} +func (m *Send) XXX_Size() int { + return m.Size() +} +func (m *Send) XXX_DiscardUnknown() { + xxx_messageInfo_Send.DiscardUnknown(m) +} + +var xxx_messageInfo_Send proto.InternalMessageInfo + +func (m *Send) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *Send) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *Send) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *Send) GetSenderChain() string { + if m != nil { + return m.SenderChain + } + return "" +} + +func (m *Send) GetReceiver() string { + if m != nil { + return m.Receiver + } + return "" +} + +func (m *Send) GetReceiverChain() string { + if m != nil { + return m.ReceiverChain + } + return "" +} + +func (m *Send) GetMBurnt() string { + if m != nil { + return m.MBurnt + } + return "" +} + +func (m *Send) GetMMint() string { + if m != nil { + return m.MMint + } + return "" +} + +func (m *Send) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *Send) GetInTxHash() string { + if m != nil { + return m.InTxHash + } + return "" +} + +func (m *Send) GetInBlockHeight() uint64 { + if m != nil { + return m.InBlockHeight + } + return 0 +} + +func (m *Send) GetOutTxHash() string { + if m != nil { + return m.OutTxHash + } + return "" +} + +func (m *Send) GetOutBlockHeight() uint64 { + if m != nil { + return m.OutBlockHeight + } + return 0 +} + +func init() { + proto.RegisterType((*Send)(nil), "MetaProtocol.metacore.metacore.Send") +} + +func init() { proto.RegisterFile("metacore/send.proto", fileDescriptor_c81f0328df818595) } + +var fileDescriptor_c81f0328df818595 = []byte{ + // 337 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xcd, 0x4e, 0x02, 0x31, + 0x14, 0x85, 0xa9, 0xfc, 0x17, 0x71, 0x51, 0x89, 0x69, 0x88, 0x69, 0x88, 0x31, 0x86, 0x8d, 0x4c, + 0xa2, 0x6f, 0x80, 0x1b, 0x16, 0x92, 0x18, 0x74, 0xe5, 0xae, 0x94, 0x9b, 0x99, 0x46, 0xa6, 0x25, + 0x9d, 0x8e, 0xc1, 0xad, 0x4f, 0xe0, 0x63, 0xb9, 0x64, 0xe9, 0xd2, 0xc0, 0x8b, 0x98, 0xb6, 0x0c, + 0x3f, 0xee, 0xce, 0x77, 0x7a, 0x7b, 0xef, 0x69, 0x6e, 0xf1, 0x79, 0x0a, 0x96, 0x0b, 0x6d, 0x20, + 0xca, 0x40, 0xcd, 0x06, 0x0b, 0xa3, 0xad, 0x26, 0x6c, 0x0c, 0x96, 0x3f, 0x39, 0x29, 0xf4, 0x7c, + 0x50, 0x54, 0xec, 0x44, 0xb7, 0x13, 0xeb, 0x58, 0xfb, 0xd2, 0xc8, 0xa9, 0x70, 0xeb, 0xea, 0xb3, + 0x8c, 0x2b, 0xcf, 0xa0, 0x66, 0x84, 0xe2, 0xba, 0x30, 0xc0, 0xad, 0x36, 0x14, 0xf5, 0x50, 0xbf, + 0x39, 0x29, 0x90, 0x74, 0x70, 0x55, 0xaa, 0x19, 0x2c, 0xe9, 0x89, 0xf7, 0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, 0x66, 0xef, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xed, 0x1f, 0xb9, 0x44, 0x26, 0x02, 0x00, + 0x00, +} + +func (m *Send) 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 *Send) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Send) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OutBlockHeight != 0 { + i = encodeVarintSend(dAtA, i, uint64(m.OutBlockHeight)) + i-- + dAtA[i] = 0x68 + } + if len(m.OutTxHash) > 0 { + i -= len(m.OutTxHash) + copy(dAtA[i:], m.OutTxHash) + i = encodeVarintSend(dAtA, i, uint64(len(m.OutTxHash))) + i-- + dAtA[i] = 0x62 + } + if m.InBlockHeight != 0 { + i = encodeVarintSend(dAtA, i, uint64(m.InBlockHeight)) + i-- + dAtA[i] = 0x58 + } + if len(m.InTxHash) > 0 { + i -= len(m.InTxHash) + copy(dAtA[i:], m.InTxHash) + i = encodeVarintSend(dAtA, i, uint64(len(m.InTxHash))) + i-- + dAtA[i] = 0x52 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintSend(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x4a + } + if len(m.MMint) > 0 { + i -= len(m.MMint) + copy(dAtA[i:], m.MMint) + i = encodeVarintSend(dAtA, i, uint64(len(m.MMint))) + i-- + dAtA[i] = 0x42 + } + if len(m.MBurnt) > 0 { + i -= len(m.MBurnt) + copy(dAtA[i:], m.MBurnt) + i = encodeVarintSend(dAtA, i, uint64(len(m.MBurnt))) + i-- + dAtA[i] = 0x3a + } + if len(m.ReceiverChain) > 0 { + i -= len(m.ReceiverChain) + copy(dAtA[i:], m.ReceiverChain) + i = encodeVarintSend(dAtA, i, uint64(len(m.ReceiverChain))) + i-- + dAtA[i] = 0x32 + } + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintSend(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x2a + } + if len(m.SenderChain) > 0 { + i -= len(m.SenderChain) + copy(dAtA[i:], m.SenderChain) + i = encodeVarintSend(dAtA, i, uint64(len(m.SenderChain))) + i-- + dAtA[i] = 0x22 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintSend(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x1a + } + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintSend(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintSend(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSend(dAtA []byte, offset int, v uint64) int { + offset -= sovSend(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Send) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.Index) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.SenderChain) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.ReceiverChain) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.MBurnt) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.MMint) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.InTxHash) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + if m.InBlockHeight != 0 { + n += 1 + sovSend(uint64(m.InBlockHeight)) + } + l = len(m.OutTxHash) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + if m.OutBlockHeight != 0 { + n += 1 + sovSend(uint64(m.OutBlockHeight)) + } + return n +} + +func sovSend(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSend(x uint64) (n int) { + return sovSend(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Send) 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 ErrIntOverflowSend + } + 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: Send: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Send: 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 ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + 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 Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SenderChain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SenderChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReceiverChain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReceiverChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MBurnt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MBurnt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MMint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MMint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InTxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InBlockHeight", wireType) + } + m.InBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutTxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutBlockHeight", wireType) + } + m.OutBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OutBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSend(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSend + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSend(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSend + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSend + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSend + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSend + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSend + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSend + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSend = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSend = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSend = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/metacore/types/tx.pb.go b/x/metacore/types/tx.pb.go index 444ce4865f..98fad3b850 100644 --- a/x/metacore/types/tx.pb.go +++ b/x/metacore/types/tx.pb.go @@ -29,6 +29,182 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // this line is used by starport scaffolding # proto/tx/message +type MsgCreateSend struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + SenderChain string `protobuf:"bytes,4,opt,name=senderChain,proto3" json:"senderChain,omitempty"` + Receiver string `protobuf:"bytes,5,opt,name=receiver,proto3" json:"receiver,omitempty"` + ReceiverChain string `protobuf:"bytes,6,opt,name=receiverChain,proto3" json:"receiverChain,omitempty"` + MBurnt string `protobuf:"bytes,7,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` + MMint string `protobuf:"bytes,8,opt,name=mMint,proto3" json:"mMint,omitempty"` + Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` + InTxHash string `protobuf:"bytes,10,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` + InBlockHeight uint64 `protobuf:"varint,11,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` + OutTxHash string `protobuf:"bytes,12,opt,name=outTxHash,proto3" json:"outTxHash,omitempty"` + OutBlockHeight uint64 `protobuf:"varint,13,opt,name=outBlockHeight,proto3" json:"outBlockHeight,omitempty"` +} + +func (m *MsgCreateSend) Reset() { *m = MsgCreateSend{} } +func (m *MsgCreateSend) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSend) ProtoMessage() {} +func (*MsgCreateSend) Descriptor() ([]byte, []int) { + return fileDescriptor_3410749d96999ade, []int{0} +} +func (m *MsgCreateSend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSend.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 *MsgCreateSend) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSend.Merge(m, src) +} +func (m *MsgCreateSend) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSend) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSend.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSend proto.InternalMessageInfo + +func (m *MsgCreateSend) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCreateSend) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *MsgCreateSend) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgCreateSend) GetSenderChain() string { + if m != nil { + return m.SenderChain + } + return "" +} + +func (m *MsgCreateSend) GetReceiver() string { + if m != nil { + return m.Receiver + } + return "" +} + +func (m *MsgCreateSend) GetReceiverChain() string { + if m != nil { + return m.ReceiverChain + } + return "" +} + +func (m *MsgCreateSend) GetMBurnt() string { + if m != nil { + return m.MBurnt + } + return "" +} + +func (m *MsgCreateSend) GetMMint() string { + if m != nil { + return m.MMint + } + return "" +} + +func (m *MsgCreateSend) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *MsgCreateSend) GetInTxHash() string { + if m != nil { + return m.InTxHash + } + return "" +} + +func (m *MsgCreateSend) GetInBlockHeight() uint64 { + if m != nil { + return m.InBlockHeight + } + return 0 +} + +func (m *MsgCreateSend) GetOutTxHash() string { + if m != nil { + return m.OutTxHash + } + return "" +} + +func (m *MsgCreateSend) GetOutBlockHeight() uint64 { + if m != nil { + return m.OutBlockHeight + } + return 0 +} + +type MsgCreateSendResponse struct { +} + +func (m *MsgCreateSendResponse) Reset() { *m = MsgCreateSendResponse{} } +func (m *MsgCreateSendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSendResponse) ProtoMessage() {} +func (*MsgCreateSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3410749d96999ade, []int{1} +} +func (m *MsgCreateSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSendResponse.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 *MsgCreateSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSendResponse.Merge(m, src) +} +func (m *MsgCreateSendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSendResponse proto.InternalMessageInfo + type MsgTxoutConfirmationVoter struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` TxoutId uint64 `protobuf:"varint,2,opt,name=txoutId,proto3" json:"txoutId,omitempty"` @@ -44,7 +220,7 @@ func (m *MsgTxoutConfirmationVoter) Reset() { *m = MsgTxoutConfirmationV func (m *MsgTxoutConfirmationVoter) String() string { return proto.CompactTextString(m) } func (*MsgTxoutConfirmationVoter) ProtoMessage() {} func (*MsgTxoutConfirmationVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{0} + return fileDescriptor_3410749d96999ade, []int{2} } func (m *MsgTxoutConfirmationVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -136,7 +312,7 @@ func (m *MsgTxoutConfirmationVoterResponse) Reset() { *m = MsgTxoutConfi func (m *MsgTxoutConfirmationVoterResponse) String() string { return proto.CompactTextString(m) } func (*MsgTxoutConfirmationVoterResponse) ProtoMessage() {} func (*MsgTxoutConfirmationVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{1} + return fileDescriptor_3410749d96999ade, []int{3} } func (m *MsgTxoutConfirmationVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -175,7 +351,7 @@ func (m *MsgSetNodeKeys) Reset() { *m = MsgSetNodeKeys{} } func (m *MsgSetNodeKeys) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeys) ProtoMessage() {} func (*MsgSetNodeKeys) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{2} + return fileDescriptor_3410749d96999ade, []int{4} } func (m *MsgSetNodeKeys) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -232,7 +408,7 @@ func (m *MsgSetNodeKeysResponse) Reset() { *m = MsgSetNodeKeysResponse{} func (m *MsgSetNodeKeysResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeysResponse) ProtoMessage() {} func (*MsgSetNodeKeysResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{3} + return fileDescriptor_3410749d96999ade, []int{5} } func (m *MsgSetNodeKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -278,7 +454,7 @@ func (m *MsgCreateTxinVoter) Reset() { *m = MsgCreateTxinVoter{} } func (m *MsgCreateTxinVoter) String() string { return proto.CompactTextString(m) } func (*MsgCreateTxinVoter) ProtoMessage() {} func (*MsgCreateTxinVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{4} + return fileDescriptor_3410749d96999ade, []int{6} } func (m *MsgCreateTxinVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -384,7 +560,7 @@ func (m *MsgCreateTxinVoterResponse) Reset() { *m = MsgCreateTxinVoterRe func (m *MsgCreateTxinVoterResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateTxinVoterResponse) ProtoMessage() {} func (*MsgCreateTxinVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{5} + return fileDescriptor_3410749d96999ade, []int{7} } func (m *MsgCreateTxinVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -414,6 +590,8 @@ func (m *MsgCreateTxinVoterResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateTxinVoterResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*MsgCreateSend)(nil), "MetaProtocol.metacore.metacore.MsgCreateSend") + proto.RegisterType((*MsgCreateSendResponse)(nil), "MetaProtocol.metacore.metacore.MsgCreateSendResponse") proto.RegisterType((*MsgTxoutConfirmationVoter)(nil), "MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoter") proto.RegisterType((*MsgTxoutConfirmationVoterResponse)(nil), "MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoterResponse") proto.RegisterType((*MsgSetNodeKeys)(nil), "MetaProtocol.metacore.metacore.MsgSetNodeKeys") @@ -425,43 +603,53 @@ func init() { func init() { proto.RegisterFile("metacore/tx.proto", fileDescriptor_3410749d96999ade) } var fileDescriptor_3410749d96999ade = []byte{ - // 570 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0x8d, 0xf3, 0xd9, 0x4c, 0x10, 0x90, 0xa5, 0x8a, 0xb6, 0x56, 0x65, 0x85, 0x70, 0xa9, 0x10, - 0x38, 0x52, 0x90, 0x90, 0xe8, 0x2d, 0xcd, 0xa5, 0xa8, 0x18, 0x45, 0x69, 0xc5, 0x81, 0x0b, 0x72, - 0xec, 0xad, 0x63, 0x35, 0xf6, 0x46, 0xde, 0x75, 0xe5, 0x1c, 0xf9, 0x07, 0x9c, 0xa8, 0xf8, 0x47, - 0x3d, 0xf6, 0xc8, 0x11, 0x25, 0x7f, 0x04, 0xed, 0x3a, 0x76, 0x9c, 0x06, 0xf7, 0x83, 0x93, 0x77, - 0xde, 0xec, 0x9b, 0x19, 0xbd, 0x79, 0x6b, 0x68, 0x7a, 0x84, 0x9b, 0x16, 0x0d, 0x48, 0x97, 0x47, - 0xfa, 0x2c, 0xa0, 0x9c, 0x22, 0xcd, 0x20, 0xdc, 0x1c, 0x8a, 0xa3, 0x45, 0xa7, 0x7a, 0x92, 0x4f, - 0x0f, 0xea, 0x5e, 0x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0xea, 0xfb, 0xc7, 0xdd, 0x4f, 0xdb, 0x7e, 0x57, 0xe0, 0xd9, 0x6d, 0xf7, 0xf5, 0x1e, 0x50, 0xeb, - 0x16, 0x47, 0x3d, 0x7c, 0x3c, 0x27, 0x99, 0xe1, 0xe8, 0xd3, 0xf5, 0x42, 0x53, 0x6e, 0x16, 0x9a, - 0xf2, 0x67, 0xa1, 0x29, 0x3f, 0x96, 0x5a, 0xe1, 0x66, 0xa9, 0x15, 0x7e, 0x2f, 0xb5, 0xc2, 0xd7, - 0x9e, 0xe3, 0xf2, 0x49, 0x38, 0x16, 0x0f, 0xb3, 0x2b, 0xea, 0xbf, 0x4d, 0x1a, 0x74, 0xd3, 0x5f, - 0x6b, 0xb4, 0x3e, 0xf2, 0xf9, 0x8c, 0xb0, 0x71, 0x55, 0xfe, 0x4c, 0xdf, 0xfd, 0x0d, 0x00, 0x00, - 0xff, 0xff, 0x2f, 0x8f, 0x53, 0x05, 0xb1, 0x05, 0x00, 0x00, + // 732 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcf, 0x4f, 0x13, 0x4f, + 0x14, 0x67, 0xa1, 0x50, 0xfa, 0x0a, 0x7c, 0xbf, 0x0c, 0x8a, 0xcb, 0x86, 0x34, 0xb5, 0x1a, 0x43, + 0x8c, 0xb4, 0x49, 0x8d, 0x26, 0x72, 0x83, 0x5e, 0x30, 0x58, 0x43, 0x0a, 0xf1, 0xe0, 0xc5, 0x6c, + 0xbb, 0x8f, 0x76, 0x02, 0x3b, 0xd3, 0xcc, 0xcc, 0x92, 0x72, 0xf4, 0x6c, 0x4c, 0x3c, 0xe9, 0xbf, + 0xc4, 0x91, 0xa3, 0x47, 0x03, 0xff, 0x88, 0x99, 0x99, 0xdd, 0xed, 0x96, 0x52, 0x7e, 0x78, 0xea, + 0xbc, 0xcf, 0x9b, 0xf7, 0xa3, 0x9f, 0xcf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, 0x5d, 0x5f, 0xf6, 0x5c, + 0xb0, 0x9d, 0x24, 0xb6, 0xee, 0x84, 0xb2, 0x9d, 0x13, 0xde, 0x39, 0xde, 0x45, 0xda, 0xed, 0x29, + 0xb7, 0x58, 0x76, 0x36, 0x72, 0xad, 0x51, 0x90, 0xac, 0x43, 0x81, 0x47, 0x2a, 0x4e, 0xb1, 0x60, + 0x52, 0x0c, 0x01, 0xf2, 0x02, 0x96, 0x78, 0xa4, 0xb2, 0x49, 0x16, 0x4d, 0x92, 0x6b, 0x68, 0xe5, + 0x09, 0x3c, 0x1e, 0x11, 0xa3, 0x85, 0xb2, 0xcf, 0x99, 0xc4, 0xca, 0xaf, 0x69, 0x58, 0x6b, 0xca, + 0xee, 0xe1, 0x80, 0x47, 0xaa, 0xc1, 0xd9, 0x11, 0x15, 0xa1, 0xaf, 0x28, 0x67, 0x9f, 0xb4, 0xbe, + 0xb7, 0x48, 0xe6, 0x42, 0x5e, 0xe9, 0x98, 0xf7, 0x81, 0x11, 0x2d, 0xd7, 0x4a, 0x4c, 0x4d, 0x9d, + 0xb2, 0xdd, 0xc6, 0xb2, 0x59, 0x6b, 0x48, 0x5d, 0xce, 0xdc, 0x8f, 0xa9, 0x7b, 0x09, 0xff, 0x07, + 0x28, 0x15, 0x65, 0xa6, 0xea, 0xb6, 0x94, 0xa8, 0x62, 0xc9, 0xc6, 0x70, 0xf2, 0x0a, 0x96, 0xb3, + 0x58, 0xc8, 0x23, 0xa6, 0x8c, 0x7c, 0xb9, 0xd6, 0xb8, 0x43, 0x13, 0xa7, 0xf8, 0x76, 0x10, 0x08, + 0x94, 0x32, 0x56, 0x71, 0x08, 0xe8, 0x21, 0x6a, 0x67, 0x58, 0x9b, 0x37, 0x59, 0xb2, 0x50, 0xe5, + 0x19, 0x3c, 0x9d, 0x48, 0xcc, 0x90, 0x3e, 0x07, 0x96, 0x9a, 0xb2, 0x7b, 0x80, 0xea, 0x23, 0x0f, + 0x70, 0x0f, 0xcf, 0xe4,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ea, 0x3d, 0x32, 0x66, 0xee, 0x7b, + 0x6f, 0x1f, 0x76, 0x3f, 0x2d, 0xfb, 0xd5, 0x81, 0xff, 0xae, 0x4f, 0x7c, 0xfd, 0xde, 0xd4, 0xa6, + 0x31, 0xde, 0xd6, 0xc3, 0x63, 0x92, 0x1e, 0x76, 0x3e, 0x9c, 0x5f, 0x96, 0x9c, 0x8b, 0xcb, 0x92, + 0xf3, 0xe7, 0xb2, 0xe4, 0xfc, 0xb8, 0x2a, 0x4d, 0x5d, 0x5c, 0x95, 0xa6, 0x7e, 0x5f, 0x95, 0xa6, + 0x3e, 0xd7, 0xbb, 0x54, 0xf5, 0xa2, 0xb6, 0x7e, 0x0c, 0x6a, 0x3a, 0xff, 0x66, 0x52, 0xa0, 0x96, + 0x7e, 0x75, 0x07, 0xc3, 0xa3, 0x3a, 0xeb, 0xa3, 0x6c, 0xcf, 0x99, 0xef, 0xec, 0xeb, 0xbf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x3a, 0x40, 0x18, 0xb5, 0xe1, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -477,6 +665,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { // this line is used by starport scaffolding # proto/tx/rpc + CreateSend(ctx context.Context, in *MsgCreateSend, opts ...grpc.CallOption) (*MsgCreateSendResponse, error) TxoutConfirmationVoter(ctx context.Context, in *MsgTxoutConfirmationVoter, opts ...grpc.CallOption) (*MsgTxoutConfirmationVoterResponse, error) SetNodeKeys(ctx context.Context, in *MsgSetNodeKeys, opts ...grpc.CallOption) (*MsgSetNodeKeysResponse, error) CreateTxinVoter(ctx context.Context, in *MsgCreateTxinVoter, opts ...grpc.CallOption) (*MsgCreateTxinVoterResponse, error) @@ -490,6 +679,15 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) CreateSend(ctx context.Context, in *MsgCreateSend, opts ...grpc.CallOption) (*MsgCreateSendResponse, error) { + out := new(MsgCreateSendResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Msg/CreateSend", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) TxoutConfirmationVoter(ctx context.Context, in *MsgTxoutConfirmationVoter, opts ...grpc.CallOption) (*MsgTxoutConfirmationVoterResponse, error) { out := new(MsgTxoutConfirmationVoterResponse) err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Msg/TxoutConfirmationVoter", in, out, opts...) @@ -520,6 +718,7 @@ func (c *msgClient) CreateTxinVoter(ctx context.Context, in *MsgCreateTxinVoter, // MsgServer is the server API for Msg service. type MsgServer interface { // this line is used by starport scaffolding # proto/tx/rpc + CreateSend(context.Context, *MsgCreateSend) (*MsgCreateSendResponse, error) TxoutConfirmationVoter(context.Context, *MsgTxoutConfirmationVoter) (*MsgTxoutConfirmationVoterResponse, error) SetNodeKeys(context.Context, *MsgSetNodeKeys) (*MsgSetNodeKeysResponse, error) CreateTxinVoter(context.Context, *MsgCreateTxinVoter) (*MsgCreateTxinVoterResponse, error) @@ -529,6 +728,9 @@ type MsgServer interface { type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) CreateSend(ctx context.Context, req *MsgCreateSend) (*MsgCreateSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSend not implemented") +} func (*UnimplementedMsgServer) TxoutConfirmationVoter(ctx context.Context, req *MsgTxoutConfirmationVoter) (*MsgTxoutConfirmationVoterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmationVoter not implemented") } @@ -543,6 +745,24 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_CreateSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateSend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateSend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/MetaProtocol.metacore.metacore.Msg/CreateSend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateSend(ctx, req.(*MsgCreateSend)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_TxoutConfirmationVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgTxoutConfirmationVoter) if err := dec(in); err != nil { @@ -601,6 +821,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "MetaProtocol.metacore.metacore.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "CreateSend", + Handler: _Msg_CreateSend_Handler, + }, { MethodName: "TxoutConfirmationVoter", Handler: _Msg_TxoutConfirmationVoter_Handler, @@ -618,6 +842,139 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "metacore/tx.proto", } +func (m *MsgCreateSend) 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 *MsgCreateSend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OutBlockHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.OutBlockHeight)) + i-- + dAtA[i] = 0x68 + } + if len(m.OutTxHash) > 0 { + i -= len(m.OutTxHash) + copy(dAtA[i:], m.OutTxHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.OutTxHash))) + i-- + dAtA[i] = 0x62 + } + if m.InBlockHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.InBlockHeight)) + i-- + dAtA[i] = 0x58 + } + if len(m.InTxHash) > 0 { + i -= len(m.InTxHash) + copy(dAtA[i:], m.InTxHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.InTxHash))) + i-- + dAtA[i] = 0x52 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTx(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x4a + } + if len(m.MMint) > 0 { + i -= len(m.MMint) + copy(dAtA[i:], m.MMint) + i = encodeVarintTx(dAtA, i, uint64(len(m.MMint))) + i-- + dAtA[i] = 0x42 + } + if len(m.MBurnt) > 0 { + i -= len(m.MBurnt) + copy(dAtA[i:], m.MBurnt) + i = encodeVarintTx(dAtA, i, uint64(len(m.MBurnt))) + i-- + dAtA[i] = 0x3a + } + if len(m.ReceiverChain) > 0 { + i -= len(m.ReceiverChain) + copy(dAtA[i:], m.ReceiverChain) + i = encodeVarintTx(dAtA, i, uint64(len(m.ReceiverChain))) + i-- + dAtA[i] = 0x32 + } + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintTx(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x2a + } + if len(m.SenderChain) > 0 { + i -= len(m.SenderChain) + copy(dAtA[i:], m.SenderChain) + i = encodeVarintTx(dAtA, i, uint64(len(m.SenderChain))) + i-- + dAtA[i] = 0x22 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x1a + } + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintTx(dAtA, i, uint64(len(m.Index))) + 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 *MsgCreateSendResponse) 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 *MsgCreateSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgTxoutConfirmationVoter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -905,7 +1262,7 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgTxoutConfirmationVoter) Size() (n int) { +func (m *MsgCreateSend) Size() (n int) { if m == nil { return 0 } @@ -915,39 +1272,107 @@ func (m *MsgTxoutConfirmationVoter) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.TxoutId != 0 { - n += 1 + sovTx(uint64(m.TxoutId)) + l = len(m.Index) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - l = len(m.TxHash) + l = len(m.Sender) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.MMint != 0 { - n += 1 + sovTx(uint64(m.MMint)) + l = len(m.SenderChain) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - l = len(m.DestinationAsset) + l = len(m.Receiver) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.DestinationAmount != 0 { - n += 1 + sovTx(uint64(m.DestinationAmount)) + l = len(m.ReceiverChain) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - l = len(m.ToAddress) + l = len(m.MBurnt) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.BlockHeight != 0 { - n += 1 + sovTx(uint64(m.BlockHeight)) + l = len(m.MMint) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - return n -} - -func (m *MsgTxoutConfirmationVoterResponse) Size() (n int) { - if m == nil { - return 0 + l = len(m.Message) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - var l int - _ = l + l = len(m.InTxHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.InBlockHeight != 0 { + n += 1 + sovTx(uint64(m.InBlockHeight)) + } + l = len(m.OutTxHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.OutBlockHeight != 0 { + n += 1 + sovTx(uint64(m.OutBlockHeight)) + } + return n +} + +func (m *MsgCreateSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgTxoutConfirmationVoter) 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)) + } + if m.TxoutId != 0 { + n += 1 + sovTx(uint64(m.TxoutId)) + } + l = len(m.TxHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.MMint != 0 { + n += 1 + sovTx(uint64(m.MMint)) + } + l = len(m.DestinationAsset) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.DestinationAmount != 0 { + n += 1 + sovTx(uint64(m.DestinationAmount)) + } + l = len(m.ToAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BlockHeight != 0 { + n += 1 + sovTx(uint64(m.BlockHeight)) + } + return n +} + +func (m *MsgTxoutConfirmationVoterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l return n } @@ -1042,6 +1467,496 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgCreateSend) 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: MsgCreateSend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSend: 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 Index", 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.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SenderChain", 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.SenderChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", 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.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReceiverChain", 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.ReceiverChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MBurnt", 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.MBurnt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MMint", 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.MMint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", 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.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InTxHash", 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.InTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InBlockHeight", wireType) + } + m.InBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutTxHash", 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.OutTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutBlockHeight", wireType) + } + m.OutBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OutBlockHeight |= 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 *MsgCreateSendResponse) 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: MsgCreateSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSendResponse: 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 (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From 2a670e8d7de59624a73e9696b2218de14fe8bfc3 Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Thu, 21 Oct 2021 04:35:53 -0500 Subject: [PATCH 02/10] Send protobuf: the message serves three purposes: 1. as voter for MetaClient to vote on a observed Send event; 2. as consensus Send structure 3. as voter for MetaClient to vote on a observed Send confirmation; 4. as consensus of Send tx confirmation on external chains --- docs/static/openapi.yml | 50 ++++++ proto/metacore/send.proto | 3 + x/metacore/client/cli/tx_send_test.go | 113 +----------- x/metacore/keeper/msg_server_send.go | 19 +- x/metacore/keeper/msg_server_send_test.go | 91 ---------- x/metacore/types/messages_send.go | 17 ++ x/metacore/types/send.pb.go | 202 ++++++++++++++++++---- 7 files changed, 251 insertions(+), 244 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 77c143520b..7d3019629f 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -19375,6 +19375,16 @@ paths: outBlockHeight: type: string format: uint64 + signers: + type: array + items: + type: string + inTxFinalizedHeight: + type: string + format: uint64 + outTxFianlizedHeight: + type: string + format: uint64 pagination: type: object properties: @@ -19510,6 +19520,16 @@ paths: outBlockHeight: type: string format: uint64 + signers: + type: array + items: + type: string + inTxFinalizedHeight: + type: string + format: uint64 + outTxFianlizedHeight: + type: string + format: uint64 default: description: An unexpected error response. schema: @@ -30668,6 +30688,16 @@ definitions: outBlockHeight: type: string format: uint64 + signers: + type: array + items: + type: string + inTxFinalizedHeight: + type: string + format: uint64 + outTxFianlizedHeight: + type: string + format: uint64 pagination: type: object properties: @@ -31009,6 +31039,16 @@ definitions: outBlockHeight: type: string format: uint64 + signers: + type: array + items: + type: string + inTxFinalizedHeight: + type: string + format: uint64 + outTxFianlizedHeight: + type: string + format: uint64 MetaProtocol.metacore.metacore.QueryGetTxinResponse: type: object properties: @@ -31189,6 +31229,16 @@ definitions: outBlockHeight: type: string format: uint64 + signers: + type: array + items: + type: string + inTxFinalizedHeight: + type: string + format: uint64 + outTxFianlizedHeight: + type: string + format: uint64 MetaProtocol.metacore.metacore.Txin: type: object properties: diff --git a/proto/metacore/send.proto b/proto/metacore/send.proto index cb4c4fb39c..ea85df2f64 100644 --- a/proto/metacore/send.proto +++ b/proto/metacore/send.proto @@ -19,4 +19,7 @@ message Send { uint64 inBlockHeight = 11; string outTxHash = 12; uint64 outBlockHeight = 13; + repeated string signers = 14; + uint64 inTxFinalizedHeight = 15; + uint64 outTxFianlizedHeight = 16; } diff --git a/x/metacore/client/cli/tx_send_test.go b/x/metacore/client/cli/tx_send_test.go index c8f7fb0e87..031e1011c3 100644 --- a/x/metacore/client/cli/tx_send_test.go +++ b/x/metacore/client/cli/tx_send_test.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" "github.com/Meta-Protocol/metacore/testutil/network" @@ -20,7 +19,7 @@ func TestCreateSend(t *testing.T) { ctx := val.ClientCtx id := "0" - fields := []string{"xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz"} + fields := []string{"xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "123", "xyz", "123"} for _, tc := range []struct { desc string id string @@ -56,113 +55,3 @@ func TestCreateSend(t *testing.T) { }) } } - -func TestUpdateSend(t *testing.T) { - net := network.New(t) - val := net.Validators[0] - ctx := val.ClientCtx - id := "0" - - fields := []string{"xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz"} - common := []string{ - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdk.NewInt(10))).String()), - } - args := []string{id} - args = append(args, fields...) - args = append(args, common...) - _, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateSend(), args) - require.NoError(t, err) - - for _, tc := range []struct { - desc string - id string - args []string - code uint32 - err error - }{ - { - desc: "valid", - id: id, - args: common, - }, - { - desc: "key not found", - id: "1", - args: common, - code: sdkerrors.ErrKeyNotFound.ABCICode(), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{tc.id} - args = append(args, fields...) - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdUpdateSend(), args) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - var resp sdk.TxResponse - require.NoError(t, ctx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &resp)) - require.Equal(t, tc.code, resp.Code) - } - }) - } -} - -func TestDeleteSend(t *testing.T) { - net := network.New(t) - - val := net.Validators[0] - ctx := val.ClientCtx - id := "0" - - fields := []string{"xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz"} - common := []string{ - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdk.NewInt(10))).String()), - } - args := []string{id} - args = append(args, fields...) - args = append(args, common...) - _, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateSend(), args) - require.NoError(t, err) - - for _, tc := range []struct { - desc string - id string - args []string - code uint32 - err error - }{ - { - desc: "valid", - id: id, - args: common, - }, - { - desc: "key not found", - id: "1", - args: common, - code: sdkerrors.ErrKeyNotFound.ABCICode(), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdDeleteSend(), append([]string{tc.id}, tc.args...)) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - var resp sdk.TxResponse - require.NoError(t, ctx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &resp)) - require.Equal(t, tc.code, resp.Code) - } - }) - } -} diff --git a/x/metacore/keeper/msg_server_send.go b/x/metacore/keeper/msg_server_send.go index 5f89895b4d..a257f2bba6 100644 --- a/x/metacore/keeper/msg_server_send.go +++ b/x/metacore/keeper/msg_server_send.go @@ -9,27 +9,36 @@ import ( func (k msgServer) CreateSend(goCtx context.Context, msg *types.MsgCreateSend) (*types.MsgCreateSendResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // index should be inTxHash send, isFound := k.GetSend(ctx, msg.Index) if !isFound { send = types.Send{ Index: msg.Index, - Creator: msg.Creator, + Creator: "", Sender: msg.Sender, SenderChain: msg.SenderChain, Receiver: msg.Receiver, ReceiverChain: msg.ReceiverChain, MBurnt: msg.MBurnt, - MMint: msg.MMint, + MMint: "", Message: msg.Message, InTxHash: msg.InTxHash, InBlockHeight: msg.InBlockHeight, - OutTxHash: msg.OutTxHash, - OutBlockHeight: msg.OutBlockHeight, + OutTxHash: "", + OutBlockHeight: 0, + Signers: []string{msg.Creator}, + InTxFinalizedHeight: 0, + OutTxFianlizedHeight: 0, } + } else { + //TODO: check if msg.Creator is already in signers; + //TODO: verify that msg.Creator is one of the validators; + send.Signers = append(send.Signers, msg.Creator) + } + + k.SetSend(ctx, send) diff --git a/x/metacore/keeper/msg_server_send_test.go b/x/metacore/keeper/msg_server_send_test.go index 66b244e2cf..02010adaa2 100644 --- a/x/metacore/keeper/msg_server_send_test.go +++ b/x/metacore/keeper/msg_server_send_test.go @@ -5,7 +5,6 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -27,93 +26,3 @@ func TestSendMsgServerCreate(t *testing.T) { assert.Equal(t, expected.Creator, rst.Creator) } } - -func TestSendMsgServerUpdate(t *testing.T) { - creator := "A" - index := "any" - - for _, tc := range []struct { - desc string - request *types.MsgUpdateSend - err error - }{ - { - desc: "Completed", - request: &types.MsgUpdateSend{Creator: creator, Index: index}, - }, - { - desc: "Unauthorized", - request: &types.MsgUpdateSend{Creator: "B", Index: index}, - err: sdkerrors.ErrUnauthorized, - }, - { - desc: "KeyNotFound", - request: &types.MsgUpdateSend{Creator: creator, Index: "missing"}, - err: sdkerrors.ErrKeyNotFound, - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - keeper, ctx := setupKeeper(t) - srv := NewMsgServerImpl(*keeper) - wctx := sdk.WrapSDKContext(ctx) - expected := &types.MsgCreateSend{Creator: creator, Index: index} - _, err := srv.CreateSend(wctx, expected) - require.NoError(t, err) - - _, err = srv.UpdateSend(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - rst, found := keeper.GetSend(ctx, expected.Index) - require.True(t, found) - assert.Equal(t, expected.Creator, rst.Creator) - } - }) - } -} - -func TestSendMsgServerDelete(t *testing.T) { - creator := "A" - index := "any" - - for _, tc := range []struct { - desc string - request *types.MsgDeleteSend - err error - }{ - { - desc: "Completed", - request: &types.MsgDeleteSend{Creator: creator, Index: index}, - }, - { - desc: "Unauthorized", - request: &types.MsgDeleteSend{Creator: "B", Index: index}, - err: sdkerrors.ErrUnauthorized, - }, - { - desc: "KeyNotFound", - request: &types.MsgDeleteSend{Creator: creator, Index: "missing"}, - err: sdkerrors.ErrKeyNotFound, - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - keeper, ctx := setupKeeper(t) - srv := NewMsgServerImpl(*keeper) - wctx := sdk.WrapSDKContext(ctx) - - _, err := srv.CreateSend(wctx, &types.MsgCreateSend{Creator: creator, Index: index}) - require.NoError(t, err) - _, err = srv.DeleteSend(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - _, found := keeper.GetSend(ctx, tc.request.Index) - require.False(t, found) - } - }) - } -} diff --git a/x/metacore/types/messages_send.go b/x/metacore/types/messages_send.go index 125ff8187e..2d719b0d50 100644 --- a/x/metacore/types/messages_send.go +++ b/x/metacore/types/messages_send.go @@ -3,6 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/ethereum/go-ethereum/crypto" ) var _ sdk.Msg = &MsgCreateSend{} @@ -47,9 +48,25 @@ func (msg *MsgCreateSend) GetSignBytes() []byte { } func (msg *MsgCreateSend) ValidateBasic() error { + //TODO: add basic validation here _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } + if msg.Digest() != msg.Index { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "index %s must match digest of message", msg.Index) + } return nil } + +// the digest should be used as index of the Send +func (msg *MsgCreateSend) Digest() string { + m := *msg + m.Creator = "" + m.Index = "" + m.OutTxHash = "" + m.OutBlockHeight = 0 + m.MMint = "" + hash := crypto.Keccak256Hash([]byte(m.String())) + return hash.Hex() +} \ No newline at end of file diff --git a/x/metacore/types/send.pb.go b/x/metacore/types/send.pb.go index eaa5df2a4a..d0929b856d 100644 --- a/x/metacore/types/send.pb.go +++ b/x/metacore/types/send.pb.go @@ -24,19 +24,22 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Send struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` - Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` - SenderChain string `protobuf:"bytes,4,opt,name=senderChain,proto3" json:"senderChain,omitempty"` - Receiver string `protobuf:"bytes,5,opt,name=receiver,proto3" json:"receiver,omitempty"` - ReceiverChain string `protobuf:"bytes,6,opt,name=receiverChain,proto3" json:"receiverChain,omitempty"` - MBurnt string `protobuf:"bytes,7,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` - MMint string `protobuf:"bytes,8,opt,name=mMint,proto3" json:"mMint,omitempty"` - Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` - InTxHash string `protobuf:"bytes,10,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` - InBlockHeight uint64 `protobuf:"varint,11,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` - OutTxHash string `protobuf:"bytes,12,opt,name=outTxHash,proto3" json:"outTxHash,omitempty"` - OutBlockHeight uint64 `protobuf:"varint,13,opt,name=outBlockHeight,proto3" json:"outBlockHeight,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + SenderChain string `protobuf:"bytes,4,opt,name=senderChain,proto3" json:"senderChain,omitempty"` + Receiver string `protobuf:"bytes,5,opt,name=receiver,proto3" json:"receiver,omitempty"` + ReceiverChain string `protobuf:"bytes,6,opt,name=receiverChain,proto3" json:"receiverChain,omitempty"` + MBurnt string `protobuf:"bytes,7,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` + MMint string `protobuf:"bytes,8,opt,name=mMint,proto3" json:"mMint,omitempty"` + Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` + InTxHash string `protobuf:"bytes,10,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` + InBlockHeight uint64 `protobuf:"varint,11,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` + OutTxHash string `protobuf:"bytes,12,opt,name=outTxHash,proto3" json:"outTxHash,omitempty"` + OutBlockHeight uint64 `protobuf:"varint,13,opt,name=outBlockHeight,proto3" json:"outBlockHeight,omitempty"` + Signers []string `protobuf:"bytes,14,rep,name=signers,proto3" json:"signers,omitempty"` + InTxFinalizedHeight uint64 `protobuf:"varint,15,opt,name=inTxFinalizedHeight,proto3" json:"inTxFinalizedHeight,omitempty"` + OutTxFianlizedHeight uint64 `protobuf:"varint,16,opt,name=outTxFianlizedHeight,proto3" json:"outTxFianlizedHeight,omitempty"` } func (m *Send) Reset() { *m = Send{} } @@ -163,6 +166,27 @@ func (m *Send) GetOutBlockHeight() uint64 { return 0 } +func (m *Send) GetSigners() []string { + if m != nil { + return m.Signers + } + return nil +} + +func (m *Send) GetInTxFinalizedHeight() uint64 { + if m != nil { + return m.InTxFinalizedHeight + } + return 0 +} + +func (m *Send) GetOutTxFianlizedHeight() uint64 { + if m != nil { + return m.OutTxFianlizedHeight + } + return 0 +} + func init() { proto.RegisterType((*Send)(nil), "MetaProtocol.metacore.metacore.Send") } @@ -170,29 +194,32 @@ func init() { func init() { proto.RegisterFile("metacore/send.proto", fileDescriptor_c81f0328df818595) } var fileDescriptor_c81f0328df818595 = []byte{ - // 337 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xcd, 0x4e, 0x02, 0x31, - 0x14, 0x85, 0xa9, 0xfc, 0x17, 0x71, 0x51, 0x89, 0x69, 0x88, 0x69, 0x88, 0x31, 0x86, 0x8d, 0x4c, - 0xa2, 0x6f, 0x80, 0x1b, 0x16, 0x92, 0x18, 0x74, 0xe5, 0xae, 0x94, 0x9b, 0x99, 0x46, 0xa6, 0x25, - 0x9d, 0x8e, 0xc1, 0xad, 0x4f, 0xe0, 0x63, 0xb9, 0x64, 0xe9, 0xd2, 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0xb4, 0xd5, 0x43, 0xfd, 0xca, 0xe4, 0xd8, 0x24, 0x97, 0xb8, 0xa9, 0x73, 0xbb, 0x6d, - 0x71, 0xea, 0x5b, 0xec, 0x0d, 0x72, 0x83, 0xcf, 0x74, 0x6e, 0x0f, 0x9b, 0xb4, 0x7d, 0x93, 0x7f, - 0xee, 0xf0, 0xf1, 0x7b, 0xcd, 0xd0, 0x6a, 0xcd, 0xd0, 0xef, 0x9a, 0xa1, 0xaf, 0x0d, 0x2b, 0xad, - 0x36, 0xac, 0xf4, 0xb3, 0x61, 0xa5, 0xd7, 0xbb, 0x58, 0xda, 0x24, 0x9f, 0x0e, 0x84, 0x4e, 0x23, - 0xb7, 0xdf, 0xdb, 0x62, 0xc1, 0xd1, 0xee, 0x0b, 0x2c, 0xf7, 0xd2, 0x7e, 0x2c, 0x20, 0x9b, 0xd6, - 0xfc, 0x66, 0xef, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xed, 0x1f, 0xb9, 0x44, 0x26, 0x02, 0x00, - 0x00, + // 389 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x4d, 0x6b, 0xdb, 0x40, + 0x10, 0xb5, 0x6a, 0xf9, 0x6b, 0x5d, 0xbb, 0x65, 0x6d, 0xca, 0x62, 0x8a, 0x10, 0xa5, 0x14, 0x5f, + 0x6a, 0x15, 0xf7, 0x1f, 0xb8, 0x60, 0x7c, 0xa8, 0x21, 0x38, 0x39, 0xe5, 0xb6, 0x96, 0x06, 0x69, + 0x89, 0xb5, 0x6b, 0x56, 0xab, 0xe0, 0xe4, 0x98, 0x5f, 0x90, 0x9f, 0x95, 0xa3, 0x8f, 0x39, 0x06, + 0xfb, 0x8f, 0x84, 0xdd, 0x95, 0xfc, 0x11, 0x7c, 0x7b, 0xef, 0xcd, 0xcc, 0x9b, 0x37, 0x30, 0xa8, + 0x97, 0x82, 0xa2, 0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0xf8, 0x17, 0xea, 0x8a, 0x5c, + 0x9d, 0x9a, 0x74, 0x8c, 0xc9, 0x07, 0x55, 0x27, 0xcc, 0x58, 0xcc, 0x41, 0x66, 0xa4, 0xeb, 0x57, + 0x75, 0xc2, 0x82, 0xe2, 0x3f, 0xa8, 0xa7, 0x13, 0x4d, 0x19, 0xa7, 0x2b, 0xf6, 0x08, 0x51, 0x61, + 0xf3, 0xc5, 0xd8, 0x5c, 0x2a, 0xe1, 0x31, 0xea, 0x9b, 0x00, 0x53, 0x46, 0xf9, 0xe9, 0xc8, 0x57, + 0x33, 0x72, 0xb1, 0x36, 0xf9, 0xff, 0xb2, 0xf3, 0x9c, 0xed, 0xce, 0x73, 0xde, 0x76, 0x9e, 0xf3, + 0xbc, 0xf7, 0x2a, 0xdb, 0xbd, 0x57, 0x79, 0xdd, 0x7b, 0x95, 0xdb, 0x71, 0xcc, 0x54, 0x92, 0x2f, + 0x47, 0xa1, 0x48, 0x03, 0xfd, 0x5f, 0xbf, 0xcb, 0x07, 0x0b, 0x0e, 0x2f, 0xb8, 0x39, 0x42, 0xf5, + 0xb0, 0x86, 0x6c, 0x59, 0x37, 0x9f, 0xf5, 0xf7, 0x3d, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x3e, 0xb4, + 0x91, 0xa6, 0x02, 0x00, 0x00, } func (m *Send) Marshal() (dAtA []byte, err error) { @@ -215,6 +242,27 @@ func (m *Send) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.OutTxFianlizedHeight != 0 { + i = encodeVarintSend(dAtA, i, uint64(m.OutTxFianlizedHeight)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.InTxFinalizedHeight != 0 { + i = encodeVarintSend(dAtA, i, uint64(m.InTxFinalizedHeight)) + i-- + dAtA[i] = 0x78 + } + if len(m.Signers) > 0 { + for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signers[iNdEx]) + copy(dAtA[i:], m.Signers[iNdEx]) + i = encodeVarintSend(dAtA, i, uint64(len(m.Signers[iNdEx]))) + i-- + dAtA[i] = 0x72 + } + } if m.OutBlockHeight != 0 { i = encodeVarintSend(dAtA, i, uint64(m.OutBlockHeight)) i-- @@ -372,6 +420,18 @@ func (m *Send) Size() (n int) { if m.OutBlockHeight != 0 { n += 1 + sovSend(uint64(m.OutBlockHeight)) } + if len(m.Signers) > 0 { + for _, s := range m.Signers { + l = len(s) + n += 1 + l + sovSend(uint64(l)) + } + } + if m.InTxFinalizedHeight != 0 { + n += 1 + sovSend(uint64(m.InTxFinalizedHeight)) + } + if m.OutTxFianlizedHeight != 0 { + n += 2 + sovSend(uint64(m.OutTxFianlizedHeight)) + } return n } @@ -800,6 +860,76 @@ func (m *Send) Unmarshal(dAtA []byte) error { break } } + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InTxFinalizedHeight", wireType) + } + m.InTxFinalizedHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InTxFinalizedHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutTxFianlizedHeight", wireType) + } + m.OutTxFianlizedHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OutTxFianlizedHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipSend(dAtA[iNdEx:]) From e1c519796d9ad43c1523c4f3879a7d5a3b794c76 Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Fri, 22 Oct 2021 03:31:33 -0500 Subject: [PATCH 03/10] starport scaffold map Send sender senderChain receiver receiverChain mBurnt mMint message inTxHash inBlockHeight finalizedMetaHeight signers --no-message --- cmd/metaclientd/tx.go | 2 +- cmd/metaclientd/voter_test.go | 2 +- docs/static/openapi.yml | 319 +++++ proto/metacore/genesis.proto | 2 + proto/metacore/query.proto | 28 + proto/metacore/send.proto | 22 + x/metacore/client/cli/query.go | 3 + x/metacore/client/cli/query_send.go | 71 ++ x/metacore/client/cli/query_send_test.go | 140 +++ .../client/cli/tx_txout_confirmation_voter.go | 2 +- x/metacore/genesis.go | 12 + x/metacore/keeper/grpc_query_send.go | 54 + x/metacore/keeper/grpc_query_send_test.go | 104 ++ .../msg_server_txout_confirmation_voter.go | 1 - x/metacore/keeper/send.go | 49 + x/metacore/keeper/send_test.go | 46 + x/metacore/types/genesis.go | 10 + x/metacore/types/genesis.pb.go | 109 +- x/metacore/types/keys.go | 4 + x/metacore/types/query.pb.go | 1088 +++++++++++++++-- x/metacore/types/query.pb.gw.go | 184 +++ x/metacore/types/send.pb.go | 939 ++++++++++++++ 22 files changed, 3045 insertions(+), 146 deletions(-) create mode 100644 proto/metacore/send.proto create mode 100644 x/metacore/client/cli/query_send.go create mode 100644 x/metacore/client/cli/query_send_test.go create mode 100644 x/metacore/keeper/grpc_query_send.go create mode 100644 x/metacore/keeper/grpc_query_send_test.go create mode 100644 x/metacore/keeper/send.go create mode 100644 x/metacore/keeper/send_test.go create mode 100644 x/metacore/types/send.pb.go diff --git a/cmd/metaclientd/tx.go b/cmd/metaclientd/tx.go index 4d24239ad5..7e2b22c664 100644 --- a/cmd/metaclientd/tx.go +++ b/cmd/metaclientd/tx.go @@ -38,7 +38,7 @@ func (b *MetachainBridge) PostTxoutConfirmation(txoutId uint64, txHash string, m } // Get all current Txout from MetaCore -func (b *MetachainBridge) GetAllTxout() ([]*types.Txout, error){ +func (b *MetachainBridge) GetAllTxout() ([]*types.Txout, error) { client := types.NewQueryClient(b.grpcConn) resp, err := client.TxoutAll(context.Background(), &types.QueryAllTxoutRequest{}) if err != nil { diff --git a/cmd/metaclientd/voter_test.go b/cmd/metaclientd/voter_test.go index 5f5597133b..9aa794ba2f 100644 --- a/cmd/metaclientd/voter_test.go +++ b/cmd/metaclientd/voter_test.go @@ -100,7 +100,7 @@ func (s *VoterSuite) TestObservedTxIn(c *C) { txouts, err := b1.GetAllTxout() c.Assert(err, IsNil) log.Info().Msgf("txouts: %v", txouts) - c.Assert(len(txouts) >=1, Equals, true) + c.Assert(len(txouts) >= 1, Equals, true) txout := txouts[0] tid := txout.Id diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 8876011513..45989c5206 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -19332,6 +19332,205 @@ paths: type: string tags: - Query + /Meta-Protocol/metacore/metacore/send: + get: + summary: Queries a list of send items. + operationId: MetaProtocolMetacoreMetacoreSendAll + responses: + '200': + description: A successful response. + schema: + type: object + properties: + Send: + type: array + items: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + finalizedMetaHeight: + type: string + signers: + type: string + pagination: + type: object + properties: + nextKey: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.countTotal + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + tags: + - Query + '/Meta-Protocol/metacore/metacore/send/{index}': + get: + summary: Queries a send by index. + operationId: MetaProtocolMetacoreMetacoreSend + responses: + '200': + description: A successful response. + schema: + type: object + properties: + Send: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + finalizedMetaHeight: + type: string + signers: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: index + in: path + required: true + type: string + tags: + - Query /Meta-Protocol/metacore/metacore/txin: get: summary: Queries a list of txin items. @@ -30427,6 +30626,65 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + MetaProtocol.metacore.metacore.QueryAllSendResponse: + type: object + properties: + Send: + type: array + items: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + finalizedMetaHeight: + type: string + signers: + type: string + pagination: + type: object + properties: + nextKey: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } MetaProtocol.metacore.metacore.QueryAllTxinResponse: type: object properties: @@ -30709,6 +30967,38 @@ definitions: - Active - Disabled default: Unknown + MetaProtocol.metacore.metacore.QueryGetSendResponse: + type: object + properties: + Send: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + finalizedMetaHeight: + type: string + signers: + type: string MetaProtocol.metacore.metacore.QueryGetTxinResponse: type: object properties: @@ -30858,6 +31148,35 @@ definitions: Height: type: string format: uint64 + MetaProtocol.metacore.metacore.Send: + type: object + properties: + creator: + type: string + index: + type: string + sender: + type: string + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: + type: string + mMint: + type: string + message: + type: string + inTxHash: + type: string + inBlockHeight: + type: string + finalizedMetaHeight: + type: string + signers: + type: string MetaProtocol.metacore.metacore.Txin: type: object properties: diff --git a/proto/metacore/genesis.proto b/proto/metacore/genesis.proto index 44376be0c8..39dbfe5615 100644 --- a/proto/metacore/genesis.proto +++ b/proto/metacore/genesis.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package MetaProtocol.metacore.metacore; // this line is used by starport scaffolding # genesis/proto/import +import "metacore/send.proto"; import "metacore/txout_confirmation.proto"; import "metacore/txout.proto"; import "metacore/node_account.proto"; @@ -13,6 +14,7 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; // GenesisState defines the metacore module's genesis state. message GenesisState { // this line is used by starport scaffolding # genesis/proto/state + repeated Send sendList = 7; // this line is used by starport scaffolding # genesis/proto/stateField repeated TxoutConfirmation txoutConfirmationList = 6; // this line is used by starport scaffolding # genesis/proto/stateField repeated Txout txoutList = 4; // this line is used by starport scaffolding # genesis/proto/stateField uint64 txoutCount = 5; // this line is used by starport scaffolding # genesis/proto/stateField diff --git a/proto/metacore/query.proto b/proto/metacore/query.proto index 585beb7e34..e9e793a9df 100644 --- a/proto/metacore/query.proto +++ b/proto/metacore/query.proto @@ -4,6 +4,7 @@ package MetaProtocol.metacore.metacore; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; // this line is used by starport scaffolding # 1 +import "metacore/send.proto"; import "metacore/txout_confirmation.proto"; import "metacore/txout.proto"; import "metacore/node_account.proto"; @@ -16,6 +17,17 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; service Query { // this line is used by starport scaffolding # 2 + // Queries a send by index. + rpc Send(QueryGetSendRequest) returns (QueryGetSendResponse) { + option (google.api.http).get = "/Meta-Protocol/metacore/metacore/send/{index}"; + } + + // Queries a list of send items. + rpc SendAll(QueryAllSendRequest) returns (QueryAllSendResponse) { + option (google.api.http).get = "/Meta-Protocol/metacore/metacore/send"; + } + + // Queries a txoutConfirmation by index. rpc TxoutConfirmation(QueryGetTxoutConfirmationRequest) returns (QueryGetTxoutConfirmationResponse) { option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txoutConfirmation/{index}"; @@ -79,6 +91,22 @@ service Query { } // this line is used by starport scaffolding # 3 +message QueryGetSendRequest { + string index = 1; +} + +message QueryGetSendResponse { + Send Send = 1; +} + +message QueryAllSendRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllSendResponse { + repeated Send Send = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} message QueryGetTxoutConfirmationRequest { string index = 1; } diff --git a/proto/metacore/send.proto b/proto/metacore/send.proto new file mode 100644 index 0000000000..11ba165bd7 --- /dev/null +++ b/proto/metacore/send.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package MetaProtocol.metacore.metacore; + +option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; + +import "gogoproto/gogo.proto"; + +message Send { + string creator = 1; + string index = 2; + string sender = 3; + string senderChain = 4; + string receiver = 5; + string receiverChain = 6; + string mBurnt = 7; + string mMint = 8; + string message = 9; + string inTxHash = 10; + string inBlockHeight = 11; + string finalizedMetaHeight = 12; + string signers = 13; +} diff --git a/x/metacore/client/cli/query.go b/x/metacore/client/cli/query.go index 6649d43b38..3b70c21836 100644 --- a/x/metacore/client/cli/query.go +++ b/x/metacore/client/cli/query.go @@ -26,6 +26,9 @@ func GetQueryCmd(queryRoute string) *cobra.Command { // this line is used by starport scaffolding # 1 + cmd.AddCommand(CmdListSend()) + cmd.AddCommand(CmdShowSend()) + cmd.AddCommand(CmdListTxoutConfirmation()) cmd.AddCommand(CmdShowTxoutConfirmation()) diff --git a/x/metacore/client/cli/query_send.go b/x/metacore/client/cli/query_send.go new file mode 100644 index 0000000000..220e29a653 --- /dev/null +++ b/x/metacore/client/cli/query_send.go @@ -0,0 +1,71 @@ +package cli + +import ( + "context" + + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +func CmdListSend() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-send", + Short: "list all Send", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllSendRequest{ + Pagination: pageReq, + } + + res, err := queryClient.SendAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowSend() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-send [index]", + Short: "shows a Send", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetSendRequest{ + Index: args[0], + } + + res, err := queryClient.Send(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/metacore/client/cli/query_send_test.go b/x/metacore/client/cli/query_send_test.go new file mode 100644 index 0000000000..34782ccbf4 --- /dev/null +++ b/x/metacore/client/cli/query_send_test.go @@ -0,0 +1,140 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/Meta-Protocol/metacore/testutil/network" + "github.com/Meta-Protocol/metacore/x/metacore/client/cli" + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func networkWithSendObjects(t *testing.T, n int) (*network.Network, []*types.Send) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + for i := 0; i < n; i++ { + state.SendList = append(state.SendList, &types.Send{Creator: "ANY", Index: strconv.Itoa(i)}) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.SendList +} + +func TestShowSend(t *testing.T) { + net, objs := networkWithSendObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + id string + args []string + err error + obj *types.Send + }{ + { + desc: "found", + id: objs[0].Index, + args: common, + obj: objs[0], + }, + { + desc: "not found", + id: "not_found", + args: common, + err: status.Error(codes.InvalidArgument, "not found"), + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + args := []string{tc.id} + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowSend(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetSendResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Send) + require.Equal(t, tc.obj, resp.Send) + } + }) + } +} + +func TestListSend(t *testing.T) { + net, objs := networkWithSendObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListSend(), args) + require.NoError(t, err) + var resp types.QueryAllSendResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + for j := i; j < len(objs) && j < i+step; j++ { + assert.Equal(t, objs[j], resp.Send[j-i]) + } + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListSend(), args) + require.NoError(t, err) + var resp types.QueryAllSendResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + for j := i; j < len(objs) && j < i+step; j++ { + assert.Equal(t, objs[j], resp.Send[j-i]) + } + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListSend(), args) + require.NoError(t, err) + var resp types.QueryAllSendResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.Equal(t, objs, resp.Send) + }) +} diff --git a/x/metacore/client/cli/tx_txout_confirmation_voter.go b/x/metacore/client/cli/tx_txout_confirmation_voter.go index be3a31f9bb..fb0bdfa3c4 100644 --- a/x/metacore/client/cli/tx_txout_confirmation_voter.go +++ b/x/metacore/client/cli/tx_txout_confirmation_voter.go @@ -24,7 +24,7 @@ func CmdTxoutConfirmationVoter() *cobra.Command { return err } argsTxHash := args[1] - argsMMint,err := cast.ToUint64E(args[2]) + argsMMint, err := cast.ToUint64E(args[2]) if err != nil { return err } diff --git a/x/metacore/genesis.go b/x/metacore/genesis.go index c2ee29e0ac..793786d3c2 100644 --- a/x/metacore/genesis.go +++ b/x/metacore/genesis.go @@ -10,6 +10,11 @@ import ( // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { // this line is used by starport scaffolding # genesis/module/init + // Set all the send + for _, elem := range genState.SendList { + k.SetSend(ctx, *elem) + } + // Set all the txoutConfirmation for _, elem := range genState.TxoutConfirmationList { k.SetTxoutConfirmation(ctx, *elem) @@ -46,6 +51,13 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() // this line is used by starport scaffolding # genesis/module/export + // Get all send + sendList := k.GetAllSend(ctx) + for _, elem := range sendList { + elem := elem + genesis.SendList = append(genesis.SendList, &elem) + } + // Get all txoutConfirmation txoutConfirmationList := k.GetAllTxoutConfirmation(ctx) for _, elem := range txoutConfirmationList { diff --git a/x/metacore/keeper/grpc_query_send.go b/x/metacore/keeper/grpc_query_send.go new file mode 100644 index 0000000000..11c3172cb6 --- /dev/null +++ b/x/metacore/keeper/grpc_query_send.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "context" + + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) SendAll(c context.Context, req *types.QueryAllSendRequest) (*types.QueryAllSendResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var sends []*types.Send + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + sendStore := prefix.NewStore(store, types.KeyPrefix(types.SendKey)) + + pageRes, err := query.Paginate(sendStore, req.Pagination, func(key []byte, value []byte) error { + var send types.Send + if err := k.cdc.UnmarshalBinaryBare(value, &send); err != nil { + return err + } + + sends = append(sends, &send) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllSendResponse{Send: sends, Pagination: pageRes}, nil +} + +func (k Keeper) Send(c context.Context, req *types.QueryGetSendRequest) (*types.QueryGetSendResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetSend(ctx, req.Index) + if !found { + return nil, status.Error(codes.InvalidArgument, "not found") + } + + return &types.QueryGetSendResponse{Send: &val}, nil +} diff --git a/x/metacore/keeper/grpc_query_send_test.go b/x/metacore/keeper/grpc_query_send_test.go new file mode 100644 index 0000000000..540c7103b8 --- /dev/null +++ b/x/metacore/keeper/grpc_query_send_test.go @@ -0,0 +1,104 @@ +package keeper + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func TestSendQuerySingle(t *testing.T) { + keeper, ctx := setupKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNSend(keeper, ctx, 2) + for _, tc := range []struct { + desc string + request *types.QueryGetSendRequest + response *types.QueryGetSendResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetSendRequest{Index: msgs[0].Index}, + response: &types.QueryGetSendResponse{Send: &msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetSendRequest{Index: msgs[1].Index}, + response: &types.QueryGetSendResponse{Send: &msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetSendRequest{Index: "missing"}, + err: status.Error(codes.InvalidArgument, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Send(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.Equal(t, tc.response, response) + } + }) + } +} + +func TestSendQueryPaginated(t *testing.T) { + keeper, ctx := setupKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNSend(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllSendRequest { + return &types.QueryAllSendRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.SendAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + for j := i; j < len(msgs) && j < i+step; j++ { + assert.Equal(t, &msgs[j], resp.Send[j-i]) + } + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.SendAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + for j := i; j < len(msgs) && j < i+step; j++ { + assert.Equal(t, &msgs[j], resp.Send[j-i]) + } + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.SendAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.SendAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/metacore/keeper/msg_server_txout_confirmation_voter.go b/x/metacore/keeper/msg_server_txout_confirmation_voter.go index cbd32b1117..287e8fc7e1 100644 --- a/x/metacore/keeper/msg_server_txout_confirmation_voter.go +++ b/x/metacore/keeper/msg_server_txout_confirmation_voter.go @@ -44,7 +44,6 @@ func (k msgServer) TxoutConfirmationVoter(goCtx context.Context, msg *types.MsgT k.SetTxoutConfirmation(ctx, txoutConf) - if len(txoutConf.Signers) == 2 { // TODO: fix threshold txoutConf.FinalizedHeight = uint64(ctx.BlockHeader().Height) k.RemoveTxout(ctx, txoutConf.TxoutId) diff --git a/x/metacore/keeper/send.go b/x/metacore/keeper/send.go new file mode 100644 index 0000000000..6a27c47946 --- /dev/null +++ b/x/metacore/keeper/send.go @@ -0,0 +1,49 @@ +package keeper + +import ( + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetSend set a specific send in the store from its index +func (k Keeper) SetSend(ctx sdk.Context, send types.Send) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SendKey)) + b := k.cdc.MustMarshalBinaryBare(&send) + store.Set(types.KeyPrefix(send.Index), b) +} + +// GetSend returns a send from its index +func (k Keeper) GetSend(ctx sdk.Context, index string) (val types.Send, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SendKey)) + + b := store.Get(types.KeyPrefix(index)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshalBinaryBare(b, &val) + return val, true +} + +// RemoveSend removes a send from the store +func (k Keeper) RemoveSend(ctx sdk.Context, index string) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SendKey)) + store.Delete(types.KeyPrefix(index)) +} + +// GetAllSend returns all send +func (k Keeper) GetAllSend(ctx sdk.Context) (list []types.Send) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SendKey)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Send + k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/metacore/keeper/send_test.go b/x/metacore/keeper/send_test.go new file mode 100644 index 0000000000..838c8d7986 --- /dev/null +++ b/x/metacore/keeper/send_test.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "fmt" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/assert" + + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func createNSend(keeper *Keeper, ctx sdk.Context, n int) []types.Send { + items := make([]types.Send, n) + for i := range items { + items[i].Creator = "any" + items[i].Index = fmt.Sprintf("%d", i) + keeper.SetSend(ctx, items[i]) + } + return items +} + +func TestSendGet(t *testing.T) { + keeper, ctx := setupKeeper(t) + items := createNSend(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetSend(ctx, item.Index) + assert.True(t, found) + assert.Equal(t, item, rst) + } +} +func TestSendRemove(t *testing.T) { + keeper, ctx := setupKeeper(t) + items := createNSend(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveSend(ctx, item.Index) + _, found := keeper.GetSend(ctx, item.Index) + assert.False(t, found) + } +} + +func TestSendGetAll(t *testing.T) { + keeper, ctx := setupKeeper(t) + items := createNSend(keeper, ctx, 10) + assert.Equal(t, items, keeper.GetAllSend(ctx)) +} diff --git a/x/metacore/types/genesis.go b/x/metacore/types/genesis.go index 8d284300af..bc56c8fd4b 100644 --- a/x/metacore/types/genesis.go +++ b/x/metacore/types/genesis.go @@ -13,6 +13,7 @@ func DefaultGenesis() *GenesisState { return &GenesisState{ // this line is used by starport scaffolding # ibc/genesistype/default // this line is used by starport scaffolding # genesis/types/default + SendList: []*Send{}, TxoutConfirmationList: []*TxoutConfirmation{}, TxoutList: []*Txout{}, NodeAccountList: []*NodeAccount{}, @@ -27,6 +28,15 @@ func (gs GenesisState) Validate() error { // this line is used by starport scaffolding # ibc/genesistype/validate // this line is used by starport scaffolding # genesis/types/validate + // Check for duplicated index in send + sendIndexMap := make(map[string]bool) + + for _, elem := range gs.SendList { + if _, ok := sendIndexMap[elem.Index]; ok { + return fmt.Errorf("duplicated index for send") + } + sendIndexMap[elem.Index] = true + } // Check for duplicated index in txoutConfirmation txoutConfirmationIndexMap := make(map[string]bool) diff --git a/x/metacore/types/genesis.pb.go b/x/metacore/types/genesis.pb.go index 17ad7ccbef..05783594ef 100644 --- a/x/metacore/types/genesis.pb.go +++ b/x/metacore/types/genesis.pb.go @@ -25,6 +25,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the metacore module's genesis state. type GenesisState struct { // this line is used by starport scaffolding # genesis/proto/state + SendList []*Send `protobuf:"bytes,7,rep,name=sendList,proto3" json:"sendList,omitempty"` TxoutConfirmationList []*TxoutConfirmation `protobuf:"bytes,6,rep,name=txoutConfirmationList,proto3" json:"txoutConfirmationList,omitempty"` TxoutList []*Txout `protobuf:"bytes,4,rep,name=txoutList,proto3" json:"txoutList,omitempty"` TxoutCount uint64 `protobuf:"varint,5,opt,name=txoutCount,proto3" json:"txoutCount,omitempty"` @@ -66,6 +67,13 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo +func (m *GenesisState) GetSendList() []*Send { + if m != nil { + return m.SendList + } + return nil +} + func (m *GenesisState) GetTxoutConfirmationList() []*TxoutConfirmation { if m != nil { return m.TxoutConfirmationList @@ -115,29 +123,30 @@ func init() { func init() { proto.RegisterFile("metacore/genesis.proto", fileDescriptor_c68bd28f2e9a7fbf) } var fileDescriptor_c68bd28f2e9a7fbf = []byte{ - // 338 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcb, 0x4a, 0x03, 0x31, - 0x14, 0x86, 0x3b, 0xb6, 0x16, 0x8d, 0x8a, 0x10, 0x2f, 0xd4, 0x0a, 0xa1, 0x8a, 0x42, 0x45, 0x9c, - 0x62, 0x7d, 0x01, 0xb5, 0x0b, 0x37, 0xf5, 0x42, 0xbc, 0x2c, 0xdc, 0x94, 0x69, 0x8c, 0x35, 0x60, - 0x93, 0x32, 0x73, 0x46, 0xea, 0x5b, 0xf8, 0x54, 0xe2, 0xb2, 0x4b, 0x97, 0xd2, 0x79, 0x11, 0x49, - 0xe6, 0x5e, 0xc4, 0x76, 0x77, 0xf8, 0x4f, 0xfe, 0xef, 0x9c, 0xfc, 0x1c, 0xb4, 0xd9, 0xe7, 0xe0, - 0x30, 0xe5, 0xf2, 0x46, 0x8f, 0x4b, 0xee, 0x09, 0xcf, 0x1e, 0xb8, 0x0a, 0x14, 0x26, 0x97, 0x1c, - 0x9c, 0x1b, 0x5d, 0x32, 0xf5, 0x6a, 0xc7, 0x8f, 0x92, 0xa2, 0xba, 0x93, 0xf8, 0x60, 0xa8, 0x7c, - 0xe8, 0x30, 0x25, 0x9f, 0x85, 0xdb, 0x77, 0x40, 0x28, 0x19, 0x22, 0xaa, 0xeb, 0xf9, 0x27, 0x91, - 0xba, 0x9d, 0xa8, 0x52, 0x3d, 0xf1, 0x8e, 0xc3,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xef, 0x03, 0xee, 0x75, - 0xcb, 0xe6, 0x3a, 0x4e, 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x07, 0xc5, 0x14, 0xdd, 0x02, - 0x00, 0x00, + // 363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcd, 0x4e, 0xc2, 0x40, + 0x10, 0xc7, 0xa9, 0x20, 0xea, 0xaa, 0x31, 0x59, 0xd4, 0x20, 0x26, 0x1b, 0x34, 0x9a, 0x60, 0x8c, + 0x25, 0xe2, 0x0b, 0xa8, 0x1c, 0xbc, 0xe0, 0x47, 0x16, 0xf5, 0xe0, 0x85, 0x94, 0xb2, 0x62, 0x13, + 0xd9, 0x25, 0xed, 0xd4, 0xe0, 0x1b, 0x78, 0xf4, 0xb1, 0x3c, 0x72, 0xf4, 0x68, 0xe0, 0x45, 0xcc, + 0x4e, 0xcb, 0xf2, 0x11, 0x63, 0xb9, 0x4d, 0xfe, 0x33, 0xff, 0xdf, 0xcc, 0xec, 0x2c, 0xd9, 0xee, + 0x08, 0x70, 0x5c, 0xe5, 0x8b, 0x72, 0x5b, 0x48, 0x11, 0x78, 0x81, 0xdd, 0xf5, 0x15, 0x28, 0xca, + 0xae, 0x05, 0x38, 0x77, 0x3a, 0x74, 0xd5, 0xab, 0x3d, 0x2a, 0x32, 0x41, 0x21, 0x67, 0x7c, 0x81, + 0x90, 0xad, 0xc8, 0x54, 0xd8, 0x33, 0x22, 0xf4, 0x54, 0x08, 0x0d, 0x57, 0xc9, 0x67, 0xcf, 0xef, + 0x38, 0xe0, 0x29, 0x19, 0x97, 0x6c, 0x4e, 0x97, 0xc4, 0xea, 0xae, 0x51, 0xa5, 0x6a, 0x89, 0x86, + 0xe3, 0xba, 0x2a, 0x94, 0xa3, 0xe4, 0xce, 0x84, 0xc5, 0x93, 0x8d, 0x37, 0x05, 0xc2, 0x8f, 0x53,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0, 0xde, 0x15, 0x41, 0x33, 0x8b, 0xff, 0xeb, 0xec, 0x37, 0x00, + 0x00, 0xff, 0xff, 0x13, 0x34, 0x55, 0xa6, 0x34, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -160,6 +169,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SendList) > 0 { + for iNdEx := len(m.SendList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } if len(m.TxoutConfirmationList) > 0 { for iNdEx := len(m.TxoutConfirmationList) - 1; iNdEx >= 0; iNdEx-- { { @@ -288,6 +311,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.SendList) > 0 { + for _, e := range m.SendList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -515,6 +544,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendList = append(m.SendList, &Send{}) + if err := m.SendList[len(m.SendList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/metacore/types/keys.go b/x/metacore/types/keys.go index 25b1950754..01765f9408 100644 --- a/x/metacore/types/keys.go +++ b/x/metacore/types/keys.go @@ -45,3 +45,7 @@ const ( const ( TxoutConfirmationKey = "TxoutConfirmation-value-" ) + +const ( + SendKey = "Send-value-" +) diff --git a/x/metacore/types/query.pb.go b/x/metacore/types/query.pb.go index 835cff8be6..3a420760dc 100644 --- a/x/metacore/types/query.pb.go +++ b/x/metacore/types/query.pb.go @@ -30,6 +30,190 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // this line is used by starport scaffolding # 3 +type QueryGetSendRequest struct { + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +} + +func (m *QueryGetSendRequest) Reset() { *m = QueryGetSendRequest{} } +func (m *QueryGetSendRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetSendRequest) ProtoMessage() {} +func (*QueryGetSendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{0} +} +func (m *QueryGetSendRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSendRequest.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 *QueryGetSendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSendRequest.Merge(m, src) +} +func (m *QueryGetSendRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSendRequest proto.InternalMessageInfo + +func (m *QueryGetSendRequest) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +type QueryGetSendResponse struct { + Send *Send `protobuf:"bytes,1,opt,name=Send,proto3" json:"Send,omitempty"` +} + +func (m *QueryGetSendResponse) Reset() { *m = QueryGetSendResponse{} } +func (m *QueryGetSendResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetSendResponse) ProtoMessage() {} +func (*QueryGetSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{1} +} +func (m *QueryGetSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSendResponse.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 *QueryGetSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSendResponse.Merge(m, src) +} +func (m *QueryGetSendResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSendResponse proto.InternalMessageInfo + +func (m *QueryGetSendResponse) GetSend() *Send { + if m != nil { + return m.Send + } + return nil +} + +type QueryAllSendRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllSendRequest) Reset() { *m = QueryAllSendRequest{} } +func (m *QueryAllSendRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllSendRequest) ProtoMessage() {} +func (*QueryAllSendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{2} +} +func (m *QueryAllSendRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllSendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllSendRequest.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 *QueryAllSendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllSendRequest.Merge(m, src) +} +func (m *QueryAllSendRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllSendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllSendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllSendRequest proto.InternalMessageInfo + +func (m *QueryAllSendRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllSendResponse struct { + Send []*Send `protobuf:"bytes,1,rep,name=Send,proto3" json:"Send,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllSendResponse) Reset() { *m = QueryAllSendResponse{} } +func (m *QueryAllSendResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllSendResponse) ProtoMessage() {} +func (*QueryAllSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{3} +} +func (m *QueryAllSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllSendResponse.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 *QueryAllSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllSendResponse.Merge(m, src) +} +func (m *QueryAllSendResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllSendResponse proto.InternalMessageInfo + +func (m *QueryAllSendResponse) GetSend() []*Send { + if m != nil { + return m.Send + } + return nil +} + +func (m *QueryAllSendResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + type QueryGetTxoutConfirmationRequest struct { Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` } @@ -38,7 +222,7 @@ func (m *QueryGetTxoutConfirmationRequest) Reset() { *m = QueryGetTxoutC func (m *QueryGetTxoutConfirmationRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTxoutConfirmationRequest) ProtoMessage() {} func (*QueryGetTxoutConfirmationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{0} + return fileDescriptor_dc2a1267d2da6377, []int{4} } func (m *QueryGetTxoutConfirmationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -82,7 +266,7 @@ func (m *QueryGetTxoutConfirmationResponse) Reset() { *m = QueryGetTxout func (m *QueryGetTxoutConfirmationResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTxoutConfirmationResponse) ProtoMessage() {} func (*QueryGetTxoutConfirmationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{1} + return fileDescriptor_dc2a1267d2da6377, []int{5} } func (m *QueryGetTxoutConfirmationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -126,7 +310,7 @@ func (m *QueryAllTxoutConfirmationRequest) Reset() { *m = QueryAllTxoutC func (m *QueryAllTxoutConfirmationRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllTxoutConfirmationRequest) ProtoMessage() {} func (*QueryAllTxoutConfirmationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{2} + return fileDescriptor_dc2a1267d2da6377, []int{6} } func (m *QueryAllTxoutConfirmationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -171,7 +355,7 @@ func (m *QueryAllTxoutConfirmationResponse) Reset() { *m = QueryAllTxout func (m *QueryAllTxoutConfirmationResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllTxoutConfirmationResponse) ProtoMessage() {} func (*QueryAllTxoutConfirmationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{3} + return fileDescriptor_dc2a1267d2da6377, []int{7} } func (m *QueryAllTxoutConfirmationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -222,7 +406,7 @@ func (m *QueryGetTxoutRequest) Reset() { *m = QueryGetTxoutRequest{} } func (m *QueryGetTxoutRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTxoutRequest) ProtoMessage() {} func (*QueryGetTxoutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{4} + return fileDescriptor_dc2a1267d2da6377, []int{8} } func (m *QueryGetTxoutRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -266,7 +450,7 @@ func (m *QueryGetTxoutResponse) Reset() { *m = QueryGetTxoutResponse{} } func (m *QueryGetTxoutResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTxoutResponse) ProtoMessage() {} func (*QueryGetTxoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{5} + return fileDescriptor_dc2a1267d2da6377, []int{9} } func (m *QueryGetTxoutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -310,7 +494,7 @@ func (m *QueryAllTxoutRequest) Reset() { *m = QueryAllTxoutRequest{} } func (m *QueryAllTxoutRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllTxoutRequest) ProtoMessage() {} func (*QueryAllTxoutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{6} + return fileDescriptor_dc2a1267d2da6377, []int{10} } func (m *QueryAllTxoutRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -355,7 +539,7 @@ func (m *QueryAllTxoutResponse) Reset() { *m = QueryAllTxoutResponse{} } func (m *QueryAllTxoutResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllTxoutResponse) ProtoMessage() {} func (*QueryAllTxoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{7} + return fileDescriptor_dc2a1267d2da6377, []int{11} } func (m *QueryAllTxoutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -406,7 +590,7 @@ func (m *QueryGetNodeAccountRequest) Reset() { *m = QueryGetNodeAccountR func (m *QueryGetNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountRequest) ProtoMessage() {} func (*QueryGetNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{8} + return fileDescriptor_dc2a1267d2da6377, []int{12} } func (m *QueryGetNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,7 +634,7 @@ func (m *QueryGetNodeAccountResponse) Reset() { *m = QueryGetNodeAccount func (m *QueryGetNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountResponse) ProtoMessage() {} func (*QueryGetNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{9} + return fileDescriptor_dc2a1267d2da6377, []int{13} } func (m *QueryGetNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -494,7 +678,7 @@ func (m *QueryAllNodeAccountRequest) Reset() { *m = QueryAllNodeAccountR func (m *QueryAllNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountRequest) ProtoMessage() {} func (*QueryAllNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{10} + return fileDescriptor_dc2a1267d2da6377, []int{14} } func (m *QueryAllNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -539,7 +723,7 @@ func (m *QueryAllNodeAccountResponse) Reset() { *m = QueryAllNodeAccount func (m *QueryAllNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountResponse) ProtoMessage() {} func (*QueryAllNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{11} + return fileDescriptor_dc2a1267d2da6377, []int{15} } func (m *QueryAllNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -589,7 +773,7 @@ func (m *QueryLastMetaHeightRequest) Reset() { *m = QueryLastMetaHeightR func (m *QueryLastMetaHeightRequest) String() string { return proto.CompactTextString(m) } func (*QueryLastMetaHeightRequest) ProtoMessage() {} func (*QueryLastMetaHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{12} + return fileDescriptor_dc2a1267d2da6377, []int{16} } func (m *QueryLastMetaHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -626,7 +810,7 @@ func (m *QueryLastMetaHeightResponse) Reset() { *m = QueryLastMetaHeight func (m *QueryLastMetaHeightResponse) String() string { return proto.CompactTextString(m) } func (*QueryLastMetaHeightResponse) ProtoMessage() {} func (*QueryLastMetaHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{13} + return fileDescriptor_dc2a1267d2da6377, []int{17} } func (m *QueryLastMetaHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -670,7 +854,7 @@ func (m *QueryGetTxinVoterRequest) Reset() { *m = QueryGetTxinVoterReque func (m *QueryGetTxinVoterRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTxinVoterRequest) ProtoMessage() {} func (*QueryGetTxinVoterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{14} + return fileDescriptor_dc2a1267d2da6377, []int{18} } func (m *QueryGetTxinVoterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -714,7 +898,7 @@ func (m *QueryGetTxinVoterResponse) Reset() { *m = QueryGetTxinVoterResp func (m *QueryGetTxinVoterResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTxinVoterResponse) ProtoMessage() {} func (*QueryGetTxinVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{15} + return fileDescriptor_dc2a1267d2da6377, []int{19} } func (m *QueryGetTxinVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -758,7 +942,7 @@ func (m *QueryAllTxinVoterRequest) Reset() { *m = QueryAllTxinVoterReque func (m *QueryAllTxinVoterRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllTxinVoterRequest) ProtoMessage() {} func (*QueryAllTxinVoterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{16} + return fileDescriptor_dc2a1267d2da6377, []int{20} } func (m *QueryAllTxinVoterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -803,7 +987,7 @@ func (m *QueryAllTxinVoterResponse) Reset() { *m = QueryAllTxinVoterResp func (m *QueryAllTxinVoterResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllTxinVoterResponse) ProtoMessage() {} func (*QueryAllTxinVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{17} + return fileDescriptor_dc2a1267d2da6377, []int{21} } func (m *QueryAllTxinVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -854,7 +1038,7 @@ func (m *QueryGetTxinRequest) Reset() { *m = QueryGetTxinRequest{} } func (m *QueryGetTxinRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTxinRequest) ProtoMessage() {} func (*QueryGetTxinRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{18} + return fileDescriptor_dc2a1267d2da6377, []int{22} } func (m *QueryGetTxinRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -898,7 +1082,7 @@ func (m *QueryGetTxinResponse) Reset() { *m = QueryGetTxinResponse{} } func (m *QueryGetTxinResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTxinResponse) ProtoMessage() {} func (*QueryGetTxinResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{19} + return fileDescriptor_dc2a1267d2da6377, []int{23} } func (m *QueryGetTxinResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -942,7 +1126,7 @@ func (m *QueryAllTxinRequest) Reset() { *m = QueryAllTxinRequest{} } func (m *QueryAllTxinRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllTxinRequest) ProtoMessage() {} func (*QueryAllTxinRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{20} + return fileDescriptor_dc2a1267d2da6377, []int{24} } func (m *QueryAllTxinRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -987,7 +1171,7 @@ func (m *QueryAllTxinResponse) Reset() { *m = QueryAllTxinResponse{} } func (m *QueryAllTxinResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllTxinResponse) ProtoMessage() {} func (*QueryAllTxinResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{21} + return fileDescriptor_dc2a1267d2da6377, []int{25} } func (m *QueryAllTxinResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1031,6 +1215,10 @@ func (m *QueryAllTxinResponse) GetPagination() *query.PageResponse { } func init() { + proto.RegisterType((*QueryGetSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetSendRequest") + proto.RegisterType((*QueryGetSendResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetSendResponse") + proto.RegisterType((*QueryAllSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllSendRequest") + proto.RegisterType((*QueryAllSendResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllSendResponse") proto.RegisterType((*QueryGetTxoutConfirmationRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetTxoutConfirmationRequest") proto.RegisterType((*QueryGetTxoutConfirmationResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetTxoutConfirmationResponse") proto.RegisterType((*QueryAllTxoutConfirmationRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllTxoutConfirmationRequest") @@ -1058,69 +1246,74 @@ func init() { func init() { proto.RegisterFile("metacore/query.proto", fileDescriptor_dc2a1267d2da6377) } var fileDescriptor_dc2a1267d2da6377 = []byte{ - // 980 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x98, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xc7, 0x3b, 0xc9, 0x76, 0x61, 0x67, 0x51, 0x05, 0xb3, 0x01, 0xed, 0x66, 0x57, 0xd1, 0x76, - 0x44, 0x7f, 0xd0, 0x36, 0x36, 0xf9, 0x51, 0x08, 0x69, 0x0f, 0xa4, 0x48, 0x94, 0x43, 0x8b, 0x4a, - 0x54, 0x71, 0x40, 0x82, 0xc8, 0x89, 0x87, 0xd4, 0xc8, 0xf1, 0xa4, 0xb1, 0x53, 0xb5, 0xaa, 0x7a, - 0x41, 0xfc, 0x01, 0x48, 0x9c, 0x38, 0x70, 0xe2, 0x00, 0x1c, 0xe0, 0x86, 0xb8, 0x20, 0x21, 0x21, - 0x0e, 0x5c, 0x90, 0x2a, 0x71, 0x80, 0x03, 0x07, 0xd4, 0xf2, 0x87, 0x20, 0x8f, 0x9f, 0x1d, 0x3b, - 0x71, 0x1d, 0x3b, 0xf5, 0x2d, 0x1e, 0xcf, 0x7b, 0xef, 0xfb, 0xf9, 0xce, 0x8c, 0xe7, 0x29, 0x38, - 0xd7, 0x63, 0x96, 0xd2, 0xe1, 0x03, 0x26, 0x1f, 0x0f, 0xd9, 0xe0, 0x4c, 0xea, 0x0f, 0xb8, 0xc5, - 0x49, 0x61, 0x9f, 0x59, 0xca, 0x81, 0xfd, 0xb3, 0xc3, 0x75, 0xc9, 0x9d, 0xe2, 0xfd, 0xc8, 0x3f, - 0xe9, 0x72, 0xde, 0xd5, 0x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52, 0x4d, 0x64, 0xb5, 0x2b, 0x7f, 0x33, 0x61, 0x14, 0x48, 0xae, - 0x08, 0xc9, 0x45, 0xb2, 0x1e, 0x4f, 0xb2, 0x7c, 0xae, 0xa9, 0x17, 0xe4, 0x1b, 0x84, 0x9f, 0x15, - 0x69, 0x6c, 0xe7, 0xab, 0x89, 0x7c, 0x4b, 0x26, 0x77, 0xbc, 0x53, 0xa1, 0x92, 0x90, 0xbb, 0x4a, - 0x96, 0xe3, 0xc9, 0x25, 0xbf, 0xa1, 0xc0, 0x65, 0x49, 0xea, 0x71, 0x5d, 0x9a, 0xbc, 0xdf, 0xf3, - 0x5b, 0x33, 0xc5, 0x82, 0xf0, 0x6d, 0x21, 0xfc, 0x35, 0x52, 0x9d, 0x2a, 0xdc, 0x18, 0x45, 0x7b, - 0xdb, 0xfe, 0x17, 0x84, 0x17, 0x7c, 0x59, 0x6d, 0xdb, 0xeb, 0x71, 0x0d, 0x9c, 0x99, 0x24, 0xbc, - 0xfd, 0xa0, 0x55, 0x41, 0x22, 0x91, 0x8d, 0x24, 0x24, 0xe4, 0x57, 0x84, 0x17, 0x82, 0x57, 0x7f, - 0x4c, 0x82, 0xd0, 0x6e, 0x22, 0x26, 0x41, 0x78, 0xaf, 0x41, 0x5f, 0x17, 0x04, 0x25, 0x22, 0x4f, - 0x25, 0xd0, 0x83, 0x8a, 0x7f, 0x46, 0xbe, 0x3b, 0x97, 0xd4, 0xe2, 0x9f, 0xb8, 0x60, 0x83, 0x90, - 0x7f, 0x63, 0x86, 0xc8, 0x19, 0x3e, 0x31, 0x10, 0xeb, 0xed, 0xa2, 0x9f, 0x10, 0x7e, 0xce, 0xcb, - 0x68, 0xef, 0xa1, 0x5a, 0xfc, 0x43, 0x38, 0x13, 0x41, 0x58, 0xdf, 0x42, 0xcb, 0x82, 0x60, 0x83, - 0xac, 0xc5, 0x27, 0x20, 0xdf, 0x22, 0xe7, 0x8e, 0x25, 0x95, 0x24, 0xce, 0xb9, 0x62, 0xab, 0xc9, - 0x82, 0x40, 0xe7, 0xa6, 0xd0, 0x29, 0x93, 0x62, 0x2c, 0x9d, 0x9e, 0xc9, 0x5f, 0x23, 0xfc, 0x8c, - 0x9d, 0xc7, 0xf6, 0xb7, 0x92, 0xc4, 0xa5, 0x64, 0x6a, 0xc7, 0x9a, 0x10, 0x5a, 0x14, 0x6a, 0x57, - 0xc8, 0x52, 0x2c, 0xb5, 0x3b, 0x7b, 0xbf, 0x5f, 0x15, 0xd0, 0xe5, 0x55, 0x01, 0xfd, 0x7b, 0x55, - 0x40, 0x9f, 0x5f, 0x17, 0xe6, 0x2e, 0xaf, 0x0b, 0x73, 0x7f, 0x5f, 0x17, 0xe6, 0x3e, 0x28, 0x77, - 0x35, 0xeb, 0x68, 0xd8, 0x96, 0x3a, 0xbc, 0x77, 0x53, 0xaa, 0x53, 0x5f, 0xb2, 0xb3, 0x3e, 0x33, - 0xdb, 0x77, 0xc5, 0x7f, 0x27, 0x95, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x95, 0x3a, 0x52, 0x16, - 0x43, 0x12, 0x00, 0x00, + // 1064 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, + 0x18, 0xcd, 0xc4, 0x4d, 0xa1, 0x53, 0x14, 0x89, 0xa9, 0x41, 0xad, 0x5b, 0x59, 0xed, 0x88, 0xa6, + 0xa5, 0x69, 0x76, 0x89, 0xe3, 0x40, 0x48, 0x7b, 0xa8, 0x8b, 0x44, 0x38, 0xb4, 0x28, 0x98, 0x8a, + 0x03, 0x12, 0x44, 0x6b, 0xef, 0xe0, 0x2e, 0xda, 0xec, 0xb8, 0xde, 0x75, 0x95, 0xaa, 0xea, 0x05, + 0xf1, 0x07, 0x20, 0x71, 0xe2, 0xc0, 0x89, 0x03, 0x70, 0xe0, 0x88, 0xb8, 0x20, 0x21, 0x21,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 0x09, 0xfa, 0x6c, + 0x33, 0xa9, 0x4e, 0x23, 0x26, 0x08, 0xb6, 0xb7, 0xef, 0xfc, 0x7a, 0xd8, 0x44, 0x4f, 0x0f, 0x9b, + 0xe8, 0xef, 0xc3, 0x26, 0xfa, 0xec, 0xa8, 0xb9, 0xf0, 0xf4, 0xa8, 0xb9, 0xf0, 0xe7, 0x51, 0x73, + 0xe1, 0xfd, 0xd6, 0xc0, 0x09, 0xee, 0x8f, 0x7b, 0x46, 0x9f, 0xef, 0x4f, 0x2b, 0x75, 0x90, 0x28, + 0xf6, 0x68, 0xc8, 0xfc, 0xde, 0x49, 0xf9, 0x6f, 0xc0, 0x8d, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x66, 0x04, 0x66, 0xda, 0x23, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1135,6 +1328,10 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { + // Queries a send by index. + Send(ctx context.Context, in *QueryGetSendRequest, opts ...grpc.CallOption) (*QueryGetSendResponse, error) + // Queries a list of send items. + SendAll(ctx context.Context, in *QueryAllSendRequest, opts ...grpc.CallOption) (*QueryAllSendResponse, error) // Queries a txoutConfirmation by index. TxoutConfirmation(ctx context.Context, in *QueryGetTxoutConfirmationRequest, opts ...grpc.CallOption) (*QueryGetTxoutConfirmationResponse, error) // Queries a list of txoutConfirmation items. @@ -1167,6 +1364,24 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } +func (c *queryClient) Send(ctx context.Context, in *QueryGetSendRequest, opts ...grpc.CallOption) (*QueryGetSendResponse, error) { + out := new(QueryGetSendResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/Send", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SendAll(ctx context.Context, in *QueryAllSendRequest, opts ...grpc.CallOption) (*QueryAllSendResponse, error) { + out := new(QueryAllSendResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/SendAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) TxoutConfirmation(ctx context.Context, in *QueryGetTxoutConfirmationRequest, opts ...grpc.CallOption) (*QueryGetTxoutConfirmationResponse, error) { out := new(QueryGetTxoutConfirmationResponse) err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/TxoutConfirmation", in, out, opts...) @@ -1268,6 +1483,10 @@ func (c *queryClient) TxinAll(ctx context.Context, in *QueryAllTxinRequest, opts // QueryServer is the server API for Query service. type QueryServer interface { + // Queries a send by index. + Send(context.Context, *QueryGetSendRequest) (*QueryGetSendResponse, error) + // Queries a list of send items. + SendAll(context.Context, *QueryAllSendRequest) (*QueryAllSendResponse, error) // Queries a txoutConfirmation by index. TxoutConfirmation(context.Context, *QueryGetTxoutConfirmationRequest) (*QueryGetTxoutConfirmationResponse, error) // Queries a list of txoutConfirmation items. @@ -1296,6 +1515,12 @@ type QueryServer interface { type UnimplementedQueryServer struct { } +func (*UnimplementedQueryServer) Send(ctx context.Context, req *QueryGetSendRequest) (*QueryGetSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} +func (*UnimplementedQueryServer) SendAll(ctx context.Context, req *QueryAllSendRequest) (*QueryAllSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendAll not implemented") +} func (*UnimplementedQueryServer) TxoutConfirmation(ctx context.Context, req *QueryGetTxoutConfirmationRequest) (*QueryGetTxoutConfirmationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmation not implemented") } @@ -1334,6 +1559,42 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } +func _Query_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetSendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/MetaProtocol.metacore.metacore.Query/Send", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Send(ctx, req.(*QueryGetSendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SendAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllSendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SendAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/MetaProtocol.metacore.metacore.Query/SendAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SendAll(ctx, req.(*QueryAllSendRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_TxoutConfirmation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetTxoutConfirmationRequest) if err := dec(in); err != nil { @@ -1536,6 +1797,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "MetaProtocol.metacore.metacore.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "Send", + Handler: _Query_Send_Handler, + }, + { + MethodName: "SendAll", + Handler: _Query_SendAll_Handler, + }, { MethodName: "TxoutConfirmation", Handler: _Query_TxoutConfirmation_Handler, @@ -1585,7 +1854,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "metacore/query.proto", } -func (m *QueryGetTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetSendRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1595,12 +1864,12 @@ func (m *QueryGetTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetSendRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1615,7 +1884,7 @@ func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryGetTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetSendResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1625,19 +1894,19 @@ func (m *QueryGetTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetSendResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.TxoutConfirmation != nil { + if m.Send != nil { { - size, err := m.TxoutConfirmation.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Send.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1650,7 +1919,7 @@ func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *QueryAllTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllSendRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1660,12 +1929,12 @@ func (m *QueryAllTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllSendRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1685,7 +1954,7 @@ func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryAllTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllSendResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1695,12 +1964,12 @@ func (m *QueryAllTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllSendResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1717,10 +1986,10 @@ func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i i-- dAtA[i] = 0x12 } - if len(m.TxoutConfirmation) > 0 { - for iNdEx := len(m.TxoutConfirmation) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Send) > 0 { + for iNdEx := len(m.Send) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TxoutConfirmation[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Send[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1734,7 +2003,7 @@ func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *QueryGetTxoutRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1744,25 +2013,27 @@ func (m *QueryGetTxoutRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryGetTxoutResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1772,19 +2043,19 @@ func (m *QueryGetTxoutResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Txout != nil { + if m.TxoutConfirmation != nil { { - size, err := m.Txout.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TxoutConfirmation.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1797,7 +2068,7 @@ func (m *QueryGetTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllTxoutRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1807,12 +2078,12 @@ func (m *QueryAllTxoutRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1832,7 +2103,7 @@ func (m *QueryAllTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllTxoutResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1842,12 +2113,159 @@ func (m *QueryAllTxoutResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.TxoutConfirmation) > 0 { + for iNdEx := len(m.TxoutConfirmation) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TxoutConfirmation[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetTxoutRequest) 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 *QueryGetTxoutRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetTxoutResponse) 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 *QueryGetTxoutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Txout != nil { + { + size, err := m.Txout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllTxoutRequest) 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 *QueryAllTxoutRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllTxoutResponse) 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 *QueryAllTxoutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2390,6 +2808,64 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryGetSendRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Send != nil { + l = m.Send.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllSendRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Send) > 0 { + for _, e := range m.Send { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryGetTxoutConfirmationRequest) Size() (n int) { if m == nil { return 0 @@ -2706,6 +3182,380 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryGetSendRequest) 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 ErrIntOverflowQuery + } + 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: QueryGetSendRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetSendResponse) 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 ErrIntOverflowQuery + } + 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: QueryGetSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Send", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Send == nil { + m.Send = &Send{} + } + if err := m.Send.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllSendRequest) 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 ErrIntOverflowQuery + } + 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: QueryAllSendRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllSendResponse) 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 ErrIntOverflowQuery + } + 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: QueryAllSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Send", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Send = append(m.Send, &Send{}) + if err := m.Send[len(m.Send)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryGetTxoutConfirmationRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/metacore/types/query.pb.gw.go b/x/metacore/types/query.pb.gw.go index 9f92800041..5b57d88688 100644 --- a/x/metacore/types/query.pb.gw.go +++ b/x/metacore/types/query.pb.gw.go @@ -33,6 +33,96 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +func request_Query_Send_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetSendRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + msg, err := client.Send(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Send_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetSendRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + msg, err := server.Send(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SendAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SendAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllSendRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SendAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SendAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllSendRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SendAll(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_TxoutConfirmation_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetTxoutConfirmationRequest var metadata runtime.ServerMetadata @@ -507,6 +597,52 @@ func local_request_Query_TxinAll_0(ctx context.Context, marshaler runtime.Marsha // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + mux.Handle("GET", pattern_Query_Send_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Send_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Send_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SendAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SendAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SendAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_TxoutConfirmation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -801,6 +937,46 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + mux.Handle("GET", pattern_Query_Send_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Send_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Send_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SendAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SendAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SendAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_TxoutConfirmation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1025,6 +1201,10 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( + pattern_Query_Send_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "send", "index"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_SendAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "send"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_TxoutConfirmation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "txoutConfirmation", "index"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_TxoutConfirmationAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "txoutConfirmation"}, "", runtime.AssumeColonVerbOpt(true))) @@ -1049,6 +1229,10 @@ var ( ) var ( + forward_Query_Send_0 = runtime.ForwardResponseMessage + + forward_Query_SendAll_0 = runtime.ForwardResponseMessage + forward_Query_TxoutConfirmation_0 = runtime.ForwardResponseMessage forward_Query_TxoutConfirmationAll_0 = runtime.ForwardResponseMessage diff --git a/x/metacore/types/send.pb.go b/x/metacore/types/send.pb.go new file mode 100644 index 0000000000..1a2f3b3e8f --- /dev/null +++ b/x/metacore/types/send.pb.go @@ -0,0 +1,939 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: metacore/send.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Send struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + SenderChain string `protobuf:"bytes,4,opt,name=senderChain,proto3" json:"senderChain,omitempty"` + Receiver string `protobuf:"bytes,5,opt,name=receiver,proto3" json:"receiver,omitempty"` + ReceiverChain string `protobuf:"bytes,6,opt,name=receiverChain,proto3" json:"receiverChain,omitempty"` + MBurnt string `protobuf:"bytes,7,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` + MMint string `protobuf:"bytes,8,opt,name=mMint,proto3" json:"mMint,omitempty"` + Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` + InTxHash string `protobuf:"bytes,10,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` + InBlockHeight string `protobuf:"bytes,11,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` + FinalizedMetaHeight string `protobuf:"bytes,12,opt,name=finalizedMetaHeight,proto3" json:"finalizedMetaHeight,omitempty"` + Signers string `protobuf:"bytes,13,opt,name=signers,proto3" json:"signers,omitempty"` +} + +func (m *Send) Reset() { *m = Send{} } +func (m *Send) String() string { return proto.CompactTextString(m) } +func (*Send) ProtoMessage() {} +func (*Send) Descriptor() ([]byte, []int) { + return fileDescriptor_c81f0328df818595, []int{0} +} +func (m *Send) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Send) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Send.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 *Send) XXX_Merge(src proto.Message) { + xxx_messageInfo_Send.Merge(m, src) +} +func (m *Send) XXX_Size() int { + return m.Size() +} +func (m *Send) XXX_DiscardUnknown() { + xxx_messageInfo_Send.DiscardUnknown(m) +} + +var xxx_messageInfo_Send proto.InternalMessageInfo + +func (m *Send) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *Send) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *Send) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *Send) GetSenderChain() string { + if m != nil { + return m.SenderChain + } + return "" +} + +func (m *Send) GetReceiver() string { + if m != nil { + return m.Receiver + } + return "" +} + +func (m *Send) GetReceiverChain() string { + if m != nil { + return m.ReceiverChain + } + return "" +} + +func (m *Send) GetMBurnt() string { + if m != nil { + return m.MBurnt + } + return "" +} + +func (m *Send) GetMMint() string { + if m != nil { + return m.MMint + } + return "" +} + +func (m *Send) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *Send) GetInTxHash() string { + if m != nil { + return m.InTxHash + } + return "" +} + +func (m *Send) GetInBlockHeight() string { + if m != nil { + return m.InBlockHeight + } + return "" +} + +func (m *Send) GetFinalizedMetaHeight() string { + if m != nil { + return m.FinalizedMetaHeight + } + return "" +} + +func (m *Send) GetSigners() string { + if m != nil { + return m.Signers + } + return "" +} + +func init() { + proto.RegisterType((*Send)(nil), "MetaProtocol.metacore.metacore.Send") +} + +func init() { proto.RegisterFile("metacore/send.proto", fileDescriptor_c81f0328df818595) } + +var fileDescriptor_c81f0328df818595 = []byte{ + // 341 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x4e, 0x32, 0x31, + 0x14, 0xc5, 0x99, 0x8f, 0xff, 0xe5, 0x63, 0x53, 0x88, 0x69, 0x58, 0x34, 0xc4, 0xb8, 0x70, 0x23, + 0x63, 0xf4, 0x0d, 0x70, 0xc3, 0x42, 0x12, 0xa3, 0xae, 0xdc, 0x95, 0x99, 0x6b, 0xa7, 0x91, 0x69, + 0x49, 0x5b, 0x0c, 0xfa, 0x04, 0x2e, 0x7d, 0x2c, 0x97, 0x2c, 0x5d, 0x1a, 0x78, 0x11, 0xd3, 0x76, + 0x66, 0x94, 0xc4, 0xdd, 0xf9, 0x9d, 0x7b, 0xca, 0x3d, 0xa5, 0x83, 0x06, 0x39, 0x58, 0x96, 0x28, + 0x0d, 0xb1, 0x01, 0x99, 0x4e, 0x56, 0x5a, 0x59, 0x85, 0xe9, 0x1c, 0x2c, 0xbb, 0x71, 0x32, 0x51, + 0xcb, 0x49, 0x99, 0xa8, 0xc4, 0x68, 0xc8, 0x15, 0x57, 0x3e, 0x1a, 0x3b, 0x15, 0x4e, 0x1d, 0xbf, + 0xd5, 0x51, 0xe3, 0x0e, 0x64, 0x8a, 0x09, 0x6a, 0x27, 0x1a, 0x98, 0x55, 0x9a, 0x44, 0xe3, 0xe8, + 0xb4, 0x7b, 0x5b, 0x22, 0x1e, 0xa2, 0xa6, 0x90, 0x29, 0x6c, 0xc8, 0x3f, 0xef, 0x07, 0xc0, 0x47, + 0xa8, 0xe5, 0x96, 0x83, 0x26, 0x75, 0x6f, 0x17, 0x84, 0xc7, 0xa8, 0x17, 0xd4, 0x55, 0xc6, 0x84, + 0x24, 0x0d, 0x3f, 0xfc, 0x6d, 0xe1, 0x11, 0xea, 0x68, 0x48, 0x40, 0x3c, 0x83, 0x26, 0x4d, 0x3f, + 0xae, 0x18, 0x9f, 0xa0, 0x7e, 0xa9, 0xc3, 0xf9, 0x96, 0x0f, 0x1c, 0x9a, 0x6e, 0x77, 0x3e, 0x5d, + 0x6b, 0x69, 0x49, 0x3b, 0xec, 0x0e, 0xe4, 0x9a, 0xe6, 0x73, 0x21, 0x2d, 0xe9, 0x84, 0xa6, 0x1e, + 0xdc, 0xcd, 0x72, 0x30, 0x86, 0x71, 0x20, 0xdd, 0x70, 0xb3, 0x02, 0x5d, 0x13, 0x21, 0xef, 0x37, + 0x33, 0x66, 0x32, 0x82, 0x42, 0x93, 0x92, 0x5d, 0x13, 0x21, 0xa7, 0x4b, 0x95, 0x3c, 0xcd, 0x40, + 0xf0, 0xcc, 0x92, 0x5e, 0x68, 0x72, 0x60, 0xe2, 0x73, 0x34, 0x78, 0x14, 0x92, 0x2d, 0xc5, 0x2b, + 0xa4, 0xee, 0xff, 0x2f, 0xb2, 0xff, 0x7d, 0xf6, 0xaf, 0x91, 0x6b, 0x63, 0x04, 0x97, 0xa0, 0x0d, + 0xe9, 0x87, 0x36, 0x05, 0x4e, 0xaf, 0x3f, 0x76, 0x34, 0xda, 0xee, 0x68, 0xf4, 0xb5, 0xa3, 0xd1, + 0xfb, 0x9e, 0xd6, 0xb6, 0x7b, 0x5a, 0xfb, 0xdc, 0xd3, 0xda, 0xc3, 0x05, 0x17, 0x36, 0x5b, 0x2f, + 0x26, 0x89, 0xca, 0x63, 0xf7, 0x53, 0x67, 0xe5, 0x33, 0xc7, 0xd5, 0x87, 0xb0, 0xf9, 0x91, 0xf6, + 0x65, 0x05, 0x66, 0xd1, 0xf2, 0xef, 0x7b, 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x20, 0x67, + 0x86, 0x2c, 0x02, 0x00, 0x00, +} + +func (m *Send) 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 *Send) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Send) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signers) > 0 { + i -= len(m.Signers) + copy(dAtA[i:], m.Signers) + i = encodeVarintSend(dAtA, i, uint64(len(m.Signers))) + i-- + dAtA[i] = 0x6a + } + if len(m.FinalizedMetaHeight) > 0 { + i -= len(m.FinalizedMetaHeight) + copy(dAtA[i:], m.FinalizedMetaHeight) + i = encodeVarintSend(dAtA, i, uint64(len(m.FinalizedMetaHeight))) + i-- + dAtA[i] = 0x62 + } + if len(m.InBlockHeight) > 0 { + i -= len(m.InBlockHeight) + copy(dAtA[i:], m.InBlockHeight) + i = encodeVarintSend(dAtA, i, uint64(len(m.InBlockHeight))) + i-- + dAtA[i] = 0x5a + } + if len(m.InTxHash) > 0 { + i -= len(m.InTxHash) + copy(dAtA[i:], m.InTxHash) + i = encodeVarintSend(dAtA, i, uint64(len(m.InTxHash))) + i-- + dAtA[i] = 0x52 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintSend(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x4a + } + if len(m.MMint) > 0 { + i -= len(m.MMint) + copy(dAtA[i:], m.MMint) + i = encodeVarintSend(dAtA, i, uint64(len(m.MMint))) + i-- + dAtA[i] = 0x42 + } + if len(m.MBurnt) > 0 { + i -= len(m.MBurnt) + copy(dAtA[i:], m.MBurnt) + i = encodeVarintSend(dAtA, i, uint64(len(m.MBurnt))) + i-- + dAtA[i] = 0x3a + } + if len(m.ReceiverChain) > 0 { + i -= len(m.ReceiverChain) + copy(dAtA[i:], m.ReceiverChain) + i = encodeVarintSend(dAtA, i, uint64(len(m.ReceiverChain))) + i-- + dAtA[i] = 0x32 + } + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintSend(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x2a + } + if len(m.SenderChain) > 0 { + i -= len(m.SenderChain) + copy(dAtA[i:], m.SenderChain) + i = encodeVarintSend(dAtA, i, uint64(len(m.SenderChain))) + i-- + dAtA[i] = 0x22 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintSend(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x1a + } + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintSend(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintSend(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSend(dAtA []byte, offset int, v uint64) int { + offset -= sovSend(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Send) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.Index) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.SenderChain) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.ReceiverChain) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.MBurnt) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.MMint) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.InTxHash) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.InBlockHeight) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.FinalizedMetaHeight) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + l = len(m.Signers) + if l > 0 { + n += 1 + l + sovSend(uint64(l)) + } + return n +} + +func sovSend(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSend(x uint64) (n int) { + return sovSend(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Send) 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 ErrIntOverflowSend + } + 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: Send: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Send: 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 ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + 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 Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SenderChain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SenderChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReceiverChain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReceiverChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MBurnt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MBurnt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MMint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MMint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InTxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InBlockHeight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InBlockHeight = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizedMetaHeight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FinalizedMetaHeight = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSend + } + 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 ErrInvalidLengthSend + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signers = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSend(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSend + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSend(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSend + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSend + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSend + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSend + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSend + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSend + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSend = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSend = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSend = fmt.Errorf("proto: unexpected end of group") +) From daa45c88a855bb0479e9e4a42de896960a5787b3 Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Fri, 22 Oct 2021 03:37:10 -0500 Subject: [PATCH 04/10] type send: cleanup; fix tests --- docs/static/openapi.yml | 20 ++++++-- proto/metacore/send.proto | 2 +- x/metacore/client/cli/query_send_test.go | 2 +- x/metacore/types/send.pb.go | 64 +++++++++++++----------- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 45989c5206..808002a72e 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -19372,7 +19372,9 @@ paths: finalizedMetaHeight: type: string signers: - type: string + type: array + items: + type: string pagination: type: object properties: @@ -19505,7 +19507,9 @@ paths: finalizedMetaHeight: type: string signers: - type: string + type: array + items: + type: string default: description: An unexpected error response. schema: @@ -30659,7 +30663,9 @@ definitions: finalizedMetaHeight: type: string signers: - type: string + type: array + items: + type: string pagination: type: object properties: @@ -30998,7 +31004,9 @@ definitions: finalizedMetaHeight: type: string signers: - type: string + type: array + items: + type: string MetaProtocol.metacore.metacore.QueryGetTxinResponse: type: object properties: @@ -31176,7 +31184,9 @@ definitions: finalizedMetaHeight: type: string signers: - type: string + type: array + items: + type: string MetaProtocol.metacore.metacore.Txin: type: object properties: diff --git a/proto/metacore/send.proto b/proto/metacore/send.proto index 11ba165bd7..c238daef20 100644 --- a/proto/metacore/send.proto +++ b/proto/metacore/send.proto @@ -18,5 +18,5 @@ message Send { string inTxHash = 10; string inBlockHeight = 11; string finalizedMetaHeight = 12; - string signers = 13; + repeated string signers = 13; } diff --git a/x/metacore/client/cli/query_send_test.go b/x/metacore/client/cli/query_send_test.go index 34782ccbf4..ec82139d7c 100644 --- a/x/metacore/client/cli/query_send_test.go +++ b/x/metacore/client/cli/query_send_test.go @@ -25,7 +25,7 @@ func networkWithSendObjects(t *testing.T, n int) (*network.Network, []*types.Sen require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) for i := 0; i < n; i++ { - state.SendList = append(state.SendList, &types.Send{Creator: "ANY", Index: strconv.Itoa(i)}) + state.SendList = append(state.SendList, &types.Send{Creator: "ANY", Index: strconv.Itoa(i), Signers: []string{}}) } buf, err := cfg.Codec.MarshalJSON(&state) require.NoError(t, err) diff --git a/x/metacore/types/send.pb.go b/x/metacore/types/send.pb.go index 1a2f3b3e8f..f08b66011d 100644 --- a/x/metacore/types/send.pb.go +++ b/x/metacore/types/send.pb.go @@ -24,19 +24,19 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Send struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` - Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` - SenderChain string `protobuf:"bytes,4,opt,name=senderChain,proto3" json:"senderChain,omitempty"` - Receiver string `protobuf:"bytes,5,opt,name=receiver,proto3" json:"receiver,omitempty"` - ReceiverChain string `protobuf:"bytes,6,opt,name=receiverChain,proto3" json:"receiverChain,omitempty"` - MBurnt string `protobuf:"bytes,7,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` - MMint string `protobuf:"bytes,8,opt,name=mMint,proto3" json:"mMint,omitempty"` - Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` - InTxHash string `protobuf:"bytes,10,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` - InBlockHeight string `protobuf:"bytes,11,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` - FinalizedMetaHeight string `protobuf:"bytes,12,opt,name=finalizedMetaHeight,proto3" json:"finalizedMetaHeight,omitempty"` - Signers string `protobuf:"bytes,13,opt,name=signers,proto3" json:"signers,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + SenderChain string `protobuf:"bytes,4,opt,name=senderChain,proto3" json:"senderChain,omitempty"` + Receiver string `protobuf:"bytes,5,opt,name=receiver,proto3" json:"receiver,omitempty"` + ReceiverChain string `protobuf:"bytes,6,opt,name=receiverChain,proto3" json:"receiverChain,omitempty"` + MBurnt string `protobuf:"bytes,7,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` + MMint string `protobuf:"bytes,8,opt,name=mMint,proto3" json:"mMint,omitempty"` + Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` + InTxHash string `protobuf:"bytes,10,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` + InBlockHeight string `protobuf:"bytes,11,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` + FinalizedMetaHeight string `protobuf:"bytes,12,opt,name=finalizedMetaHeight,proto3" json:"finalizedMetaHeight,omitempty"` + Signers []string `protobuf:"bytes,13,rep,name=signers,proto3" json:"signers,omitempty"` } func (m *Send) Reset() { *m = Send{} } @@ -156,11 +156,11 @@ func (m *Send) GetFinalizedMetaHeight() string { return "" } -func (m *Send) GetSigners() string { +func (m *Send) GetSigners() []string { if m != nil { return m.Signers } - return "" + return nil } func init() { @@ -170,7 +170,7 @@ func init() { func init() { proto.RegisterFile("metacore/send.proto", fileDescriptor_c81f0328df818595) } var fileDescriptor_c81f0328df818595 = []byte{ - // 341 bytes of a gzipped FileDescriptorProto + // 343 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x4e, 0x32, 0x31, 0x14, 0xc5, 0x99, 0x8f, 0xff, 0xe5, 0x63, 0x53, 0x88, 0x69, 0x58, 0x34, 0xc4, 0xb8, 0x70, 0x23, 0x63, 0xf4, 0x0d, 0x70, 0xc3, 0x42, 0x12, 0xa3, 0xae, 0xdc, 0x95, 0x99, 0x6b, 0xa7, 0x91, 0x69, @@ -188,11 +188,11 @@ var fileDescriptor_c81f0328df818595 = []byte{ 0x33, 0x66, 0x32, 0x82, 0x42, 0x93,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(m *Send) Marshal() (dAtA []byte, err error) { @@ -216,11 +216,13 @@ func (m *Send) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.Signers) > 0 { - i -= len(m.Signers) - copy(dAtA[i:], m.Signers) - i = encodeVarintSend(dAtA, i, uint64(len(m.Signers))) - i-- - dAtA[i] = 0x6a + for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signers[iNdEx]) + copy(dAtA[i:], m.Signers[iNdEx]) + i = encodeVarintSend(dAtA, i, uint64(len(m.Signers[iNdEx]))) + i-- + dAtA[i] = 0x6a + } } if len(m.FinalizedMetaHeight) > 0 { i -= len(m.FinalizedMetaHeight) @@ -374,9 +376,11 @@ func (m *Send) Size() (n int) { if l > 0 { n += 1 + l + sovSend(uint64(l)) } - l = len(m.Signers) - if l > 0 { - n += 1 + l + sovSend(uint64(l)) + if len(m.Signers) > 0 { + for _, s := range m.Signers { + l = len(s) + n += 1 + l + sovSend(uint64(l)) + } } return n } @@ -830,7 +834,7 @@ func (m *Send) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signers = string(dAtA[iNdEx:postIndex]) + m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex From a49f3d12baf732c13a9524ccd867dce6101b1e57 Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Fri, 22 Oct 2021 03:41:21 -0500 Subject: [PATCH 05/10] starport scaffold message sendVoter sender senderChain receiver receiverChain mBurnt mMint message inTxHash inBlockHeight --- docs/static/openapi.yml | 2 + proto/metacore/tx.proto | 17 + x/metacore/client/cli/tx.go | 2 + x/metacore/client/cli/tx_send_voter.go | 47 ++ x/metacore/handler.go | 4 + x/metacore/keeper/msg_server_send_voter.go | 17 + x/metacore/types/codec.go | 5 + x/metacore/types/message_send_voter.go | 52 ++ x/metacore/types/tx.pb.go | 878 ++++++++++++++++++++- 9 files changed, 981 insertions(+), 43 deletions(-) create mode 100644 x/metacore/client/cli/tx_send_voter.go create mode 100644 x/metacore/keeper/msg_server_send_voter.go create mode 100644 x/metacore/types/message_send_voter.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 808002a72e..5bf5455921 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -30530,6 +30530,8 @@ definitions: the connection handshake. MetaProtocol.metacore.metacore.MsgCreateTxinVoterResponse: type: object + MetaProtocol.metacore.metacore.MsgSendVoterResponse: + type: object MetaProtocol.metacore.metacore.MsgSetNodeKeysResponse: type: object MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoterResponse: diff --git a/proto/metacore/tx.proto b/proto/metacore/tx.proto index 13905b885c..c39117881b 100644 --- a/proto/metacore/tx.proto +++ b/proto/metacore/tx.proto @@ -10,12 +10,29 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; // Msg defines the Msg service. service Msg { // this line is used by starport scaffolding # proto/tx/rpc + rpc SendVoter(MsgSendVoter) returns (MsgSendVoterResponse); rpc TxoutConfirmationVoter(MsgTxoutConfirmationVoter) returns (MsgTxoutConfirmationVoterResponse); rpc SetNodeKeys(MsgSetNodeKeys) returns (MsgSetNodeKeysResponse); rpc CreateTxinVoter(MsgCreateTxinVoter) returns (MsgCreateTxinVoterResponse); } // this line is used by starport scaffolding # proto/tx/message +message MsgSendVoter { + string creator = 1; + string sender = 2; + string senderChain = 3; + string receiver = 4; + string receiverChain = 5; + string mBurnt = 6; + string mMint = 7; + string message = 8; + string inTxHash = 9; + string inBlockHeight = 10; +} + +message MsgSendVoterResponse { +} + message MsgTxoutConfirmationVoter { string creator = 1; uint64 txoutId = 2; diff --git a/x/metacore/client/cli/tx.go b/x/metacore/client/cli/tx.go index 6a4a254a66..24696e2004 100644 --- a/x/metacore/client/cli/tx.go +++ b/x/metacore/client/cli/tx.go @@ -30,6 +30,8 @@ func GetTxCmd() *cobra.Command { } // this line is used by starport scaffolding # 1 + cmd.AddCommand(CmdSendVoter()) + cmd.AddCommand(CmdTxoutConfirmationVoter()) cmd.AddCommand(CmdSetNodeKeys()) diff --git a/x/metacore/client/cli/tx_send_voter.go b/x/metacore/client/cli/tx_send_voter.go new file mode 100644 index 0000000000..ad4c94a3bf --- /dev/null +++ b/x/metacore/client/cli/tx_send_voter.go @@ -0,0 +1,47 @@ +package cli + +import ( + "github.com/spf13/cobra" + "strconv" + + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" +) + +var _ = strconv.Itoa(0) + +func CmdSendVoter() *cobra.Command { + cmd := &cobra.Command{ + Use: "send-voter [sender] [senderChain] [receiver] [receiverChain] [mBurnt] [mMint] [message] [inTxHash] [inBlockHeight]", + Short: "Broadcast message sendVoter", + Args: cobra.ExactArgs(9), + RunE: func(cmd *cobra.Command, args []string) error { + argsSender := string(args[0]) + argsSenderChain := string(args[1]) + argsReceiver := string(args[2]) + argsReceiverChain := string(args[3]) + argsMBurnt := string(args[4]) + argsMMint := string(args[5]) + argsMessage := string(args[6]) + argsInTxHash := string(args[7]) + argsInBlockHeight := string(args[8]) + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgSendVoter(clientCtx.GetFromAddress().String(), string(argsSender), string(argsSenderChain), string(argsReceiver), string(argsReceiverChain), string(argsMBurnt), string(argsMMint), string(argsMessage), string(argsInTxHash), string(argsInBlockHeight)) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/metacore/handler.go b/x/metacore/handler.go index 8b816aa47e..628a0cbbcf 100644 --- a/x/metacore/handler.go +++ b/x/metacore/handler.go @@ -18,6 +18,10 @@ func NewHandler(k keeper.Keeper) sdk.Handler { switch msg := msg.(type) { // this line is used by starport scaffolding # 1 + case *types.MsgSendVoter: + res, err := msgServer.SendVoter(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgTxoutConfirmationVoter: res, err := msgServer.TxoutConfirmationVoter(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) diff --git a/x/metacore/keeper/msg_server_send_voter.go b/x/metacore/keeper/msg_server_send_voter.go new file mode 100644 index 0000000000..d0e7ee137d --- /dev/null +++ b/x/metacore/keeper/msg_server_send_voter.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + "github.com/Meta-Protocol/metacore/x/metacore/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) SendVoter(goCtx context.Context, msg *types.MsgSendVoter) (*types.MsgSendVoterResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgSendVoterResponse{}, nil +} diff --git a/x/metacore/types/codec.go b/x/metacore/types/codec.go index e011d33616..0020c00c60 100644 --- a/x/metacore/types/codec.go +++ b/x/metacore/types/codec.go @@ -9,6 +9,8 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { // this line is used by starport scaffolding # 2 + cdc.RegisterConcrete(&MsgSendVoter{}, "metacore/SendVoter", nil) + cdc.RegisterConcrete(&MsgTxoutConfirmationVoter{}, "metacore/TxoutConfirmationVoter", nil) cdc.RegisterConcrete(&MsgSetNodeKeys{}, "metacore/SetNodeKeys", nil) @@ -19,6 +21,9 @@ func RegisterCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { // this line is used by starport scaffolding # 3 + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgSendVoter{}, + ) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgTxoutConfirmationVoter{}, ) diff --git a/x/metacore/types/message_send_voter.go b/x/metacore/types/message_send_voter.go new file mode 100644 index 0000000000..8a67b9f35a --- /dev/null +++ b/x/metacore/types/message_send_voter.go @@ -0,0 +1,52 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgSendVoter{} + +func NewMsgSendVoter(creator string, sender string, senderChain string, receiver string, receiverChain string, mBurnt string, mMint string, message string, inTxHash string, inBlockHeight string) *MsgSendVoter { + return &MsgSendVoter{ + Creator: creator, + Sender: sender, + SenderChain: senderChain, + Receiver: receiver, + ReceiverChain: receiverChain, + MBurnt: mBurnt, + MMint: mMint, + Message: message, + InTxHash: inTxHash, + InBlockHeight: inBlockHeight, + } +} + +func (msg *MsgSendVoter) Route() string { + return RouterKey +} + +func (msg *MsgSendVoter) Type() string { + return "SendVoter" +} + +func (msg *MsgSendVoter) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgSendVoter) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgSendVoter) 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/metacore/types/tx.pb.go b/x/metacore/types/tx.pb.go index 444ce4865f..eb93681853 100644 --- a/x/metacore/types/tx.pb.go +++ b/x/metacore/types/tx.pb.go @@ -29,6 +29,158 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // this line is used by starport scaffolding # proto/tx/message +type MsgSendVoter struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + SenderChain string `protobuf:"bytes,3,opt,name=senderChain,proto3" json:"senderChain,omitempty"` + Receiver string `protobuf:"bytes,4,opt,name=receiver,proto3" json:"receiver,omitempty"` + ReceiverChain string `protobuf:"bytes,5,opt,name=receiverChain,proto3" json:"receiverChain,omitempty"` + MBurnt string `protobuf:"bytes,6,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` + MMint string `protobuf:"bytes,7,opt,name=mMint,proto3" json:"mMint,omitempty"` + Message string `protobuf:"bytes,8,opt,name=message,proto3" json:"message,omitempty"` + InTxHash string `protobuf:"bytes,9,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` + InBlockHeight string `protobuf:"bytes,10,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` +} + +func (m *MsgSendVoter) Reset() { *m = MsgSendVoter{} } +func (m *MsgSendVoter) String() string { return proto.CompactTextString(m) } +func (*MsgSendVoter) ProtoMessage() {} +func (*MsgSendVoter) Descriptor() ([]byte, []int) { + return fileDescriptor_3410749d96999ade, []int{0} +} +func (m *MsgSendVoter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendVoter.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 *MsgSendVoter) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendVoter.Merge(m, src) +} +func (m *MsgSendVoter) XXX_Size() int { + return m.Size() +} +func (m *MsgSendVoter) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendVoter.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendVoter proto.InternalMessageInfo + +func (m *MsgSendVoter) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgSendVoter) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgSendVoter) GetSenderChain() string { + if m != nil { + return m.SenderChain + } + return "" +} + +func (m *MsgSendVoter) GetReceiver() string { + if m != nil { + return m.Receiver + } + return "" +} + +func (m *MsgSendVoter) GetReceiverChain() string { + if m != nil { + return m.ReceiverChain + } + return "" +} + +func (m *MsgSendVoter) GetMBurnt() string { + if m != nil { + return m.MBurnt + } + return "" +} + +func (m *MsgSendVoter) GetMMint() string { + if m != nil { + return m.MMint + } + return "" +} + +func (m *MsgSendVoter) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *MsgSendVoter) GetInTxHash() string { + if m != nil { + return m.InTxHash + } + return "" +} + +func (m *MsgSendVoter) GetInBlockHeight() string { + if m != nil { + return m.InBlockHeight + } + return "" +} + +type MsgSendVoterResponse struct { +} + +func (m *MsgSendVoterResponse) Reset() { *m = MsgSendVoterResponse{} } +func (m *MsgSendVoterResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSendVoterResponse) ProtoMessage() {} +func (*MsgSendVoterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3410749d96999ade, []int{1} +} +func (m *MsgSendVoterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendVoterResponse.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 *MsgSendVoterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendVoterResponse.Merge(m, src) +} +func (m *MsgSendVoterResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSendVoterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendVoterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendVoterResponse proto.InternalMessageInfo + type MsgTxoutConfirmationVoter struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` TxoutId uint64 `protobuf:"varint,2,opt,name=txoutId,proto3" json:"txoutId,omitempty"` @@ -44,7 +196,7 @@ func (m *MsgTxoutConfirmationVoter) Reset() { *m = MsgTxoutConfirmationV func (m *MsgTxoutConfirmationVoter) String() string { return proto.CompactTextString(m) } func (*MsgTxoutConfirmationVoter) ProtoMessage() {} func (*MsgTxoutConfirmationVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{0} + return fileDescriptor_3410749d96999ade, []int{2} } func (m *MsgTxoutConfirmationVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -136,7 +288,7 @@ func (m *MsgTxoutConfirmationVoterResponse) Reset() { *m = MsgTxoutConfi func (m *MsgTxoutConfirmationVoterResponse) String() string { return proto.CompactTextString(m) } func (*MsgTxoutConfirmationVoterResponse) ProtoMessage() {} func (*MsgTxoutConfirmationVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{1} + return fileDescriptor_3410749d96999ade, []int{3} } func (m *MsgTxoutConfirmationVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -175,7 +327,7 @@ func (m *MsgSetNodeKeys) Reset() { *m = MsgSetNodeKeys{} } func (m *MsgSetNodeKeys) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeys) ProtoMessage() {} func (*MsgSetNodeKeys) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{2} + return fileDescriptor_3410749d96999ade, []int{4} } func (m *MsgSetNodeKeys) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -232,7 +384,7 @@ func (m *MsgSetNodeKeysResponse) Reset() { *m = MsgSetNodeKeysResponse{} func (m *MsgSetNodeKeysResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeysResponse) ProtoMessage() {} func (*MsgSetNodeKeysResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{3} + return fileDescriptor_3410749d96999ade, []int{5} } func (m *MsgSetNodeKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -278,7 +430,7 @@ func (m *MsgCreateTxinVoter) Reset() { *m = MsgCreateTxinVoter{} } func (m *MsgCreateTxinVoter) String() string { return proto.CompactTextString(m) } func (*MsgCreateTxinVoter) ProtoMessage() {} func (*MsgCreateTxinVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{4} + return fileDescriptor_3410749d96999ade, []int{6} } func (m *MsgCreateTxinVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -384,7 +536,7 @@ func (m *MsgCreateTxinVoterResponse) Reset() { *m = MsgCreateTxinVoterRe func (m *MsgCreateTxinVoterResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateTxinVoterResponse) ProtoMessage() {} func (*MsgCreateTxinVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{5} + return fileDescriptor_3410749d96999ade, []int{7} } func (m *MsgCreateTxinVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -414,6 +566,8 @@ func (m *MsgCreateTxinVoterResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateTxinVoterResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*MsgSendVoter)(nil), "MetaProtocol.metacore.metacore.MsgSendVoter") + proto.RegisterType((*MsgSendVoterResponse)(nil), "MetaProtocol.metacore.metacore.MsgSendVoterResponse") proto.RegisterType((*MsgTxoutConfirmationVoter)(nil), "MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoter") proto.RegisterType((*MsgTxoutConfirmationVoterResponse)(nil), "MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoterResponse") proto.RegisterType((*MsgSetNodeKeys)(nil), "MetaProtocol.metacore.metacore.MsgSetNodeKeys") @@ -425,43 +579,51 @@ func init() { func init() { proto.RegisterFile("metacore/tx.proto", fileDescriptor_3410749d96999ade) } var fileDescriptor_3410749d96999ade = []byte{ - // 570 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4d, 0x6f, 0xd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ff, 0xff, 0x2f, 0x8f, 0x53, 0x05, 0xb1, 0x05, 0x00, 0x00, + // 695 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x3d, 0x4f, 0x1b, 0x4d, + 0x10, 0xe6, 0x8c, 0x8d, 0xf1, 0x98, 0xf7, 0x83, 0x7d, 0x91, 0x75, 0x9c, 0x90, 0xc5, 0xeb, 0xa4, + 0x88, 0x22, 0x62, 0x4b, 0x4e, 0x14, 0x29, 0x74, 0xe0, 0x86, 0x88, 0x38, 0x42, 0x06, 0xa5, 0x48, + 0x13, 0x9d, 0xef, 0x86, 0xf3, 0x0a, 0x6e, 0xd7, 0xba, 0xdd, 0x43, 0xa6, 0x4c, 0x9b, 0x2a, 0x55, + 0xf2, 0x2f, 0xf2, 0x3b, 0x28, 0x29, 0x53, 0x46, 0xf0, 0x47, 0xa2, 0xdd, 0xbd, 0x2f, 0x63, 0xcc, + 0x47, 0x2a, 0xef, 0xf3, 0xcc, 0xcc, 0xce, 0xcc, 0xb3, 0x33, 0x67, 0x58, 0x0d, 0x51, 0xba, 0x1e, + 0x8f, 0xb0, 0x23, 0x27, 0xed, 0x71, 0xc4, 0x25, 0x27, 0xcd, 0x3e, 0x4a, 0xf7, 0x40, 0x1d, 0x3d, + 0x7e, 0xda, 0x4e, 0xed, 0xd9, 0xc1, 0x59, 0x2f, 0x84, 0x50, 0xf6, 0xe9, 0x8c, 0x4b, 0x8c, 0x4c, + 0xa8, 0xf3, 0x9f, 0xc7, 0xc3, 0x90, 0xb3, 0x8e, 0xf9, 0x31, 0x64, 0xeb, 0x47, 0x09, 0x56, 0xfa, + 0x22, 0x38, 0x44, 0xe6, 0x7f, 0x50, 0xbe, 0xc4, 0x86, 0xaa, 0x17, 0xa1, 0x2b, 0x79, 0x64, 0x5b, + 0x9b, 0xd6, 0xb3, 0xda, 0x20, 0x85, 0xa4, 0x01, 0x4b, 0x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46, 0x6a, 0xf7, 0xcc, 0x08, 0xcc, 0xce, 0xc8, 0x06, 0x38, 0xb3, + 0x4a, 0xa6, 0x42, 0x77, 0xbf, 0x94, 0x61, 0xb1, 0x2f, 0x02, 0xc2, 0xa1, 0x96, 0x7f, 0xa8, 0xb6, + 0xda, 0x77, 0x7f, 0x0a, 0xdb, 0xc5, 0x35, 0x75, 0x5e, 0x3d, 0xc6, 0x3b, 0x4d, 0x4c, 0xbe, 0x59, + 0xd0, 0x98, 0xb3, 0xd1, 0x6f, 0x1e, 0x70, 0xe1, 0xed, 0xa1, 0xce, 0xce, 0x1f, 0x87, 0x66, 0x85, + 0xc5, 0x50, 0x2f, 0xae, 0x4a, 0xfb, 0x41, 0xdd, 0x65, 0xfe, 0xce, 0xeb, 0xc7, 0xf9, 0x67, 0x69, + 0x3f, 0x5b, 0xf0, 0xcf, 0xcd, 0x71, 0xef, 0x3e, 0xe0, 0xae, 0x1b, 0x31, 0xce, 0xf6, 0xe3, 0x63, + 0xd2, 0x1a, 0x76, 0xdf, 0x5d, 0x5c, 0x35, 0xad, 0xcb, 0xab, 0xa6, 0xf5, 0xeb, 0xaa, 0x69, 0x7d, + 0xbd, 0x6e, 0x2e, 0x5c, 0x5e, 0x37, 0x17, 0x7e, 0x5e, 0x37, 0x17, 0x3e, 0x76, 0x03, 0x2a, 0x47, + 0xf1, 0x50, 0x7d, 0x09, 0x3a, 0xea, 0xfe, 0x17, 0x69, 0x82, 0x4e, 0xf6, 0xa7, 0x38, 0xc9, 0x8f, + 0xf2, 0x7c, 0x8c, 0x62, 0xb8, 0xa4, 0xff, 0x06, 0x5f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xbb, + 0x5a, 0xc7, 0x5d, 0x6b, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -477,6 +639,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { // this line is used by starport scaffolding # proto/tx/rpc + SendVoter(ctx context.Context, in *MsgSendVoter, opts ...grpc.CallOption) (*MsgSendVoterResponse, error) TxoutConfirmationVoter(ctx context.Context, in *MsgTxoutConfirmationVoter, opts ...grpc.CallOption) (*MsgTxoutConfirmationVoterResponse, error) SetNodeKeys(ctx context.Context, in *MsgSetNodeKeys, opts ...grpc.CallOption) (*MsgSetNodeKeysResponse, error) CreateTxinVoter(ctx context.Context, in *MsgCreateTxinVoter, opts ...grpc.CallOption) (*MsgCreateTxinVoterResponse, error) @@ -490,6 +653,15 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) SendVoter(ctx context.Context, in *MsgSendVoter, opts ...grpc.CallOption) (*MsgSendVoterResponse, error) { + out := new(MsgSendVoterResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Msg/SendVoter", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) TxoutConfirmationVoter(ctx context.Context, in *MsgTxoutConfirmationVoter, opts ...grpc.CallOption) (*MsgTxoutConfirmationVoterResponse, error) { out := new(MsgTxoutConfirmationVoterResponse) err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Msg/TxoutConfirmationVoter", in, out, opts...) @@ -520,6 +692,7 @@ func (c *msgClient) CreateTxinVoter(ctx context.Context, in *MsgCreateTxinVoter, // MsgServer is the server API for Msg service. type MsgServer interface { // this line is used by starport scaffolding # proto/tx/rpc + SendVoter(context.Context, *MsgSendVoter) (*MsgSendVoterResponse, error) TxoutConfirmationVoter(context.Context, *MsgTxoutConfirmationVoter) (*MsgTxoutConfirmationVoterResponse, error) SetNodeKeys(context.Context, *MsgSetNodeKeys) (*MsgSetNodeKeysResponse, error) CreateTxinVoter(context.Context, *MsgCreateTxinVoter) (*MsgCreateTxinVoterResponse, error) @@ -529,6 +702,9 @@ type MsgServer interface { type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) SendVoter(ctx context.Context, req *MsgSendVoter) (*MsgSendVoterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendVoter not implemented") +} func (*UnimplementedMsgServer) TxoutConfirmationVoter(ctx context.Context, req *MsgTxoutConfirmationVoter) (*MsgTxoutConfirmationVoterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmationVoter not implemented") } @@ -543,6 +719,24 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_SendVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSendVoter) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SendVoter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/MetaProtocol.metacore.metacore.Msg/SendVoter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SendVoter(ctx, req.(*MsgSendVoter)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_TxoutConfirmationVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgTxoutConfirmationVoter) if err := dec(in); err != nil { @@ -601,6 +795,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "MetaProtocol.metacore.metacore.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "SendVoter", + Handler: _Msg_SendVoter_Handler, + }, { MethodName: "TxoutConfirmationVoter", Handler: _Msg_TxoutConfirmationVoter_Handler, @@ -618,6 +816,122 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "metacore/tx.proto", } +func (m *MsgSendVoter) 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 *MsgSendVoter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendVoter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InBlockHeight) > 0 { + i -= len(m.InBlockHeight) + copy(dAtA[i:], m.InBlockHeight) + i = encodeVarintTx(dAtA, i, uint64(len(m.InBlockHeight))) + i-- + dAtA[i] = 0x52 + } + if len(m.InTxHash) > 0 { + i -= len(m.InTxHash) + copy(dAtA[i:], m.InTxHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.InTxHash))) + i-- + dAtA[i] = 0x4a + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTx(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x42 + } + if len(m.MMint) > 0 { + i -= len(m.MMint) + copy(dAtA[i:], m.MMint) + i = encodeVarintTx(dAtA, i, uint64(len(m.MMint))) + i-- + dAtA[i] = 0x3a + } + if len(m.MBurnt) > 0 { + i -= len(m.MBurnt) + copy(dAtA[i:], m.MBurnt) + i = encodeVarintTx(dAtA, i, uint64(len(m.MBurnt))) + i-- + dAtA[i] = 0x32 + } + if len(m.ReceiverChain) > 0 { + i -= len(m.ReceiverChain) + copy(dAtA[i:], m.ReceiverChain) + i = encodeVarintTx(dAtA, i, uint64(len(m.ReceiverChain))) + i-- + dAtA[i] = 0x2a + } + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintTx(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x22 + } + if len(m.SenderChain) > 0 { + i -= len(m.SenderChain) + copy(dAtA[i:], m.SenderChain) + i = encodeVarintTx(dAtA, i, uint64(len(m.SenderChain))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + 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 *MsgSendVoterResponse) 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 *MsgSendVoterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgTxoutConfirmationVoter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -905,6 +1219,64 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgSendVoter) 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.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SenderChain) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ReceiverChain) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MBurnt) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MMint) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.InTxHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.InBlockHeight) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSendVoterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgTxoutConfirmationVoter) Size() (n int) { if m == nil { return 0 @@ -1042,6 +1414,426 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgSendVoter) 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: MsgSendVoter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendVoter: 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 Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SenderChain", 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.SenderChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", 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.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReceiverChain", 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.ReceiverChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MBurnt", 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.MBurnt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MMint", 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.MMint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", 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.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InTxHash", 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.InTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InBlockHeight", 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.InBlockHeight = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 *MsgSendVoterResponse) 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: MsgSendVoterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendVoterResponse: 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 (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From d7c106568ba3f1fb542b9a8eb6fa6b8d7a17041d Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Fri, 22 Oct 2021 04:05:22 -0500 Subject: [PATCH 06/10] type send: voter logic --- cmd/metaclientd/tx.go | 22 ++++ cmd/metaclientd/voter_test.go | 43 +++++++ docs/static/openapi.yml | 10 ++ proto/metacore/send.proto | 4 +- proto/metacore/tx.proto | 2 +- x/metacore/client/cli/tx_send_voter.go | 8 +- x/metacore/keeper/msg_server_send_voter.go | 31 ++++- x/metacore/types/message_send_voter.go | 11 +- x/metacore/types/send.pb.go | 122 ++++++++------------ x/metacore/types/tx.pb.go | 128 +++++++++------------ 10 files changed, 223 insertions(+), 158 deletions(-) diff --git a/cmd/metaclientd/tx.go b/cmd/metaclientd/tx.go index 7e2b22c664..956d09306a 100644 --- a/cmd/metaclientd/tx.go +++ b/cmd/metaclientd/tx.go @@ -47,3 +47,25 @@ func (b *MetachainBridge) GetAllTxout() ([]*types.Txout, error) { } return resp.Txout, nil } + +func (b *MetachainBridge) PostSend(sender string, senderChain string, receiver string, receiverChain string, mBurnt string, mMint string, message string, inTxHash string, inBlockHeight uint64) (string, error) { + signerAddress := b.keys.GetSignerInfo().GetAddress().String() + msg := types.NewMsgSendVoter(signerAddress, sender, senderChain, receiver, receiverChain, mBurnt, mMint, message, inTxHash, inBlockHeight) + + metaTxHash, err := b.Broadcast(msg) + if err != nil { + log.Err(err).Msg("PostSend broadcast fail") + return "", err + } + return metaTxHash, nil +} + +func (b *MetachainBridge) GetAllSend() ([]*types.Send, error) { + client := types.NewQueryClient(b.grpcConn) + resp, err := client.SendAll(context.Background(), &types.QueryAllSendRequest{}) + if err != nil { + log.Error().Err(err).Msg("query SendAll error") + return nil, err + } + return resp.Send, nil +} \ No newline at end of file diff --git a/cmd/metaclientd/voter_test.go b/cmd/metaclientd/voter_test.go index 9aa794ba2f..b6ce596cce 100644 --- a/cmd/metaclientd/voter_test.go +++ b/cmd/metaclientd/voter_test.go @@ -116,3 +116,46 @@ func (s *VoterSuite) TestObservedTxIn(c *C) { c.Assert(err, IsNil) log.Info().Msgf("txouts: %v", txouts) } + + +func (s *VoterSuite) TestSendVoter(c *C) { + b1 := s.bridge1 + b2 := s.bridge2 + metaHash, err := b1.PostSend("0xfrom", "Ethereum", "0xto", "BSC", "123456", "23245", "little message", + "0xtxhash", 123123) + + c.Assert(err, IsNil) + log.Info().Msgf("PostSend metaHash %s", metaHash) + + // wait for the next block + timer1 := time.NewTimer(2 * time.Second) + <-timer1.C + + metaHash, err = b2.PostSend("0xfrom", "Ethereum", "0xto", "BSC", "123456", "23245", "little message", + "0xtxhash", 123123) + c.Assert(err, IsNil) + log.Info().Msgf("Second PostSend metaHash %s", metaHash) + + // wait for the next block + timer2 := time.NewTimer(2 * time.Second) + <-timer2.C + + sends, err := b1.GetAllSend() + c.Assert(err, IsNil) + log.Info().Msgf("sends: %v", sends) + c.Assert(len(sends) >= 1, Equals, true) + + //send := sends[0] + //tid := send.Index + //metaHash, err = b1.PostTxoutConfirmation(tid, "0xhashtxout", 1337, "0xnicetoken", 1773, "0xmywallet", 12345) + //timer3 := time.NewTimer(2 * time.Second) + //<-timer3.C + //metaHash, err = b2.PostTxoutConfirmation(tid, "0xhashtxout", 1337, "0xnicetoken", 1773, "0xmywallet", 12345) + // + //timer4 := time.NewTimer(2 * time.Second) + //<-timer4.C + // + //sends, err = b1.GetAllSend() + //c.Assert(err, IsNil) + //log.Info().Msgf("sends: %v", txouts) +} diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 5bf5455921..f3999fdb39 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -19369,8 +19369,10 @@ paths: type: string inBlockHeight: type: string + format: uint64 finalizedMetaHeight: type: string + format: uint64 signers: type: array items: @@ -19504,8 +19506,10 @@ paths: type: string inBlockHeight: type: string + format: uint64 finalizedMetaHeight: type: string + format: uint64 signers: type: array items: @@ -30662,8 +30666,10 @@ definitions: type: string inBlockHeight: type: string + format: uint64 finalizedMetaHeight: type: string + format: uint64 signers: type: array items: @@ -31003,8 +31009,10 @@ definitions: type: string inBlockHeight: type: string + format: uint64 finalizedMetaHeight: type: string + format: uint64 signers: type: array items: @@ -31183,8 +31191,10 @@ definitions: type: string inBlockHeight: type: string + format: uint64 finalizedMetaHeight: type: string + format: uint64 signers: type: array items: diff --git a/proto/metacore/send.proto b/proto/metacore/send.proto index c238daef20..cd8ce9c2b3 100644 --- a/proto/metacore/send.proto +++ b/proto/metacore/send.proto @@ -16,7 +16,7 @@ message Send { string mMint = 8; string message = 9; string inTxHash = 10; - string inBlockHeight = 11; - string finalizedMetaHeight = 12; + uint64 inBlockHeight = 11; + uint64 finalizedMetaHeight = 12; repeated string signers = 13; } diff --git a/proto/metacore/tx.proto b/proto/metacore/tx.proto index c39117881b..c6d42b54ee 100644 --- a/proto/metacore/tx.proto +++ b/proto/metacore/tx.proto @@ -27,7 +27,7 @@ message MsgSendVoter { string mMint = 7; string message = 8; string inTxHash = 9; - string inBlockHeight = 10; + uint64 inBlockHeight = 10; } message MsgSendVoterResponse { diff --git a/x/metacore/client/cli/tx_send_voter.go b/x/metacore/client/cli/tx_send_voter.go index ad4c94a3bf..11d61f1120 100644 --- a/x/metacore/client/cli/tx_send_voter.go +++ b/x/metacore/client/cli/tx_send_voter.go @@ -26,14 +26,16 @@ func CmdSendVoter() *cobra.Command { argsMMint := string(args[5]) argsMessage := string(args[6]) argsInTxHash := string(args[7]) - argsInBlockHeight := string(args[8]) - + argsInBlockHeight,err := strconv.ParseInt(args[8], 10, 64) + if err != nil { + return err + } clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - msg := types.NewMsgSendVoter(clientCtx.GetFromAddress().String(), string(argsSender), string(argsSenderChain), string(argsReceiver), string(argsReceiverChain), string(argsMBurnt), string(argsMMint), string(argsMessage), string(argsInTxHash), string(argsInBlockHeight)) + msg := types.NewMsgSendVoter(clientCtx.GetFromAddress().String(), string(argsSender), string(argsSenderChain), string(argsReceiver), string(argsReceiverChain), string(argsMBurnt), string(argsMMint), string(argsMessage), string(argsInTxHash), uint64(argsInBlockHeight)) if err := msg.ValidateBasic(); err != nil { return err } diff --git a/x/metacore/keeper/msg_server_send_voter.go b/x/metacore/keeper/msg_server_send_voter.go index d0e7ee137d..8b8e83f71d 100644 --- a/x/metacore/keeper/msg_server_send_voter.go +++ b/x/metacore/keeper/msg_server_send_voter.go @@ -10,8 +10,35 @@ import ( func (k msgServer) SendVoter(goCtx context.Context, msg *types.MsgSendVoter) (*types.MsgSendVoterResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // TODO: Handling the message - _ = ctx + index := msg.Digest() + send, isFound := k.GetSend(ctx, index) + if isFound { // send exists; add creator to signers + send.Signers = append(send.Signers, msg.Creator) + } else { + send = types.Send{ + Creator: msg.Creator, + Index: index, + Sender: msg.Sender, + SenderChain: msg.SenderChain, + Receiver: msg.Receiver, + ReceiverChain: msg.ReceiverChain, + MBurnt: msg.MBurnt, + MMint: msg.MMint, + Message: msg.Message, + InTxHash: msg.InTxHash, + InBlockHeight: msg.InBlockHeight, + FinalizedMetaHeight: 0, + Signers: []string{msg.Creator}, + } + } + + //TODO: proper super majority needed + if len(send.Signers) == 2 { + send.FinalizedMetaHeight = uint64(ctx.BlockHeader().Height) + } + + + k.SetSend(ctx, send) return &types.MsgSendVoterResponse{}, nil } diff --git a/x/metacore/types/message_send_voter.go b/x/metacore/types/message_send_voter.go index 8a67b9f35a..9da3e38f46 100644 --- a/x/metacore/types/message_send_voter.go +++ b/x/metacore/types/message_send_voter.go @@ -3,11 +3,12 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/ethereum/go-ethereum/crypto" ) var _ sdk.Msg = &MsgSendVoter{} -func NewMsgSendVoter(creator string, sender string, senderChain string, receiver string, receiverChain string, mBurnt string, mMint string, message string, inTxHash string, inBlockHeight string) *MsgSendVoter { +func NewMsgSendVoter(creator string, sender string, senderChain string, receiver string, receiverChain string, mBurnt string, mMint string, message string, inTxHash string, inBlockHeight uint64) *MsgSendVoter { return &MsgSendVoter{ Creator: creator, Sender: sender, @@ -44,9 +45,17 @@ func (msg *MsgSendVoter) GetSignBytes() []byte { } func (msg *MsgSendVoter) ValidateBasic() error { + //TODO: add basic validation _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } return nil } + +func (msg *MsgSendVoter) Digest() string { + m := *msg + m.Creator = "" + hash := crypto.Keccak256Hash([]byte(m.String())) + return hash.Hex() +} \ No newline at end of file diff --git a/x/metacore/types/send.pb.go b/x/metacore/types/send.pb.go index f08b66011d..7b152c6c67 100644 --- a/x/metacore/types/send.pb.go +++ b/x/metacore/types/send.pb.go @@ -34,8 +34,8 @@ type Send struct { MMint string `protobuf:"bytes,8,opt,name=mMint,proto3" json:"mMint,omitempty"` Message string `protobuf:"bytes,9,opt,name=message,proto3" json:"message,omitempty"` InTxHash string `protobuf:"bytes,10,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` - InBlockHeight string `protobuf:"bytes,11,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` - FinalizedMetaHeight string `protobuf:"bytes,12,opt,name=finalizedMetaHeight,proto3" json:"finalizedMetaHeight,omitempty"` + InBlockHeight uint64 `protobuf:"varint,11,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` + FinalizedMetaHeight uint64 `protobuf:"varint,12,opt,name=finalizedMetaHeight,proto3" json:"finalizedMetaHeight,omitempty"` Signers []string `protobuf:"bytes,13,rep,name=signers,proto3" json:"signers,omitempty"` } @@ -142,18 +142,18 @@ func (m *Send) GetInTxHash() string { return "" } -func (m *Send) GetInBlockHeight() string { +func (m *Send) GetInBlockHeight() uint64 { if m != nil { return m.InBlockHeight } - return "" + return 0 } -func (m *Send) GetFinalizedMetaHeight() string { +func (m *Send) GetFinalizedMetaHeight() uint64 { if m != nil { return m.FinalizedMetaHeight } - return "" + return 0 } func (m *Send) GetSigners() []string { @@ -170,29 +170,29 @@ func init() { func init() { proto.RegisterFile("metacore/send.proto", fileDescriptor_c81f0328df818595) } var fileDescriptor_c81f0328df818595 = []byte{ - // 343 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x4e, 0x32, 0x31, - 0x14, 0xc5, 0x99, 0x8f, 0xff, 0xe5, 0x63, 0x53, 0x88, 0x69, 0x58, 0x34, 0xc4, 0xb8, 0x70, 0x23, - 0x63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xdd, 0x70, 0xb3, 0x02, 0x5d, 0x13, 0x21, 0xef, 0x37, - 0x33, 0x66, 0x32, 0x82, 0x42, 0x93, 0x92, 0x5d, 0x13, 0x21, 0xa7, 0x4b, 0x95, 0x3c, 0xcd, 0x40, - 0xf0, 0xcc, 0x92, 0x5e, 0x68, 0x72, 0x60, 0xe2, 0x73, 0x34, 0x78, 0x14, 0x92, 0x2d, 0xc5, 0x2b, - 0xa4, 0xee, 0xff, 0x2f, 0xb2, 0xff, 0x7d, 0xf6, 0xaf, 0x91, 0x6b, 0x63, 0x04, 0x97, 0xa0, 0x0d, - 0xe9, 0x8f, 0xeb, 0xae, 0x4d, 0x81, 0xd3, 0xeb, 0x8f, 0x1d, 0x8d, 0xb6, 0x3b, 0x1a, 0x7d, 0xed, - 0x68, 0xf4, 0xbe, 0xa7, 0xb5, 0xed, 0x9e, 0xd6, 0x3e, 0xf7, 0xb4, 0xf6, 0x70, 0xc1, 0x85, 0xcd, - 0xd6, 0x8b, 0x49, 0xa2, 0xf2, 0xd8, 0xfd, 0xd4, 0x59, 0xf9, 0xcc, 0x71, 0xf5, 0x21, 0x6c, 0x7e, - 0xa4, 0x7d, 0x59, 0x81, 0x59, 0xb4, 0xfc, 0xfb, 0x5e, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xf3, - 0x0a, 0xec, 0x53, 0x2c, 0x02, 0x00, 0x00, + // 346 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xbf, 0x4e, 0xf3, 0x30, + 0x14, 0xc5, 0x9b, 0xaf, 0xff, 0xdd, 0xaf, 0x8b, 0x5b, 0x21, 0xab, 0x83, 0x15, 0x21, 0x86, 0x2e, + 0x34, 0x08, 0xde, 0xa0, 0x2c, 0x1d, 0xa8, 0x84, 0x0a, 0x13, 0x9b, 0x9b, 0x5c, 0x12, 0x8b, 0xc6, + 0xae, 0x6c, 0x17, 0x15, 0x9e, 0x80, 0x91, 0xc7, 0x62, 0xec, 0xc8, 0x88, 0xda, 0x17, 0x41, 0xb6, + 0x93, 0x40, 0x25, 0xb6, 0xf3, 0x3b, 0xf7, 0xb8, 0xf7, 0xb8, 0x0e, 0x1a, 0xe4, 0x60, 0x58, 0x2c, + 0x15, 0x44, 0x1a, 0x44, 0x32, 0x59, 0x2b, 0x69, 0x24, 0xa6, 0x73, 0x30, 0xec, 0xd6, 0xca, 0x58, + 0xae, 0x26, 0x65, 0xa2, 0x12, 0xa3, 0x61, 0x2a, 0x53, 0xe9, 0xa2, 0x91, 0x55, 0xfe, 0xd4, 0xe9, + 0x5b, 0x1d, 0x35, 0xee, 0x40, 0x24, 0x98, 0xa0, 0x76, 0xac, 0x80, 0x19, 0xa9, 0x48, 0x10, 0x06, + 0xe3, 0xee, 0xa2, 0x44, 0x3c, 0x44, 0x4d, 0x2e, 0x12, 0xd8, 0x92, 0x7f, 0xce, 0xf7, 0x80, 0x4f, + 0x50, 0xcb, 0x2e, 0x07, 0x45, 0xea, 0xce, 0x2e, 0x08, 0x87, 0xa8, 0xe7, 0xd5, 0x75, 0xc6, 0xb8, + 0x20, 0x0d, 0x37, 0xfc, 0x6d, 0xe1, 0x11, 0xea, 0x28, 0x88, 0x81, 0x3f, 0x83, 0x22, 0x4d, 0x37, + 0xae, 0x18, 0x9f, 0xa1, 0x7e, 0xa9, 0xfd, 0xf9, 0x96, 0x0b, 0x1c, 0x9b, 0x76, 0x77, 0x3e, 0xdd, + 0x28, 0x61, 0x48, 0xdb, 0xef, 0xf6, 0x64, 0x9b, 0xe6, 0x73, 0x2e, 0x0c, 0xe9, 0xf8, 0xa6, 0x0e, + 0xec, 0xcd, 0x72, 0xd0, 0x9a, 0xa5, 0x40, 0xba, 0xfe, 0x66, 0x05, 0xda, 0x26, 0x5c, 0xdc, 0x6f, + 0x67, 0x4c, 0x67, 0x04, 0xf9, 0x26, 0x25, 0xdb, 0x26, 0x5c, 0x4c, 0x57, 0x32, 0x7e, 0x9a, 0x01, + 0x4f, 0x33, 0x43, 0x7a, 0x61, 0x30, 0x6e, 0x2c, 0x8e, 0x4d, 0x7c, 0x81, 0x06, 0x8f, 0x5c, 0xb0, + 0x15, 0x7f, 0x85, 0xc4, 0xfe, 0xff, 0x45, 0xf6, 0xbf, 0xcb, 0xfe, 0x35, 0xb2, 0x6d, 0x34, 0x4f, + 0x05, 0x28, 0x4d, 0xfa, 0x61, 0xdd, 0xb6, 0x29, 0x70, 0x7a, 0xf3, 0xb1, 0xa7, 0xc1, 0x6e, 0x4f, + 0x83, 0xaf, 0x3d, 0x0d, 0xde, 0x0f, 0xb4, 0xb6, 0x3b, 0xd0, 0xda, 0xe7, 0x81, 0xd6, 0x1e, 0x2e, + 0x53, 0x6e, 0xb2, 0xcd, 0x72, 0x12, 0xcb, 0x3c, 0xb2, 0x3f, 0x75, 0x5e, 0x3e, 0x73, 0x54, 0x7d, + 0x08, 0xdb, 0x1f, 0x69, 0x5e, 0xd6, 0xa0, 0x97, 0x2d, 0xf7, 0xbe, 0x57, 0xdf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x8a, 0x2b, 0x52, 0xbc, 0x2c, 0x02, 0x00, 0x00, } func (m *Send) Marshal() (dAtA []byte, err error) { @@ -224,19 +224,15 @@ func (m *Send) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x6a } } - if len(m.FinalizedMetaHeight) > 0 { - i -= len(m.FinalizedMetaHeight) - copy(dAtA[i:], m.FinalizedMetaHeight) - i = encodeVarintSend(dAtA, i, uint64(len(m.FinalizedMetaHeight))) + if m.FinalizedMetaHeight != 0 { + i = encodeVarintSend(dAtA, i, uint64(m.FinalizedMetaHeight)) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x60 } - if len(m.InBlockHeight) > 0 { - i -= len(m.InBlockHeight) - copy(dAtA[i:], m.InBlockHeight) - i = encodeVarintSend(dAtA, i, uint64(len(m.InBlockHeight))) + if m.InBlockHeight != 0 { + i = encodeVarintSend(dAtA, i, uint64(m.InBlockHeight)) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x58 } if len(m.InTxHash) > 0 { i -= len(m.InTxHash) @@ -368,13 +364,11 @@ func (m *Send) Size() (n int) { if l > 0 { n += 1 + l + sovSend(uint64(l)) } - l = len(m.InBlockHeight) - if l > 0 { - n += 1 + l + sovSend(uint64(l)) + if m.InBlockHeight != 0 { + n += 1 + sovSend(uint64(m.InBlockHeight)) } - l = len(m.FinalizedMetaHeight) - if l > 0 { - n += 1 + l + sovSend(uint64(l)) + if m.FinalizedMetaHeight != 0 { + n += 1 + sovSend(uint64(m.FinalizedMetaHeight)) } if len(m.Signers) > 0 { for _, s := range m.Signers { @@ -741,10 +735,10 @@ func (m *Send) Unmarshal(dAtA []byte) error { m.InTxHash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 11: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field InBlockHeight", wireType) } - var stringLen uint64 + m.InBlockHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSend @@ -754,29 +748,16 @@ func (m *Send) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.InBlockHeight |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSend - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSend - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InBlockHeight = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 12: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FinalizedMetaHeight", wireType) } - var stringLen uint64 + m.FinalizedMetaHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSend @@ -786,24 +767,11 @@ func (m *Send) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.FinalizedMetaHeight |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSend - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSend - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FinalizedMetaHeight = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) diff --git a/x/metacore/types/tx.pb.go b/x/metacore/types/tx.pb.go index eb93681853..12558b8ca6 100644 --- a/x/metacore/types/tx.pb.go +++ b/x/metacore/types/tx.pb.go @@ -39,7 +39,7 @@ type MsgSendVoter struct { MMint string `protobuf:"bytes,7,opt,name=mMint,proto3" json:"mMint,omitempty"` Message string `protobuf:"bytes,8,opt,name=message,proto3" json:"message,omitempty"` InTxHash string `protobuf:"bytes,9,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` - InBlockHeight string `protobuf:"bytes,10,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` + InBlockHeight uint64 `protobuf:"varint,10,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` } func (m *MsgSendVoter) Reset() { *m = MsgSendVoter{} } @@ -138,11 +138,11 @@ func (m *MsgSendVoter) GetInTxHash() string { return "" } -func (m *MsgSendVoter) GetInBlockHeight() string { +func (m *MsgSendVoter) GetInBlockHeight() uint64 { if m != nil { return m.InBlockHeight } - return "" + return 0 } type MsgSendVoterResponse struct { @@ -579,51 +579,51 @@ func init() { func init() { proto.RegisterFile("metacore/tx.proto", fileDescriptor_3410749d96999ade) } var fileDescriptor_3410749d96999ade = []byte{ - // 695 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x3d, 0x4f, 0x1b, 0x4d, - 0x10, 0xe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, 0xdb, 0xc5, 0x35, 0x75, 0x5e, 0x3d, 0xc6, 0x3b, 0x4d, 0x4c, 0xbe, 0x59, - 0xd0, 0x98, 0xb3, 0xd1, 0x6f, 0x1e, 0x70, 0xe1, 0xed, 0xa1, 0xce, 0xce, 0x1f, 0x87, 0x66, 0x85, - 0xc5, 0x50, 0x2f, 0xae, 0x4a, 0xfb, 0x41, 0xdd, 0x65, 0xfe, 0xce, 0xeb, 0xc7, 0xf9, 0x67, 0x69, - 0x3f, 0x5b, 0xf0, 0xcf, 0xcd, 0x71, 0xef, 0x3e, 0xe0, 0xae, 0x1b, 0x31, 0xce, 0xf6, 0xe3, 0x63, - 0xd2, 0x1a, 0x76, 0xdf, 0x5d, 0x5c, 0x35, 0xad, 0xcb, 0xab, 0xa6, 0xf5, 0xeb, 0xaa, 0x69, 0x7d, - 0xbd, 0x6e, 0x2e, 0x5c, 0x5e, 0x37, 0x17, 0x7e, 0x5e, 0x37, 0x17, 0x3e, 0x76, 0x03, 0x2a, 0x47, - 0xf1, 0x50, 0x7d, 0x09, 0x3a, 0xea, 0xfe, 0x17, 0x69, 0x82, 0x4e, 0xf6, 0xa7, 0x38, 0xc9, 0x8f, - 0xf2, 0x7c, 0x8c, 0x62, 0xb8, 0xa4, 0xff, 0x06, 0x5f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xbb, - 0x5a, 0xc7, 0x5d, 0x6b, 0x07, 0x00, 0x00, + // 696 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x4e, 0xdb, 0x40, + 0x10, 0xc6, 0xc1, 0x21, 0x64, 0x42, 0x7f, 0xd8, 0xa2, 0xc8, 0x58, 0xc8, 0x4a, 0xd3, 0x1e, 0x50, + 0x45, 0x13, 0x29, 0xad, 0x2a, 0x95, 0x1b, 0xe4, 0x42, 0x45, 0x53, 0xa1, 0x80, 0x7a, 0xe8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62, 0xa8, 0x15, 0x57, 0xa5, 0xf5, 0xa0, 0xee, 0x32, 0x7f, 0xfb, 0xdd, 0x7c, 0xfe, + 0x59, 0xda, 0x6f, 0x06, 0x3c, 0xb9, 0x39, 0xee, 0x9d, 0x07, 0xdc, 0x75, 0x23, 0xc6, 0xde, 0x9e, + 0x3f, 0x26, 0xad, 0x61, 0xf7, 0xe3, 0xc5, 0x95, 0x63, 0x5c, 0x5e, 0x39, 0xc6, 0xdf, 0x2b, 0xc7, + 0xf8, 0x71, 0xed, 0x2c, 0x5c, 0x5e, 0x3b, 0x0b, 0x7f, 0xae, 0x9d, 0x85, 0x2f, 0x9d, 0x80, 0x88, + 0x61, 0x3c, 0x90, 0x5f, 0x82, 0xb6, 0xbc, 0xff, 0x75, 0x9a, 0xa0, 0x9d, 0xfd, 0x29, 0x8e, 0xf3, + 0xa3, 0x38, 0x1f, 0x61, 0x3e, 0x58, 0x52, 0x7f, 0x83, 0x6f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, + 0xd6, 0x37, 0x5b, 0xbf, 0x6b, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -836,12 +836,10 @@ func (m *MsgSendVoter) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.InBlockHeight) > 0 { - i -= len(m.InBlockHeight) - copy(dAtA[i:], m.InBlockHeight) - i = encodeVarintTx(dAtA, i, uint64(len(m.InBlockHeight))) + if m.InBlockHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.InBlockHeight)) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x50 } if len(m.InTxHash) > 0 { i -= len(m.InTxHash) @@ -1261,9 +1259,8 @@ func (m *MsgSendVoter) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.InBlockHeight) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.InBlockHeight != 0 { + n += 1 + sovTx(uint64(m.InBlockHeight)) } return n } @@ -1732,10 +1729,10 @@ func (m *MsgSendVoter) Unmarshal(dAtA []byte) error { m.InTxHash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field InBlockHeight", wireType) } - var stringLen uint64 + m.InBlockHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1745,24 +1742,11 @@ func (m *MsgSendVoter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.InBlockHeight |= 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.InBlockHeight = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 5185742d439a6d3303139d14a7b6def671fe737d Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Fri, 22 Oct 2021 04:10:59 -0500 Subject: [PATCH 07/10] fix linter issue --- x/metacore/client/cli/tx_send_voter.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/x/metacore/client/cli/tx_send_voter.go b/x/metacore/client/cli/tx_send_voter.go index 11d61f1120..da1bde5f08 100644 --- a/x/metacore/client/cli/tx_send_voter.go +++ b/x/metacore/client/cli/tx_send_voter.go @@ -18,14 +18,14 @@ func CmdSendVoter() *cobra.Command { Short: "Broadcast message sendVoter", Args: cobra.ExactArgs(9), RunE: func(cmd *cobra.Command, args []string) error { - argsSender := string(args[0]) - argsSenderChain := string(args[1]) - argsReceiver := string(args[2]) - argsReceiverChain := string(args[3]) - argsMBurnt := string(args[4]) - argsMMint := string(args[5]) - argsMessage := string(args[6]) - argsInTxHash := string(args[7]) + argsSender := (args[0]) + argsSenderChain := (args[1]) + argsReceiver := (args[2]) + argsReceiverChain := (args[3]) + argsMBurnt := (args[4]) + argsMMint := (args[5]) + argsMessage := (args[6]) + argsInTxHash := (args[7]) argsInBlockHeight,err := strconv.ParseInt(args[8], 10, 64) if err != nil { return err @@ -35,7 +35,7 @@ func CmdSendVoter() *cobra.Command { return err } - msg := types.NewMsgSendVoter(clientCtx.GetFromAddress().String(), string(argsSender), string(argsSenderChain), string(argsReceiver), string(argsReceiverChain), string(argsMBurnt), string(argsMMint), string(argsMessage), string(argsInTxHash), uint64(argsInBlockHeight)) + msg := types.NewMsgSendVoter(clientCtx.GetFromAddress().String(), (argsSender), (argsSenderChain), (argsReceiver), (argsReceiverChain), (argsMBurnt), (argsMMint), (argsMessage), (argsInTxHash), uint64(argsInBlockHeight)) if err := msg.ValidateBasic(); err != nil { return err } From 2edcd8c1fd50a09c2e991b206320ffd182752529 Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Fri, 22 Oct 2021 04:44:18 -0500 Subject: [PATCH 08/10] remove txin/txout voter logic, in favor of the new one --- cmd/metaclientd/tx.go | 41 - cmd/metaclientd/voter_test.go | 42 - docs/static/openapi.yml | 1420 +----- proto/metacore/genesis.proto | 9 - proto/metacore/query.proto | 110 - proto/metacore/tx.proto | 31 - proto/metacore/txin.proto | 21 - proto/metacore/txin_voter.proto | 19 - proto/metacore/txout.proto | 24 - proto/metacore/txout_confirmation.proto | 20 - x/metacore/client/cli/query.go | 12 - x/metacore/client/cli/query_txin.go | 71 - x/metacore/client/cli/query_txin_test.go | 140 - x/metacore/client/cli/query_txin_voter.go | 71 - .../client/cli/query_txin_voter_test.go | 140 - x/metacore/client/cli/query_txout.go | 77 - .../client/cli/query_txout_confirmation.go | 71 - .../cli/query_txout_confirmation_test.go | 140 - x/metacore/client/cli/query_txout_test.go | 139 - x/metacore/client/cli/tx.go | 2 - x/metacore/client/cli/tx_txin_voter.go | 71 - x/metacore/client/cli/tx_txin_voter_test.go | 57 - .../client/cli/tx_txout_confirmation_voter.go | 59 - x/metacore/genesis.go | 47 - x/metacore/handler.go | 8 - x/metacore/keeper/grpc_query_txin.go | 54 - x/metacore/keeper/grpc_query_txin_test.go | 104 - x/metacore/keeper/grpc_query_txin_voter.go | 54 - .../keeper/grpc_query_txin_voter_test.go | 104 - x/metacore/keeper/grpc_query_txout.go | 59 - .../keeper/grpc_query_txout_confirmation.go | 54 - .../grpc_query_txout_confirmation_test.go | 104 - x/metacore/keeper/grpc_query_txout_test.go | 105 - x/metacore/keeper/msg_server_txin_voter.go | 94 - .../keeper/msg_server_txin_voter_test.go | 28 - .../msg_server_txout_confirmation_voter.go | 53 - x/metacore/keeper/txin.go | 49 - x/metacore/keeper/txin_test.go | 46 - x/metacore/keeper/txin_voter.go | 49 - x/metacore/keeper/txin_voter_test.go | 46 - x/metacore/keeper/txout.go | 119 - x/metacore/keeper/txout_confirmation.go | 49 - x/metacore/keeper/txout_confirmation_test.go | 46 - x/metacore/keeper/txout_test.go | 56 - x/metacore/types/codec.go | 10 +- x/metacore/types/genesis.go | 37 - x/metacore/types/genesis.pb.go | 326 +- .../types/message_txout_confirmation_voter.go | 50 - x/metacore/types/messages_txin_voter.go | 58 - x/metacore/types/query.pb.go | 4099 ++--------------- x/metacore/types/query.pb.gw.go | 782 +--- x/metacore/types/tx.pb.go | 1540 +------ x/metacore/types/txin.pb.go | 828 ---- x/metacore/types/txin_voter.pb.go | 736 --- x/metacore/types/txout.pb.go | 884 ---- x/metacore/types/txout_confirmation.pb.go | 761 --- 56 files changed, 512 insertions(+), 13714 deletions(-) delete mode 100644 proto/metacore/txin.proto delete mode 100644 proto/metacore/txin_voter.proto delete mode 100644 proto/metacore/txout.proto delete mode 100644 proto/metacore/txout_confirmation.proto delete mode 100644 x/metacore/client/cli/query_txin.go delete mode 100644 x/metacore/client/cli/query_txin_test.go delete mode 100644 x/metacore/client/cli/query_txin_voter.go delete mode 100644 x/metacore/client/cli/query_txin_voter_test.go delete mode 100644 x/metacore/client/cli/query_txout.go delete mode 100644 x/metacore/client/cli/query_txout_confirmation.go delete mode 100644 x/metacore/client/cli/query_txout_confirmation_test.go delete mode 100644 x/metacore/client/cli/query_txout_test.go delete mode 100644 x/metacore/client/cli/tx_txin_voter.go delete mode 100644 x/metacore/client/cli/tx_txin_voter_test.go delete mode 100644 x/metacore/client/cli/tx_txout_confirmation_voter.go delete mode 100644 x/metacore/keeper/grpc_query_txin.go delete mode 100644 x/metacore/keeper/grpc_query_txin_test.go delete mode 100644 x/metacore/keeper/grpc_query_txin_voter.go delete mode 100644 x/metacore/keeper/grpc_query_txin_voter_test.go delete mode 100644 x/metacore/keeper/grpc_query_txout.go delete mode 100644 x/metacore/keeper/grpc_query_txout_confirmation.go delete mode 100644 x/metacore/keeper/grpc_query_txout_confirmation_test.go delete mode 100644 x/metacore/keeper/grpc_query_txout_test.go delete mode 100644 x/metacore/keeper/msg_server_txin_voter.go delete mode 100644 x/metacore/keeper/msg_server_txin_voter_test.go delete mode 100644 x/metacore/keeper/msg_server_txout_confirmation_voter.go delete mode 100644 x/metacore/keeper/txin.go delete mode 100644 x/metacore/keeper/txin_test.go delete mode 100644 x/metacore/keeper/txin_voter.go delete mode 100644 x/metacore/keeper/txin_voter_test.go delete mode 100644 x/metacore/keeper/txout.go delete mode 100644 x/metacore/keeper/txout_confirmation.go delete mode 100644 x/metacore/keeper/txout_confirmation_test.go delete mode 100644 x/metacore/keeper/txout_test.go delete mode 100644 x/metacore/types/message_txout_confirmation_voter.go delete mode 100644 x/metacore/types/messages_txin_voter.go delete mode 100644 x/metacore/types/txin.pb.go delete mode 100644 x/metacore/types/txin_voter.pb.go delete mode 100644 x/metacore/types/txout.pb.go delete mode 100644 x/metacore/types/txout_confirmation.pb.go diff --git a/cmd/metaclientd/tx.go b/cmd/metaclientd/tx.go index 956d09306a..c68f2d2e25 100644 --- a/cmd/metaclientd/tx.go +++ b/cmd/metaclientd/tx.go @@ -6,47 +6,6 @@ import ( "github.com/rs/zerolog/log" ) -// Post Txin to Metachain, with signature of the signer. -// MetaChain takes this as a vote to the PostTxIn. -func (b *MetachainBridge) PostTxIn(fromAddress string, toAddress string, sourceAsset string, sourceAmount uint64, mBurnt uint64, destAsset string, txHash string, blockHeight uint64) (string, error) { - signerAddress := b.keys.GetSignerInfo().GetAddress().String() - msg := types.NewMsgCreateTxinVoter( - signerAddress, - txHash, sourceAsset, sourceAmount, mBurnt, destAsset, - fromAddress, toAddress, blockHeight, - ) - - metaTxHash, err := b.Broadcast(msg) - if err != nil { - log.Err(err).Msg("PostTxIn broadcast fail") - return "", err - } - return metaTxHash, nil -} - -// Post Txin to Metachain, with signature of the signer. -// MetaChain takes this as a vote to the PostTxIn. -func (b *MetachainBridge) PostTxoutConfirmation(txoutId uint64, txHash string, mMint uint64, destinationAsset string, destinationAmount uint64, toAddress string, blockHeight uint64) (string, error) { - signerAddress := b.keys.GetSignerInfo().GetAddress().String() - msg := types.NewMsgTxoutConfirmationVoter(signerAddress, txoutId, txHash, mMint, destinationAsset, destinationAmount, toAddress, blockHeight) - metaTxHash, err := b.Broadcast(msg) - if err != nil { - log.Err(err).Msg("PostTxoutConfirmation broadcast fail") - return "", err - } - return metaTxHash, nil -} - -// Get all current Txout from MetaCore -func (b *MetachainBridge) GetAllTxout() ([]*types.Txout, error) { - client := types.NewQueryClient(b.grpcConn) - resp, err := client.TxoutAll(context.Background(), &types.QueryAllTxoutRequest{}) - if err != nil { - log.Error().Err(err).Msg("query TxoutAll error") - return nil, err - } - return resp.Txout, nil -} func (b *MetachainBridge) PostSend(sender string, senderChain string, receiver string, receiverChain string, mBurnt string, mMint string, message string, inTxHash string, inBlockHeight uint64) (string, error) { signerAddress := b.keys.GetSignerInfo().GetAddress().String() diff --git a/cmd/metaclientd/voter_test.go b/cmd/metaclientd/voter_test.go index b6ce596cce..ba1450f28d 100644 --- a/cmd/metaclientd/voter_test.go +++ b/cmd/metaclientd/voter_test.go @@ -74,48 +74,6 @@ func (s *VoterSuite) SetUpTest(c *C) { } } -func (s *VoterSuite) TestObservedTxIn(c *C) { - b1 := s.bridge1 - b2 := s.bridge2 - //err := b.PostTxIn("ETH.ETH", 2, 4, "ETH.BSC", "0xdeadbeef", "0x1234", 2345) - metaHash, err := b1.PostTxIn("0xfrom", "0xto", "0xsource.ETH", 123456, 23245, "0xdest.BSC", - "0xtxhash", 123123) - - c.Assert(err, IsNil) - log.Info().Msgf("PostTxIn metaHash %s", metaHash) - - // wait for the next block - timer1 := time.NewTimer(2 * time.Second) - <-timer1.C - - metaHash, err = b2.PostTxIn("0xfrom", "0xto", "0xsource.ETH", 123456, 23245, "0xdest.BSC", - "0xtxhash", 123123) - c.Assert(err, IsNil) - log.Info().Msgf("Second PostTxIn metaHash %s", metaHash) - - // wait for the next block - timer2 := time.NewTimer(2 * time.Second) - <-timer2.C - - txouts, err := b1.GetAllTxout() - c.Assert(err, IsNil) - log.Info().Msgf("txouts: %v", txouts) - c.Assert(len(txouts) >= 1, Equals, true) - - txout := txouts[0] - tid := txout.Id - metaHash, err = b1.PostTxoutConfirmation(tid, "0xhashtxout", 1337, "0xnicetoken", 1773, "0xmywallet", 12345) - timer3 := time.NewTimer(2 * time.Second) - <-timer3.C - metaHash, err = b2.PostTxoutConfirmation(tid, "0xhashtxout", 1337, "0xnicetoken", 1773, "0xmywallet", 12345) - - timer4 := time.NewTimer(2 * time.Second) - <-timer4.C - - txouts, err = b1.GetAllTxout() - c.Assert(err, IsNil) - log.Info().Msgf("txouts: %v", txouts) -} func (s *VoterSuite) TestSendVoter(c *C) { diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index f3999fdb39..edd20696e5 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -19539,833 +19539,6 @@ paths: type: string tags: - Query - /Meta-Protocol/metacore/metacore/txin: - get: - summary: Queries a list of txin items. - operationId: MetaProtocolMetacoreMetacoreTxinAll - responses: - '200': - description: A successful response. - schema: - type: object - properties: - Txin: - type: array - items: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.countTotal - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - tags: - - Query - '/Meta-Protocol/metacore/metacore/txin/{index}': - get: - summary: Queries a txin by index. - operationId: MetaProtocolMetacoreMetacoreTxin - responses: - '200': - description: A successful response. - schema: - type: object - properties: - Txin: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: index - in: path - required: true - type: string - tags: - - Query - /Meta-Protocol/metacore/metacore/txinVoter: - get: - summary: Queries a list of txinVoter items. - operationId: MetaProtocolMetacoreMetacoreTxinVoterAll - responses: - '200': - description: A successful response. - schema: - type: object - properties: - TxinVoter: - type: array - items: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.countTotal - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - tags: - - Query - '/Meta-Protocol/metacore/metacore/txinVoter/{index}': - get: - summary: Queries a txinVoter by index. - operationId: MetaProtocolMetacoreMetacoreTxinVoter - responses: - '200': - description: A successful response. - schema: - type: object - properties: - TxinVoter: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: index - in: path - required: true - type: string - tags: - - Query - /Meta-Protocol/metacore/metacore/txout: - get: - summary: Queries a list of txout items. - operationId: MetaProtocolMetacoreMetacoreTxoutAll - responses: - '200': - description: A successful response. - schema: - type: object - properties: - Txout: - type: array - items: - type: object - properties: - creator: - type: string - id: - type: string - format: uint64 - txinHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - mMint: - type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: - type: string - format: uint64 - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.countTotal - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - tags: - - Query - '/Meta-Protocol/metacore/metacore/txout/{id}': - get: - summary: Queries a txout by id. - operationId: MetaProtocolMetacoreMetacoreTxout - responses: - '200': - description: A successful response. - schema: - type: object - properties: - Txout: - type: object - properties: - creator: - type: string - id: - type: string - format: uint64 - txinHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - mMint: - type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: - type: string - format: uint64 - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: id - in: path - required: true - type: string - format: uint64 - tags: - - Query - /Meta-Protocol/metacore/metacore/txoutConfirmation: - get: - summary: Queries a list of txoutConfirmation items. - operationId: MetaProtocolMetacoreMetacoreTxoutConfirmationAll - responses: - '200': - description: A successful response. - schema: - type: object - properties: - TxoutConfirmation: - type: array - items: - type: object - properties: - creator: - type: string - index: - type: string - txoutId: - type: string - format: uint64 - txHash: - type: string - mMint: - type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: - type: string - format: uint64 - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.countTotal - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - tags: - - Query - '/Meta-Protocol/metacore/metacore/txoutConfirmation/{index}': - get: - summary: Queries a txoutConfirmation by index. - operationId: MetaProtocolMetacoreMetacoreTxoutConfirmation - responses: - '200': - description: A successful response. - schema: - type: object - properties: - TxoutConfirmation: - type: object - properties: - creator: - type: string - index: - type: string - txoutId: - type: string - format: uint64 - txHash: - type: string - mMint: - type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: - type: string - format: uint64 - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: index - in: path - required: true - type: string - tags: - - Query definitions: cosmos.bank.v1beta1.DenomUnit: type: object @@ -30532,14 +29705,10 @@ definitions: description: |- Version defines the versioning scheme used to negotiate the IBC verison in the connection handshake. - MetaProtocol.metacore.metacore.MsgCreateTxinVoterResponse: - type: object MetaProtocol.metacore.metacore.MsgSendVoterResponse: type: object MetaProtocol.metacore.metacore.MsgSetNodeKeysResponse: type: object - MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoterResponse: - type: object MetaProtocol.metacore.metacore.NodeAccount: type: object properties: @@ -30590,271 +29759,27 @@ definitions: type: string index: type: string - nodeAddress: - type: string - format: byte - pubkeySet: - type: object - properties: - secp256k1: - type: string - ed25519: - type: string - title: 'PubKeySet contains two pub keys , secp256k1 and ed25519' - nodeStatus: - type: string - enum: - - Unknown - - Whitelisted - - Standby - - Ready - - Active - - Disabled - default: Unknown - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - MetaProtocol.metacore.metacore.QueryAllSendResponse: - type: object - properties: - Send: - type: array - items: - type: object - properties: - creator: - type: string - index: - type: string - sender: - type: string - senderChain: - type: string - receiver: - type: string - receiverChain: - type: string - mBurnt: - type: string - mMint: - type: string - message: - type: string - inTxHash: - type: string - inBlockHeight: - type: string - format: uint64 - finalizedMetaHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - MetaProtocol.metacore.metacore.QueryAllTxinResponse: - type: object - properties: - Txin: - type: array - items: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - MetaProtocol.metacore.metacore.QueryAllTxinVoterResponse: - type: object - properties: - TxinVoter: - type: array - items: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - MetaProtocol.metacore.metacore.QueryAllTxoutConfirmationResponse: - type: object - properties: - TxoutConfirmation: - type: array - items: - type: object - properties: - creator: - type: string - index: - type: string - txoutId: - type: string - format: uint64 - txHash: - type: string - mMint: - type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: - type: string - format: uint64 - toAddress: - type: string - blockHeight: + nodeAddress: type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: + format: byte + pubkeySet: + type: object + properties: + secp256k1: + type: string + ed25519: + type: string + title: 'PubKeySet contains two pub keys , secp256k1 and ed25519' + nodeStatus: type: string - format: uint64 + enum: + - Unknown + - Whitelisted + - Standby + - Ready + - Active + - Disabled + default: Unknown pagination: type: object properties: @@ -30880,51 +29805,44 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - MetaProtocol.metacore.metacore.QueryAllTxoutResponse: + MetaProtocol.metacore.metacore.QueryAllSendResponse: type: object properties: - Txout: + Send: type: array items: type: object properties: creator: type: string - id: + index: type: string - format: uint64 - txinHash: + sender: type: string - sourceAsset: + senderChain: type: string - sourceAmount: + receiver: + type: string + receiverChain: type: string - format: uint64 mBurnt: type: string - format: uint64 mMint: type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: + message: type: string - format: uint64 - fromAddress: + inTxHash: type: string - toAddress: + inBlockHeight: type: string - blockHeight: + format: uint64 + finalizedMetaHeight: type: string format: uint64 signers: type: array items: type: string - finalizedHeight: - type: string - format: uint64 pagination: type: object properties: @@ -31017,149 +29935,6 @@ definitions: type: array items: type: string - MetaProtocol.metacore.metacore.QueryGetTxinResponse: - type: object - properties: - Txin: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - MetaProtocol.metacore.metacore.QueryGetTxinVoterResponse: - type: object - properties: - TxinVoter: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - MetaProtocol.metacore.metacore.QueryGetTxoutConfirmationResponse: - type: object - properties: - TxoutConfirmation: - type: object - properties: - creator: - type: string - index: - type: string - txoutId: - type: string - format: uint64 - txHash: - type: string - mMint: - type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: - type: string - format: uint64 - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - MetaProtocol.metacore.metacore.QueryGetTxoutResponse: - type: object - properties: - Txout: - type: object - properties: - creator: - type: string - id: - type: string - format: uint64 - txinHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - mMint: - type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: - type: string - format: uint64 - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 MetaProtocol.metacore.metacore.QueryLastMetaHeightResponse: type: object properties: @@ -31199,137 +29974,6 @@ definitions: type: array items: type: string - MetaProtocol.metacore.metacore.Txin: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - MetaProtocol.metacore.metacore.TxinVoter: - type: object - properties: - creator: - type: string - index: - type: string - txHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - MetaProtocol.metacore.metacore.Txout: - type: object - properties: - creator: - type: string - id: - type: string - format: uint64 - txinHash: - type: string - sourceAsset: - type: string - sourceAmount: - type: string - format: uint64 - mBurnt: - type: string - format: uint64 - mMint: - type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: - type: string - format: uint64 - fromAddress: - type: string - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 - MetaProtocol.metacore.metacore.TxoutConfirmation: - type: object - properties: - creator: - type: string - index: - type: string - txoutId: - type: string - format: uint64 - txHash: - type: string - mMint: - type: string - format: uint64 - destinationAsset: - type: string - destinationAmount: - type: string - format: uint64 - toAddress: - type: string - blockHeight: - type: string - format: uint64 - signers: - type: array - items: - type: string - finalizedHeight: - type: string - format: uint64 common.PubKeySet: type: object properties: diff --git a/proto/metacore/genesis.proto b/proto/metacore/genesis.proto index 39dbfe5615..c6490bd398 100644 --- a/proto/metacore/genesis.proto +++ b/proto/metacore/genesis.proto @@ -3,11 +3,7 @@ package MetaProtocol.metacore.metacore; // this line is used by starport scaffolding # genesis/proto/import import "metacore/send.proto"; -import "metacore/txout_confirmation.proto"; -import "metacore/txout.proto"; import "metacore/node_account.proto"; -import "metacore/txin_voter.proto"; -import "metacore/txin.proto"; option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; @@ -15,11 +11,6 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; message GenesisState { // this line is used by starport scaffolding # genesis/proto/state repeated Send sendList = 7; // this line is used by starport scaffolding # genesis/proto/stateField - repeated TxoutConfirmation txoutConfirmationList = 6; // this line is used by starport scaffolding # genesis/proto/stateField - repeated Txout txoutList = 4; // this line is used by starport scaffolding # genesis/proto/stateField - uint64 txoutCount = 5; // this line is used by starport scaffolding # genesis/proto/stateField repeated NodeAccount nodeAccountList = 3; // this line is used by starport scaffolding # genesis/proto/stateField - repeated TxinVoter txinVoterList = 2; // this line is used by starport scaffolding # genesis/proto/stateField - repeated Txin txinList = 1; // this line is used by starport scaffolding # genesis/proto/stateField // this line is used by starport scaffolding # ibc/genesis/proto } diff --git a/proto/metacore/query.proto b/proto/metacore/query.proto index e9e793a9df..a04467eca2 100644 --- a/proto/metacore/query.proto +++ b/proto/metacore/query.proto @@ -5,11 +5,7 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; // this line is used by starport scaffolding # 1 import "metacore/send.proto"; -import "metacore/txout_confirmation.proto"; -import "metacore/txout.proto"; import "metacore/node_account.proto"; -import "metacore/txin_voter.proto"; -import "metacore/txin.proto"; option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; @@ -28,28 +24,6 @@ service Query { } - // Queries a txoutConfirmation by index. - rpc TxoutConfirmation(QueryGetTxoutConfirmationRequest) returns (QueryGetTxoutConfirmationResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txoutConfirmation/{index}"; - } - - // Queries a list of txoutConfirmation items. - rpc TxoutConfirmationAll(QueryAllTxoutConfirmationRequest) returns (QueryAllTxoutConfirmationResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txoutConfirmation"; - } - - - // Queries a txout by id. - rpc Txout(QueryGetTxoutRequest) returns (QueryGetTxoutResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txout/{id}"; - } - - // Queries a list of txout items. - rpc TxoutAll(QueryAllTxoutRequest) returns (QueryAllTxoutResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txout"; - } - - // Queries a nodeAccount by index. rpc NodeAccount(QueryGetNodeAccountRequest) returns (QueryGetNodeAccountResponse) { option (google.api.http).get = "/Meta-Protocol/metacore/metacore/nodeAccount/{index}"; @@ -67,26 +41,6 @@ service Query { } - // Queries a txinVoter by index. - rpc TxinVoter(QueryGetTxinVoterRequest) returns (QueryGetTxinVoterResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txinVoter/{index}"; - } - - // Queries a list of txinVoter items. - rpc TxinVoterAll(QueryAllTxinVoterRequest) returns (QueryAllTxinVoterResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txinVoter"; - } - - - // Queries a txin by index. - rpc Txin(QueryGetTxinRequest) returns (QueryGetTxinResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txin/{index}"; - } - - // Queries a list of txin items. - rpc TxinAll(QueryAllTxinRequest) returns (QueryAllTxinResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txin"; - } } @@ -107,38 +61,7 @@ message QueryAllSendResponse { repeated Send Send = 1; cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryGetTxoutConfirmationRequest { - string index = 1; -} - -message QueryGetTxoutConfirmationResponse { - TxoutConfirmation TxoutConfirmation = 1; -} - -message QueryAllTxoutConfirmationRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllTxoutConfirmationResponse { - repeated TxoutConfirmation TxoutConfirmation = 1; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} -message QueryGetTxoutRequest { - uint64 id = 1; -} -message QueryGetTxoutResponse { - Txout Txout = 1; -} - -message QueryAllTxoutRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllTxoutResponse { - repeated Txout Txout = 1; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} message QueryGetNodeAccountRequest { string index = 1; } @@ -161,36 +84,3 @@ message QueryLastMetaHeightRequest { message QueryLastMetaHeightResponse { uint64 Height = 1; } - -message QueryGetTxinVoterRequest { - string index = 1; -} - -message QueryGetTxinVoterResponse { - TxinVoter TxinVoter = 1; -} - -message QueryAllTxinVoterRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllTxinVoterResponse { - repeated TxinVoter TxinVoter = 1; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} -message QueryGetTxinRequest { - string index = 1; -} - -message QueryGetTxinResponse { - Txin Txin = 1; -} - -message QueryAllTxinRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllTxinResponse { - repeated Txin Txin = 1; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/proto/metacore/tx.proto b/proto/metacore/tx.proto index c6d42b54ee..96457d41e4 100644 --- a/proto/metacore/tx.proto +++ b/proto/metacore/tx.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package MetaProtocol.metacore.metacore; // this line is used by starport scaffolding # proto/tx/import -import "metacore/txin_voter.proto"; import "common/common.proto"; option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; @@ -11,9 +10,7 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; service Msg { // this line is used by starport scaffolding # proto/tx/rpc rpc SendVoter(MsgSendVoter) returns (MsgSendVoterResponse); - rpc TxoutConfirmationVoter(MsgTxoutConfirmationVoter) returns (MsgTxoutConfirmationVoterResponse); rpc SetNodeKeys(MsgSetNodeKeys) returns (MsgSetNodeKeysResponse); - rpc CreateTxinVoter(MsgCreateTxinVoter) returns (MsgCreateTxinVoterResponse); } // this line is used by starport scaffolding # proto/tx/message @@ -33,20 +30,6 @@ message MsgSendVoter { message MsgSendVoterResponse { } -message MsgTxoutConfirmationVoter { - string creator = 1; - uint64 txoutId = 2; - string txHash = 3; - uint64 mMint = 4; - string destinationAsset = 5; - uint64 destinationAmount = 6; - string toAddress = 7; - uint64 blockHeight = 8; -} - -message MsgTxoutConfirmationVoterResponse { -} - message MsgSetNodeKeys { string creator = 1; common.PubKeySet pubkeySet = 2; @@ -55,17 +38,3 @@ message MsgSetNodeKeys { message MsgSetNodeKeysResponse { } - -message MsgCreateTxinVoter { - string creator = 1; - string index = 2; - string txHash = 3; - string sourceAsset = 4; - uint64 sourceAmount = 5; - uint64 mBurnt = 6; - string destinationAsset = 7; - string fromAddress = 8; - string toAddress = 9; - uint64 blockHeight = 10; -} -message MsgCreateTxinVoterResponse { } diff --git a/proto/metacore/txin.proto b/proto/metacore/txin.proto deleted file mode 100644 index 86ea69b492..0000000000 --- a/proto/metacore/txin.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; -package MetaProtocol.metacore.metacore; - -option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; - -import "gogoproto/gogo.proto"; - -message Txin { - string creator = 1; - string index = 2; - string txHash = 3; - string sourceAsset = 4; - uint64 sourceAmount = 5; - uint64 mBurnt = 6; - string destinationAsset = 7; - string fromAddress = 8; - string toAddress = 9; - uint64 blockHeight = 10; - repeated string signers = 11 [(gogoproto.nullable) = false]; - uint64 finalizedHeight = 12; -} diff --git a/proto/metacore/txin_voter.proto b/proto/metacore/txin_voter.proto deleted file mode 100644 index 15ec020b57..0000000000 --- a/proto/metacore/txin_voter.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; -package MetaProtocol.metacore.metacore; - -option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; - -import "gogoproto/gogo.proto"; - -message TxinVoter { - string creator = 1; - string index = 2; - string txHash = 3; - string sourceAsset = 4; - uint64 sourceAmount = 5; - uint64 mBurnt = 6; - string destinationAsset = 7; - string fromAddress = 8; - string toAddress = 9; - uint64 blockHeight = 10; -} diff --git a/proto/metacore/txout.proto b/proto/metacore/txout.proto deleted file mode 100644 index da7b5d5d7d..0000000000 --- a/proto/metacore/txout.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; -package MetaProtocol.metacore.metacore; - -option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; - -import "gogoproto/gogo.proto"; - -message Txout { - string creator = 1; - uint64 id = 2; - string txinHash = 3; - string sourceAsset = 4; - uint64 sourceAmount = 5; - uint64 mBurnt = 6; - uint64 mMint = 7; - string destinationAsset = 8; - uint64 destinationAmount = 9; - string fromAddress = 10; - string toAddress = 11; - uint64 blockHeight = 12; - repeated string signers = 13 [(gogoproto.nullable) = false]; - uint64 finalizedHeight = 14; - -} \ No newline at end of file diff --git a/proto/metacore/txout_confirmation.proto b/proto/metacore/txout_confirmation.proto deleted file mode 100644 index 9bbd24966d..0000000000 --- a/proto/metacore/txout_confirmation.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; -package MetaProtocol.metacore.metacore; - -option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; - -import "gogoproto/gogo.proto"; - -message TxoutConfirmation { - string creator = 1; - string index = 2; - uint64 txoutId = 3; - string txHash = 4; - uint64 mMint = 5; - string destinationAsset = 6; - uint64 destinationAmount = 7; - string toAddress = 8; - uint64 blockHeight = 9; - repeated string signers = 10 [(gogoproto.nullable) = false]; - uint64 finalizedHeight = 11; -} diff --git a/x/metacore/client/cli/query.go b/x/metacore/client/cli/query.go index 3b70c21836..5f1b147ed0 100644 --- a/x/metacore/client/cli/query.go +++ b/x/metacore/client/cli/query.go @@ -29,22 +29,10 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdListSend()) cmd.AddCommand(CmdShowSend()) - cmd.AddCommand(CmdListTxoutConfirmation()) - cmd.AddCommand(CmdShowTxoutConfirmation()) - - cmd.AddCommand(CmdListTxout()) - cmd.AddCommand(CmdShowTxout()) - cmd.AddCommand(CmdListNodeAccount()) cmd.AddCommand(CmdShowNodeAccount()) cmd.AddCommand(CmdLastMetaHeight()) - cmd.AddCommand(CmdListTxinVoter()) - cmd.AddCommand(CmdShowTxinVoter()) - - cmd.AddCommand(CmdListTxin()) - cmd.AddCommand(CmdShowTxin()) - return cmd } diff --git a/x/metacore/client/cli/query_txin.go b/x/metacore/client/cli/query_txin.go deleted file mode 100644 index a11593cbc1..0000000000 --- a/x/metacore/client/cli/query_txin.go +++ /dev/null @@ -1,71 +0,0 @@ -package cli - -import ( - "context" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" -) - -func CmdListTxin() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-txin", - Short: "list all Txin", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllTxinRequest{ - Pagination: pageReq, - } - - res, err := queryClient.TxinAll(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowTxin() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-txin [index]", - Short: "shows a Txin", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetTxinRequest{ - Index: args[0], - } - - res, err := queryClient.Txin(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/metacore/client/cli/query_txin_test.go b/x/metacore/client/cli/query_txin_test.go deleted file mode 100644 index 0d35ef9f60..0000000000 --- a/x/metacore/client/cli/query_txin_test.go +++ /dev/null @@ -1,140 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/Meta-Protocol/metacore/testutil/network" - "github.com/Meta-Protocol/metacore/x/metacore/client/cli" - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func networkWithTxinObjects(t *testing.T, n int) (*network.Network, []*types.Txin) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - state.TxinList = append(state.TxinList, &types.Txin{Creator: "ANY", Index: strconv.Itoa(i), Signers: []string{"A", "B"}}) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.TxinList -} - -func TestShowTxin(t *testing.T) { - net, objs := networkWithTxinObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - id string - args []string - err error - obj *types.Txin - }{ - { - desc: "found", - id: objs[0].Index, - args: common, - obj: objs[0], - }, - { - desc: "not found", - id: "not_found", - args: common, - err: status.Error(codes.InvalidArgument, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{tc.id} - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowTxin(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetTxinResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.Txin) - require.Equal(t, tc.obj, resp.Txin) - } - }) - } -} - -func TestListTxin(t *testing.T) { - net, objs := networkWithTxinObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxin(), args) - require.NoError(t, err) - var resp types.QueryAllTxinResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - for j := i; j < len(objs) && j < i+step; j++ { - assert.Equal(t, objs[j], resp.Txin[j-i]) - } - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxin(), args) - require.NoError(t, err) - var resp types.QueryAllTxinResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - for j := i; j < len(objs) && j < i+step; j++ { - assert.Equal(t, objs[j], resp.Txin[j-i]) - } - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxin(), args) - require.NoError(t, err) - var resp types.QueryAllTxinResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.Equal(t, objs, resp.Txin) - }) -} diff --git a/x/metacore/client/cli/query_txin_voter.go b/x/metacore/client/cli/query_txin_voter.go deleted file mode 100644 index 04ab607162..0000000000 --- a/x/metacore/client/cli/query_txin_voter.go +++ /dev/null @@ -1,71 +0,0 @@ -package cli - -import ( - "context" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" -) - -func CmdListTxinVoter() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-txin-voter", - Short: "list all TxinVoter", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllTxinVoterRequest{ - Pagination: pageReq, - } - - res, err := queryClient.TxinVoterAll(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowTxinVoter() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-txin-voter [index]", - Short: "shows a TxinVoter", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetTxinVoterRequest{ - Index: args[0], - } - - res, err := queryClient.TxinVoter(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/metacore/client/cli/query_txin_voter_test.go b/x/metacore/client/cli/query_txin_voter_test.go deleted file mode 100644 index 7c4466365f..0000000000 --- a/x/metacore/client/cli/query_txin_voter_test.go +++ /dev/null @@ -1,140 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/Meta-Protocol/metacore/testutil/network" - "github.com/Meta-Protocol/metacore/x/metacore/client/cli" - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func networkWithTxinVoterObjects(t *testing.T, n int) (*network.Network, []*types.TxinVoter) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - state.TxinVoterList = append(state.TxinVoterList, &types.TxinVoter{Creator: "ANY", Index: strconv.Itoa(i)}) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.TxinVoterList -} - -func TestShowTxinVoter(t *testing.T) { - net, objs := networkWithTxinVoterObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - id string - args []string - err error - obj *types.TxinVoter - }{ - { - desc: "found", - id: objs[0].Index, - args: common, - obj: objs[0], - }, - { - desc: "not found", - id: "not_found", - args: common, - err: status.Error(codes.InvalidArgument, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{tc.id} - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowTxinVoter(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetTxinVoterResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.TxinVoter) - require.Equal(t, tc.obj, resp.TxinVoter) - } - }) - } -} - -func TestListTxinVoter(t *testing.T) { - net, objs := networkWithTxinVoterObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxinVoter(), args) - require.NoError(t, err) - var resp types.QueryAllTxinVoterResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - for j := i; j < len(objs) && j < i+step; j++ { - assert.Equal(t, objs[j], resp.TxinVoter[j-i]) - } - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxinVoter(), args) - require.NoError(t, err) - var resp types.QueryAllTxinVoterResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - for j := i; j < len(objs) && j < i+step; j++ { - assert.Equal(t, objs[j], resp.TxinVoter[j-i]) - } - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxinVoter(), args) - require.NoError(t, err) - var resp types.QueryAllTxinVoterResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.Equal(t, objs, resp.TxinVoter) - }) -} diff --git a/x/metacore/client/cli/query_txout.go b/x/metacore/client/cli/query_txout.go deleted file mode 100644 index e9201e1f0f..0000000000 --- a/x/metacore/client/cli/query_txout.go +++ /dev/null @@ -1,77 +0,0 @@ -package cli - -import ( - "context" - "strconv" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" -) - -func CmdListTxout() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-txout", - Short: "list all Txout", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllTxoutRequest{ - Pagination: pageReq, - } - - res, err := queryClient.TxoutAll(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowTxout() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-txout [id]", - Short: "shows a Txout", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - id, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - params := &types.QueryGetTxoutRequest{ - Id: id, - } - - res, err := queryClient.Txout(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/metacore/client/cli/query_txout_confirmation.go b/x/metacore/client/cli/query_txout_confirmation.go deleted file mode 100644 index 2c201d960e..0000000000 --- a/x/metacore/client/cli/query_txout_confirmation.go +++ /dev/null @@ -1,71 +0,0 @@ -package cli - -import ( - "context" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" -) - -func CmdListTxoutConfirmation() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-txout-confirmation", - Short: "list all TxoutConfirmation", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllTxoutConfirmationRequest{ - Pagination: pageReq, - } - - res, err := queryClient.TxoutConfirmationAll(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowTxoutConfirmation() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-txout-confirmation [index]", - Short: "shows a TxoutConfirmation", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetTxoutConfirmationRequest{ - Index: args[0], - } - - res, err := queryClient.TxoutConfirmation(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/metacore/client/cli/query_txout_confirmation_test.go b/x/metacore/client/cli/query_txout_confirmation_test.go deleted file mode 100644 index 05be6f723c..0000000000 --- a/x/metacore/client/cli/query_txout_confirmation_test.go +++ /dev/null @@ -1,140 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/Meta-Protocol/metacore/testutil/network" - "github.com/Meta-Protocol/metacore/x/metacore/client/cli" - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func networkWithTxoutConfirmationObjects(t *testing.T, n int) (*network.Network, []*types.TxoutConfirmation) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - state.TxoutConfirmationList = append(state.TxoutConfirmationList, &types.TxoutConfirmation{Creator: "ANY", Index: strconv.Itoa(i), Signers: []string{}}) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.TxoutConfirmationList -} - -func TestShowTxoutConfirmation(t *testing.T) { - net, objs := networkWithTxoutConfirmationObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - id string - args []string - err error - obj *types.TxoutConfirmation - }{ - { - desc: "found", - id: objs[0].Index, - args: common, - obj: objs[0], - }, - { - desc: "not found", - id: "not_found", - args: common, - err: status.Error(codes.InvalidArgument, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{tc.id} - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowTxoutConfirmation(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetTxoutConfirmationResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.TxoutConfirmation) - require.Equal(t, tc.obj, resp.TxoutConfirmation) - } - }) - } -} - -func TestListTxoutConfirmation(t *testing.T) { - net, objs := networkWithTxoutConfirmationObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxoutConfirmation(), args) - require.NoError(t, err) - var resp types.QueryAllTxoutConfirmationResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - for j := i; j < len(objs) && j < i+step; j++ { - assert.Equal(t, objs[j], resp.TxoutConfirmation[j-i]) - } - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxoutConfirmation(), args) - require.NoError(t, err) - var resp types.QueryAllTxoutConfirmationResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - for j := i; j < len(objs) && j < i+step; j++ { - assert.Equal(t, objs[j], resp.TxoutConfirmation[j-i]) - } - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxoutConfirmation(), args) - require.NoError(t, err) - var resp types.QueryAllTxoutConfirmationResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.Equal(t, objs, resp.TxoutConfirmation) - }) -} diff --git a/x/metacore/client/cli/query_txout_test.go b/x/metacore/client/cli/query_txout_test.go deleted file mode 100644 index ad6f63d238..0000000000 --- a/x/metacore/client/cli/query_txout_test.go +++ /dev/null @@ -1,139 +0,0 @@ -package cli_test - -import ( - "fmt" - "testing" - - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/Meta-Protocol/metacore/testutil/network" - "github.com/Meta-Protocol/metacore/x/metacore/client/cli" - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func networkWithTxoutObjects(t *testing.T, n int) (*network.Network, []*types.Txout) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - state.TxoutList = append(state.TxoutList, &types.Txout{Creator: "ANY", Id: uint64(i), Signers: []string{}}) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.TxoutList -} - -func TestShowTxout(t *testing.T) { - net, objs := networkWithTxoutObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - id string - args []string - err error - obj *types.Txout - }{ - { - desc: "found", - id: fmt.Sprintf("%d", objs[0].Id), - args: common, - obj: objs[0], - }, - { - desc: "not found", - id: "not_found", - args: common, - err: status.Error(codes.InvalidArgument, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{tc.id} - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowTxout(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetTxoutResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.Txout) - require.Equal(t, tc.obj, resp.Txout) - } - }) - } -} - -func TestListTxout(t *testing.T) { - net, objs := networkWithTxoutObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxout(), args) - require.NoError(t, err) - var resp types.QueryAllTxoutResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - for j := i; j < len(objs) && j < i+step; j++ { - assert.Equal(t, objs[j], resp.Txout[j-i]) - } - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxout(), args) - require.NoError(t, err) - var resp types.QueryAllTxoutResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - for j := i; j < len(objs) && j < i+step; j++ { - assert.Equal(t, objs[j], resp.Txout[j-i]) - } - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListTxout(), args) - require.NoError(t, err) - var resp types.QueryAllTxoutResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.Equal(t, objs, resp.Txout) - }) -} diff --git a/x/metacore/client/cli/tx.go b/x/metacore/client/cli/tx.go index 24696e2004..351349a95e 100644 --- a/x/metacore/client/cli/tx.go +++ b/x/metacore/client/cli/tx.go @@ -32,11 +32,9 @@ func GetTxCmd() *cobra.Command { // this line is used by starport scaffolding # 1 cmd.AddCommand(CmdSendVoter()) - cmd.AddCommand(CmdTxoutConfirmationVoter()) cmd.AddCommand(CmdSetNodeKeys()) - cmd.AddCommand(CmdCreateTxinVoter()) return cmd } diff --git a/x/metacore/client/cli/tx_txin_voter.go b/x/metacore/client/cli/tx_txin_voter.go deleted file mode 100644 index 94a4a3e4df..0000000000 --- a/x/metacore/client/cli/tx_txin_voter.go +++ /dev/null @@ -1,71 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" - - "github.com/spf13/cast" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" -) - -func CmdCreateTxinVoter() *cobra.Command { - cmd := &cobra.Command{ - Use: "create-txin-voter [index] [txHash] [sourceAsset] [sourceAmount] [mBurnt] [destinationAsset] [fromAddress] [toAddress] [blockHeight] [signer] [signature]", - Short: "Create a new TxinVoter", - Args: cobra.ExactArgs(11), - RunE: func(cmd *cobra.Command, args []string) error { - index := args[0] - argsTxHash, err := cast.ToStringE(args[1]) - if err != nil { - return err - } - argsSourceAsset, err := cast.ToStringE(args[2]) - if err != nil { - return err - } - argsSourceAmount, err := cast.ToUint64E(args[3]) - if err != nil { - return err - } - argsMBurnt, err := cast.ToUint64E(args[4]) - if err != nil { - return err - } - argsDestinationAsset, err := cast.ToStringE(args[5]) - if err != nil { - return err - } - argsFromAddress, err := cast.ToStringE(args[6]) - if err != nil { - return err - } - argsToAddress, err := cast.ToStringE(args[7]) - if err != nil { - return err - } - argsBlockHeight, err := cast.ToUint64E(args[8]) - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - _ = index // index is set to "TxHash-Creator" automatically by NewMsgCreateTxinVoter - msg := types.NewMsgCreateTxinVoter(clientCtx.GetFromAddress().String(), argsTxHash, argsSourceAsset, argsSourceAmount, argsMBurnt, argsDestinationAsset, argsFromAddress, argsToAddress, argsBlockHeight) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/metacore/client/cli/tx_txin_voter_test.go b/x/metacore/client/cli/tx_txin_voter_test.go deleted file mode 100644 index 8f23db8c44..0000000000 --- a/x/metacore/client/cli/tx_txin_voter_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package cli_test - -import ( - "fmt" - "testing" - - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - "github.com/Meta-Protocol/metacore/testutil/network" - "github.com/Meta-Protocol/metacore/x/metacore/client/cli" -) - -func TestCreateTxinVoter(t *testing.T) { - net := network.New(t) - val := net.Validators[0] - ctx := val.ClientCtx - id := "0" - - fields := []string{"xyz", "xyz", "123", "234", "xyz", "xyz", "xyz", "456", "xyz", "xyz"} - for _, tc := range []struct { - desc string - id string - args []string - err error - code uint32 - }{ - { - id: id, - desc: "valid", - args: []string{ - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdk.NewInt(10))).String()), - }, - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{tc.id} - args = append(args, fields...) - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateTxinVoter(), args) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - var resp sdk.TxResponse - require.NoError(t, ctx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &resp)) - require.Equal(t, tc.code, resp.Code) - } - }) - } -} diff --git a/x/metacore/client/cli/tx_txout_confirmation_voter.go b/x/metacore/client/cli/tx_txout_confirmation_voter.go deleted file mode 100644 index fb0bdfa3c4..0000000000 --- a/x/metacore/client/cli/tx_txout_confirmation_voter.go +++ /dev/null @@ -1,59 +0,0 @@ -package cli - -import ( - "github.com/spf13/cast" - "github.com/spf13/cobra" - "strconv" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" -) - -var _ = strconv.Itoa(0) - -func CmdTxoutConfirmationVoter() *cobra.Command { - cmd := &cobra.Command{ - Use: "txout-confirmation-voter [txoutId] [txHash] [mMint] [destinationAsset] [destinationAmount] [toAddress] [blockHeight]", - Short: "Broadcast message TxoutConfirmationVoter", - Args: cobra.ExactArgs(7), - RunE: func(cmd *cobra.Command, args []string) error { - argsTxoutId, err := cast.ToUint64E(args[0]) - if err != nil { - return err - } - argsTxHash := args[1] - argsMMint, err := cast.ToUint64E(args[2]) - if err != nil { - return err - } - argsDestinationAsset := args[3] - argsDestinationAmount, err := cast.ToUint64E(args[4]) - if err != nil { - return err - } - toAddress := args[5] - - argsBlockHeight, err := cast.ToUint64E(args[6]) - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgTxoutConfirmationVoter(clientCtx.GetFromAddress().String(), argsTxoutId, argsTxHash, argsMMint, argsDestinationAsset, argsDestinationAmount, toAddress, argsBlockHeight) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/metacore/genesis.go b/x/metacore/genesis.go index 793786d3c2..beb61a8729 100644 --- a/x/metacore/genesis.go +++ b/x/metacore/genesis.go @@ -15,33 +15,14 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) k.SetSend(ctx, *elem) } - // Set all the txoutConfirmation - for _, elem := range genState.TxoutConfirmationList { - k.SetTxoutConfirmation(ctx, *elem) - } - - // Set all the txout - for _, elem := range genState.TxoutList { - k.SetTxout(ctx, *elem) - } - // Set txout count - k.SetTxoutCount(ctx, genState.TxoutCount) // Set all the nodeAccount for _, elem := range genState.NodeAccountList { k.SetNodeAccount(ctx, *elem) } - // Set all the txinVoter - for _, elem := range genState.TxinVoterList { - k.SetTxinVoter(ctx, *elem) - } - // Set all the txin - for _, elem := range genState.TxinList { - k.SetTxin(ctx, *elem) - } // this line is used by starport scaffolding # ibc/genesis/init } @@ -58,22 +39,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.SendList = append(genesis.SendList, &elem) } - // Get all txoutConfirmation - txoutConfirmationList := k.GetAllTxoutConfirmation(ctx) - for _, elem := range txoutConfirmationList { - elem := elem - genesis.TxoutConfirmationList = append(genesis.TxoutConfirmationList, &elem) - } - // Get all txout - txoutList := k.GetAllTxout(ctx) - for _, elem := range txoutList { - elem := elem - genesis.TxoutList = append(genesis.TxoutList, &elem) - } - - // Set the current count - genesis.TxoutCount = k.GetTxoutCount(ctx) // Get all nodeAccount nodeAccountList := k.GetAllNodeAccount(ctx) @@ -82,19 +48,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.NodeAccountList = append(genesis.NodeAccountList, &elem) } - // Get all txinVoter - txinVoterList := k.GetAllTxinVoter(ctx) - for _, elem := range txinVoterList { - elem := elem - genesis.TxinVoterList = append(genesis.TxinVoterList, &elem) - } - - // Get all txin - txinList := k.GetAllTxin(ctx) - for _, elem := range txinList { - elem := elem - genesis.TxinList = append(genesis.TxinList, &elem) - } // this line is used by starport scaffolding # ibc/genesis/export diff --git a/x/metacore/handler.go b/x/metacore/handler.go index 628a0cbbcf..788c771214 100644 --- a/x/metacore/handler.go +++ b/x/metacore/handler.go @@ -22,18 +22,10 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := msgServer.SendVoter(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgTxoutConfirmationVoter: - res, err := msgServer.TxoutConfirmationVoter(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgSetNodeKeys: res, err := msgServer.SetNodeKeys(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateTxinVoter: - res, err := msgServer.CreateTxinVoter(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) diff --git a/x/metacore/keeper/grpc_query_txin.go b/x/metacore/keeper/grpc_query_txin.go deleted file mode 100644 index 290bc14430..0000000000 --- a/x/metacore/keeper/grpc_query_txin.go +++ /dev/null @@ -1,54 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) TxinAll(c context.Context, req *types.QueryAllTxinRequest) (*types.QueryAllTxinResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var txins []*types.Txin - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - txinStore := prefix.NewStore(store, types.KeyPrefix(types.TxinKey)) - - pageRes, err := query.Paginate(txinStore, req.Pagination, func(key []byte, value []byte) error { - var txin types.Txin - if err := k.cdc.UnmarshalBinaryBare(value, &txin); err != nil { - return err - } - - txins = append(txins, &txin) - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllTxinResponse{Txin: txins, Pagination: pageRes}, nil -} - -func (k Keeper) Txin(c context.Context, req *types.QueryGetTxinRequest) (*types.QueryGetTxinResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - val, found := k.GetTxin(ctx, req.Index) - if !found { - return nil, status.Error(codes.InvalidArgument, "not found") - } - - return &types.QueryGetTxinResponse{Txin: &val}, nil -} diff --git a/x/metacore/keeper/grpc_query_txin_test.go b/x/metacore/keeper/grpc_query_txin_test.go deleted file mode 100644 index 4b5033f6ba..0000000000 --- a/x/metacore/keeper/grpc_query_txin_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package keeper - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func TestTxinQuerySingle(t *testing.T) { - keeper, ctx := setupKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxin(keeper, ctx, 2) - for _, tc := range []struct { - desc string - request *types.QueryGetTxinRequest - response *types.QueryGetTxinResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetTxinRequest{Index: msgs[0].Index}, - response: &types.QueryGetTxinResponse{Txin: &msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetTxinRequest{Index: msgs[1].Index}, - response: &types.QueryGetTxinResponse{Txin: &msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetTxinRequest{Index: "missing"}, - err: status.Error(codes.InvalidArgument, "not found"), - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.Txin(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.Equal(t, tc.response, response) - } - }) - } -} - -func TestTxinQueryPaginated(t *testing.T) { - keeper, ctx := setupKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxin(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllTxinRequest { - return &types.QueryAllTxinRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.TxinAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - for j := i; j < len(msgs) && j < i+step; j++ { - assert.Equal(t, &msgs[j], resp.Txin[j-i]) - } - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.TxinAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - for j := i; j < len(msgs) && j < i+step; j++ { - assert.Equal(t, &msgs[j], resp.Txin[j-i]) - } - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.TxinAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.TxinAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/metacore/keeper/grpc_query_txin_voter.go b/x/metacore/keeper/grpc_query_txin_voter.go deleted file mode 100644 index d937484d46..0000000000 --- a/x/metacore/keeper/grpc_query_txin_voter.go +++ /dev/null @@ -1,54 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) TxinVoterAll(c context.Context, req *types.QueryAllTxinVoterRequest) (*types.QueryAllTxinVoterResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var txinVoters []*types.TxinVoter - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - txinVoterStore := prefix.NewStore(store, types.KeyPrefix(types.TxinVoterKey)) - - pageRes, err := query.Paginate(txinVoterStore, req.Pagination, func(key []byte, value []byte) error { - var txinVoter types.TxinVoter - if err := k.cdc.UnmarshalBinaryBare(value, &txinVoter); err != nil { - return err - } - - txinVoters = append(txinVoters, &txinVoter) - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllTxinVoterResponse{TxinVoter: txinVoters, Pagination: pageRes}, nil -} - -func (k Keeper) TxinVoter(c context.Context, req *types.QueryGetTxinVoterRequest) (*types.QueryGetTxinVoterResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - val, found := k.GetTxinVoter(ctx, req.Index) - if !found { - return nil, status.Error(codes.InvalidArgument, "not found") - } - - return &types.QueryGetTxinVoterResponse{TxinVoter: &val}, nil -} diff --git a/x/metacore/keeper/grpc_query_txin_voter_test.go b/x/metacore/keeper/grpc_query_txin_voter_test.go deleted file mode 100644 index a5a35adaf9..0000000000 --- a/x/metacore/keeper/grpc_query_txin_voter_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package keeper - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func TestTxinVoterQuerySingle(t *testing.T) { - keeper, ctx := setupKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxinVoter(keeper, ctx, 2) - for _, tc := range []struct { - desc string - request *types.QueryGetTxinVoterRequest - response *types.QueryGetTxinVoterResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetTxinVoterRequest{Index: msgs[0].Index}, - response: &types.QueryGetTxinVoterResponse{TxinVoter: &msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetTxinVoterRequest{Index: msgs[1].Index}, - response: &types.QueryGetTxinVoterResponse{TxinVoter: &msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetTxinVoterRequest{Index: "missing"}, - err: status.Error(codes.InvalidArgument, "not found"), - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.TxinVoter(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.Equal(t, tc.response, response) - } - }) - } -} - -func TestTxinVoterQueryPaginated(t *testing.T) { - keeper, ctx := setupKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxinVoter(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllTxinVoterRequest { - return &types.QueryAllTxinVoterRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.TxinVoterAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - for j := i; j < len(msgs) && j < i+step; j++ { - assert.Equal(t, &msgs[j], resp.TxinVoter[j-i]) - } - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.TxinVoterAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - for j := i; j < len(msgs) && j < i+step; j++ { - assert.Equal(t, &msgs[j], resp.TxinVoter[j-i]) - } - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.TxinVoterAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.TxinVoterAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/metacore/keeper/grpc_query_txout.go b/x/metacore/keeper/grpc_query_txout.go deleted file mode 100644 index 064e7e40ce..0000000000 --- a/x/metacore/keeper/grpc_query_txout.go +++ /dev/null @@ -1,59 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) TxoutAll(c context.Context, req *types.QueryAllTxoutRequest) (*types.QueryAllTxoutResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var txouts []*types.Txout - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - txoutStore := prefix.NewStore(store, types.KeyPrefix(types.TxoutKey)) - - pageRes, err := query.Paginate(txoutStore, req.Pagination, func(key []byte, value []byte) error { - var txout types.Txout - if err := k.cdc.UnmarshalBinaryBare(value, &txout); err != nil { - return err - } - - txouts = append(txouts, &txout) - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllTxoutResponse{Txout: txouts, Pagination: pageRes}, nil -} - -func (k Keeper) Txout(c context.Context, req *types.QueryGetTxoutRequest) (*types.QueryGetTxoutResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var txout types.Txout - ctx := sdk.UnwrapSDKContext(c) - - if !k.HasTxout(ctx, req.Id) { - return nil, sdkerrors.ErrKeyNotFound - } - - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutKey)) - k.cdc.MustUnmarshalBinaryBare(store.Get(GetTxoutIDBytes(req.Id)), &txout) - - return &types.QueryGetTxoutResponse{Txout: &txout}, nil -} diff --git a/x/metacore/keeper/grpc_query_txout_confirmation.go b/x/metacore/keeper/grpc_query_txout_confirmation.go deleted file mode 100644 index 54f6b3b66a..0000000000 --- a/x/metacore/keeper/grpc_query_txout_confirmation.go +++ /dev/null @@ -1,54 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) TxoutConfirmationAll(c context.Context, req *types.QueryAllTxoutConfirmationRequest) (*types.QueryAllTxoutConfirmationResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var txoutConfirmations []*types.TxoutConfirmation - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - txoutConfirmationStore := prefix.NewStore(store, types.KeyPrefix(types.TxoutConfirmationKey)) - - pageRes, err := query.Paginate(txoutConfirmationStore, req.Pagination, func(key []byte, value []byte) error { - var txoutConfirmation types.TxoutConfirmation - if err := k.cdc.UnmarshalBinaryBare(value, &txoutConfirmation); err != nil { - return err - } - - txoutConfirmations = append(txoutConfirmations, &txoutConfirmation) - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllTxoutConfirmationResponse{TxoutConfirmation: txoutConfirmations, Pagination: pageRes}, nil -} - -func (k Keeper) TxoutConfirmation(c context.Context, req *types.QueryGetTxoutConfirmationRequest) (*types.QueryGetTxoutConfirmationResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - val, found := k.GetTxoutConfirmation(ctx, req.Index) - if !found { - return nil, status.Error(codes.InvalidArgument, "not found") - } - - return &types.QueryGetTxoutConfirmationResponse{TxoutConfirmation: &val}, nil -} diff --git a/x/metacore/keeper/grpc_query_txout_confirmation_test.go b/x/metacore/keeper/grpc_query_txout_confirmation_test.go deleted file mode 100644 index 8d4a3bff24..0000000000 --- a/x/metacore/keeper/grpc_query_txout_confirmation_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package keeper - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func TestTxoutConfirmationQuerySingle(t *testing.T) { - keeper, ctx := setupKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxoutConfirmation(keeper, ctx, 2) - for _, tc := range []struct { - desc string - request *types.QueryGetTxoutConfirmationRequest - response *types.QueryGetTxoutConfirmationResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetTxoutConfirmationRequest{Index: msgs[0].Index}, - response: &types.QueryGetTxoutConfirmationResponse{TxoutConfirmation: &msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetTxoutConfirmationRequest{Index: msgs[1].Index}, - response: &types.QueryGetTxoutConfirmationResponse{TxoutConfirmation: &msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetTxoutConfirmationRequest{Index: "missing"}, - err: status.Error(codes.InvalidArgument, "not found"), - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.TxoutConfirmation(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.Equal(t, tc.response, response) - } - }) - } -} - -func TestTxoutConfirmationQueryPaginated(t *testing.T) { - keeper, ctx := setupKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxoutConfirmation(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllTxoutConfirmationRequest { - return &types.QueryAllTxoutConfirmationRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.TxoutConfirmationAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - for j := i; j < len(msgs) && j < i+step; j++ { - assert.Equal(t, &msgs[j], resp.TxoutConfirmation[j-i]) - } - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.TxoutConfirmationAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - for j := i; j < len(msgs) && j < i+step; j++ { - assert.Equal(t, &msgs[j], resp.TxoutConfirmation[j-i]) - } - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.TxoutConfirmationAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.TxoutConfirmationAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/metacore/keeper/grpc_query_txout_test.go b/x/metacore/keeper/grpc_query_txout_test.go deleted file mode 100644 index 7b6f23c73d..0000000000 --- a/x/metacore/keeper/grpc_query_txout_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package keeper - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func TestTxoutQuerySingle(t *testing.T) { - keeper, ctx := setupKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxout(keeper, ctx, 2) - for _, tc := range []struct { - desc string - request *types.QueryGetTxoutRequest - response *types.QueryGetTxoutResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetTxoutRequest{Id: msgs[0].Id}, - response: &types.QueryGetTxoutResponse{Txout: &msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetTxoutRequest{Id: msgs[1].Id}, - response: &types.QueryGetTxoutResponse{Txout: &msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetTxoutRequest{Id: uint64(len(msgs))}, - err: sdkerrors.ErrKeyNotFound, - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.Txout(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.Equal(t, tc.response, response) - } - }) - } -} - -func TestTxoutQueryPaginated(t *testing.T) { - keeper, ctx := setupKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxout(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllTxoutRequest { - return &types.QueryAllTxoutRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.TxoutAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - for j := i; j < len(msgs) && j < i+step; j++ { - assert.Equal(t, &msgs[j], resp.Txout[j-i]) - } - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.TxoutAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - for j := i; j < len(msgs) && j < i+step; j++ { - assert.Equal(t, &msgs[j], resp.Txout[j-i]) - } - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.TxoutAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.TxoutAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/metacore/keeper/msg_server_txin_voter.go b/x/metacore/keeper/msg_server_txin_voter.go deleted file mode 100644 index 71f939e49a..0000000000 --- a/x/metacore/keeper/msg_server_txin_voter.go +++ /dev/null @@ -1,94 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - "github.com/ethereum/go-ethereum/crypto" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -func (k msgServer) CreateTxinVoter(goCtx context.Context, msg *types.MsgCreateTxinVoter) (*types.MsgCreateTxinVoterResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - // Check if the value already exists - _, isFound := k.GetTxinVoter(ctx, msg.Index) - if isFound { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("index %v already set", msg.Index)) - } - - var txinVoter = types.TxinVoter{ - Index: msg.Index, - Creator: msg.Creator, - TxHash: msg.TxHash, - SourceAsset: msg.SourceAsset, - SourceAmount: msg.SourceAmount, - MBurnt: msg.MBurnt, - DestinationAsset: msg.DestinationAsset, - FromAddress: msg.FromAddress, - ToAddress: msg.ToAddress, - BlockHeight: msg.BlockHeight, - } - - k.SetTxinVoter(ctx, txinVoter) - - // hash the body of txinVoter--making sure that each TxinVoter votes - // on the exact same Txin. - txinVoter.Index = "" - txinVoter.Creator = "" - hashTxin := crypto.Keccak256Hash([]byte(txinVoter.String())) - - txin, isFound := k.GetTxin(ctx, hashTxin.Hex()) - if isFound { // txin already created; add signer to it - for _, s := range txin.Signers { - if s == msg.Creator { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("txin index %s already set from signer %s", msg.TxHash, msg.Creator)) - } - } - txin.Signers = append(txin.Signers, msg.Creator) - } else { // first signer for TxHash - txin = types.Txin{ - Creator: msg.Creator, - Index: hashTxin.Hex(), - TxHash: msg.TxHash, - SourceAsset: msg.SourceAsset, - SourceAmount: msg.SourceAmount, - MBurnt: msg.MBurnt, - DestinationAsset: msg.DestinationAsset, - FromAddress: msg.FromAddress, - ToAddress: msg.ToAddress, - Signers: []string{msg.Creator}, - FinalizedHeight: 0, - } - } - - // see if the txin reached consensus. If so, create the corresponding txout. - // FIXME: change to super-majority of current validator set - if len(txin.Signers) == 2 { // the first time that txin reaches consensus - txin.FinalizedHeight = uint64(ctx.BlockHeader().Height) - // create Txout for Metaclient to consume - txout := types.Txout{ - Creator: "", // not used - Id: 0, // Id will get overwritten when SetTxout - TxinHash: hashTxin.Hex(), // the Txin that generates this Txout. - SourceAsset: txin.SourceAsset, - SourceAmount: txin.SourceAmount, - MBurnt: txin.MBurnt, - MMint: txin.MBurnt, //TODO: compute the amount to Mint; should be MBurnt - gas on destination - our fee. - DestinationAsset: txin.DestinationAsset, - DestinationAmount: 0, - FromAddress: txin.FromAddress, - ToAddress: txin.ToAddress, - BlockHeight: 0, - Signers: []string{}, - FinalizedHeight: 0, - } - k.SetTxout(ctx, txout) - } - - k.SetTxin(ctx, txin) - - return &types.MsgCreateTxinVoterResponse{}, nil -} diff --git a/x/metacore/keeper/msg_server_txin_voter_test.go b/x/metacore/keeper/msg_server_txin_voter_test.go deleted file mode 100644 index 705cc75fb1..0000000000 --- a/x/metacore/keeper/msg_server_txin_voter_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package keeper - -import ( - "fmt" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func TestTxinVoterMsgServerCreate(t *testing.T) { - keeper, ctx := setupKeeper(t) - srv := NewMsgServerImpl(*keeper) - wctx := sdk.WrapSDKContext(ctx) - creator := "A" - for i := 0; i < 5; i++ { - idx := fmt.Sprintf("txhash%d-%s", i, creator) - expected := &types.MsgCreateTxinVoter{Creator: creator, TxHash: fmt.Sprintf("txhash%d", i), Index: idx} - _, err := srv.CreateTxinVoter(wctx, expected) - require.NoError(t, err) - rst, found := keeper.GetTxinVoter(ctx, expected.Index) - require.True(t, found) - assert.Equal(t, expected.Creator, rst.Creator) - } -} diff --git a/x/metacore/keeper/msg_server_txout_confirmation_voter.go b/x/metacore/keeper/msg_server_txout_confirmation_voter.go deleted file mode 100644 index 287e8fc7e1..0000000000 --- a/x/metacore/keeper/msg_server_txout_confirmation_voter.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/ethereum/go-ethereum/crypto" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (k msgServer) TxoutConfirmationVoter(goCtx context.Context, msg *types.MsgTxoutConfirmationVoter) (*types.MsgTxoutConfirmationVoterResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - found := k.HasTxout(ctx, msg.TxoutId) - if !found { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("txoutId %d does not exist", msg.TxoutId)) - } - - txoutConf := types.TxoutConfirmation{ - Creator: "", - Index: "", - TxoutId: msg.TxoutId, - TxHash: msg.TxHash, - MMint: msg.MMint, - DestinationAsset: msg.DestinationAsset, - DestinationAmount: msg.DestinationAmount, - ToAddress: msg.ToAddress, - BlockHeight: msg.BlockHeight, - Signers: nil, - FinalizedHeight: 0, - } - - hashTxoutConf := crypto.Keccak256Hash([]byte(txoutConf.String())) - txoutConf2, found := k.GetTxoutConfirmation(ctx, hashTxoutConf.Hex()) - if !found { - txoutConf.Index = hashTxoutConf.Hex() - txoutConf.Signers = append(txoutConf.Signers, msg.Creator) - } else { - txoutConf2.Signers = append(txoutConf2.Signers, msg.Creator) - txoutConf = txoutConf2 - } - - k.SetTxoutConfirmation(ctx, txoutConf) - - if len(txoutConf.Signers) == 2 { // TODO: fix threshold - txoutConf.FinalizedHeight = uint64(ctx.BlockHeader().Height) - k.RemoveTxout(ctx, txoutConf.TxoutId) - } - - return &types.MsgTxoutConfirmationVoterResponse{}, nil -} diff --git a/x/metacore/keeper/txin.go b/x/metacore/keeper/txin.go deleted file mode 100644 index b1969f2faa..0000000000 --- a/x/metacore/keeper/txin.go +++ /dev/null @@ -1,49 +0,0 @@ -package keeper - -import ( - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// SetTxin set a specific txin in the store from its index -func (k Keeper) SetTxin(ctx sdk.Context, txin types.Txin) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxinKey)) - b := k.cdc.MustMarshalBinaryBare(&txin) - store.Set(types.KeyPrefix(txin.Index), b) -} - -// GetTxin returns a txin from its index -func (k Keeper) GetTxin(ctx sdk.Context, index string) (val types.Txin, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxinKey)) - - b := store.Get(types.KeyPrefix(index)) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshalBinaryBare(b, &val) - return val, true -} - -// RemoveTxin removes a txin from the store -func (k Keeper) RemoveTxin(ctx sdk.Context, index string) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxinKey)) - store.Delete(types.KeyPrefix(index)) -} - -// GetAllTxin returns all txin -func (k Keeper) GetAllTxin(ctx sdk.Context) (list []types.Txin) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxinKey)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Txin - k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) - list = append(list, val) - } - - return -} diff --git a/x/metacore/keeper/txin_test.go b/x/metacore/keeper/txin_test.go deleted file mode 100644 index 5e2b1705cd..0000000000 --- a/x/metacore/keeper/txin_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package keeper - -import ( - "fmt" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/assert" - - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func createNTxin(keeper *Keeper, ctx sdk.Context, n int) []types.Txin { - items := make([]types.Txin, n) - for i := range items { - items[i].Creator = "any" - items[i].Index = fmt.Sprintf("%d", i) - keeper.SetTxin(ctx, items[i]) - } - return items -} - -func TestTxinGet(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxin(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetTxin(ctx, item.Index) - assert.True(t, found) - assert.Equal(t, item, rst) - } -} -func TestTxinRemove(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxin(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveTxin(ctx, item.Index) - _, found := keeper.GetTxin(ctx, item.Index) - assert.False(t, found) - } -} - -func TestTxinGetAll(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxin(keeper, ctx, 10) - assert.Equal(t, items, keeper.GetAllTxin(ctx)) -} diff --git a/x/metacore/keeper/txin_voter.go b/x/metacore/keeper/txin_voter.go deleted file mode 100644 index 5566fe1e40..0000000000 --- a/x/metacore/keeper/txin_voter.go +++ /dev/null @@ -1,49 +0,0 @@ -package keeper - -import ( - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// SetTxinVoter set a specific txinVoter in the store from its index -func (k Keeper) SetTxinVoter(ctx sdk.Context, txinVoter types.TxinVoter) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxinVoterKey)) - b := k.cdc.MustMarshalBinaryBare(&txinVoter) - store.Set(types.KeyPrefix(txinVoter.Index), b) -} - -// GetTxinVoter returns a txinVoter from its index -func (k Keeper) GetTxinVoter(ctx sdk.Context, index string) (val types.TxinVoter, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxinVoterKey)) - - b := store.Get(types.KeyPrefix(index)) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshalBinaryBare(b, &val) - return val, true -} - -// RemoveTxinVoter removes a txinVoter from the store -func (k Keeper) RemoveTxinVoter(ctx sdk.Context, index string) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxinVoterKey)) - store.Delete(types.KeyPrefix(index)) -} - -// GetAllTxinVoter returns all txinVoter -func (k Keeper) GetAllTxinVoter(ctx sdk.Context) (list []types.TxinVoter) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxinVoterKey)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.TxinVoter - k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) - list = append(list, val) - } - - return -} diff --git a/x/metacore/keeper/txin_voter_test.go b/x/metacore/keeper/txin_voter_test.go deleted file mode 100644 index ec2ba862f8..0000000000 --- a/x/metacore/keeper/txin_voter_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package keeper - -import ( - "fmt" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/assert" - - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func createNTxinVoter(keeper *Keeper, ctx sdk.Context, n int) []types.TxinVoter { - items := make([]types.TxinVoter, n) - for i := range items { - items[i].Creator = "any" - items[i].Index = fmt.Sprintf("%d", i) - keeper.SetTxinVoter(ctx, items[i]) - } - return items -} - -func TestTxinVoterGet(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxinVoter(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetTxinVoter(ctx, item.Index) - assert.True(t, found) - assert.Equal(t, item, rst) - } -} -func TestTxinVoterRemove(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxinVoter(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveTxinVoter(ctx, item.Index) - _, found := keeper.GetTxinVoter(ctx, item.Index) - assert.False(t, found) - } -} - -func TestTxinVoterGetAll(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxinVoter(keeper, ctx, 10) - assert.Equal(t, items, keeper.GetAllTxinVoter(ctx)) -} diff --git a/x/metacore/keeper/txout.go b/x/metacore/keeper/txout.go deleted file mode 100644 index 4ba655a164..0000000000 --- a/x/metacore/keeper/txout.go +++ /dev/null @@ -1,119 +0,0 @@ -package keeper - -import ( - "encoding/binary" - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "strconv" -) - -// GetTxoutCount get the total number of TypeName.LowerCamel -func (k Keeper) GetTxoutCount(ctx sdk.Context) uint64 { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutCountKey)) - byteKey := types.KeyPrefix(types.TxoutCountKey) - bz := store.Get(byteKey) - - // Count doesn't exist: no element - if bz == nil { - return 0 - } - - // Parse bytes - count, err := strconv.ParseUint(string(bz), 10, 64) - if err != nil { - // Panic because the count should be always formattable to uint64 - panic("cannot decode count") - } - - return count -} - -// SetTxoutCount set the total number of txout -func (k Keeper) SetTxoutCount(ctx sdk.Context, count uint64) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutCountKey)) - byteKey := types.KeyPrefix(types.TxoutCountKey) - bz := []byte(strconv.FormatUint(count, 10)) - store.Set(byteKey, bz) -} - -// AppendTxout appends a txout in the store with a new id and update the count -func (k Keeper) AppendTxout( - ctx sdk.Context, - txout types.Txout, -) uint64 { - // Create the txout - count := k.GetTxoutCount(ctx) - - // Set the ID of the appended value - txout.Id = count - - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutKey)) - appendedValue := k.cdc.MustMarshalBinaryBare(&txout) - store.Set(GetTxoutIDBytes(txout.Id), appendedValue) - - // Update txout count - k.SetTxoutCount(ctx, count+1) - - return count -} - -// SetTxout set a specific txout in the store -func (k Keeper) SetTxout(ctx sdk.Context, txout types.Txout) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutKey)) - b := k.cdc.MustMarshalBinaryBare(&txout) - store.Set(GetTxoutIDBytes(txout.Id), b) -} - -// GetTxout returns a txout from its id -func (k Keeper) GetTxout(ctx sdk.Context, id uint64) types.Txout { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutKey)) - var txout types.Txout - k.cdc.MustUnmarshalBinaryBare(store.Get(GetTxoutIDBytes(id)), &txout) - return txout -} - -// HasTxout checks if the txout exists in the store -func (k Keeper) HasTxout(ctx sdk.Context, id uint64) bool { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutKey)) - return store.Has(GetTxoutIDBytes(id)) -} - -// GetTxoutOwner returns the creator of the -func (k Keeper) GetTxoutOwner(ctx sdk.Context, id uint64) string { - return k.GetTxout(ctx, id).Creator -} - -// RemoveTxout removes a txout from the store -func (k Keeper) RemoveTxout(ctx sdk.Context, id uint64) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutKey)) - store.Delete(GetTxoutIDBytes(id)) -} - -// GetAllTxout returns all txout -func (k Keeper) GetAllTxout(ctx sdk.Context) (list []types.Txout) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutKey)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Txout - k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) - list = append(list, val) - } - - return -} - -// GetTxoutIDBytes returns the byte representation of the ID -func GetTxoutIDBytes(id uint64) []byte { - bz := make([]byte, 8) - binary.BigEndian.PutUint64(bz, id) - return bz -} - -// GetTxoutIDFromBytes returns ID in uint64 format from a byte array -func GetTxoutIDFromBytes(bz []byte) uint64 { - return binary.BigEndian.Uint64(bz) -} diff --git a/x/metacore/keeper/txout_confirmation.go b/x/metacore/keeper/txout_confirmation.go deleted file mode 100644 index 208831aa01..0000000000 --- a/x/metacore/keeper/txout_confirmation.go +++ /dev/null @@ -1,49 +0,0 @@ -package keeper - -import ( - "github.com/Meta-Protocol/metacore/x/metacore/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// SetTxoutConfirmation set a specific txoutConfirmation in the store from its index -func (k Keeper) SetTxoutConfirmation(ctx sdk.Context, txoutConfirmation types.TxoutConfirmation) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutConfirmationKey)) - b := k.cdc.MustMarshalBinaryBare(&txoutConfirmation) - store.Set(types.KeyPrefix(txoutConfirmation.Index), b) -} - -// GetTxoutConfirmation returns a txoutConfirmation from its index -func (k Keeper) GetTxoutConfirmation(ctx sdk.Context, index string) (val types.TxoutConfirmation, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutConfirmationKey)) - - b := store.Get(types.KeyPrefix(index)) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshalBinaryBare(b, &val) - return val, true -} - -// RemoveTxoutConfirmation removes a txoutConfirmation from the store -func (k Keeper) RemoveTxoutConfirmation(ctx sdk.Context, index string) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutConfirmationKey)) - store.Delete(types.KeyPrefix(index)) -} - -// GetAllTxoutConfirmation returns all txoutConfirmation -func (k Keeper) GetAllTxoutConfirmation(ctx sdk.Context) (list []types.TxoutConfirmation) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TxoutConfirmationKey)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.TxoutConfirmation - k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) - list = append(list, val) - } - - return -} diff --git a/x/metacore/keeper/txout_confirmation_test.go b/x/metacore/keeper/txout_confirmation_test.go deleted file mode 100644 index 75cd15c725..0000000000 --- a/x/metacore/keeper/txout_confirmation_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package keeper - -import ( - "fmt" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/assert" - - "github.com/Meta-Protocol/metacore/x/metacore/types" -) - -func createNTxoutConfirmation(keeper *Keeper, ctx sdk.Context, n int) []types.TxoutConfirmation { - items := make([]types.TxoutConfirmation, n) - for i := range items { - items[i].Creator = "any" - items[i].Index = fmt.Sprintf("%d", i) - keeper.SetTxoutConfirmation(ctx, items[i]) - } - return items -} - -func TestTxoutConfirmationGet(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxoutConfirmation(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetTxoutConfirmation(ctx, item.Index) - assert.True(t, found) - assert.Equal(t, item, rst) - } -} -func TestTxoutConfirmationRemove(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxoutConfirmation(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveTxoutConfirmation(ctx, item.Index) - _, found := keeper.GetTxoutConfirmation(ctx, item.Index) - assert.False(t, found) - } -} - -func TestTxoutConfirmationGetAll(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxoutConfirmation(keeper, ctx, 10) - assert.Equal(t, items, keeper.GetAllTxoutConfirmation(ctx)) -} diff --git a/x/metacore/keeper/txout_test.go b/x/metacore/keeper/txout_test.go deleted file mode 100644 index 5c73550502..0000000000 --- a/x/metacore/keeper/txout_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package keeper - -import ( - "testing" - - "github.com/Meta-Protocol/metacore/x/metacore/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/assert" -) - -func createNTxout(keeper *Keeper, ctx sdk.Context, n int) []types.Txout { - items := make([]types.Txout, n) - for i := range items { - items[i].Creator = "any" - items[i].Id = keeper.AppendTxout(ctx, items[i]) - } - return items -} - -func TestTxoutGet(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxout(keeper, ctx, 10) - for _, item := range items { - assert.Equal(t, item, keeper.GetTxout(ctx, item.Id)) - } -} - -func TestTxoutExist(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxout(keeper, ctx, 10) - for _, item := range items { - assert.True(t, keeper.HasTxout(ctx, item.Id)) - } -} - -func TestTxoutRemove(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxout(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveTxout(ctx, item.Id) - assert.False(t, keeper.HasTxout(ctx, item.Id)) - } -} - -func TestTxoutGetAll(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxout(keeper, ctx, 10) - assert.Equal(t, items, keeper.GetAllTxout(ctx)) -} - -func TestTxoutCount(t *testing.T) { - keeper, ctx := setupKeeper(t) - items := createNTxout(keeper, ctx, 10) - count := uint64(len(items)) - assert.Equal(t, count, keeper.GetTxoutCount(ctx)) -} diff --git a/x/metacore/types/codec.go b/x/metacore/types/codec.go index 0020c00c60..58ba86a3f8 100644 --- a/x/metacore/types/codec.go +++ b/x/metacore/types/codec.go @@ -11,11 +11,9 @@ func RegisterCodec(cdc *codec.LegacyAmino) { // this line is used by starport scaffolding # 2 cdc.RegisterConcrete(&MsgSendVoter{}, "metacore/SendVoter", nil) - cdc.RegisterConcrete(&MsgTxoutConfirmationVoter{}, "metacore/TxoutConfirmationVoter", nil) cdc.RegisterConcrete(&MsgSetNodeKeys{}, "metacore/SetNodeKeys", nil) - cdc.RegisterConcrete(&MsgCreateTxinVoter{}, "metacore/CreateTxinVoter", nil) } @@ -24,15 +22,11 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSendVoter{}, ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgTxoutConfirmationVoter{}, - ) + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSetNodeKeys{}, ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgCreateTxinVoter{}, - ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/metacore/types/genesis.go b/x/metacore/types/genesis.go index bc56c8fd4b..a8fa34eacb 100644 --- a/x/metacore/types/genesis.go +++ b/x/metacore/types/genesis.go @@ -14,11 +14,7 @@ func DefaultGenesis() *GenesisState { // this line is used by starport scaffolding # ibc/genesistype/default // this line is used by starport scaffolding # genesis/types/default SendList: []*Send{}, - TxoutConfirmationList: []*TxoutConfirmation{}, - TxoutList: []*Txout{}, NodeAccountList: []*NodeAccount{}, - TxinVoterList: []*TxinVoter{}, - TxinList: []*Txin{}, } } @@ -37,24 +33,8 @@ func (gs GenesisState) Validate() error { } sendIndexMap[elem.Index] = true } - // Check for duplicated index in txoutConfirmation - txoutConfirmationIndexMap := make(map[string]bool) - for _, elem := range gs.TxoutConfirmationList { - if _, ok := txoutConfirmationIndexMap[elem.Index]; ok { - return fmt.Errorf("duplicated index for txoutConfirmation") - } - txoutConfirmationIndexMap[elem.Index] = true - } - // Check for duplicated ID in txout - txoutIdMap := make(map[uint64]bool) - for _, elem := range gs.TxoutList { - if _, ok := txoutIdMap[elem.Id]; ok { - return fmt.Errorf("duplicated id for txout") - } - txoutIdMap[elem.Id] = true - } // Check for duplicated index in nodeAccount nodeAccountIndexMap := make(map[string]bool) @@ -64,24 +44,7 @@ func (gs GenesisState) Validate() error { } nodeAccountIndexMap[elem.Index] = true } - // Check for duplicated index in txinVoter - txinVoterIndexMap := make(map[string]bool) - for _, elem := range gs.TxinVoterList { - if _, ok := txinVoterIndexMap[elem.Index]; ok { - return fmt.Errorf("duplicated index for txinVoter") - } - txinVoterIndexMap[elem.Index] = true - } - // Check for duplicated index in txin - txinIndexMap := make(map[string]bool) - - for _, elem := range gs.TxinList { - if _, ok := txinIndexMap[elem.Index]; ok { - return fmt.Errorf("duplicated index for txin") - } - txinIndexMap[elem.Index] = true - } return nil } diff --git a/x/metacore/types/genesis.pb.go b/x/metacore/types/genesis.pb.go index 05783594ef..96f3e70f5a 100644 --- a/x/metacore/types/genesis.pb.go +++ b/x/metacore/types/genesis.pb.go @@ -25,13 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the metacore module's genesis state. type GenesisState struct { // this line is used by starport scaffolding # genesis/proto/state - SendList []*Send `protobuf:"bytes,7,rep,name=sendList,proto3" json:"sendList,omitempty"` - TxoutConfirmationList []*TxoutConfirmation `protobuf:"bytes,6,rep,name=txoutConfirmationList,proto3" json:"txoutConfirmationList,omitempty"` - TxoutList []*Txout `protobuf:"bytes,4,rep,name=txoutList,proto3" json:"txoutList,omitempty"` - TxoutCount uint64 `protobuf:"varint,5,opt,name=txoutCount,proto3" json:"txoutCount,omitempty"` - NodeAccountList []*NodeAccount `protobuf:"bytes,3,rep,name=nodeAccountList,proto3" json:"nodeAccountList,omitempty"` - TxinVoterList []*TxinVoter `protobuf:"bytes,2,rep,name=txinVoterList,proto3" json:"txinVoterList,omitempty"` - TxinList []*Txin `protobuf:"bytes,1,rep,name=txinList,proto3" json:"txinList,omitempty"` + SendList []*Send `protobuf:"bytes,7,rep,name=sendList,proto3" json:"sendList,omitempty"` + NodeAccountList []*NodeAccount `protobuf:"bytes,3,rep,name=nodeAccountList,proto3" json:"nodeAccountList,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -74,27 +69,6 @@ func (m *GenesisState) GetSendList() []*Send { return nil } -func (m *GenesisState) GetTxoutConfirmationList() []*TxoutConfirmation { - if m != nil { - return m.TxoutConfirmationList - } - return nil -} - -func (m *GenesisState) GetTxoutList() []*Txout { - if m != nil { - return m.TxoutList - } - return nil -} - -func (m *GenesisState) GetTxoutCount() uint64 { - if m != nil { - return m.TxoutCount - } - return 0 -} - func (m *GenesisState) GetNodeAccountList() []*NodeAccount { if m != nil { return m.NodeAccountList @@ -102,20 +76,6 @@ func (m *GenesisState) GetNodeAccountList() []*NodeAccount { return nil } -func (m *GenesisState) GetTxinVoterList() []*TxinVoter { - if m != nil { - return m.TxinVoterList - } - return nil -} - -func (m *GenesisState) GetTxinList() []*Txin { - if m != nil { - return m.TxinList - } - return nil -} - func init() { proto.RegisterType((*GenesisState)(nil), "MetaProtocol.metacore.metacore.GenesisState") } @@ -123,30 +83,21 @@ func init() { func init() { proto.RegisterFile("metacore/genesis.proto", fileDescriptor_c68bd28f2e9a7fbf) } var fileDescriptor_c68bd28f2e9a7fbf = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcd, 0x4e, 0xc2, 0x40, - 0x10, 0xc7, 0xa9, 0x20, 0xea, 0xaa, 0x31, 0x59, 0xd4, 0x20, 0x26, 0x1b, 0x34, 0x9a, 0x60, 0x8c, - 0x25, 0xe2, 0x0b, 0xa8, 0x1c, 0xbc, 0xe0, 0x47, 0x16, 0xf5, 0xe0, 0x85, 0x94, 0xb2, 0x62, 0x13, - 0xd9, 0x25, 0xed, 0xd4, 0xe0, 0x1b, 0x78, 0xf4, 0xb1, 0x3c, 0x72, 0xf4, 0x68, 0xe0, 0x45, 0xcc, - 0x4e, 0xcb, 0xf2, 0x11, 0x63, 0xb9, 0x4d, 0xfe, 0x33, 0xff, 0xdf, 0xcc, 0xec, 0x2c, 0xd9, 0xee, - 0x08, 0x70, 0x5c, 0xe5, 0x8b, 0x72, 0x5b, 0x48, 0x11, 0x78, 0x81, 0xdd, 0xf5, 0x15, 0x28, 0xca, - 0xae, 0x05, 0x38, 0x77, 0x3a, 0x74, 0xd5, 0xab, 0x3d, 0x2a, 0x32, 0x41, 0x21, 0x67, 0x7c, 0x81, - 0x90, 0xad, 0xc8, 0x54, 0xd8, 0x33, 0x22, 0xf4, 0x54, 0x08, 0x0d, 0x57, 0xc9, 0x67, 0xcf, 0xef, - 0x38, 0xe0, 0x29, 0x19, 0x97, 0x6c, 0x4e, 0x97, 0xc4, 0xea, 0xae, 0x51, 0xa5, 0x6a, 0x89, 0x86, - 0xe3, 0xba, 0x2a, 0x94, 0xa3, 0xe4, 0xce, 0x84, 0xc5, 0x93, 0x8d, 0x37, 0x05, 0xc2, 0x8f, 0x53, - 0xb9, 0xa9, 0x54, 0x24, 0xee, 0x7f, 0x64, 0xc8, 0xda, 0x55, 0xb4, 0x4c, 0x1d, 0x1c, 0x10, 0xf4, - 0x9c, 0x2c, 0xeb, 0x21, 0x6b, 0x5e, 0x00, 0xf9, 0xa5, 0x62, 0xba, 0xb4, 0x5a, 0x39, 0xb0, 0xff, - 0x5f, 0xcf, 0xae, 0x0b, 0xd9, 0xe2, 0xc6, 0x45, 0xdb, 0x64, 0x0b, 0xc7, 0xad, 0x4e, 0x2c, 0x84, - 0xb8, 0x2c, 0xe2, 0x4e, 0x93, 0x70, 0xf7, 0xb3, 0x66, 0xfe, 0x37, 0x8f, 0x56, 0xc9, 0x0a, 0x26, - 0x10, 0x9e, 0x41, 0xf8, 0xe1, 0x5c, 0x70, 0x3e, 0xf6, 0x51, 0x46, 0x48, 0x4c, 0x0f, 0x25, 0xe4, - 0x17, 0x8b, 0x56, 0x29, 0xc3, 0x27, 0x14, 0xfa, 0x40, 0x36, 0xf4, 0x33, 0x5f, 0x44, 0xaf, 0x8c, - 0xad, 0xd2, 0xd8, 0xea, 0x38, 0xa9, 0xd5, 0xcd, 0xd8, 0xc6, 0x67, 0x19, 0xf4, 0x96, 0xac, 0xeb, - 0x2b, 0x3c, 0xea, 0xfb, 0x20, 0x74, 0x01, 0xa1, 0x47, 0xc9, 0xf3, 0xc7, 0x26, 0x3e, 0xed, 0xd7, - 0x77, 0xd3, 0x02, 0xb2, 0xac, 0xf9, 0xee, 0xa6, 0x59, 0xdc, 0xb8, 0x2e, 0x6b, 0x5f, 0x03, 0x66, - 0xf5, 0x07, 0xcc, 0xfa, 0x19, 0x30, 0xeb, 0x73, 0xc8, 0x52, 0xfd, 0x21, 0x4b, 0x7d, 0x0f, 0x59, - 0xea, 0xa9, 0xd2, 0xf6, 0xe0, 0x25, 0x6c, 0xda, 0xae, 0xea, 0x94, 0x35, 0xf3, 0x64, 0x04, 0x2d, - 0x9b, 0x2f, 0xd5, 0x1b, 0x87, 0xf0, 0xde, 0x15, 0x41, 0x33, 0x8b, 0xff, 0xeb, 0xec, 0x37, 0x00, - 0x00, 0xff, 0xff, 0x13, 0x34, 0x55, 0xa6, 0x34, 0x03, 0x00, 0x00, + // 221 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcb, 0x4d, 0x2d, 0x49, + 0x4c, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x92, 0xf3, 0x4d, 0x2d, 0x49, 0x0c, 0x00, 0x31, 0x93, 0xf3, 0x73, 0xf4, 0x60, + 0x8a, 0xe0, 0x0c, 0x29, 0x61, 0xb8, 0xbe, 0xe2, 0xd4, 0xbc, 0x14, 0x88, 0x26, 0x29, 0x69, 0xb8, + 0x60, 0x5e, 0x7e, 0x4a, 0x6a, 0x7c, 0x62, 0x72, 0x72, 0x7e, 0x69, 0x5e, 0x09, 0x44, 0x52, 0x69, + 0x39, 0x23, 0x17, 0x8f, 0x3b, 0xc4, 0x8e, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x07, 0x2e, 0x0e, + 0x90, 0x5e, 0x9f, 0xcc, 0xe2, 0x12, 0x09, 0x76, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x15, 0x3d, 0xfc, + 0xb6, 0xea, 0x05, 0xa7, 0xe6, 0xa5, 0x04, 0xc1, 0x75, 0x09, 0x85, 0x72, 0xf1, 0x83, 0x2c, 0x72, + 0x84, 0xd8, 0x03, 0x36, 0x88, 0x19, 0x6c, 0x90, 0x36, 0x21, 0x83, 0xfc, 0x10, 0xda, 0x82, 0xd0, + 0xcd, 0x70, 0xf2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, + 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa3, 0xf4, + 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x90, 0x0d, 0xba, 0x30, 0x2b, 0xf4, + 0xe1, 0x3e, 0xaf, 0x40, 0x30, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xde, 0x37, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xfb, 0xa4, 0xfb, 0x6a, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -183,39 +134,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x3a } } - if len(m.TxoutConfirmationList) > 0 { - for iNdEx := len(m.TxoutConfirmationList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TxoutConfirmationList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.TxoutCount != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.TxoutCount)) - i-- - dAtA[i] = 0x28 - } - if len(m.TxoutList) > 0 { - for iNdEx := len(m.TxoutList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TxoutList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } if len(m.NodeAccountList) > 0 { for iNdEx := len(m.NodeAccountList) - 1; iNdEx >= 0; iNdEx-- { { @@ -230,34 +148,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x1a } } - if len(m.TxinVoterList) > 0 { - for iNdEx := len(m.TxinVoterList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TxinVoterList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.TxinList) > 0 { - for iNdEx := len(m.TxinList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TxinList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } @@ -278,39 +168,12 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - if len(m.TxinList) > 0 { - for _, e := range m.TxinList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.TxinVoterList) > 0 { - for _, e := range m.TxinVoterList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } if len(m.NodeAccountList) > 0 { for _, e := range m.NodeAccountList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.TxoutList) > 0 { - for _, e := range m.TxoutList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.TxoutCount != 0 { - n += 1 + sovGenesis(uint64(m.TxoutCount)) - } - if len(m.TxoutConfirmationList) > 0 { - for _, e := range m.TxoutConfirmationList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } if len(m.SendList) > 0 { for _, e := range m.SendList { l = e.Size() @@ -355,74 +218,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxinList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxinList = append(m.TxinList, &Txin{}) - if err := m.TxinList[len(m.TxinList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxinVoterList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxinVoterList = append(m.TxinVoterList, &TxinVoter{}) - if err := m.TxinVoterList[len(m.TxinVoterList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NodeAccountList", wireType) @@ -457,93 +252,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxoutList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxoutList = append(m.TxoutList, &Txout{}) - if err := m.TxoutList[len(m.TxoutList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TxoutCount", wireType) - } - m.TxoutCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TxoutCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxoutConfirmationList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxoutConfirmationList = append(m.TxoutConfirmationList, &TxoutConfirmation{}) - if err := m.TxoutConfirmationList[len(m.TxoutConfirmationList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SendList", wireType) diff --git a/x/metacore/types/message_txout_confirmation_voter.go b/x/metacore/types/message_txout_confirmation_voter.go deleted file mode 100644 index 37ca8cf157..0000000000 --- a/x/metacore/types/message_txout_confirmation_voter.go +++ /dev/null @@ -1,50 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -var _ sdk.Msg = &MsgTxoutConfirmationVoter{} - -func NewMsgTxoutConfirmationVoter(creator string, txoutId uint64, txHash string, mMint uint64, destinationAsset string, destinationAmount uint64, toAddress string, blockHeight uint64) *MsgTxoutConfirmationVoter { - return &MsgTxoutConfirmationVoter{ - Creator: creator, - TxoutId: txoutId, - TxHash: txHash, - MMint: mMint, - DestinationAsset: destinationAsset, - DestinationAmount: destinationAmount, - ToAddress: toAddress, - BlockHeight: blockHeight, - } -} - -func (msg *MsgTxoutConfirmationVoter) Route() string { - return RouterKey -} - -func (msg *MsgTxoutConfirmationVoter) Type() string { - return "TxoutConfirmationVoter" -} - -func (msg *MsgTxoutConfirmationVoter) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgTxoutConfirmationVoter) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgTxoutConfirmationVoter) 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/metacore/types/messages_txin_voter.go b/x/metacore/types/messages_txin_voter.go deleted file mode 100644 index e73f86383b..0000000000 --- a/x/metacore/types/messages_txin_voter.go +++ /dev/null @@ -1,58 +0,0 @@ -package types - -import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -var _ sdk.Msg = &MsgCreateTxinVoter{} - -func NewMsgCreateTxinVoter(creator string, txHash string, sourceAsset string, sourceAmount uint64, mBurnt uint64, destinationAsset string, fromAddress string, toAddress string, blockHeight uint64) *MsgCreateTxinVoter { - return &MsgCreateTxinVoter{ - Creator: creator, - Index: fmt.Sprintf("%s-%s", txHash, creator), - TxHash: txHash, - SourceAsset: sourceAsset, - SourceAmount: sourceAmount, - MBurnt: mBurnt, - DestinationAsset: destinationAsset, - FromAddress: fromAddress, - ToAddress: toAddress, - BlockHeight: blockHeight, - } -} - -func (msg *MsgCreateTxinVoter) Route() string { - return RouterKey -} - -func (msg *MsgCreateTxinVoter) Type() string { - return "CreateTxinVoter" -} - -func (msg *MsgCreateTxinVoter) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgCreateTxinVoter) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgCreateTxinVoter) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - wantedIndex := fmt.Sprintf("%s-%s", msg.TxHash, msg.Creator) - if msg.Index != wantedIndex { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "msg.Index must be (%s), instead got (%s)", wantedIndex, msg.Index) - } - // TODO: Validate the addresses, amounts, and asset format - return nil -} diff --git a/x/metacore/types/query.pb.go b/x/metacore/types/query.pb.go index 3a420760dc..44915611aa 100644 --- a/x/metacore/types/query.pb.go +++ b/x/metacore/types/query.pb.go @@ -214,374 +214,6 @@ func (m *QueryAllSendResponse) GetPagination() *query.PageResponse { return nil } -type QueryGetTxoutConfirmationRequest struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` -} - -func (m *QueryGetTxoutConfirmationRequest) Reset() { *m = QueryGetTxoutConfirmationRequest{} } -func (m *QueryGetTxoutConfirmationRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxoutConfirmationRequest) ProtoMessage() {} -func (*QueryGetTxoutConfirmationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{4} -} -func (m *QueryGetTxoutConfirmationRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTxoutConfirmationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTxoutConfirmationRequest.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 *QueryGetTxoutConfirmationRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxoutConfirmationRequest.Merge(m, src) -} -func (m *QueryGetTxoutConfirmationRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTxoutConfirmationRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxoutConfirmationRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTxoutConfirmationRequest proto.InternalMessageInfo - -func (m *QueryGetTxoutConfirmationRequest) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -type QueryGetTxoutConfirmationResponse struct { - TxoutConfirmation *TxoutConfirmation `protobuf:"bytes,1,opt,name=TxoutConfirmation,proto3" json:"TxoutConfirmation,omitempty"` -} - -func (m *QueryGetTxoutConfirmationResponse) Reset() { *m = QueryGetTxoutConfirmationResponse{} } -func (m *QueryGetTxoutConfirmationResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxoutConfirmationResponse) ProtoMessage() {} -func (*QueryGetTxoutConfirmationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{5} -} -func (m *QueryGetTxoutConfirmationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTxoutConfirmationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTxoutConfirmationResponse.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 *QueryGetTxoutConfirmationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxoutConfirmationResponse.Merge(m, src) -} -func (m *QueryGetTxoutConfirmationResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTxoutConfirmationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxoutConfirmationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTxoutConfirmationResponse proto.InternalMessageInfo - -func (m *QueryGetTxoutConfirmationResponse) GetTxoutConfirmation() *TxoutConfirmation { - if m != nil { - return m.TxoutConfirmation - } - return nil -} - -type QueryAllTxoutConfirmationRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllTxoutConfirmationRequest) Reset() { *m = QueryAllTxoutConfirmationRequest{} } -func (m *QueryAllTxoutConfirmationRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxoutConfirmationRequest) ProtoMessage() {} -func (*QueryAllTxoutConfirmationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{6} -} -func (m *QueryAllTxoutConfirmationRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllTxoutConfirmationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllTxoutConfirmationRequest.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 *QueryAllTxoutConfirmationRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxoutConfirmationRequest.Merge(m, src) -} -func (m *QueryAllTxoutConfirmationRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllTxoutConfirmationRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxoutConfirmationRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllTxoutConfirmationRequest proto.InternalMessageInfo - -func (m *QueryAllTxoutConfirmationRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllTxoutConfirmationResponse struct { - TxoutConfirmation []*TxoutConfirmation `protobuf:"bytes,1,rep,name=TxoutConfirmation,proto3" json:"TxoutConfirmation,omitempty"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllTxoutConfirmationResponse) Reset() { *m = QueryAllTxoutConfirmationResponse{} } -func (m *QueryAllTxoutConfirmationResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxoutConfirmationResponse) ProtoMessage() {} -func (*QueryAllTxoutConfirmationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{7} -} -func (m *QueryAllTxoutConfirmationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllTxoutConfirmationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllTxoutConfirmationResponse.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 *QueryAllTxoutConfirmationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxoutConfirmationResponse.Merge(m, src) -} -func (m *QueryAllTxoutConfirmationResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllTxoutConfirmationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxoutConfirmationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllTxoutConfirmationResponse proto.InternalMessageInfo - -func (m *QueryAllTxoutConfirmationResponse) GetTxoutConfirmation() []*TxoutConfirmation { - if m != nil { - return m.TxoutConfirmation - } - return nil -} - -func (m *QueryAllTxoutConfirmationResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryGetTxoutRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *QueryGetTxoutRequest) Reset() { *m = QueryGetTxoutRequest{} } -func (m *QueryGetTxoutRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxoutRequest) ProtoMessage() {} -func (*QueryGetTxoutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{8} -} -func (m *QueryGetTxoutRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTxoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTxoutRequest.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 *QueryGetTxoutRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxoutRequest.Merge(m, src) -} -func (m *QueryGetTxoutRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTxoutRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxoutRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTxoutRequest proto.InternalMessageInfo - -func (m *QueryGetTxoutRequest) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -type QueryGetTxoutResponse struct { - Txout *Txout `protobuf:"bytes,1,opt,name=Txout,proto3" json:"Txout,omitempty"` -} - -func (m *QueryGetTxoutResponse) Reset() { *m = QueryGetTxoutResponse{} } -func (m *QueryGetTxoutResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxoutResponse) ProtoMessage() {} -func (*QueryGetTxoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{9} -} -func (m *QueryGetTxoutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTxoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTxoutResponse.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 *QueryGetTxoutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxoutResponse.Merge(m, src) -} -func (m *QueryGetTxoutResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTxoutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxoutResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTxoutResponse proto.InternalMessageInfo - -func (m *QueryGetTxoutResponse) GetTxout() *Txout { - if m != nil { - return m.Txout - } - return nil -} - -type QueryAllTxoutRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllTxoutRequest) Reset() { *m = QueryAllTxoutRequest{} } -func (m *QueryAllTxoutRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxoutRequest) ProtoMessage() {} -func (*QueryAllTxoutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{10} -} -func (m *QueryAllTxoutRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllTxoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllTxoutRequest.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 *QueryAllTxoutRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxoutRequest.Merge(m, src) -} -func (m *QueryAllTxoutRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllTxoutRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxoutRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllTxoutRequest proto.InternalMessageInfo - -func (m *QueryAllTxoutRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllTxoutResponse struct { - Txout []*Txout `protobuf:"bytes,1,rep,name=Txout,proto3" json:"Txout,omitempty"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllTxoutResponse) Reset() { *m = QueryAllTxoutResponse{} } -func (m *QueryAllTxoutResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxoutResponse) ProtoMessage() {} -func (*QueryAllTxoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{11} -} -func (m *QueryAllTxoutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllTxoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllTxoutResponse.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 *QueryAllTxoutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxoutResponse.Merge(m, src) -} -func (m *QueryAllTxoutResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllTxoutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxoutResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllTxoutResponse proto.InternalMessageInfo - -func (m *QueryAllTxoutResponse) GetTxout() []*Txout { - if m != nil { - return m.Txout - } - return nil -} - -func (m *QueryAllTxoutResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - type QueryGetNodeAccountRequest struct { Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` } @@ -590,7 +222,7 @@ func (m *QueryGetNodeAccountRequest) Reset() { *m = QueryGetNodeAccountR func (m *QueryGetNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountRequest) ProtoMessage() {} func (*QueryGetNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{12} + return fileDescriptor_dc2a1267d2da6377, []int{4} } func (m *QueryGetNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -634,7 +266,7 @@ func (m *QueryGetNodeAccountResponse) Reset() { *m = QueryGetNodeAccount func (m *QueryGetNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountResponse) ProtoMessage() {} func (*QueryGetNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{13} + return fileDescriptor_dc2a1267d2da6377, []int{5} } func (m *QueryGetNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -678,7 +310,7 @@ func (m *QueryAllNodeAccountRequest) Reset() { *m = QueryAllNodeAccountR func (m *QueryAllNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountRequest) ProtoMessage() {} func (*QueryAllNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{14} + return fileDescriptor_dc2a1267d2da6377, []int{6} } func (m *QueryAllNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -723,7 +355,7 @@ func (m *QueryAllNodeAccountResponse) Reset() { *m = QueryAllNodeAccount func (m *QueryAllNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountResponse) ProtoMessage() {} func (*QueryAllNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{15} + return fileDescriptor_dc2a1267d2da6377, []int{7} } func (m *QueryAllNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -773,7 +405,7 @@ func (m *QueryLastMetaHeightRequest) Reset() { *m = QueryLastMetaHeightR func (m *QueryLastMetaHeightRequest) String() string { return proto.CompactTextString(m) } func (*QueryLastMetaHeightRequest) ProtoMessage() {} func (*QueryLastMetaHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{16} + return fileDescriptor_dc2a1267d2da6377, []int{8} } func (m *QueryLastMetaHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -810,7 +442,7 @@ func (m *QueryLastMetaHeightResponse) Reset() { *m = QueryLastMetaHeight func (m *QueryLastMetaHeightResponse) String() string { return proto.CompactTextString(m) } func (*QueryLastMetaHeightResponse) ProtoMessage() {} func (*QueryLastMetaHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{17} + return fileDescriptor_dc2a1267d2da6377, []int{9} } func (m *QueryLastMetaHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -846,474 +478,61 @@ func (m *QueryLastMetaHeightResponse) GetHeight() uint64 { return 0 } -type QueryGetTxinVoterRequest struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +func init() { + proto.RegisterType((*QueryGetSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetSendRequest") + proto.RegisterType((*QueryGetSendResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetSendResponse") + proto.RegisterType((*QueryAllSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllSendRequest") + proto.RegisterType((*QueryAllSendResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllSendResponse") + proto.RegisterType((*QueryGetNodeAccountRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetNodeAccountRequest") + proto.RegisterType((*QueryGetNodeAccountResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetNodeAccountResponse") + proto.RegisterType((*QueryAllNodeAccountRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllNodeAccountRequest") + proto.RegisterType((*QueryAllNodeAccountResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllNodeAccountResponse") + proto.RegisterType((*QueryLastMetaHeightRequest)(nil), "MetaProtocol.metacore.metacore.QueryLastMetaHeightRequest") + proto.RegisterType((*QueryLastMetaHeightResponse)(nil), "MetaProtocol.metacore.metacore.QueryLastMetaHeightResponse") } -func (m *QueryGetTxinVoterRequest) Reset() { *m = QueryGetTxinVoterRequest{} } -func (m *QueryGetTxinVoterRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxinVoterRequest) ProtoMessage() {} -func (*QueryGetTxinVoterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{18} -} -func (m *QueryGetTxinVoterRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTxinVoterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTxinVoterRequest.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 *QueryGetTxinVoterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxinVoterRequest.Merge(m, src) -} -func (m *QueryGetTxinVoterRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTxinVoterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxinVoterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTxinVoterRequest proto.InternalMessageInfo - -func (m *QueryGetTxinVoterRequest) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -type QueryGetTxinVoterResponse struct { - TxinVoter *TxinVoter `protobuf:"bytes,1,opt,name=TxinVoter,proto3" json:"TxinVoter,omitempty"` -} - -func (m *QueryGetTxinVoterResponse) Reset() { *m = QueryGetTxinVoterResponse{} } -func (m *QueryGetTxinVoterResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxinVoterResponse) ProtoMessage() {} -func (*QueryGetTxinVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{19} -} -func (m *QueryGetTxinVoterResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTxinVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTxinVoterResponse.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 *QueryGetTxinVoterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxinVoterResponse.Merge(m, src) -} -func (m *QueryGetTxinVoterResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTxinVoterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxinVoterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTxinVoterResponse proto.InternalMessageInfo - -func (m *QueryGetTxinVoterResponse) GetTxinVoter() *TxinVoter { - if m != nil { - return m.TxinVoter - } - return nil -} - -type QueryAllTxinVoterRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllTxinVoterRequest) Reset() { *m = QueryAllTxinVoterRequest{} } -func (m *QueryAllTxinVoterRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxinVoterRequest) ProtoMessage() {} -func (*QueryAllTxinVoterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{20} -} -func (m *QueryAllTxinVoterRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllTxinVoterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllTxinVoterRequest.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 *QueryAllTxinVoterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxinVoterRequest.Merge(m, src) -} -func (m *QueryAllTxinVoterRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllTxinVoterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxinVoterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllTxinVoterRequest proto.InternalMessageInfo - -func (m *QueryAllTxinVoterRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllTxinVoterResponse struct { - TxinVoter []*TxinVoter `protobuf:"bytes,1,rep,name=TxinVoter,proto3" json:"TxinVoter,omitempty"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllTxinVoterResponse) Reset() { *m = QueryAllTxinVoterResponse{} } -func (m *QueryAllTxinVoterResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxinVoterResponse) ProtoMessage() {} -func (*QueryAllTxinVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{21} -} -func (m *QueryAllTxinVoterResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllTxinVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllTxinVoterResponse.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 *QueryAllTxinVoterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxinVoterResponse.Merge(m, src) -} -func (m *QueryAllTxinVoterResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllTxinVoterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxinVoterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllTxinVoterResponse proto.InternalMessageInfo - -func (m *QueryAllTxinVoterResponse) GetTxinVoter() []*TxinVoter { - if m != nil { - return m.TxinVoter - } - return nil -} - -func (m *QueryAllTxinVoterResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryGetTxinRequest struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` -} - -func (m *QueryGetTxinRequest) Reset() { *m = QueryGetTxinRequest{} } -func (m *QueryGetTxinRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxinRequest) ProtoMessage() {} -func (*QueryGetTxinRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{22} -} -func (m *QueryGetTxinRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTxinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTxinRequest.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 *QueryGetTxinRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxinRequest.Merge(m, src) -} -func (m *QueryGetTxinRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTxinRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxinRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTxinRequest proto.InternalMessageInfo - -func (m *QueryGetTxinRequest) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -type QueryGetTxinResponse struct { - Txin *Txin `protobuf:"bytes,1,opt,name=Txin,proto3" json:"Txin,omitempty"` -} - -func (m *QueryGetTxinResponse) Reset() { *m = QueryGetTxinResponse{} } -func (m *QueryGetTxinResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxinResponse) ProtoMessage() {} -func (*QueryGetTxinResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{23} -} -func (m *QueryGetTxinResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTxinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTxinResponse.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 *QueryGetTxinResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxinResponse.Merge(m, src) -} -func (m *QueryGetTxinResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTxinResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxinResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTxinResponse proto.InternalMessageInfo - -func (m *QueryGetTxinResponse) GetTxin() *Txin { - if m != nil { - return m.Txin - } - return nil -} - -type QueryAllTxinRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllTxinRequest) Reset() { *m = QueryAllTxinRequest{} } -func (m *QueryAllTxinRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxinRequest) ProtoMessage() {} -func (*QueryAllTxinRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{24} -} -func (m *QueryAllTxinRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllTxinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllTxinRequest.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 *QueryAllTxinRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxinRequest.Merge(m, src) -} -func (m *QueryAllTxinRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllTxinRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxinRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllTxinRequest proto.InternalMessageInfo - -func (m *QueryAllTxinRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllTxinResponse struct { - Txin []*Txin `protobuf:"bytes,1,rep,name=Txin,proto3" json:"Txin,omitempty"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllTxinResponse) Reset() { *m = QueryAllTxinResponse{} } -func (m *QueryAllTxinResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxinResponse) ProtoMessage() {} -func (*QueryAllTxinResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{25} -} -func (m *QueryAllTxinResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllTxinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllTxinResponse.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 *QueryAllTxinResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxinResponse.Merge(m, src) -} -func (m *QueryAllTxinResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllTxinResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxinResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllTxinResponse proto.InternalMessageInfo - -func (m *QueryAllTxinResponse) GetTxin() []*Txin { - if m != nil { - return m.Txin - } - return nil -} - -func (m *QueryAllTxinResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryGetSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetSendRequest") - proto.RegisterType((*QueryGetSendResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetSendResponse") - proto.RegisterType((*QueryAllSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllSendRequest") - proto.RegisterType((*QueryAllSendResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllSendResponse") - proto.RegisterType((*QueryGetTxoutConfirmationRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetTxoutConfirmationRequest") - proto.RegisterType((*QueryGetTxoutConfirmationResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetTxoutConfirmationResponse") - proto.RegisterType((*QueryAllTxoutConfirmationRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllTxoutConfirmationRequest") - proto.RegisterType((*QueryAllTxoutConfirmationResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllTxoutConfirmationResponse") - proto.RegisterType((*QueryGetTxoutRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetTxoutRequest") - proto.RegisterType((*QueryGetTxoutResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetTxoutResponse") - proto.RegisterType((*QueryAllTxoutRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllTxoutRequest") - proto.RegisterType((*QueryAllTxoutResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllTxoutResponse") - proto.RegisterType((*QueryGetNodeAccountRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetNodeAccountRequest") - proto.RegisterType((*QueryGetNodeAccountResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetNodeAccountResponse") - proto.RegisterType((*QueryAllNodeAccountRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllNodeAccountRequest") - proto.RegisterType((*QueryAllNodeAccountResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllNodeAccountResponse") - proto.RegisterType((*QueryLastMetaHeightRequest)(nil), "MetaProtocol.metacore.metacore.QueryLastMetaHeightRequest") - proto.RegisterType((*QueryLastMetaHeightResponse)(nil), "MetaProtocol.metacore.metacore.QueryLastMetaHeightResponse") - proto.RegisterType((*QueryGetTxinVoterRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetTxinVoterRequest") - proto.RegisterType((*QueryGetTxinVoterResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetTxinVoterResponse") - proto.RegisterType((*QueryAllTxinVoterRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllTxinVoterRequest") - proto.RegisterType((*QueryAllTxinVoterResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllTxinVoterResponse") - proto.RegisterType((*QueryGetTxinRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetTxinRequest") - proto.RegisterType((*QueryGetTxinResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetTxinResponse") - proto.RegisterType((*QueryAllTxinRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllTxinRequest") - proto.RegisterType((*QueryAllTxinResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllTxinResponse") -} - -func init() { proto.RegisterFile("metacore/query.proto", fileDescriptor_dc2a1267d2da6377) } - -var fileDescriptor_dc2a1267d2da6377 = []byte{ - // 1064 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, - 0x18, 0xcd, 0xc4, 0x4d, 0xa1, 0x53, 0x14, 0x89, 0xa9, 0x41, 0xad, 0x5b, 0x59, 0xed, 0x88, 0xa6, - 0xa5, 0x69, 0x76, 0x89, 0xe3, 0x40, 0x48, 0x7b, 0xa8, 0x8b, 0x44, 0x38, 0xb4, 0x28, 0x98, 0x8a, - 0x03, 0x12, 0x44, 0x6b, 0xef, 0xe0, 0x2e, 0xda, 0xec, 0xb8, 0xde, 0x75, 0x95, 0xaa, 0xea, 0x05, - 0xf1, 0x07, 0x20, 0x71, 0xe2, 0xc0, 0x89, 0x03, 0x70, 0xe0, 0x88, 0xb8, 0x20, 0x21, 0x21, 0x0e, - 0x5c, 0x90, 0x2a, 0x71, 0x80, 0x03, 0x07, 0x94, 0xf0, 0x7f, 0x80, 0x66, 0xf6, 0xdb, 0xf5, 0xfe, - 0xb2, 0x77, 0xc6, 0x59, 0x6e, 0xde, 0xd9, 0x79, 0xdf, 0xf7, 0xde, 0xfb, 0x66, 0x36, 0x4f, 0xc1, - 0xf5, 0x7d, 0x16, 0x58, 0x7d, 0x3e, 0x62, 0xe6, 0x83, 0x31, 0x1b, 0x3d, 0x32, 0x86, 0x23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f, 0x2b, 0x75, 0x90, 0x28, - 0xf6, 0x68, 0xc8, 0xfc, 0xde, 0x49, 0xf9, 0x6f, 0xc0, 0x8d, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x66, 0x04, 0x66, 0xda, 0x23, 0x15, 0x00, 0x00, +func init() { proto.RegisterFile("metacore/query.proto", fileDescriptor_dc2a1267d2da6377) } + +var fileDescriptor_dc2a1267d2da6377 = []byte{ + // 608 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6b, 0x13, 0x41, + 0x1c, 0xcd, 0xf4, 0x2f, 0x4e, 0xa1, 0x87, 0x69, 0x10, 0x49, 0xcb, 0x22, 0x8b, 0x5a, 0xb1, 0x66, + 0x87, 0xa4, 0xa9, 0x4a, 0xf5, 0x12, 0x0f, 0xd6, 0x43, 0x2b, 0x31, 0xde, 0x04, 0x91, 0xc9, 0xee, + 0xb0, 0x5d, 0xd8, 0xcc, 0xa4, 0x99, 0x89, 0xb4, 0x88, 0x17, 0x3f, 0x81, 0xe0, 0xc9, 0xb3, 0x20, + 0x7e, 0x01, 0xcf, 0x82, 0x78, 0xf0, 0x58, 0xf0, 0xe2, 0x51, 0x12, 0x3f, 0x88, 0xec, 0xcc, 0x64, + 0xb3, 0x9b, 0x6e, 0x9b, 0x4d, 0xdb, 0xdb, 0xcc, 0xe4, 0xf7, 0xde, 0xef, 0xbd, 0x37, 0xf3, 0xdb, + 0xc0, 0x62, 0x9b, 0x4a, 0xe2, 0xf2, 0x2e, 0xc5, 0x07, 0x3d, 0xda, 0x3d, 0x72, 0x3a, 0x5d, 0x2e, + 0x39, 0xb2, 0xf6, 0xa8, 0x24, 0x8d, 0x68, 0xe9, 0xf2, 0xd0, 0x19, 0x96, 0xc4, 0x8b, 0xd2, 0x9a, + 0xcf, 0xb9, 0x1f, 0x52, 0x4c, 0x3a, 0x01, 0x26, 0x8c,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x35, 0xca, 0x7c, 0x3b, 0x6f, 0x7c, 0xe7, 0x76, 0x92, 0x3d, 0x9a, + 0x76, 0x4d, 0x39, 0x71, 0xd0, 0xdd, 0x69, 0x9c, 0xa0, 0x1f, 0x00, 0x2e, 0xa7, 0xc7, 0x22, 0xa7, + 0x83, 0xcc, 0x49, 0xcb, 0xe9, 0x20, 0x7b, 0x0e, 0xed, 0xfb, 0xca, 0x41, 0x05, 0xe1, 0x89, 0x0e, + 0xc2, 0x14, 0xc1, 0xe3, 0xdd, 0x5f, 0x7d, 0x0b, 0x1c, 0xf7, 0x2d, 0xf0, 0xb7, 0x6f, 0x81, 0x0f, + 0x03, 0xab, 0x70, 0x3c, 0xb0, 0x0a, 0x7f, 0x06, 0x56, 0xe1, 0x65, 0xd5, 0x0f, 0xe4, 0x7e, 0xaf, + 0xe5, 0xb8, 0xbc, 0x7d, 0x1a, 0xe9, 0xe1, 0x68, 0x29, 0x8f, 0x3a, 0x54, 0xb4, 0x16, 0xd4, 0x9f, + 0xf1, 0xe6, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xa7, 0xd4, 0xef, 0x40, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1332,28 +551,12 @@ type QueryClient interface { Send(ctx context.Context, in *QueryGetSendRequest, opts ...grpc.CallOption) (*QueryGetSendResponse, error) // Queries a list of send items. SendAll(ctx context.Context, in *QueryAllSendRequest, opts ...grpc.CallOption) (*QueryAllSendResponse, error) - // Queries a txoutConfirmation by index. - TxoutConfirmation(ctx context.Context, in *QueryGetTxoutConfirmationRequest, opts ...grpc.CallOption) (*QueryGetTxoutConfirmationResponse, error) - // Queries a list of txoutConfirmation items. - TxoutConfirmationAll(ctx context.Context, in *QueryAllTxoutConfirmationRequest, opts ...grpc.CallOption) (*QueryAllTxoutConfirmationResponse, error) - // Queries a txout by id. - Txout(ctx context.Context, in *QueryGetTxoutRequest, opts ...grpc.CallOption) (*QueryGetTxoutResponse, error) - // Queries a list of txout items. - TxoutAll(ctx context.Context, in *QueryAllTxoutRequest, opts ...grpc.CallOption) (*QueryAllTxoutResponse, error) // Queries a nodeAccount by index. NodeAccount(ctx context.Context, in *QueryGetNodeAccountRequest, opts ...grpc.CallOption) (*QueryGetNodeAccountResponse, error) // Queries a list of nodeAccount items. NodeAccountAll(ctx context.Context, in *QueryAllNodeAccountRequest, opts ...grpc.CallOption) (*QueryAllNodeAccountResponse, error) // Queries a list of lastMetaHeight items. LastMetaHeight(ctx context.Context, in *QueryLastMetaHeightRequest, opts ...grpc.CallOption) (*QueryLastMetaHeightResponse, error) - // Queries a txinVoter by index. - TxinVoter(ctx context.Context, in *QueryGetTxinVoterRequest, opts ...grpc.CallOption) (*QueryGetTxinVoterResponse, error) - // Queries a list of txinVoter items. - TxinVoterAll(ctx context.Context, in *QueryAllTxinVoterRequest, opts ...grpc.CallOption) (*QueryAllTxinVoterResponse, error) - // Queries a txin by index. - Txin(ctx context.Context, in *QueryGetTxinRequest, opts ...grpc.CallOption) (*QueryGetTxinResponse, error) - // Queries a list of txin items. - TxinAll(ctx context.Context, in *QueryAllTxinRequest, opts ...grpc.CallOption) (*QueryAllTxinResponse, error) } type queryClient struct { @@ -1382,99 +585,27 @@ func (c *queryClient) SendAll(ctx context.Context, in *QueryAllSendRequest, opts return out, nil } -func (c *queryClient) TxoutConfirmation(ctx context.Context, in *QueryGetTxoutConfirmationRequest, opts ...grpc.CallOption) (*QueryGetTxoutConfirmationResponse, error) { - out := new(QueryGetTxoutConfirmationResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/TxoutConfirmation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TxoutConfirmationAll(ctx context.Context, in *QueryAllTxoutConfirmationRequest, opts ...grpc.CallOption) (*QueryAllTxoutConfirmationResponse, error) { - out := new(QueryAllTxoutConfirmationResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/TxoutConfirmationAll", in, out, opts...) +func (c *queryClient) NodeAccount(ctx context.Context, in *QueryGetNodeAccountRequest, opts ...grpc.CallOption) (*QueryGetNodeAccountResponse, error) { + out := new(QueryGetNodeAccountResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/NodeAccount", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Txout(ctx context.Context, in *QueryGetTxoutRequest, opts ...grpc.CallOption) (*QueryGetTxoutResponse, error) { - out := new(QueryGetTxoutResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/Txout", in, out, opts...) +func (c *queryClient) NodeAccountAll(ctx context.Context, in *QueryAllNodeAccountRequest, opts ...grpc.CallOption) (*QueryAllNodeAccountResponse, error) { + out := new(QueryAllNodeAccountResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/NodeAccountAll", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) TxoutAll(ctx context.Context, in *QueryAllTxoutRequest, opts ...grpc.CallOption) (*QueryAllTxoutResponse, error) { - out := new(QueryAllTxoutResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/TxoutAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) NodeAccount(ctx context.Context, in *QueryGetNodeAccountRequest, opts ...grpc.CallOption) (*QueryGetNodeAccountResponse, error) { - out := new(QueryGetNodeAccountResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/NodeAccount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) NodeAccountAll(ctx context.Context, in *QueryAllNodeAccountRequest, opts ...grpc.CallOption) (*QueryAllNodeAccountResponse, error) { - out := new(QueryAllNodeAccountResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/NodeAccountAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) LastMetaHeight(ctx context.Context, in *QueryLastMetaHeightRequest, opts ...grpc.CallOption) (*QueryLastMetaHeightResponse, error) { - out := new(QueryLastMetaHeightResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/LastMetaHeight", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TxinVoter(ctx context.Context, in *QueryGetTxinVoterRequest, opts ...grpc.CallOption) (*QueryGetTxinVoterResponse, error) { - out := new(QueryGetTxinVoterResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/TxinVoter", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TxinVoterAll(ctx context.Context, in *QueryAllTxinVoterRequest, opts ...grpc.CallOption) (*QueryAllTxinVoterResponse, error) { - out := new(QueryAllTxinVoterResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/TxinVoterAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Txin(ctx context.Context, in *QueryGetTxinRequest, opts ...grpc.CallOption) (*QueryGetTxinResponse, error) { - out := new(QueryGetTxinResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/Txin", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TxinAll(ctx context.Context, in *QueryAllTxinRequest, opts ...grpc.CallOption) (*QueryAllTxinResponse, error) { - out := new(QueryAllTxinResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/TxinAll", in, out, opts...) +func (c *queryClient) LastMetaHeight(ctx context.Context, in *QueryLastMetaHeightRequest, opts ...grpc.CallOption) (*QueryLastMetaHeightResponse, error) { + out := new(QueryLastMetaHeightResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/LastMetaHeight", in, out, opts...) if err != nil { return nil, err } @@ -1487,28 +618,12 @@ type QueryServer interface { Send(context.Context, *QueryGetSendRequest) (*QueryGetSendResponse, error) // Queries a list of send items. SendAll(context.Context, *QueryAllSendRequest) (*QueryAllSendResponse, error) - // Queries a txoutConfirmation by index. - TxoutConfirmation(context.Context, *QueryGetTxoutConfirmationRequest) (*QueryGetTxoutConfirmationResponse, error) - // Queries a list of txoutConfirmation items. - TxoutConfirmationAll(context.Context, *QueryAllTxoutConfirmationRequest) (*QueryAllTxoutConfirmationResponse, error) - // Queries a txout by id. - Txout(context.Context, *QueryGetTxoutRequest) (*QueryGetTxoutResponse, error) - // Queries a list of txout items. - TxoutAll(context.Context, *QueryAllTxoutRequest) (*QueryAllTxoutResponse, error) // Queries a nodeAccount by index. NodeAccount(context.Context, *QueryGetNodeAccountRequest) (*QueryGetNodeAccountResponse, error) // Queries a list of nodeAccount items. NodeAccountAll(context.Context, *QueryAllNodeAccountRequest) (*QueryAllNodeAccountResponse, error) // Queries a list of lastMetaHeight items. LastMetaHeight(context.Context, *QueryLastMetaHeightRequest) (*QueryLastMetaHeightResponse, error) - // Queries a txinVoter by index. - TxinVoter(context.Context, *QueryGetTxinVoterRequest) (*QueryGetTxinVoterResponse, error) - // Queries a list of txinVoter items. - TxinVoterAll(context.Context, *QueryAllTxinVoterRequest) (*QueryAllTxinVoterResponse, error) - // Queries a txin by index. - Txin(context.Context, *QueryGetTxinRequest) (*QueryGetTxinResponse, error) - // Queries a list of txin items. - TxinAll(context.Context, *QueryAllTxinRequest) (*QueryAllTxinResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1521,18 +636,6 @@ func (*UnimplementedQueryServer) Send(ctx context.Context, req *QueryGetSendRequ func (*UnimplementedQueryServer) SendAll(ctx context.Context, req *QueryAllSendRequest) (*QueryAllSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendAll not implemented") } -func (*UnimplementedQueryServer) TxoutConfirmation(ctx context.Context, req *QueryGetTxoutConfirmationRequest) (*QueryGetTxoutConfirmationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmation not implemented") -} -func (*UnimplementedQueryServer) TxoutConfirmationAll(ctx context.Context, req *QueryAllTxoutConfirmationRequest) (*QueryAllTxoutConfirmationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmationAll not implemented") -} -func (*UnimplementedQueryServer) Txout(ctx context.Context, req *QueryGetTxoutRequest) (*QueryGetTxoutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Txout not implemented") -} -func (*UnimplementedQueryServer) TxoutAll(ctx context.Context, req *QueryAllTxoutRequest) (*QueryAllTxoutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxoutAll not implemented") -} func (*UnimplementedQueryServer) NodeAccount(ctx context.Context, req *QueryGetNodeAccountRequest) (*QueryGetNodeAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NodeAccount not implemented") } @@ -1542,18 +645,6 @@ func (*UnimplementedQueryServer) NodeAccountAll(ctx context.Context, req *QueryA func (*UnimplementedQueryServer) LastMetaHeight(ctx context.Context, req *QueryLastMetaHeightRequest) (*QueryLastMetaHeightResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastMetaHeight not implemented") } -func (*UnimplementedQueryServer) TxinVoter(ctx context.Context, req *QueryGetTxinVoterRequest) (*QueryGetTxinVoterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxinVoter not implemented") -} -func (*UnimplementedQueryServer) TxinVoterAll(ctx context.Context, req *QueryAllTxinVoterRequest) (*QueryAllTxinVoterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxinVoterAll not implemented") -} -func (*UnimplementedQueryServer) Txin(ctx context.Context, req *QueryGetTxinRequest) (*QueryGetTxinResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Txin not implemented") -} -func (*UnimplementedQueryServer) TxinAll(ctx context.Context, req *QueryAllTxinRequest) (*QueryAllTxinResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxinAll not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1595,78 +686,6 @@ func _Query_SendAll_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_TxoutConfirmation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetTxoutConfirmationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TxoutConfirmation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/TxoutConfirmation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TxoutConfirmation(ctx, req.(*QueryGetTxoutConfirmationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TxoutConfirmationAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllTxoutConfirmationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TxoutConfirmationAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/TxoutConfirmationAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TxoutConfirmationAll(ctx, req.(*QueryAllTxoutConfirmationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Txout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetTxoutRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Txout(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/Txout", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Txout(ctx, req.(*QueryGetTxoutRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TxoutAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllTxoutRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TxoutAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/TxoutAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TxoutAll(ctx, req.(*QueryAllTxoutRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_NodeAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetNodeAccountRequest) if err := dec(in); err != nil { @@ -1721,78 +740,6 @@ func _Query_LastMetaHeight_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Query_TxinVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetTxinVoterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TxinVoter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/TxinVoter", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TxinVoter(ctx, req.(*QueryGetTxinVoterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TxinVoterAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllTxinVoterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TxinVoterAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/TxinVoterAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TxinVoterAll(ctx, req.(*QueryAllTxinVoterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Txin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetTxinRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Txin(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/Txin", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Txin(ctx, req.(*QueryGetTxinRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TxinAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllTxinRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TxinAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/TxinAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TxinAll(ctx, req.(*QueryAllTxinRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "MetaProtocol.metacore.metacore.Query", HandlerType: (*QueryServer)(nil), @@ -1805,22 +752,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "SendAll", Handler: _Query_SendAll_Handler, }, - { - MethodName: "TxoutConfirmation", - Handler: _Query_TxoutConfirmation_Handler, - }, - { - MethodName: "TxoutConfirmationAll", - Handler: _Query_TxoutConfirmationAll_Handler, - }, - { - MethodName: "Txout", - Handler: _Query_Txout_Handler, - }, - { - MethodName: "TxoutAll", - Handler: _Query_TxoutAll_Handler, - }, { MethodName: "NodeAccount", Handler: _Query_NodeAccount_Handler, @@ -1833,22 +764,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "LastMetaHeight", Handler: _Query_LastMetaHeight_Handler, }, - { - MethodName: "TxinVoter", - Handler: _Query_TxinVoter_Handler, - }, - { - MethodName: "TxinVoterAll", - Handler: _Query_TxinVoterAll_Handler, - }, - { - MethodName: "Txin", - Handler: _Query_Txin_Handler, - }, - { - MethodName: "TxinAll", - Handler: _Query_TxinAll_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "metacore/query.proto", @@ -2003,7 +918,7 @@ func (m *QueryAllSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryGetTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetNodeAccountRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2013,12 +928,12 @@ func (m *QueryGetTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetNodeAccountRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2033,7 +948,7 @@ func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryGetTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetNodeAccountResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2043,19 +958,19 @@ func (m *QueryGetTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetNodeAccountResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.TxoutConfirmation != nil { + if m.NodeAccount != nil { { - size, err := m.TxoutConfirmation.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.NodeAccount.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2068,7 +983,7 @@ func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *QueryAllTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllNodeAccountRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2078,12 +993,12 @@ func (m *QueryAllTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllNodeAccountRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2103,7 +1018,7 @@ func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryAllTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllNodeAccountResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2113,12 +1028,12 @@ func (m *QueryAllTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllNodeAccountResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2135,10 +1050,10 @@ func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i i-- dAtA[i] = 0x12 } - if len(m.TxoutConfirmation) > 0 { - for iNdEx := len(m.TxoutConfirmation) - 1; iNdEx >= 0; iNdEx-- { + if len(m.NodeAccount) > 0 { + for iNdEx := len(m.NodeAccount) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TxoutConfirmation[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.NodeAccount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2152,7 +1067,7 @@ func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *QueryGetTxoutRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryLastMetaHeightRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2162,25 +1077,20 @@ func (m *QueryGetTxoutRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLastMetaHeightRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLastMetaHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } return len(dAtA) - i, nil } -func (m *QueryGetTxoutResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryLastMetaHeightResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2190,2601 +1100,179 @@ func (m *QueryGetTxoutResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLastMetaHeightResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLastMetaHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Txout != nil { - { - size, err := m.Txout.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *QueryAllTxoutRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil + dAtA[offset] = uint8(v) + return base } - -func (m *QueryAllTxoutRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryGetSendRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryAllTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryGetSendResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + if m.Send != nil { + l = m.Send.Size() + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *QueryAllTxoutResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryAllSendRequest) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryAllTxoutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Txout) > 0 { - for iNdEx := len(m.Txout) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Txout[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *QueryGetNodeAccountRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryAllSendResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryGetNodeAccountRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa + if len(m.Send) > 0 { + for _, e := range m.Send { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } } - return len(dAtA) - i, nil -} - -func (m *QueryGetNodeAccountResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) } - return dAtA[:n], nil -} - -func (m *QueryGetNodeAccountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } -func (m *QueryGetNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryGetNodeAccountRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.NodeAccount != nil { - { - size, err := m.NodeAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + l = len(m.Index) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *QueryAllNodeAccountRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryGetNodeAccountResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryAllNodeAccountRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + if m.NodeAccount != nil { + l = m.NodeAccount.Size() + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *QueryAllNodeAccountResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryAllNodeAccountRequest) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryAllNodeAccountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.NodeAccount) > 0 { - for iNdEx := len(m.NodeAccount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.NodeAccount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryLastMetaHeightRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) } - return dAtA[:n], nil -} - -func (m *QueryLastMetaHeightRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLastMetaHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil + return n } -func (m *QueryLastMetaHeightResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryAllNodeAccountResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryLastMetaHeightResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLastMetaHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.Height != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryGetTxinVoterRequest) 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 *QueryGetTxinVoterRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetTxinVoterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetTxinVoterResponse) 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 *QueryGetTxinVoterResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetTxinVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TxinVoter != nil { - { - size, err := m.TxinVoter.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllTxinVoterRequest) 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 *QueryAllTxinVoterRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllTxinVoterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllTxinVoterResponse) 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 *QueryAllTxinVoterResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllTxinVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.TxinVoter) > 0 { - for iNdEx := len(m.TxinVoter) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TxinVoter[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGetTxinRequest) 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 *QueryGetTxinRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetTxinRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetTxinResponse) 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 *QueryGetTxinResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetTxinResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Txin != nil { - { - size, err := m.Txin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllTxinRequest) 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 *QueryAllTxinRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllTxinRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllTxinResponse) 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 *QueryAllTxinResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllTxinResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Txin) > 0 { - for iNdEx := len(m.Txin) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Txin[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryGetSendRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetSendResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Send != nil { - l = m.Send.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllSendRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllSendResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Send) > 0 { - for _, e := range m.Send { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetTxoutConfirmationRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetTxoutConfirmationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TxoutConfirmation != nil { - l = m.TxoutConfirmation.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllTxoutConfirmationRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllTxoutConfirmationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.TxoutConfirmation) > 0 { - for _, e := range m.TxoutConfirmation { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetTxoutRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } - return n -} - -func (m *QueryGetTxoutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Txout != nil { - l = m.Txout.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllTxoutRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllTxoutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Txout) > 0 { - for _, e := range m.Txout { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetNodeAccountRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetNodeAccountResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NodeAccount != nil { - l = m.NodeAccount.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllNodeAccountRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllNodeAccountResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.NodeAccount) > 0 { - for _, e := range m.NodeAccount { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryLastMetaHeightRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryLastMetaHeightResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovQuery(uint64(m.Height)) - } - return n -} - -func (m *QueryGetTxinVoterRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetTxinVoterResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TxinVoter != nil { - l = m.TxinVoter.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllTxinVoterRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllTxinVoterResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.TxinVoter) > 0 { - for _, e := range m.TxinVoter { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetTxinRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetTxinResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Txin != nil { - l = m.Txin.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllTxinRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllTxinResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Txin) > 0 { - for _, e := range m.Txin { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryGetSendRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetSendRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetSendResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetSendResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Send", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Send == nil { - m.Send = &Send{} - } - if err := m.Send.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllSendRequest) 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 ErrIntOverflowQuery - } - 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: QueryAllSendRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllSendResponse) 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 ErrIntOverflowQuery - } - 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: QueryAllSendResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Send", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Send = append(m.Send, &Send{}) - if err := m.Send[len(m.Send)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetTxoutConfirmationRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetTxoutConfirmationRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTxoutConfirmationRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetTxoutConfirmationResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetTxoutConfirmationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTxoutConfirmationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxoutConfirmation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TxoutConfirmation == nil { - m.TxoutConfirmation = &TxoutConfirmation{} - } - if err := m.TxoutConfirmation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllTxoutConfirmationRequest) 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 ErrIntOverflowQuery - } - 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: QueryAllTxoutConfirmationRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTxoutConfirmationRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllTxoutConfirmationResponse) 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 ErrIntOverflowQuery - } - 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: QueryAllTxoutConfirmationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTxoutConfirmationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxoutConfirmation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxoutConfirmation = append(m.TxoutConfirmation, &TxoutConfirmation{}) - if err := m.TxoutConfirmation[len(m.TxoutConfirmation)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetTxoutRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetTxoutRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTxoutRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetTxoutResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetTxoutResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTxoutResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txout", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Txout == nil { - m.Txout = &Txout{} - } - if err := m.Txout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllTxoutRequest) 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 ErrIntOverflowQuery - } - 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: QueryAllTxoutRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTxoutRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllTxoutResponse) 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 ErrIntOverflowQuery - } - 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: QueryAllTxoutResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTxoutResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txout", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Txout = append(m.Txout, &Txout{}) - if err := m.Txout[len(m.Txout)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetNodeAccountRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetNodeAccountRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetNodeAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetNodeAccountResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetNodeAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetNodeAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.NodeAccount == nil { - m.NodeAccount = &NodeAccount{} - } - if err := m.NodeAccount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllNodeAccountRequest) 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 ErrIntOverflowQuery - } - 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: QueryAllNodeAccountRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllNodeAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllNodeAccountResponse) 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 ErrIntOverflowQuery - } - 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: QueryAllNodeAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllNodeAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeAccount = append(m.NodeAccount, &NodeAccount{}) - if err := m.NodeAccount[len(m.NodeAccount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryLastMetaHeightRequest) 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 ErrIntOverflowQuery - } - 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: QueryLastMetaHeightRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLastMetaHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + if len(m.NodeAccount) > 0 { + for _, e := range m.NodeAccount { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } } - - if iNdEx > l { - return io.ErrUnexpectedEOF + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) } - return nil + return n } -func (m *QueryLastMetaHeightResponse) 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 ErrIntOverflowQuery - } - 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: QueryLastMetaHeightResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLastMetaHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + +func (m *QueryLastMetaHeightRequest) Size() (n int) { + if m == nil { + return 0 } + var l int + _ = l + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *QueryLastMetaHeightResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } -func (m *QueryGetTxinVoterRequest) Unmarshal(dAtA []byte) error { +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryGetSendRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4807,10 +1295,10 @@ func (m *QueryGetTxinVoterRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetTxinVoterRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetSendRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTxinVoterRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4866,7 +1354,7 @@ func (m *QueryGetTxinVoterRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetTxinVoterResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetSendResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4889,15 +1377,15 @@ func (m *QueryGetTxinVoterResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetTxinVoterResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetSendResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTxinVoterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxinVoter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Send", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4924,10 +1412,10 @@ func (m *QueryGetTxinVoterResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.TxinVoter == nil { - m.TxinVoter = &TxinVoter{} + if m.Send == nil { + m.Send = &Send{} } - if err := m.TxinVoter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Send.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4952,7 +1440,7 @@ func (m *QueryGetTxinVoterResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllTxinVoterRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllSendRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4975,10 +1463,10 @@ func (m *QueryAllTxinVoterRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllTxinVoterRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllSendRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTxinVoterRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5038,7 +1526,7 @@ func (m *QueryAllTxinVoterRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllTxinVoterResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllSendResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5061,15 +1549,15 @@ func (m *QueryAllTxinVoterResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllTxinVoterResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllSendResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTxinVoterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxinVoter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Send", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5096,8 +1584,8 @@ func (m *QueryAllTxinVoterResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TxinVoter = append(m.TxinVoter, &TxinVoter{}) - if err := m.TxinVoter[len(m.TxinVoter)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Send = append(m.Send, &Send{}) + if err := m.Send[len(m.Send)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5158,7 +1646,7 @@ func (m *QueryAllTxinVoterResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetTxinRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetNodeAccountRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5181,10 +1669,10 @@ func (m *QueryGetTxinRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetTxinRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetNodeAccountRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTxinRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetNodeAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5240,7 +1728,7 @@ func (m *QueryGetTxinRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetTxinResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetNodeAccountResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5263,15 +1751,15 @@ func (m *QueryGetTxinResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetTxinResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetNodeAccountResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTxinResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetNodeAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeAccount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5298,10 +1786,10 @@ func (m *QueryGetTxinResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Txin == nil { - m.Txin = &Txin{} + if m.NodeAccount == nil { + m.NodeAccount = &NodeAccount{} } - if err := m.Txin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.NodeAccount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5326,7 +1814,7 @@ func (m *QueryGetTxinResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllTxinRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllNodeAccountRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5349,10 +1837,10 @@ func (m *QueryAllTxinRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllTxinRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllNodeAccountRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTxinRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllNodeAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5412,7 +1900,7 @@ func (m *QueryAllTxinRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllTxinResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllNodeAccountResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5435,15 +1923,15 @@ func (m *QueryAllTxinResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllTxinResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllNodeAccountResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTxinResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllNodeAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeAccount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5470,8 +1958,8 @@ func (m *QueryAllTxinResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Txin = append(m.Txin, &Txin{}) - if err := m.Txin[len(m.Txin)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.NodeAccount = append(m.NodeAccount, &NodeAccount{}) + if err := m.NodeAccount[len(m.NodeAccount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5532,6 +2020,125 @@ func (m *QueryAllTxinResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryLastMetaHeightRequest) 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 ErrIntOverflowQuery + } + 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: QueryLastMetaHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLastMetaHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLastMetaHeightResponse) 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 ErrIntOverflowQuery + } + 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: QueryLastMetaHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLastMetaHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/metacore/types/query.pb.gw.go b/x/metacore/types/query.pb.gw.go index 5b57d88688..613c2fd973 100644 --- a/x/metacore/types/query.pb.gw.go +++ b/x/metacore/types/query.pb.gw.go @@ -123,186 +123,6 @@ func local_request_Query_SendAll_0(ctx context.Context, marshaler runtime.Marsha } -func request_Query_TxoutConfirmation_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTxoutConfirmationRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := client.TxoutConfirmation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TxoutConfirmation_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTxoutConfirmationRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := server.TxoutConfirmation(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_TxoutConfirmationAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_TxoutConfirmationAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllTxoutConfirmationRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TxoutConfirmationAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.TxoutConfirmationAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TxoutConfirmationAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllTxoutConfirmationRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TxoutConfirmationAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.TxoutConfirmationAll(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Txout_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTxoutRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.Txout(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Txout_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTxoutRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.Txout(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_TxoutAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_TxoutAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllTxoutRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TxoutAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.TxoutAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TxoutAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllTxoutRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TxoutAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.TxoutAll(ctx, &protoReq) - return msg, metadata, err - -} - func request_Query_NodeAccount_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetNodeAccountRequest var metadata runtime.ServerMetadata @@ -397,299 +217,27 @@ func request_Query_LastMetaHeight_0(ctx context.Context, marshaler runtime.Marsh var protoReq QueryLastMetaHeightRequest var metadata runtime.ServerMetadata - msg, err := client.LastMetaHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_LastMetaHeight_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLastMetaHeightRequest - var metadata runtime.ServerMetadata - - msg, err := server.LastMetaHeight(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_TxinVoter_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTxinVoterRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := client.TxinVoter(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TxinVoter_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTxinVoterRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := server.TxinVoter(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_TxinVoterAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_TxinVoterAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllTxinVoterRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TxinVoterAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.TxinVoterAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TxinVoterAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllTxinVoterRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TxinVoterAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.TxinVoterAll(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Txin_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTxinRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := client.Txin(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Txin_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTxinRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["index"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") - } - - protoReq.Index, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) - } - - msg, err := server.Txin(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_TxinAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_TxinAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllTxinRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TxinAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.TxinAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TxinAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllTxinRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TxinAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.TxinAll(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Send_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Send_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Send_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SendAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SendAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SendAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TxoutConfirmation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TxoutConfirmation_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxoutConfirmation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TxoutConfirmationAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TxoutConfirmationAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } + msg, err := client.LastMetaHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err - forward_Query_TxoutConfirmationAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) +} - }) +func local_request_Query_LastMetaHeight_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLastMetaHeightRequest + var metadata runtime.ServerMetadata + + msg, err := server.LastMetaHeight(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_Txout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Send_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -700,7 +248,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_Txout_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_Send_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -708,11 +256,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Txout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Send_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_TxoutAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_SendAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -723,7 +271,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_TxoutAll_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_SendAll_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -731,7 +279,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_TxoutAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_SendAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -804,98 +352,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_TxinVoter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TxinVoter_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxinVoter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TxinVoterAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TxinVoterAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxinVoterAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Txin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Txin_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Txin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TxinAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TxinAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxinAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -977,86 +433,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_TxoutConfirmation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TxoutConfirmation_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxoutConfirmation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TxoutConfirmationAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TxoutConfirmationAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxoutConfirmationAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Txout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Txout_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Txout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TxoutAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TxoutAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxoutAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_NodeAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1117,86 +493,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_TxinVoter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TxinVoter_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxinVoter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TxinVoterAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TxinVoterAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxinVoterAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Txin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Txin_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Txin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TxinAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TxinAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TxinAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -1205,27 +501,11 @@ var ( pattern_Query_SendAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "send"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_TxoutConfirmation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "txoutConfirmation", "index"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_TxoutConfirmationAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "txoutConfirmation"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_Txout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "txout", "id"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_TxoutAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "txout"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_NodeAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "nodeAccount", "index"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_NodeAccountAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "nodeAccount"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_LastMetaHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "lastMetaHeight"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_TxinVoter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "txinVoter", "index"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_TxinVoterAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "txinVoter"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_Txin_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "txin", "index"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_TxinAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "txin"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -1233,25 +513,9 @@ var ( forward_Query_SendAll_0 = runtime.ForwardResponseMessage - forward_Query_TxoutConfirmation_0 = runtime.ForwardResponseMessage - - forward_Query_TxoutConfirmationAll_0 = runtime.ForwardResponseMessage - - forward_Query_Txout_0 = runtime.ForwardResponseMessage - - forward_Query_TxoutAll_0 = runtime.ForwardResponseMessage - forward_Query_NodeAccount_0 = runtime.ForwardResponseMessage forward_Query_NodeAccountAll_0 = runtime.ForwardResponseMessage forward_Query_LastMetaHeight_0 = runtime.ForwardResponseMessage - - forward_Query_TxinVoter_0 = runtime.ForwardResponseMessage - - forward_Query_TxinVoterAll_0 = runtime.ForwardResponseMessage - - forward_Query_Txin_0 = runtime.ForwardResponseMessage - - forward_Query_TxinAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/metacore/types/tx.pb.go b/x/metacore/types/tx.pb.go index 12558b8ca6..06090ebce4 100644 --- a/x/metacore/types/tx.pb.go +++ b/x/metacore/types/tx.pb.go @@ -181,142 +181,6 @@ func (m *MsgSendVoterResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSendVoterResponse proto.InternalMessageInfo -type MsgTxoutConfirmationVoter struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - TxoutId uint64 `protobuf:"varint,2,opt,name=txoutId,proto3" json:"txoutId,omitempty"` - TxHash string `protobuf:"bytes,3,opt,name=txHash,proto3" json:"txHash,omitempty"` - MMint uint64 `protobuf:"varint,4,opt,name=mMint,proto3" json:"mMint,omitempty"` - DestinationAsset string `protobuf:"bytes,5,opt,name=destinationAsset,proto3" json:"destinationAsset,omitempty"` - DestinationAmount uint64 `protobuf:"varint,6,opt,name=destinationAmount,proto3" json:"destinationAmount,omitempty"` - ToAddress string `protobuf:"bytes,7,opt,name=toAddress,proto3" json:"toAddress,omitempty"` - BlockHeight uint64 `protobuf:"varint,8,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"` -} - -func (m *MsgTxoutConfirmationVoter) Reset() { *m = MsgTxoutConfirmationVoter{} } -func (m *MsgTxoutConfirmationVoter) String() string { return proto.CompactTextString(m) } -func (*MsgTxoutConfirmationVoter) ProtoMessage() {} -func (*MsgTxoutConfirmationVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{2} -} -func (m *MsgTxoutConfirmationVoter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTxoutConfirmationVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTxoutConfirmationVoter.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 *MsgTxoutConfirmationVoter) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTxoutConfirmationVoter.Merge(m, src) -} -func (m *MsgTxoutConfirmationVoter) XXX_Size() int { - return m.Size() -} -func (m *MsgTxoutConfirmationVoter) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTxoutConfirmationVoter.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTxoutConfirmationVoter proto.InternalMessageInfo - -func (m *MsgTxoutConfirmationVoter) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgTxoutConfirmationVoter) GetTxoutId() uint64 { - if m != nil { - return m.TxoutId - } - return 0 -} - -func (m *MsgTxoutConfirmationVoter) GetTxHash() string { - if m != nil { - return m.TxHash - } - return "" -} - -func (m *MsgTxoutConfirmationVoter) GetMMint() uint64 { - if m != nil { - return m.MMint - } - return 0 -} - -func (m *MsgTxoutConfirmationVoter) GetDestinationAsset() string { - if m != nil { - return m.DestinationAsset - } - return "" -} - -func (m *MsgTxoutConfirmationVoter) GetDestinationAmount() uint64 { - if m != nil { - return m.DestinationAmount - } - return 0 -} - -func (m *MsgTxoutConfirmationVoter) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *MsgTxoutConfirmationVoter) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -type MsgTxoutConfirmationVoterResponse struct { -} - -func (m *MsgTxoutConfirmationVoterResponse) Reset() { *m = MsgTxoutConfirmationVoterResponse{} } -func (m *MsgTxoutConfirmationVoterResponse) String() string { return proto.CompactTextString(m) } -func (*MsgTxoutConfirmationVoterResponse) ProtoMessage() {} -func (*MsgTxoutConfirmationVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{3} -} -func (m *MsgTxoutConfirmationVoterResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTxoutConfirmationVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTxoutConfirmationVoterResponse.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 *MsgTxoutConfirmationVoterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTxoutConfirmationVoterResponse.Merge(m, src) -} -func (m *MsgTxoutConfirmationVoterResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgTxoutConfirmationVoterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTxoutConfirmationVoterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTxoutConfirmationVoterResponse proto.InternalMessageInfo - type MsgSetNodeKeys struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` PubkeySet *common.PubKeySet `protobuf:"bytes,2,opt,name=pubkeySet,proto3" json:"pubkeySet,omitempty"` @@ -327,7 +191,7 @@ func (m *MsgSetNodeKeys) Reset() { *m = MsgSetNodeKeys{} } func (m *MsgSetNodeKeys) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeys) ProtoMessage() {} func (*MsgSetNodeKeys) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{4} + return fileDescriptor_3410749d96999ade, []int{2} } func (m *MsgSetNodeKeys) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -384,7 +248,7 @@ func (m *MsgSetNodeKeysResponse) Reset() { *m = MsgSetNodeKeysResponse{} func (m *MsgSetNodeKeysResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeysResponse) ProtoMessage() {} func (*MsgSetNodeKeysResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{5} + return fileDescriptor_3410749d96999ade, []int{3} } func (m *MsgSetNodeKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -413,217 +277,45 @@ func (m *MsgSetNodeKeysResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetNodeKeysResponse proto.InternalMessageInfo -type MsgCreateTxinVoter struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` - TxHash string `protobuf:"bytes,3,opt,name=txHash,proto3" json:"txHash,omitempty"` - SourceAsset string `protobuf:"bytes,4,opt,name=sourceAsset,proto3" json:"sourceAsset,omitempty"` - SourceAmount uint64 `protobuf:"varint,5,opt,name=sourceAmount,proto3" json:"sourceAmount,omitempty"` - MBurnt uint64 `protobuf:"varint,6,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` - DestinationAsset string `protobuf:"bytes,7,opt,name=destinationAsset,proto3" json:"destinationAsset,omitempty"` - FromAddress string `protobuf:"bytes,8,opt,name=fromAddress,proto3" json:"fromAddress,omitempty"` - ToAddress string `protobuf:"bytes,9,opt,name=toAddress,proto3" json:"toAddress,omitempty"` - BlockHeight uint64 `protobuf:"varint,10,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"` -} - -func (m *MsgCreateTxinVoter) Reset() { *m = MsgCreateTxinVoter{} } -func (m *MsgCreateTxinVoter) String() string { return proto.CompactTextString(m) } -func (*MsgCreateTxinVoter) ProtoMessage() {} -func (*MsgCreateTxinVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{6} -} -func (m *MsgCreateTxinVoter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateTxinVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateTxinVoter.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 *MsgCreateTxinVoter) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateTxinVoter.Merge(m, src) -} -func (m *MsgCreateTxinVoter) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateTxinVoter) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateTxinVoter.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateTxinVoter proto.InternalMessageInfo - -func (m *MsgCreateTxinVoter) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgCreateTxinVoter) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *MsgCreateTxinVoter) GetTxHash() string { - if m != nil { - return m.TxHash - } - return "" -} - -func (m *MsgCreateTxinVoter) GetSourceAsset() string { - if m != nil { - return m.SourceAsset - } - return "" -} - -func (m *MsgCreateTxinVoter) GetSourceAmount() uint64 { - if m != nil { - return m.SourceAmount - } - return 0 -} - -func (m *MsgCreateTxinVoter) GetMBurnt() uint64 { - if m != nil { - return m.MBurnt - } - return 0 -} - -func (m *MsgCreateTxinVoter) GetDestinationAsset() string { - if m != nil { - return m.DestinationAsset - } - return "" -} - -func (m *MsgCreateTxinVoter) GetFromAddress() string { - if m != nil { - return m.FromAddress - } - return "" -} - -func (m *MsgCreateTxinVoter) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *MsgCreateTxinVoter) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -type MsgCreateTxinVoterResponse struct { -} - -func (m *MsgCreateTxinVoterResponse) Reset() { *m = MsgCreateTxinVoterResponse{} } -func (m *MsgCreateTxinVoterResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateTxinVoterResponse) ProtoMessage() {} -func (*MsgCreateTxinVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{7} -} -func (m *MsgCreateTxinVoterResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateTxinVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateTxinVoterResponse.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 *MsgCreateTxinVoterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateTxinVoterResponse.Merge(m, src) -} -func (m *MsgCreateTxinVoterResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateTxinVoterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateTxinVoterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateTxinVoterResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgSendVoter)(nil), "MetaProtocol.metacore.metacore.MsgSendVoter") proto.RegisterType((*MsgSendVoterResponse)(nil), "MetaProtocol.metacore.metacore.MsgSendVoterResponse") - proto.RegisterType((*MsgTxoutConfirmationVoter)(nil), "MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoter") - proto.RegisterType((*MsgTxoutConfirmationVoterResponse)(nil), "MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoterResponse") proto.RegisterType((*MsgSetNodeKeys)(nil), "MetaProtocol.metacore.metacore.MsgSetNodeKeys") proto.RegisterType((*MsgSetNodeKeysResponse)(nil), "MetaProtocol.metacore.metacore.MsgSetNodeKeysResponse") - proto.RegisterType((*MsgCreateTxinVoter)(nil), "MetaProtocol.metacore.metacore.MsgCreateTxinVoter") - proto.RegisterType((*MsgCreateTxinVoterResponse)(nil), "MetaProtocol.metacore.metacore.MsgCreateTxinVoterResponse") } func init() { proto.RegisterFile("metacore/tx.proto", fileDescriptor_3410749d96999ade) } var fileDescriptor_3410749d96999ade = []byte{ - // 696 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x4e, 0xdb, 0x40, - 0x10, 0xc6, 0xc1, 0x21, 0x64, 0x42, 0x7f, 0xd8, 0xa2, 0xc8, 0x58, 0xc8, 0x4a, 0xd3, 0x1e, 0x50, - 0x45, 0x13, 0x29, 0xad, 0x2a, 0x95, 0x1b, 0xe4, 0x42, 0x45, 0x53, 0xa1, 0x80, 0x7a, 0xe8, 0xa5, - 0x72, 0xec, 0xc5, 0x59, 0x81, 0x77, 0x23, 0xef, 0x1a, 0x85, 0x63, 0xaf, 0x3d, 0xf5, 0xd4, 0xbe, - 0x45, 0x9f, 0x83, 0x23, 0xc7, 0x1e, 0x2b, 0x78, 0x91, 0x6a, 0x77, 0xfd, 0x17, 0x42, 0x80, 0xf4, - 0x94, 0xfd, 0xbe, 0x99, 0xd9, 0x99, 0xf9, 0x76, 0xc6, 0x81, 0xd5, 0x10, 0x0b, 0xd7, 0x63, 0x11, - 0x6e, 0x8b, 0x71, 0x6b, 0x14, 0x31, 0xc1, 0x90, 0xd3, 0xc3,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, 0x9d, 0x80, 0x88, - 0x61, 0x3c, 0x90, 0x5f, 0x82, 0xb6, 0xbc, 0xff, 0x75, 0x9a, 0xa0, 0x9d, 0xfd, 0x29, 0x8e, 0xf3, - 0xa3, 0x38, 0x1f, 0x61, 0x3e, 0x58, 0x52, 0x7f, 0x83, 0x6f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, - 0xd6, 0x37, 0x5b, 0xbf, 0x6b, 0x07, 0x00, 0x00, + // 443 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x3f, 0x6f, 0x1a, 0x31, + 0x14, 0xc7, 0xf9, 0x43, 0xc2, 0xa3, 0xad, 0x14, 0x37, 0x42, 0x16, 0xc3, 0x09, 0xa1, 0x0e, 0x19, + 0xda, 0x3b, 0x89, 0x56, 0x1d, 0x3a, 0x92, 0x25, 0x52, 0x4a, 0x85, 0x48, 0xd5, 0xa1, 0xdb, 0x71, + 0x3c, 0x1d, 0x56, 0x38, 0x1b, 0xd9, 0xbe, 0x08, 0xbe, 0x45, 0xb7, 0x7e, 0x8b, 0x7e, 0x8e, 0x8e, + 0x19, 0x3b, 0x56, 0x30, 0xf7, 0x3b, 0x54, 0xb6, 0x31, 0x1c, 0x43, 0xa3, 0x32, 0xf9, 0xfd, 0xde, + 0xef, 0xfd, 0xfd, 0xd9, 0x86, 0x8b, 0x02, 0x4d, 0x9a, 0x49, 0x85, 0x89, 0x59, 0xc4, 0x73, 0x25, + 0x8d, 0xa4, 0xd1, 0x00, 0x4d, 0x3a, 0xb4, 0x66, 0x26, 0x67, 0x71, 0xe0, 0xb7, 0x46, 0xfb, 0x65, + 0x26, 0x8b, 0x42, 0x8a, 0xc4, 0x1f, 0x3e, 0xa9, 0xfb, 0xe3, 0x08, 0x9e, 0x0d, 0x74, 0x7e, 0x87, + 0x62, 0xf2, 0x45, 0x1a, 0x54, 0x94, 0xc1, 0x59, 0x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 0xb6, + 0x9f, 0xd0, 0xa5, 0x1e, 0x3a, 0x7a, 0x23, 0xf8, 0x3f, 0xf9, 0x2e, 0x83, 0xd6, 0xfe, 0x60, 0x61, + 0xe6, 0xde, 0x1f, 0x02, 0xc7, 0x03, 0x9d, 0x53, 0x09, 0x8d, 0xdd, 0x03, 0x78, 0x1d, 0x3f, 0xfd, + 0x8e, 0xe2, 0xea, 0xfa, 0xed, 0x77, 0x87, 0x44, 0x87, 0xc6, 0xb4, 0x84, 0x66, 0x55, 0xa8, 0xf8, + 0xbf, 0x8a, 0x6c, 0xe3, 0xdb, 0xef, 0x0f, 0x8b, 0x0f, 0x6d, 0xfb, 0x1f, 0x7f, 0xae, 0x22, 0xf2, + 0xb8, 0x8a, 0xc8, 0xef, 0x55, 0x44, 0xbe, 0xad, 0xa3, 0xda, 0xe3, 0x3a, 0xaa, 0xfd, 0x5a, 0x47, + 0xb5, 0xaf, 0xbd, 0x9c, 0x9b, 0x69, 0x39, 0xb6, 0x77, 0x90, 0xd8, 0xda, 0x6f, 0x42, 0xf1, 0x64, + 0xfb, 0xcf, 0x16, 0x3b, 0xd3, 0x2c, 0xe7, 0xa8, 0xc7, 0x75, 0xf7, 0x83, 0xde, 0xfe, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0xd4, 0x77, 0x84, 0x79, 0x8b, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -640,9 +332,7 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // this line is used by starport scaffolding # proto/tx/rpc SendVoter(ctx context.Context, in *MsgSendVoter, opts ...grpc.CallOption) (*MsgSendVoterResponse, error) - TxoutConfirmationVoter(ctx context.Context, in *MsgTxoutConfirmationVoter, opts ...grpc.CallOption) (*MsgTxoutConfirmationVoterResponse, error) SetNodeKeys(ctx context.Context, in *MsgSetNodeKeys, opts ...grpc.CallOption) (*MsgSetNodeKeysResponse, error) - CreateTxinVoter(ctx context.Context, in *MsgCreateTxinVoter, opts ...grpc.CallOption) (*MsgCreateTxinVoterResponse, error) } type msgClient struct { @@ -662,15 +352,6 @@ func (c *msgClient) SendVoter(ctx context.Context, in *MsgSendVoter, opts ...grp return out, nil } -func (c *msgClient) TxoutConfirmationVoter(ctx context.Context, in *MsgTxoutConfirmationVoter, opts ...grpc.CallOption) (*MsgTxoutConfirmationVoterResponse, error) { - out := new(MsgTxoutConfirmationVoterResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Msg/TxoutConfirmationVoter", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) SetNodeKeys(ctx context.Context, in *MsgSetNodeKeys, opts ...grpc.CallOption) (*MsgSetNodeKeysResponse, error) { out := new(MsgSetNodeKeysResponse) err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Msg/SetNodeKeys", in, out, opts...) @@ -680,22 +361,11 @@ func (c *msgClient) SetNodeKeys(ctx context.Context, in *MsgSetNodeKeys, opts .. return out, nil } -func (c *msgClient) CreateTxinVoter(ctx context.Context, in *MsgCreateTxinVoter, opts ...grpc.CallOption) (*MsgCreateTxinVoterResponse, error) { - out := new(MsgCreateTxinVoterResponse) - err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Msg/CreateTxinVoter", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. type MsgServer interface { // this line is used by starport scaffolding # proto/tx/rpc SendVoter(context.Context, *MsgSendVoter) (*MsgSendVoterResponse, error) - TxoutConfirmationVoter(context.Context, *MsgTxoutConfirmationVoter) (*MsgTxoutConfirmationVoterResponse, error) SetNodeKeys(context.Context, *MsgSetNodeKeys) (*MsgSetNodeKeysResponse, error) - CreateTxinVoter(context.Context, *MsgCreateTxinVoter) (*MsgCreateTxinVoterResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -705,15 +375,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) SendVoter(ctx context.Context, req *MsgSendVoter) (*MsgSendVoterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendVoter not implemented") } -func (*UnimplementedMsgServer) TxoutConfirmationVoter(ctx context.Context, req *MsgTxoutConfirmationVoter) (*MsgTxoutConfirmationVoterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmationVoter not implemented") -} func (*UnimplementedMsgServer) SetNodeKeys(ctx context.Context, req *MsgSetNodeKeys) (*MsgSetNodeKeysResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetNodeKeys not implemented") } -func (*UnimplementedMsgServer) CreateTxinVoter(ctx context.Context, req *MsgCreateTxinVoter) (*MsgCreateTxinVoterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateTxinVoter not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -737,24 +401,6 @@ func _Msg_SendVoter_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Msg_TxoutConfirmationVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTxoutConfirmationVoter) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).TxoutConfirmationVoter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Msg/TxoutConfirmationVoter", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).TxoutConfirmationVoter(ctx, req.(*MsgTxoutConfirmationVoter)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_SetNodeKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgSetNodeKeys) if err := dec(in); err != nil { @@ -773,24 +419,6 @@ func _Msg_SetNodeKeys_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _Msg_CreateTxinVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateTxinVoter) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateTxinVoter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Msg/CreateTxinVoter", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateTxinVoter(ctx, req.(*MsgCreateTxinVoter)) - } - return interceptor(ctx, in, info, handler) -} - var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "MetaProtocol.metacore.metacore.Msg", HandlerType: (*MsgServer)(nil), @@ -799,18 +427,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SendVoter", Handler: _Msg_SendVoter_Handler, }, - { - MethodName: "TxoutConfirmationVoter", - Handler: _Msg_TxoutConfirmationVoter_Handler, - }, { MethodName: "SetNodeKeys", Handler: _Msg_SetNodeKeys_Handler, }, - { - MethodName: "CreateTxinVoter", - Handler: _Msg_CreateTxinVoter_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "metacore/tx.proto", @@ -930,7 +550,7 @@ func (m *MsgSendVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgTxoutConfirmationVoter) Marshal() (dAtA []byte, err error) { +func (m *MsgSetNodeKeys) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -940,56 +560,34 @@ func (m *MsgTxoutConfirmationVoter) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgTxoutConfirmationVoter) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSetNodeKeys) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgTxoutConfirmationVoter) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSetNodeKeys) 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] = 0x40 - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x3a - } - if m.DestinationAmount != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.DestinationAmount)) - i-- - dAtA[i] = 0x30 - } - if len(m.DestinationAsset) > 0 { - i -= len(m.DestinationAsset) - copy(dAtA[i:], m.DestinationAsset) - i = encodeVarintTx(dAtA, i, uint64(len(m.DestinationAsset))) - i-- - dAtA[i] = 0x2a - } - if m.MMint != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MMint)) - i-- - dAtA[i] = 0x20 - } - if len(m.TxHash) > 0 { - i -= len(m.TxHash) - copy(dAtA[i:], m.TxHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.TxHash))) + if len(m.ValidatorConsensusPubkey) > 0 { + i -= len(m.ValidatorConsensusPubkey) + copy(dAtA[i:], m.ValidatorConsensusPubkey) + i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorConsensusPubkey))) i-- dAtA[i] = 0x1a } - if m.TxoutId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.TxoutId)) + if m.PubkeySet != nil { + { + size, err := m.PubkeySet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } if len(m.Creator) > 0 { i -= len(m.Creator) @@ -1001,7 +599,7 @@ func (m *MsgTxoutConfirmationVoter) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *MsgTxoutConfirmationVoterResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgSetNodeKeysResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1011,194 +609,12 @@ func (m *MsgTxoutConfirmationVoterResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgTxoutConfirmationVoterResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSetNodeKeysResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgTxoutConfirmationVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgSetNodeKeys) 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 *MsgSetNodeKeys) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSetNodeKeys) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorConsensusPubkey) > 0 { - i -= len(m.ValidatorConsensusPubkey) - copy(dAtA[i:], m.ValidatorConsensusPubkey) - i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorConsensusPubkey))) - i-- - dAtA[i] = 0x1a - } - if m.PubkeySet != nil { - { - size, err := m.PubkeySet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - 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 *MsgSetNodeKeysResponse) 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 *MsgSetNodeKeysResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSetNodeKeysResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgCreateTxinVoter) 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 *MsgCreateTxinVoter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateTxinVoter) 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] = 0x50 - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x4a - } - if len(m.FromAddress) > 0 { - i -= len(m.FromAddress) - copy(dAtA[i:], m.FromAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.FromAddress))) - i-- - dAtA[i] = 0x42 - } - if len(m.DestinationAsset) > 0 { - i -= len(m.DestinationAsset) - copy(dAtA[i:], m.DestinationAsset) - i = encodeVarintTx(dAtA, i, uint64(len(m.DestinationAsset))) - i-- - dAtA[i] = 0x3a - } - if m.MBurnt != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MBurnt)) - i-- - dAtA[i] = 0x30 - } - if m.SourceAmount != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.SourceAmount)) - i-- - dAtA[i] = 0x28 - } - if len(m.SourceAsset) > 0 { - i -= len(m.SourceAsset) - copy(dAtA[i:], m.SourceAsset) - i = encodeVarintTx(dAtA, i, uint64(len(m.SourceAsset))) - i-- - dAtA[i] = 0x22 - } - if len(m.TxHash) > 0 { - i -= len(m.TxHash) - copy(dAtA[i:], m.TxHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.TxHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintTx(dAtA, i, uint64(len(m.Index))) - 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 *MsgCreateTxinVoterResponse) 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 *MsgCreateTxinVoterResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateTxinVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSetNodeKeysResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1274,52 +690,6 @@ func (m *MsgSendVoterResponse) Size() (n int) { return n } -func (m *MsgTxoutConfirmationVoter) 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)) - } - if m.TxoutId != 0 { - n += 1 + sovTx(uint64(m.TxoutId)) - } - l = len(m.TxHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.MMint != 0 { - n += 1 + sovTx(uint64(m.MMint)) - } - l = len(m.DestinationAsset) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.DestinationAmount != 0 { - n += 1 + sovTx(uint64(m.DestinationAmount)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.BlockHeight != 0 { - n += 1 + sovTx(uint64(m.BlockHeight)) - } - return n -} - -func (m *MsgTxoutConfirmationVoterResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *MsgSetNodeKeys) Size() (n int) { if m == nil { return 0 @@ -1350,61 +720,6 @@ func (m *MsgSetNodeKeysResponse) Size() (n int) { return n } -func (m *MsgCreateTxinVoter) 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.Index) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.TxHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.SourceAsset) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.SourceAmount != 0 { - n += 1 + sovTx(uint64(m.SourceAmount)) - } - if m.MBurnt != 0 { - n += 1 + sovTx(uint64(m.MBurnt)) - } - l = len(m.DestinationAsset) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.BlockHeight != 0 { - n += 1 + sovTx(uint64(m.BlockHeight)) - } - return n -} - -func (m *MsgCreateTxinVoterResponse) 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 } @@ -1818,7 +1133,7 @@ func (m *MsgSendVoterResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { +func (m *MsgSetNodeKeys) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1841,10 +1156,10 @@ func (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgTxoutConfirmationVoter: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetNodeKeys: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTxoutConfirmationVoter: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetNodeKeys: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1880,10 +1195,10 @@ func (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TxoutId", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubkeySet", wireType) } - m.TxoutId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1893,14 +1208,31 @@ func (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TxoutId |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubkeySet == nil { + m.PubkeySet = &common.PubKeySet{} + } + if err := m.PubkeySet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorConsensusPubkey", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1928,715 +1260,13 @@ func (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TxHash = string(dAtA[iNdEx:postIndex]) + m.ValidatorConsensusPubkey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MMint", wireType) - } - m.MMint = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MMint |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationAsset", 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.DestinationAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationAmount", wireType) - } - m.DestinationAmount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DestinationAmount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", 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.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - 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 *MsgTxoutConfirmationVoterResponse) 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: MsgTxoutConfirmationVoterResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTxoutConfirmationVoterResponse: 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 (m *MsgSetNodeKeys) 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: MsgSetNodeKeys: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetNodeKeys: 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 PubkeySet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PubkeySet == nil { - m.PubkeySet = &common.PubKeySet{} - } - if err := m.PubkeySet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorConsensusPubkey", 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.ValidatorConsensusPubkey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - 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 *MsgSetNodeKeysResponse) 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: MsgSetNodeKeysResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetNodeKeysResponse: 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 (m *MsgCreateTxinVoter) 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: MsgCreateTxinVoter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateTxinVoter: 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 Index", 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.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxHash", 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.TxHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAsset", 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.SourceAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAmount", wireType) - } - m.SourceAmount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SourceAmount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MBurnt", wireType) - } - m.MBurnt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MBurnt |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationAsset", 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.DestinationAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", 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.FromAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", 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.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - 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 + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTx @@ -2653,7 +1283,7 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateTxinVoterResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSetNodeKeysResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2676,10 +1306,10 @@ func (m *MsgCreateTxinVoterResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateTxinVoterResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetNodeKeysResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateTxinVoterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetNodeKeysResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/metacore/types/txin.pb.go b/x/metacore/types/txin.pb.go deleted file mode 100644 index 0fe11e8ef4..0000000000 --- a/x/metacore/types/txin.pb.go +++ /dev/null @@ -1,828 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: metacore/txin.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Txin struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` - TxHash string `protobuf:"bytes,3,opt,name=txHash,proto3" json:"txHash,omitempty"` - SourceAsset string `protobuf:"bytes,4,opt,name=sourceAsset,proto3" json:"sourceAsset,omitempty"` - SourceAmount uint64 `protobuf:"varint,5,opt,name=sourceAmount,proto3" json:"sourceAmount,omitempty"` - MBurnt uint64 `protobuf:"varint,6,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` - DestinationAsset string `protobuf:"bytes,7,opt,name=destinationAsset,proto3" json:"destinationAsset,omitempty"` - FromAddress string `protobuf:"bytes,8,opt,name=fromAddress,proto3" json:"fromAddress,omitempty"` - ToAddress string `protobuf:"bytes,9,opt,name=toAddress,proto3" json:"toAddress,omitempty"` - BlockHeight uint64 `protobuf:"varint,10,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"` - Signers []string `protobuf:"bytes,11,rep,name=signers,proto3" json:"signers,omitempty"` - FinalizedHeight uint64 `protobuf:"varint,12,opt,name=finalizedHeight,proto3" json:"finalizedHeight,omitempty"` -} - -func (m *Txin) Reset() { *m = Txin{} } -func (m *Txin) String() string { return proto.CompactTextString(m) } -func (*Txin) ProtoMessage() {} -func (*Txin) Descriptor() ([]byte, []int) { - return fileDescriptor_93184ce4f3b6d324, []int{0} -} -func (m *Txin) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Txin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Txin.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 *Txin) XXX_Merge(src proto.Message) { - xxx_messageInfo_Txin.Merge(m, src) -} -func (m *Txin) XXX_Size() int { - return m.Size() -} -func (m *Txin) XXX_DiscardUnknown() { - xxx_messageInfo_Txin.DiscardUnknown(m) -} - -var xxx_messageInfo_Txin proto.InternalMessageInfo - -func (m *Txin) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *Txin) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *Txin) GetTxHash() string { - if m != nil { - return m.TxHash - } - return "" -} - -func (m *Txin) GetSourceAsset() string { - if m != nil { - return m.SourceAsset - } - return "" -} - -func (m *Txin) GetSourceAmount() uint64 { - if m != nil { - return m.SourceAmount - } - return 0 -} - -func (m *Txin) GetMBurnt() uint64 { - if m != nil { - return m.MBurnt - } - return 0 -} - -func (m *Txin) GetDestinationAsset() string { - if m != nil { - return m.DestinationAsset - } - return "" -} - -func (m *Txin) GetFromAddress() string { - if m != nil { - return m.FromAddress - } - return "" -} - -func (m *Txin) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *Txin) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func (m *Txin) GetSigners() []string { - if m != nil { - return m.Signers - } - return nil -} - -func (m *Txin) GetFinalizedHeight() uint64 { - if m != nil { - return m.FinalizedHeight - } - return 0 -} - -func init() { - proto.RegisterType((*Txin)(nil), "MetaProtocol.metacore.metacore.Txin") -} - -func init() { proto.RegisterFile("metacore/txin.proto", fileDescriptor_93184ce4f3b6d324) } - -var fileDescriptor_93184ce4f3b6d324 = []byte{ - // 350 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0x4f, 0x4b, 0xc3, 0x30, - 0x18, 0xc6, 0x5b, 0xd7, 0x6d, 0x36, 0x1b, 0x28, 0x71, 0x48, 0x10, 0x89, 0x65, 0xa7, 0x22, 0xb8, - 0x82, 0x7e, 0x82, 0xed, 0xb4, 0x83, 0x82, 0x0c, 0x4f, 0xde, 0xba, 0x36, 0xeb, 0x82, 0x6b, 0x32, - 0x92, 0xb7, 0x50, 0x3d, 0xfb, 0x01, 0xfc, 0x58, 0x3b, 0xee, 0xe8, 0x49, 0x64, 0xfb, 0x22, 0xd2, - 0xb4, 0xdd, 0xa6, 0xde, 0x9e, 0xe7, 0xf7, 0xe4, 0xfd, 0x03, 0x6f, 0xd0, 0x59, 0xca, 0x20, 0x8c, - 0xa4, 0x62, 0x01, 0xe4, 0x5c, 0x0c, 0x96, 0x4a, 0x82, 0xc4, 0xf4, 0x81, 0x41, 0xf8, 0x58, 0xc8, - 0x48, 0x2e, 0x06, 0xf5, 0x8b, 0x9d, 0xb8, 0xe8, 0x25, 0x32, 0x91, 0xe6, 0x69, 0x50, 0xa8, 0xb2, - 0xaa, 0xff, 0xde, 0x40, 0xce, 0x53, 0xce, 0x05, 0x26, 0xa8, 0x1d, 0x29, 0x16, 0x82, 0x54, 0xc4, - 0xf6, 0x6c, 0xdf, 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9, 0x74, 0x10, 0xc9, 0x34, 0x28, 0x2e, 0x7c, - 0x53, 0x9f, 0x38, 0xd8, 0x7d, 0x82, 0x7c, 0x2f, 0xe1, 0x75, 0xc9, 0xf4, 0xb4, 0x65, 0x6e, 0x7b, - 0xf7, 0x13, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x8b, 0xc9, 0x20, 0x28, 0x02, 0x00, 0x00, -} - -func (m *Txin) 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 *Txin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Txin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.FinalizedHeight != 0 { - i = encodeVarintTxin(dAtA, i, uint64(m.FinalizedHeight)) - i-- - dAtA[i] = 0x60 - } - if len(m.Signers) > 0 { - for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Signers[iNdEx]) - copy(dAtA[i:], m.Signers[iNdEx]) - i = encodeVarintTxin(dAtA, i, uint64(len(m.Signers[iNdEx]))) - i-- - dAtA[i] = 0x5a - } - } - if m.BlockHeight != 0 { - i = encodeVarintTxin(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x50 - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTxin(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x4a - } - if len(m.FromAddress) > 0 { - i -= len(m.FromAddress) - copy(dAtA[i:], m.FromAddress) - i = encodeVarintTxin(dAtA, i, uint64(len(m.FromAddress))) - i-- - dAtA[i] = 0x42 - } - if len(m.DestinationAsset) > 0 { - i -= len(m.DestinationAsset) - copy(dAtA[i:], m.DestinationAsset) - i = encodeVarintTxin(dAtA, i, uint64(len(m.DestinationAsset))) - i-- - dAtA[i] = 0x3a - } - if m.MBurnt != 0 { - i = encodeVarintTxin(dAtA, i, uint64(m.MBurnt)) - i-- - dAtA[i] = 0x30 - } - if m.SourceAmount != 0 { - i = encodeVarintTxin(dAtA, i, uint64(m.SourceAmount)) - i-- - dAtA[i] = 0x28 - } - if len(m.SourceAsset) > 0 { - i -= len(m.SourceAsset) - copy(dAtA[i:], m.SourceAsset) - i = encodeVarintTxin(dAtA, i, uint64(len(m.SourceAsset))) - i-- - dAtA[i] = 0x22 - } - if len(m.TxHash) > 0 { - i -= len(m.TxHash) - copy(dAtA[i:], m.TxHash) - i = encodeVarintTxin(dAtA, i, uint64(len(m.TxHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintTxin(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTxin(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTxin(dAtA []byte, offset int, v uint64) int { - offset -= sovTxin(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Txin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTxin(uint64(l)) - } - l = len(m.Index) - if l > 0 { - n += 1 + l + sovTxin(uint64(l)) - } - l = len(m.TxHash) - if l > 0 { - n += 1 + l + sovTxin(uint64(l)) - } - l = len(m.SourceAsset) - if l > 0 { - n += 1 + l + sovTxin(uint64(l)) - } - if m.SourceAmount != 0 { - n += 1 + sovTxin(uint64(m.SourceAmount)) - } - if m.MBurnt != 0 { - n += 1 + sovTxin(uint64(m.MBurnt)) - } - l = len(m.DestinationAsset) - if l > 0 { - n += 1 + l + sovTxin(uint64(l)) - } - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTxin(uint64(l)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTxin(uint64(l)) - } - if m.BlockHeight != 0 { - n += 1 + sovTxin(uint64(m.BlockHeight)) - } - if len(m.Signers) > 0 { - for _, s := range m.Signers { - l = len(s) - n += 1 + l + sovTxin(uint64(l)) - } - } - if m.FinalizedHeight != 0 { - n += 1 + sovTxin(uint64(m.FinalizedHeight)) - } - return n -} - -func sovTxin(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTxin(x uint64) (n int) { - return sovTxin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Txin) 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 ErrIntOverflowTxin - } - 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: Txin: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Txin: 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 ErrIntOverflowTxin - } - 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 ErrInvalidLengthTxin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxin - } - 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 Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - 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 ErrInvalidLengthTxin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - 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 ErrInvalidLengthTxin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAsset", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - 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 ErrInvalidLengthTxin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SourceAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAmount", wireType) - } - m.SourceAmount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SourceAmount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MBurnt", wireType) - } - m.MBurnt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MBurnt |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationAsset", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - 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 ErrInvalidLengthTxin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - 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 ErrInvalidLengthTxin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FromAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - 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 ErrInvalidLengthTxin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - 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 ErrIntOverflowTxin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - 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 ErrInvalidLengthTxin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalizedHeight", wireType) - } - m.FinalizedHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxin - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FinalizedHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTxin(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTxin - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTxin(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxin - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxin - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxin - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTxin - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTxin - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTxin - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTxin = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTxin = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTxin = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/metacore/types/txin_voter.pb.go b/x/metacore/types/txin_voter.pb.go deleted file mode 100644 index 563fd93827..0000000000 --- a/x/metacore/types/txin_voter.pb.go +++ /dev/null @@ -1,736 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: metacore/txin_voter.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type TxinVoter struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` - TxHash string `protobuf:"bytes,3,opt,name=txHash,proto3" json:"txHash,omitempty"` - SourceAsset string `protobuf:"bytes,4,opt,name=sourceAsset,proto3" json:"sourceAsset,omitempty"` - SourceAmount uint64 `protobuf:"varint,5,opt,name=sourceAmount,proto3" json:"sourceAmount,omitempty"` - MBurnt uint64 `protobuf:"varint,6,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` - DestinationAsset string `protobuf:"bytes,7,opt,name=destinationAsset,proto3" json:"destinationAsset,omitempty"` - FromAddress string `protobuf:"bytes,8,opt,name=fromAddress,proto3" json:"fromAddress,omitempty"` - ToAddress string `protobuf:"bytes,9,opt,name=toAddress,proto3" json:"toAddress,omitempty"` - BlockHeight uint64 `protobuf:"varint,10,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"` -} - -func (m *TxinVoter) Reset() { *m = TxinVoter{} } -func (m *TxinVoter) String() string { return proto.CompactTextString(m) } -func (*TxinVoter) ProtoMessage() {} -func (*TxinVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_2096ad856d20275a, []int{0} -} -func (m *TxinVoter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxinVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxinVoter.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 *TxinVoter) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxinVoter.Merge(m, src) -} -func (m *TxinVoter) XXX_Size() int { - return m.Size() -} -func (m *TxinVoter) XXX_DiscardUnknown() { - xxx_messageInfo_TxinVoter.DiscardUnknown(m) -} - -var xxx_messageInfo_TxinVoter proto.InternalMessageInfo - -func (m *TxinVoter) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *TxinVoter) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *TxinVoter) GetTxHash() string { - if m != nil { - return m.TxHash - } - return "" -} - -func (m *TxinVoter) GetSourceAsset() string { - if m != nil { - return m.SourceAsset - } - return "" -} - -func (m *TxinVoter) GetSourceAmount() uint64 { - if m != nil { - return m.SourceAmount - } - return 0 -} - -func (m *TxinVoter) GetMBurnt() uint64 { - if m != nil { - return m.MBurnt - } - return 0 -} - -func (m *TxinVoter) GetDestinationAsset() string { - if m != nil { - return m.DestinationAsset - } - return "" -} - -func (m *TxinVoter) GetFromAddress() string { - if m != nil { - return m.FromAddress - } - return "" -} - -func (m *TxinVoter) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *TxinVoter) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func init() { - proto.RegisterType((*TxinVoter)(nil), "MetaProtocol.metacore.metacore.TxinVoter") -} - -func init() { proto.RegisterFile("metacore/txin_voter.proto", fileDescriptor_2096ad856d20275a) } - -var fileDescriptor_2096ad856d20275a = []byte{ - // 320 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xcd, 0x4a, 0x03, 0x31, - 0x14, 0x85, 0x3b, 0xb5, 0x3f, 0x4e, 0x74, 0x21, 0xa1, 0x48, 0x14, 0x09, 0xa5, 0xab, 0x22, 0xd8, - 0x01, 0x7d, 0x82, 0x76, 0xd5, 0x85, 0x82, 0x14, 0x71, 0xe1, 0x46, 0xa6, 0x99, 0x38, 0x0d, 0x76, - 0x72, 0x4b, 0x72, 0x47, 0xc6, 0xb7, 0xf0, 0x8d, 0xdc, 0xba, 0xec, 0xd2, 0xa5, 0xb4, 0x2f, 0x22, - 0xc9, 0x74, 0xda, 0x8a, 0xbb, 0x73, 0xbe, 0x93, 0xdc, 0x7b, 0xe1, 0x90, 0xb3, 0x4c, 0x62, 0x2c, - 0xc0, 0xc8, 0x08, 0x0b, 0xa5, 0x9f, 0xdf, 0x00, 0xa5, 0x19, 0x2c, 0x0c, 0x20, 0x50, 0x7e, 0x27, - 0x31, 0xbe, 0x77, 0x52, 0xc0, 0x7c, 0x50, 0xbd, 0xdb, 0x8a, 0xf3, 0x4e, 0x0a, 0x29, 0xf8, 0xa7, - 0x91, 0x53, 0xe5, 0xaf, 0xde, 0x67, 0x9d, 0x84, 0x0f, 0x85, 0xd2, 0x8f, 0x6e, 0x12, 0x65, 0xa4, - 0x2d, 0x8c, 0x8c, 0x11, 0x0c, 0x0b, 0xba, 0x41, 0x3f, 0x9c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} - -func (m *TxinVoter) 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 *TxinVoter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxinVoter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BlockHeight != 0 { - i = encodeVarintTxinVoter(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x50 - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTxinVoter(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x4a - } - if len(m.FromAddress) > 0 { - i -= len(m.FromAddress) - copy(dAtA[i:], m.FromAddress) - i = encodeVarintTxinVoter(dAtA, i, uint64(len(m.FromAddress))) - i-- - dAtA[i] = 0x42 - } - if len(m.DestinationAsset) > 0 { - i -= len(m.DestinationAsset) - copy(dAtA[i:], m.DestinationAsset) - i = encodeVarintTxinVoter(dAtA, i, uint64(len(m.DestinationAsset))) - i-- - dAtA[i] = 0x3a - } - if m.MBurnt != 0 { - i = encodeVarintTxinVoter(dAtA, i, uint64(m.MBurnt)) - i-- - dAtA[i] = 0x30 - } - if m.SourceAmount != 0 { - i = encodeVarintTxinVoter(dAtA, i, uint64(m.SourceAmount)) - i-- - dAtA[i] = 0x28 - } - if len(m.SourceAsset) > 0 { - i -= len(m.SourceAsset) - copy(dAtA[i:], m.SourceAsset) - i = encodeVarintTxinVoter(dAtA, i, uint64(len(m.SourceAsset))) - i-- - dAtA[i] = 0x22 - } - if len(m.TxHash) > 0 { - i -= len(m.TxHash) - copy(dAtA[i:], m.TxHash) - i = encodeVarintTxinVoter(dAtA, i, uint64(len(m.TxHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintTxinVoter(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTxinVoter(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTxinVoter(dAtA []byte, offset int, v uint64) int { - offset -= sovTxinVoter(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TxinVoter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTxinVoter(uint64(l)) - } - l = len(m.Index) - if l > 0 { - n += 1 + l + sovTxinVoter(uint64(l)) - } - l = len(m.TxHash) - if l > 0 { - n += 1 + l + sovTxinVoter(uint64(l)) - } - l = len(m.SourceAsset) - if l > 0 { - n += 1 + l + sovTxinVoter(uint64(l)) - } - if m.SourceAmount != 0 { - n += 1 + sovTxinVoter(uint64(m.SourceAmount)) - } - if m.MBurnt != 0 { - n += 1 + sovTxinVoter(uint64(m.MBurnt)) - } - l = len(m.DestinationAsset) - if l > 0 { - n += 1 + l + sovTxinVoter(uint64(l)) - } - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTxinVoter(uint64(l)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTxinVoter(uint64(l)) - } - if m.BlockHeight != 0 { - n += 1 + sovTxinVoter(uint64(m.BlockHeight)) - } - return n -} - -func sovTxinVoter(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTxinVoter(x uint64) (n int) { - return sovTxinVoter(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TxinVoter) 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 ErrIntOverflowTxinVoter - } - 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: TxinVoter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxinVoter: 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 ErrIntOverflowTxinVoter - } - 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 ErrInvalidLengthTxinVoter - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxinVoter - } - 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 Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxinVoter - } - 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 ErrInvalidLengthTxinVoter - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxinVoter - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxinVoter - } - 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 ErrInvalidLengthTxinVoter - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxinVoter - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAsset", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxinVoter - } - 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 ErrInvalidLengthTxinVoter - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxinVoter - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SourceAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAmount", wireType) - } - m.SourceAmount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxinVoter - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SourceAmount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MBurnt", wireType) - } - m.MBurnt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxinVoter - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MBurnt |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationAsset", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxinVoter - } - 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 ErrInvalidLengthTxinVoter - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxinVoter - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxinVoter - } - 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 ErrInvalidLengthTxinVoter - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxinVoter - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FromAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxinVoter - } - 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 ErrInvalidLengthTxinVoter - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxinVoter - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - 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 ErrIntOverflowTxinVoter - } - 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 := skipTxinVoter(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTxinVoter - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTxinVoter(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxinVoter - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxinVoter - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxinVoter - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTxinVoter - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTxinVoter - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTxinVoter - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTxinVoter = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTxinVoter = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTxinVoter = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/metacore/types/txout.pb.go b/x/metacore/types/txout.pb.go deleted file mode 100644 index 2ee5291da2..0000000000 --- a/x/metacore/types/txout.pb.go +++ /dev/null @@ -1,884 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: metacore/txout.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Txout struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - TxinHash string `protobuf:"bytes,3,opt,name=txinHash,proto3" json:"txinHash,omitempty"` - SourceAsset string `protobuf:"bytes,4,opt,name=sourceAsset,proto3" json:"sourceAsset,omitempty"` - SourceAmount uint64 `protobuf:"varint,5,opt,name=sourceAmount,proto3" json:"sourceAmount,omitempty"` - MBurnt uint64 `protobuf:"varint,6,opt,name=mBurnt,proto3" json:"mBurnt,omitempty"` - MMint uint64 `protobuf:"varint,7,opt,name=mMint,proto3" json:"mMint,omitempty"` - DestinationAsset string `protobuf:"bytes,8,opt,name=destinationAsset,proto3" json:"destinationAsset,omitempty"` - DestinationAmount uint64 `protobuf:"varint,9,opt,name=destinationAmount,proto3" json:"destinationAmount,omitempty"` - FromAddress string `protobuf:"bytes,10,opt,name=fromAddress,proto3" json:"fromAddress,omitempty"` - ToAddress string `protobuf:"bytes,11,opt,name=toAddress,proto3" json:"toAddress,omitempty"` - BlockHeight uint64 `protobuf:"varint,12,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"` - Signers []string `protobuf:"bytes,13,rep,name=signers,proto3" json:"signers,omitempty"` - FinalizedHeight uint64 `protobuf:"varint,14,opt,name=finalizedHeight,proto3" json:"finalizedHeight,omitempty"` -} - -func (m *Txout) Reset() { *m = Txout{} } -func (m *Txout) String() string { return proto.CompactTextString(m) } -func (*Txout) ProtoMessage() {} -func (*Txout) Descriptor() ([]byte, []int) { - return fileDescriptor_f61438ebc14ac1ae, []int{0} -} -func (m *Txout) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Txout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Txout.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 *Txout) XXX_Merge(src proto.Message) { - xxx_messageInfo_Txout.Merge(m, src) -} -func (m *Txout) XXX_Size() int { - return m.Size() -} -func (m *Txout) XXX_DiscardUnknown() { - xxx_messageInfo_Txout.DiscardUnknown(m) -} - -var xxx_messageInfo_Txout proto.InternalMessageInfo - -func (m *Txout) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *Txout) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Txout) GetTxinHash() string { - if m != nil { - return m.TxinHash - } - return "" -} - -func (m *Txout) GetSourceAsset() string { - if m != nil { - return m.SourceAsset - } - return "" -} - -func (m *Txout) GetSourceAmount() uint64 { - if m != nil { - return m.SourceAmount - } - return 0 -} - -func (m *Txout) GetMBurnt() uint64 { - if m != nil { - return m.MBurnt - } - return 0 -} - -func (m *Txout) GetMMint() uint64 { - if m != nil { - return m.MMint - } - return 0 -} - -func (m *Txout) GetDestinationAsset() string { - if m != nil { - return m.DestinationAsset - } - return "" -} - -func (m *Txout) GetDestinationAmount() uint64 { - if m != nil { - return m.DestinationAmount - } - return 0 -} - -func (m *Txout) GetFromAddress() string { - if m != nil { - return m.FromAddress - } - return "" -} - -func (m *Txout) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *Txout) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func (m *Txout) GetSigners() []string { - if m != nil { - return m.Signers - } - return nil -} - -func (m *Txout) GetFinalizedHeight() uint64 { - if m != nil { - return m.FinalizedHeight - } - return 0 -} - -func init() { - proto.RegisterType((*Txout)(nil), "MetaProtocol.metacore.metacore.Txout") -} - -func init() { proto.RegisterFile("metacore/txout.proto", fileDescriptor_f61438ebc14ac1ae) } - -var fileDescriptor_f61438ebc14ac1ae = []byte{ - // 378 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xcf, 0x6e, 0xe2, 0x30, - 0x10, 0xc6, 0x13, 0xfe, 0xc7, 0xb0, 0xec, 0xae, 0x85, 0x56, 0x16, 0x5a, 0x79, 0x23, 0x4e, 0xd1, - 0x6a, 0x97, 0x48, 0xed, 0x13, 0xc0, 0x89, 0x43, 0x91, 0x2a, 0xd4, 0x53, 0x6f, 0x21, 0x31, 0xc1, - 0x2a, 0xb1, 0x91, 0x3d, 0x91, 0x68, 0x9f, 0xa2, 0x6f, 0x55, 0x8e, 0x1c, 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 0xc9, 0x28, 0x8a, 0x14, 0xd3, 0x9a, 0xa0, 0x7c, 0x9b, 0x12, 0xc2, 0xbf, 0x91, - 0x03, 0xb2, 0xf0, 0xdb, 0xc6, 0x3f, 0x83, 0xec, 0xfd, 0x7c, 0x25, 0xc3, 0x87, 0x09, 0xe3, 0xf1, - 0x12, 0x48, 0xc7, 0xcc, 0x29, 0x23, 0x4c, 0x51, 0x53, 0xf3, 0x58, 0x30, 0xa5, 0xc9, 0x37, 0xb7, - 0xea, 0x39, 0xe3, 0xda, 0xf6, 0xed, 0x8f, 0x35, 0x2b, 0x20, 0xf6, 0xd0, 0xf7, 0x05, 0x17, 0xc1, - 0x8a, 0x3f, 0xb1, 0xe8, 0x98, 0xd2, 0x35, 0x29, 0x5f, 0xf1, 0xf8, 0x66, 0xbb, 0xa7, 0xf6, 0x6e, - 0x4f, 0xed, 0xf7, 0x3d, 0xb5, 0x9f, 0x0f, 0xd4, 0xda, 0x1d, 0xa8, 0xf5, 0x7a, 0xa0, 0xd6, 0xfd, - 0x55, 0xcc, 0x61, 0x99, 0xce, 0x87, 0xa1, 0x4c, 0xfc, 0xec, 0x48, 0xfe, 0x17, 0x57, 0xe2, 0x9f, - 0x0e, 0x69, 0x73, 0x2e, 0xe1, 0x71, 0xcd, 0xf4, 0xbc, 0x61, 0xce, 0xe3, 0xfa, 0x23, 0x00, 0x00, - 0xff, 0xff, 0x94, 0x14, 0xe4, 0x97, 0x6c, 0x02, 0x00, 0x00, -} - -func (m *Txout) 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 *Txout) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Txout) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.FinalizedHeight != 0 { - i = encodeVarintTxout(dAtA, i, uint64(m.FinalizedHeight)) - i-- - dAtA[i] = 0x70 - } - if len(m.Signers) > 0 { - for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Signers[iNdEx]) - copy(dAtA[i:], m.Signers[iNdEx]) - i = encodeVarintTxout(dAtA, i, uint64(len(m.Signers[iNdEx]))) - i-- - dAtA[i] = 0x6a - } - } - if m.BlockHeight != 0 { - i = encodeVarintTxout(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x60 - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTxout(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x5a - } - if len(m.FromAddress) > 0 { - i -= len(m.FromAddress) - copy(dAtA[i:], m.FromAddress) - i = encodeVarintTxout(dAtA, i, uint64(len(m.FromAddress))) - i-- - dAtA[i] = 0x52 - } - if m.DestinationAmount != 0 { - i = encodeVarintTxout(dAtA, i, uint64(m.DestinationAmount)) - i-- - dAtA[i] = 0x48 - } - if len(m.DestinationAsset) > 0 { - i -= len(m.DestinationAsset) - copy(dAtA[i:], m.DestinationAsset) - i = encodeVarintTxout(dAtA, i, uint64(len(m.DestinationAsset))) - i-- - dAtA[i] = 0x42 - } - if m.MMint != 0 { - i = encodeVarintTxout(dAtA, i, uint64(m.MMint)) - i-- - dAtA[i] = 0x38 - } - if m.MBurnt != 0 { - i = encodeVarintTxout(dAtA, i, uint64(m.MBurnt)) - i-- - dAtA[i] = 0x30 - } - if m.SourceAmount != 0 { - i = encodeVarintTxout(dAtA, i, uint64(m.SourceAmount)) - i-- - dAtA[i] = 0x28 - } - if len(m.SourceAsset) > 0 { - i -= len(m.SourceAsset) - copy(dAtA[i:], m.SourceAsset) - i = encodeVarintTxout(dAtA, i, uint64(len(m.SourceAsset))) - i-- - dAtA[i] = 0x22 - } - if len(m.TxinHash) > 0 { - i -= len(m.TxinHash) - copy(dAtA[i:], m.TxinHash) - i = encodeVarintTxout(dAtA, i, uint64(len(m.TxinHash))) - i-- - dAtA[i] = 0x1a - } - if m.Id != 0 { - i = encodeVarintTxout(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x10 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTxout(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTxout(dAtA []byte, offset int, v uint64) int { - offset -= sovTxout(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Txout) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTxout(uint64(l)) - } - if m.Id != 0 { - n += 1 + sovTxout(uint64(m.Id)) - } - l = len(m.TxinHash) - if l > 0 { - n += 1 + l + sovTxout(uint64(l)) - } - l = len(m.SourceAsset) - if l > 0 { - n += 1 + l + sovTxout(uint64(l)) - } - if m.SourceAmount != 0 { - n += 1 + sovTxout(uint64(m.SourceAmount)) - } - if m.MBurnt != 0 { - n += 1 + sovTxout(uint64(m.MBurnt)) - } - if m.MMint != 0 { - n += 1 + sovTxout(uint64(m.MMint)) - } - l = len(m.DestinationAsset) - if l > 0 { - n += 1 + l + sovTxout(uint64(l)) - } - if m.DestinationAmount != 0 { - n += 1 + sovTxout(uint64(m.DestinationAmount)) - } - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTxout(uint64(l)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTxout(uint64(l)) - } - if m.BlockHeight != 0 { - n += 1 + sovTxout(uint64(m.BlockHeight)) - } - if len(m.Signers) > 0 { - for _, s := range m.Signers { - l = len(s) - n += 1 + l + sovTxout(uint64(l)) - } - } - if m.FinalizedHeight != 0 { - n += 1 + sovTxout(uint64(m.FinalizedHeight)) - } - return n -} - -func sovTxout(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTxout(x uint64) (n int) { - return sovTxout(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Txout) 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 ErrIntOverflowTxout - } - 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: Txout: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Txout: 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 ErrIntOverflowTxout - } - 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 ErrInvalidLengthTxout - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxout - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxinHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - 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 ErrInvalidLengthTxout - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxout - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxinHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAsset", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - 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 ErrInvalidLengthTxout - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxout - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SourceAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAmount", wireType) - } - m.SourceAmount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SourceAmount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MBurnt", wireType) - } - m.MBurnt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MBurnt |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MMint", wireType) - } - m.MMint = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MMint |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationAsset", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - 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 ErrInvalidLengthTxout - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxout - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationAmount", wireType) - } - m.DestinationAmount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DestinationAmount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - 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 ErrInvalidLengthTxout - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxout - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FromAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - 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 ErrInvalidLengthTxout - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxout - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - 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 ErrIntOverflowTxout - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - 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 ErrInvalidLengthTxout - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxout - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalizedHeight", wireType) - } - m.FinalizedHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxout - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FinalizedHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTxout(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTxout - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTxout(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxout - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxout - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxout - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTxout - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTxout - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTxout - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTxout = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTxout = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTxout = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/metacore/types/txout_confirmation.pb.go b/x/metacore/types/txout_confirmation.pb.go deleted file mode 100644 index 5e0959bf7f..0000000000 --- a/x/metacore/types/txout_confirmation.pb.go +++ /dev/null @@ -1,761 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: metacore/txout_confirmation.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type TxoutConfirmation struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` - TxoutId uint64 `protobuf:"varint,3,opt,name=txoutId,proto3" json:"txoutId,omitempty"` - TxHash string `protobuf:"bytes,4,opt,name=txHash,proto3" json:"txHash,omitempty"` - MMint uint64 `protobuf:"varint,5,opt,name=mMint,proto3" json:"mMint,omitempty"` - DestinationAsset string `protobuf:"bytes,6,opt,name=destinationAsset,proto3" json:"destinationAsset,omitempty"` - DestinationAmount uint64 `protobuf:"varint,7,opt,name=destinationAmount,proto3" json:"destinationAmount,omitempty"` - ToAddress string `protobuf:"bytes,8,opt,name=toAddress,proto3" json:"toAddress,omitempty"` - BlockHeight uint64 `protobuf:"varint,9,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"` - Signers []string `protobuf:"bytes,10,rep,name=signers,proto3" json:"signers,omitempty"` - FinalizedHeight uint64 `protobuf:"varint,11,opt,name=finalizedHeight,proto3" json:"finalizedHeight,omitempty"` -} - -func (m *TxoutConfirmation) Reset() { *m = TxoutConfirmation{} } -func (m *TxoutConfirmation) String() string { return proto.CompactTextString(m) } -func (*TxoutConfirmation) ProtoMessage() {} -func (*TxoutConfirmation) Descriptor() ([]byte, []int) { - return fileDescriptor_215cae0c23269573, []int{0} -} -func (m *TxoutConfirmation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxoutConfirmation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxoutConfirmation.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 *TxoutConfirmation) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxoutConfirmation.Merge(m, src) -} -func (m *TxoutConfirmation) XXX_Size() int { - return m.Size() -} -func (m *TxoutConfirmation) XXX_DiscardUnknown() { - xxx_messageInfo_TxoutConfirmation.DiscardUnknown(m) -} - -var xxx_messageInfo_TxoutConfirmation proto.InternalMessageInfo - -func (m *TxoutConfirmation) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *TxoutConfirmation) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *TxoutConfirmation) GetTxoutId() uint64 { - if m != nil { - return m.TxoutId - } - return 0 -} - -func (m *TxoutConfirmation) GetTxHash() string { - if m != nil { - return m.TxHash - } - return "" -} - -func (m *TxoutConfirmation) GetMMint() uint64 { - if m != nil { - return m.MMint - } - return 0 -} - -func (m *TxoutConfirmation) GetDestinationAsset() string { - if m != nil { - return m.DestinationAsset - } - return "" -} - -func (m *TxoutConfirmation) GetDestinationAmount() uint64 { - if m != nil { - return m.DestinationAmount - } - return 0 -} - -func (m *TxoutConfirmation) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *TxoutConfirmation) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func (m *TxoutConfirmation) GetSigners() []string { - if m != nil { - return m.Signers - } - return nil -} - -func (m *TxoutConfirmation) GetFinalizedHeight() uint64 { - if m != nil { - return m.FinalizedHeight - } - return 0 -} - -func init() { - proto.RegisterType((*TxoutConfirmation)(nil), "MetaProtocol.metacore.metacore.TxoutConfirmation") -} - -func init() { proto.RegisterFile("metacore/txout_confirmation.proto", fileDescriptor_215cae0c23269573) } - -var fileDescriptor_215cae0c23269573 = []byte{ - // 350 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xcf, 0x4a, 0xf3, 0x40, - 0x14, 0xc5, 0x93, 0xfe, 0xfd, 0x32, 0x5d, 0x7c, 0x76, 0x28, 0x32, 0x88, 0x8c, 0xd1, 0x55, 0x10, - 0x6d, 0x40, 0x9f, 0xa0, 0x75, 0x53, 0xc1, 0x82, 0x14, 0x57, 0x6e, 0x24, 0x4d, 0xa6, 0xe9, 0x60, - 0x33, 0xb7, 0x64, 0x6e, 0x21, 0xfa, 0x14, 0x3e, 0x56, 0x97, 0x5d, 0xba, 0x12, 0x69, 0x1f, 0xc0, - 0x57, 0x90, 0x4c, 0x9b, 0xb6, 0xd8, 0xdd, 0x39, 0x67, 0xce, 0xfd, 0x31, 0x70, 0xc8, 0x79, 0x22, - 0x30, 0x08, 0x21, 0x15, 0x3e, 0x66, 0x30, 0xc3, 0x97, 0x10, 0xd4, 0x48, 0xa6, 0x49, 0x80, 0x12, - 0x54, 0x7b, 0x9a, 0x02, 0x02, 0xe5, 0x7d, 0x81, 0xc1, 0x63, 0x2e, 0x43, 0x98, 0xb4, 0x8b, 0xfe,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, 0x4b, 0x6e, 0x7f, 0xac, 0xb8, 0xb5, 0x58, 0x71, - 0xeb, 0x73, 0xc5, 0xad, 0xe7, 0x9b, 0x58, 0xe2, 0x78, 0x36, 0x6c, 0x87, 0x90, 0xf8, 0xf9, 0x98, - 0xd7, 0xc5, 0x9a, 0xfe, 0x76, 0xfd, 0x6c, 0x27, 0xf1, 0x6d, 0x2a, 0xf4, 0xb0, 0x66, 0x66, 0xbc, - 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x05, 0xa9, 0xc8, 0x21, 0x02, 0x00, 0x00, -} - -func (m *TxoutConfirmation) 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 *TxoutConfirmation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxoutConfirmation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.FinalizedHeight != 0 { - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(m.FinalizedHeight)) - i-- - dAtA[i] = 0x58 - } - if len(m.Signers) > 0 { - for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Signers[iNdEx]) - copy(dAtA[i:], m.Signers[iNdEx]) - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(len(m.Signers[iNdEx]))) - i-- - dAtA[i] = 0x52 - } - } - if m.BlockHeight != 0 { - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x48 - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x42 - } - if m.DestinationAmount != 0 { - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(m.DestinationAmount)) - i-- - dAtA[i] = 0x38 - } - if len(m.DestinationAsset) > 0 { - i -= len(m.DestinationAsset) - copy(dAtA[i:], m.DestinationAsset) - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(len(m.DestinationAsset))) - i-- - dAtA[i] = 0x32 - } - if m.MMint != 0 { - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(m.MMint)) - i-- - dAtA[i] = 0x28 - } - if len(m.TxHash) > 0 { - i -= len(m.TxHash) - copy(dAtA[i:], m.TxHash) - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(len(m.TxHash))) - i-- - dAtA[i] = 0x22 - } - if m.TxoutId != 0 { - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(m.TxoutId)) - i-- - dAtA[i] = 0x18 - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTxoutConfirmation(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTxoutConfirmation(dAtA []byte, offset int, v uint64) int { - offset -= sovTxoutConfirmation(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TxoutConfirmation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTxoutConfirmation(uint64(l)) - } - l = len(m.Index) - if l > 0 { - n += 1 + l + sovTxoutConfirmation(uint64(l)) - } - if m.TxoutId != 0 { - n += 1 + sovTxoutConfirmation(uint64(m.TxoutId)) - } - l = len(m.TxHash) - if l > 0 { - n += 1 + l + sovTxoutConfirmation(uint64(l)) - } - if m.MMint != 0 { - n += 1 + sovTxoutConfirmation(uint64(m.MMint)) - } - l = len(m.DestinationAsset) - if l > 0 { - n += 1 + l + sovTxoutConfirmation(uint64(l)) - } - if m.DestinationAmount != 0 { - n += 1 + sovTxoutConfirmation(uint64(m.DestinationAmount)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTxoutConfirmation(uint64(l)) - } - if m.BlockHeight != 0 { - n += 1 + sovTxoutConfirmation(uint64(m.BlockHeight)) - } - if len(m.Signers) > 0 { - for _, s := range m.Signers { - l = len(s) - n += 1 + l + sovTxoutConfirmation(uint64(l)) - } - } - if m.FinalizedHeight != 0 { - n += 1 + sovTxoutConfirmation(uint64(m.FinalizedHeight)) - } - return n -} - -func sovTxoutConfirmation(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTxoutConfirmation(x uint64) (n int) { - return sovTxoutConfirmation(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TxoutConfirmation) 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 ErrIntOverflowTxoutConfirmation - } - 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: TxoutConfirmation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxoutConfirmation: 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 ErrIntOverflowTxoutConfirmation - } - 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 ErrInvalidLengthTxoutConfirmation - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxoutConfirmation - } - 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 Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxoutConfirmation - } - 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 ErrInvalidLengthTxoutConfirmation - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxoutConfirmation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TxoutId", wireType) - } - m.TxoutId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxoutConfirmation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TxoutId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxoutConfirmation - } - 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 ErrInvalidLengthTxoutConfirmation - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxoutConfirmation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MMint", wireType) - } - m.MMint = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxoutConfirmation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MMint |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationAsset", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxoutConfirmation - } - 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 ErrInvalidLengthTxoutConfirmation - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxoutConfirmation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DestinationAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationAmount", wireType) - } - m.DestinationAmount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxoutConfirmation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DestinationAmount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxoutConfirmation - } - 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 ErrInvalidLengthTxoutConfirmation - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxoutConfirmation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - 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 ErrIntOverflowTxoutConfirmation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxoutConfirmation - } - 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 ErrInvalidLengthTxoutConfirmation - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTxoutConfirmation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalizedHeight", wireType) - } - m.FinalizedHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTxoutConfirmation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FinalizedHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTxoutConfirmation(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTxoutConfirmation - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTxoutConfirmation(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxoutConfirmation - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxoutConfirmation - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTxoutConfirmation - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTxoutConfirmation - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTxoutConfirmation - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTxoutConfirmation - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTxoutConfirmation = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTxoutConfirmation = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTxoutConfirmation = fmt.Errorf("proto: unexpected end of group") -) From 592e7d89db2fe65d72d8e9fcfaf987cadd6c3147 Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Fri, 22 Oct 2021 14:44:01 -0500 Subject: [PATCH 09/10] receive type: for outbound consumption and also voter MetaClient watch receive type for outbound tx; once the outbound tx is confirmed, it sends receiveConfirm msg (to be introduced in later commit) Once enough voters votes on receiveConfirm, it's considered confirmed. MetaClient needs to make sure not to double sign and not to drop and "receive" outbound. --- docs/static/openapi.yml | 279 +++++ proto/metacore/genesis.proto | 4 +- proto/metacore/query.proto | 28 + proto/metacore/receive.proto | 16 + x/metacore/client/cli/query.go | 4 + x/metacore/client/cli/query_receive.go | 71 ++ x/metacore/client/cli/query_receive_test.go | 140 +++ x/metacore/genesis.go | 13 + x/metacore/keeper/grpc_query_receive.go | 54 + x/metacore/keeper/grpc_query_receive_test.go | 104 ++ x/metacore/keeper/msg_server_send_voter.go | 12 + x/metacore/keeper/receive.go | 49 + x/metacore/keeper/receive_test.go | 46 + x/metacore/types/genesis.go | 10 + x/metacore/types/genesis.pb.go | 130 ++- x/metacore/types/keys.go | 4 + x/metacore/types/query.pb.go | 1045 ++++++++++++++++-- x/metacore/types/query.pb.gw.go | 184 +++ x/metacore/types/receive.pb.go | 601 ++++++++++ 19 files changed, 2664 insertions(+), 130 deletions(-) create mode 100644 proto/metacore/receive.proto create mode 100644 x/metacore/client/cli/query_receive.go create mode 100644 x/metacore/client/cli/query_receive_test.go create mode 100644 x/metacore/keeper/grpc_query_receive.go create mode 100644 x/metacore/keeper/grpc_query_receive_test.go create mode 100644 x/metacore/keeper/receive.go create mode 100644 x/metacore/keeper/receive_test.go create mode 100644 x/metacore/types/receive.pb.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index edd20696e5..87332b590d 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -19332,6 +19332,189 @@ paths: type: string tags: - Query + /Meta-Protocol/metacore/metacore/receive: + get: + summary: Queries a list of receive items. + operationId: MetaProtocolMetacoreMetacoreReceiveAll + responses: + '200': + description: A successful response. + schema: + type: object + properties: + Receive: + type: array + items: + type: object + properties: + creator: + type: string + index: + type: string + sendHash: + type: string + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 + finalizedMetaHeight: + type: string + format: uint64 + signers: + type: array + items: + type: string + pagination: + type: object + properties: + nextKey: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.countTotal + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + tags: + - Query + '/Meta-Protocol/metacore/metacore/receive/{index}': + get: + summary: Queries a receive by index. + operationId: MetaProtocolMetacoreMetacoreReceive + responses: + '200': + description: A successful response. + schema: + type: object + properties: + Receive: + type: object + properties: + creator: + type: string + index: + type: string + sendHash: + type: string + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 + finalizedMetaHeight: + type: string + format: uint64 + signers: + type: array + items: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: index + in: path + required: true + type: string + tags: + - Query /Meta-Protocol/metacore/metacore/send: get: summary: Queries a list of send items. @@ -29805,6 +29988,57 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + MetaProtocol.metacore.metacore.QueryAllReceiveResponse: + type: object + properties: + Receive: + type: array + items: + type: object + properties: + creator: + type: string + index: + type: string + sendHash: + type: string + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 + finalizedMetaHeight: + type: string + format: uint64 + signers: + type: array + items: + type: string + pagination: + type: object + properties: + nextKey: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } MetaProtocol.metacore.metacore.QueryAllSendResponse: type: object properties: @@ -29899,6 +30133,30 @@ definitions: - Active - Disabled default: Unknown + MetaProtocol.metacore.metacore.QueryGetReceiveResponse: + type: object + properties: + Receive: + type: object + properties: + creator: + type: string + index: + type: string + sendHash: + type: string + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 + finalizedMetaHeight: + type: string + format: uint64 + signers: + type: array + items: + type: string MetaProtocol.metacore.metacore.QueryGetSendResponse: type: object properties: @@ -29941,6 +30199,27 @@ definitions: Height: type: string format: uint64 + MetaProtocol.metacore.metacore.Receive: + type: object + properties: + creator: + type: string + index: + type: string + sendHash: + type: string + outTxHash: + type: string + outBlockHeight: + type: string + format: uint64 + finalizedMetaHeight: + type: string + format: uint64 + signers: + type: array + items: + type: string MetaProtocol.metacore.metacore.Send: type: object properties: diff --git a/proto/metacore/genesis.proto b/proto/metacore/genesis.proto index c6490bd398..9ef7e9a2af 100644 --- a/proto/metacore/genesis.proto +++ b/proto/metacore/genesis.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package MetaProtocol.metacore.metacore; // this line is used by starport scaffolding # genesis/proto/import +import "metacore/receive.proto"; import "metacore/send.proto"; import "metacore/node_account.proto"; @@ -10,7 +11,8 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; // GenesisState defines the metacore module's genesis state. message GenesisState { // this line is used by starport scaffolding # genesis/proto/state - repeated Send sendList = 7; // this line is used by starport scaffolding # genesis/proto/stateField + repeated Send sendList = 1; // this line is used by starport scaffolding # genesis/proto/stateField + repeated Receive receiveList = 2; // this line is used by starport scaffolding # genesis/proto/stateField repeated NodeAccount nodeAccountList = 3; // this line is used by starport scaffolding # genesis/proto/stateField // this line is used by starport scaffolding # ibc/genesis/proto } diff --git a/proto/metacore/query.proto b/proto/metacore/query.proto index a04467eca2..00f9c30b93 100644 --- a/proto/metacore/query.proto +++ b/proto/metacore/query.proto @@ -4,6 +4,7 @@ package MetaProtocol.metacore.metacore; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; // this line is used by starport scaffolding # 1 +import "metacore/receive.proto"; import "metacore/send.proto"; import "metacore/node_account.proto"; @@ -13,6 +14,17 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; service Query { // this line is used by starport scaffolding # 2 + // Queries a receive by index. + rpc Receive(QueryGetReceiveRequest) returns (QueryGetReceiveResponse) { + option (google.api.http).get = "/Meta-Protocol/metacore/metacore/receive/{index}"; + } + + // Queries a list of receive items. + rpc ReceiveAll(QueryAllReceiveRequest) returns (QueryAllReceiveResponse) { + option (google.api.http).get = "/Meta-Protocol/metacore/metacore/receive"; + } + + // Queries a send by index. rpc Send(QueryGetSendRequest) returns (QueryGetSendResponse) { option (google.api.http).get = "/Meta-Protocol/metacore/metacore/send/{index}"; @@ -45,6 +57,22 @@ service Query { } // this line is used by starport scaffolding # 3 +message QueryGetReceiveRequest { + string index = 1; +} + +message QueryGetReceiveResponse { + Receive Receive = 1; +} + +message QueryAllReceiveRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllReceiveResponse { + repeated Receive Receive = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} message QueryGetSendRequest { string index = 1; } diff --git a/proto/metacore/receive.proto b/proto/metacore/receive.proto new file mode 100644 index 0000000000..7e2fd0f01a --- /dev/null +++ b/proto/metacore/receive.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package MetaProtocol.metacore.metacore; + +option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; + +import "gogoproto/gogo.proto"; + +message Receive { + string creator = 1; + string index = 2; + string sendHash = 3; + string outTxHash = 4; + uint64 outBlockHeight = 5; + uint64 finalizedMetaHeight = 6; + repeated string signers = 7; +} diff --git a/x/metacore/client/cli/query.go b/x/metacore/client/cli/query.go index 5f1b147ed0..0043c2f17b 100644 --- a/x/metacore/client/cli/query.go +++ b/x/metacore/client/cli/query.go @@ -26,6 +26,10 @@ func GetQueryCmd(queryRoute string) *cobra.Command { // this line is used by starport scaffolding # 1 + cmd.AddCommand(CmdListReceive()) + cmd.AddCommand(CmdShowReceive()) + + cmd.AddCommand(CmdListSend()) cmd.AddCommand(CmdShowSend()) diff --git a/x/metacore/client/cli/query_receive.go b/x/metacore/client/cli/query_receive.go new file mode 100644 index 0000000000..37daff1e93 --- /dev/null +++ b/x/metacore/client/cli/query_receive.go @@ -0,0 +1,71 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func CmdListReceive() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-receive", + Short: "list all receive", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllReceiveRequest{ + Pagination: pageReq, + } + + res, err := queryClient.ReceiveAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowReceive() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-receive [index]", + Short: "shows a receive", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetReceiveRequest{ + Index: args[0], + } + + res, err := queryClient.Receive(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/metacore/client/cli/query_receive_test.go b/x/metacore/client/cli/query_receive_test.go new file mode 100644 index 0000000000..b661af69cf --- /dev/null +++ b/x/metacore/client/cli/query_receive_test.go @@ -0,0 +1,140 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/Meta-Protocol/metacore/testutil/network" + "github.com/Meta-Protocol/metacore/x/metacore/client/cli" + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func networkWithReceiveObjects(t *testing.T, n int) (*network.Network, []*types.Receive) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + for i := 0; i < n; i++ { + state.ReceiveList = append(state.ReceiveList, &types.Receive{Creator: "ANY", Index: strconv.Itoa(i)}) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.ReceiveList +} + +func TestShowReceive(t *testing.T) { + net, objs := networkWithReceiveObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + id string + args []string + err error + obj *types.Receive + }{ + { + desc: "found", + id: objs[0].Index, + args: common, + obj: objs[0], + }, + { + desc: "not found", + id: "not_found", + args: common, + err: status.Error(codes.InvalidArgument, "not found"), + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + args := []string{tc.id} + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowReceive(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetReceiveResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Receive) + require.Equal(t, tc.obj, resp.Receive) + } + }) + } +} + +func TestListReceive(t *testing.T) { + net, objs := networkWithReceiveObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListReceive(), args) + require.NoError(t, err) + var resp types.QueryAllReceiveResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + for j := i; j < len(objs) && j < i+step; j++ { + assert.Equal(t, objs[j], resp.Receive[j-i]) + } + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListReceive(), args) + require.NoError(t, err) + var resp types.QueryAllReceiveResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + for j := i; j < len(objs) && j < i+step; j++ { + assert.Equal(t, objs[j], resp.Receive[j-i]) + } + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListReceive(), args) + require.NoError(t, err) + var resp types.QueryAllReceiveResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.Equal(t, objs, resp.Receive) + }) +} diff --git a/x/metacore/genesis.go b/x/metacore/genesis.go index beb61a8729..c90674efe0 100644 --- a/x/metacore/genesis.go +++ b/x/metacore/genesis.go @@ -10,6 +10,12 @@ import ( // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { // this line is used by starport scaffolding # genesis/module/init +// Set all the receive +for _, elem := range genState.ReceiveList { + k.SetReceive(ctx, *elem) +} + + // Set all the send for _, elem := range genState.SendList { k.SetSend(ctx, *elem) @@ -32,6 +38,13 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() // this line is used by starport scaffolding # genesis/module/export +// Get all receive +receiveList := k.GetAllReceive(ctx) +for _, elem := range receiveList { + elem := elem + genesis.ReceiveList = append(genesis.ReceiveList, &elem) +} + // Get all send sendList := k.GetAllSend(ctx) for _, elem := range sendList { diff --git a/x/metacore/keeper/grpc_query_receive.go b/x/metacore/keeper/grpc_query_receive.go new file mode 100644 index 0000000000..1d1a0f1c8d --- /dev/null +++ b/x/metacore/keeper/grpc_query_receive.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/Meta-Protocol/metacore/x/metacore/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ReceiveAll(c context.Context, req *types.QueryAllReceiveRequest) (*types.QueryAllReceiveResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var receives []*types.Receive + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + receiveStore := prefix.NewStore(store, types.KeyPrefix(types.ReceiveKey)) + + pageRes, err := query.Paginate(receiveStore, req.Pagination, func(key []byte, value []byte) error { + var receive types.Receive + if err := k.cdc.UnmarshalBinaryBare(value, &receive); err != nil { + return err + } + + receives = append(receives, &receive) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllReceiveResponse{Receive: receives, Pagination: pageRes}, nil +} + +func (k Keeper) Receive(c context.Context, req *types.QueryGetReceiveRequest) (*types.QueryGetReceiveResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetReceive(ctx, req.Index) + if !found { + return nil, status.Error(codes.InvalidArgument, "not found") + } + + return &types.QueryGetReceiveResponse{Receive: &val}, nil +} \ No newline at end of file diff --git a/x/metacore/keeper/grpc_query_receive_test.go b/x/metacore/keeper/grpc_query_receive_test.go new file mode 100644 index 0000000000..49dcce028b --- /dev/null +++ b/x/metacore/keeper/grpc_query_receive_test.go @@ -0,0 +1,104 @@ +package keeper + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func TestReceiveQuerySingle(t *testing.T) { + keeper, ctx := setupKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNReceive(keeper, ctx, 2) + for _, tc := range []struct { + desc string + request *types.QueryGetReceiveRequest + response *types.QueryGetReceiveResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetReceiveRequest{Index: msgs[0].Index}, + response: &types.QueryGetReceiveResponse{Receive: &msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetReceiveRequest{Index: msgs[1].Index}, + response: &types.QueryGetReceiveResponse{Receive: &msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetReceiveRequest{Index: "missing"}, + err: status.Error(codes.InvalidArgument, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Receive(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.Equal(t, tc.response, response) + } + }) + } +} + +func TestReceiveQueryPaginated(t *testing.T) { + keeper, ctx := setupKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNReceive(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllReceiveRequest { + return &types.QueryAllReceiveRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.ReceiveAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + for j := i; j < len(msgs) && j < i+step; j++ { + assert.Equal(t, &msgs[j], resp.Receive[j-i]) + } + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.ReceiveAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + for j := i; j < len(msgs) && j < i+step; j++ { + assert.Equal(t, &msgs[j], resp.Receive[j-i]) + } + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.ReceiveAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.ReceiveAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/metacore/keeper/msg_server_send_voter.go b/x/metacore/keeper/msg_server_send_voter.go index 8b8e83f71d..b0bbe232f9 100644 --- a/x/metacore/keeper/msg_server_send_voter.go +++ b/x/metacore/keeper/msg_server_send_voter.go @@ -35,6 +35,18 @@ func (k msgServer) SendVoter(goCtx context.Context, msg *types.MsgSendVoter) (*t //TODO: proper super majority needed if len(send.Signers) == 2 { send.FinalizedMetaHeight = uint64(ctx.BlockHeader().Height) + // create receive var to signal outbound tx + // also for collecting confirmation and store signers + receive := types.Receive{ + Creator: msg.Creator, + Index: index, + SendHash: index, + OutTxHash: "", + OutBlockHeight: 0, + FinalizedMetaHeight: 0, + Signers: []string{}, + } + k.SetReceive(ctx, receive) } diff --git a/x/metacore/keeper/receive.go b/x/metacore/keeper/receive.go new file mode 100644 index 0000000000..7c32f83002 --- /dev/null +++ b/x/metacore/keeper/receive.go @@ -0,0 +1,49 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/store/prefix" +) + +// SetReceive set a specific receive in the store from its index +func (k Keeper) SetReceive(ctx sdk.Context, receive types.Receive) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ReceiveKey)) + b := k.cdc.MustMarshalBinaryBare(&receive) + store.Set(types.KeyPrefix(receive.Index), b) +} + +// GetReceive returns a receive from its index +func (k Keeper) GetReceive(ctx sdk.Context, index string) (val types.Receive, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ReceiveKey)) + + b := store.Get(types.KeyPrefix(index)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshalBinaryBare(b, &val) + return val, true +} + +// RemoveReceive removes a receive from the store +func (k Keeper) RemoveReceive(ctx sdk.Context, index string) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ReceiveKey)) + store.Delete(types.KeyPrefix(index)) +} + +// GetAllReceive returns all receive +func (k Keeper) GetAllReceive(ctx sdk.Context) (list []types.Receive) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ReceiveKey)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Receive + k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/metacore/keeper/receive_test.go b/x/metacore/keeper/receive_test.go new file mode 100644 index 0000000000..b8b5c42203 --- /dev/null +++ b/x/metacore/keeper/receive_test.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "fmt" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/assert" + + "github.com/Meta-Protocol/metacore/x/metacore/types" +) + +func createNReceive(keeper *Keeper, ctx sdk.Context, n int) []types.Receive { + items := make([]types.Receive, n) + for i := range items { + items[i].Creator = "any" + items[i].Index = fmt.Sprintf("%d", i) + keeper.SetReceive(ctx, items[i]) + } + return items +} + +func TestReceiveGet(t *testing.T) { + keeper, ctx := setupKeeper(t) + items := createNReceive(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetReceive(ctx, item.Index) + assert.True(t, found) + assert.Equal(t, item, rst) + } +} +func TestReceiveRemove(t *testing.T) { + keeper, ctx := setupKeeper(t) + items := createNReceive(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveReceive(ctx, item.Index) + _, found := keeper.GetReceive(ctx, item.Index) + assert.False(t, found) + } +} + +func TestReceiveGetAll(t *testing.T) { + keeper, ctx := setupKeeper(t) + items := createNReceive(keeper, ctx, 10) + assert.Equal(t, items, keeper.GetAllReceive(ctx)) +} diff --git a/x/metacore/types/genesis.go b/x/metacore/types/genesis.go index a8fa34eacb..a4c4715795 100644 --- a/x/metacore/types/genesis.go +++ b/x/metacore/types/genesis.go @@ -13,6 +13,7 @@ func DefaultGenesis() *GenesisState { return &GenesisState{ // this line is used by starport scaffolding # ibc/genesistype/default // this line is used by starport scaffolding # genesis/types/default +ReceiveList: []*Receive{}, SendList: []*Send{}, NodeAccountList: []*NodeAccount{}, } @@ -24,6 +25,15 @@ func (gs GenesisState) Validate() error { // this line is used by starport scaffolding # ibc/genesistype/validate // this line is used by starport scaffolding # genesis/types/validate +// Check for duplicated index in receive +receiveIndexMap := make(map[string]bool) + +for _, elem := range gs.ReceiveList { + if _, ok := receiveIndexMap[elem.Index]; ok { + return fmt.Errorf("duplicated index for receive") + } + receiveIndexMap[elem.Index] = true +} // Check for duplicated index in send sendIndexMap := make(map[string]bool) diff --git a/x/metacore/types/genesis.pb.go b/x/metacore/types/genesis.pb.go index 96f3e70f5a..22e35231d9 100644 --- a/x/metacore/types/genesis.pb.go +++ b/x/metacore/types/genesis.pb.go @@ -25,7 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the metacore module's genesis state. type GenesisState struct { // this line is used by starport scaffolding # genesis/proto/state - SendList []*Send `protobuf:"bytes,7,rep,name=sendList,proto3" json:"sendList,omitempty"` + SendList []*Send `protobuf:"bytes,1,rep,name=sendList,proto3" json:"sendList,omitempty"` + ReceiveList []*Receive `protobuf:"bytes,2,rep,name=receiveList,proto3" json:"receiveList,omitempty"` NodeAccountList []*NodeAccount `protobuf:"bytes,3,rep,name=nodeAccountList,proto3" json:"nodeAccountList,omitempty"` } @@ -69,6 +70,13 @@ func (m *GenesisState) GetSendList() []*Send { return nil } +func (m *GenesisState) GetReceiveList() []*Receive { + if m != nil { + return m.ReceiveList + } + return nil +} + func (m *GenesisState) GetNodeAccountList() []*NodeAccount { if m != nil { return m.NodeAccountList @@ -83,21 +91,23 @@ func init() { func init() { proto.RegisterFile("metacore/genesis.proto", fileDescriptor_c68bd28f2e9a7fbf) } var fileDescriptor_c68bd28f2e9a7fbf = []byte{ - // 221 bytes of a gzipped FileDescriptorProto + // 253 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcb, 0x4d, 0x2d, 0x49, 0x4c, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xf3, 0x4d, 0x2d, 0x49, 0x0c, 0x00, 0x31, 0x93, 0xf3, 0x73, 0xf4, 0x60, - 0x8a, 0xe0, 0x0c, 0x29, 0x61, 0xb8, 0xbe, 0xe2, 0xd4, 0xbc, 0x14, 0x88, 0x26, 0x29, 0x69, 0xb8, - 0x60, 0x5e, 0x7e, 0x4a, 0x6a, 0x7c, 0x62, 0x72, 0x72, 0x7e, 0x69, 0x5e, 0x09, 0x44, 0x52, 0x69, - 0x39, 0x23, 0x17, 0x8f, 0x3b, 0xc4, 0x8e, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x07, 0x2e, 0x0e, - 0x90, 0x5e, 0x9f, 0xcc, 0xe2, 0x12, 0x09, 0x76, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x15, 0x3d, 0xfc, - 0xb6, 0xea, 0x05, 0xa7, 0xe6, 0xa5, 0x04, 0xc1, 0x75, 0x09, 0x85, 0x72, 0xf1, 0x83, 0x2c, 0x72, - 0x84, 0xd8, 0x03, 0x36, 0x88, 0x19, 0x6c, 0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0x90, 0x21, 0x41, 0x10, 0x2d, 0x41, 0xc8, 0x7a, 0x85, 0x42, 0xb9, 0xf8, 0x41, 0x6e, 0x76, + 0x84, 0x38, 0x19, 0x6c, 0x1c, 0x33, 0xd8, 0x38, 0x6d, 0x42, 0xc6, 0xf9, 0x21, 0xb4, 0x05, 0xa1, + 0x9b, 0xe1, 0xe4, 0x73, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, + 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x46, 0xe9, + 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0x1b, 0x74, 0x61, 0x56, 0xe8, + 0xc3, 0x03, 0xb1, 0x02, 0xc1, 0x2c, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x87, 0xa4, 0x31, + 0x20, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x01, 0xf4, 0x11, 0xcd, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -120,10 +130,10 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.SendList) > 0 { - for iNdEx := len(m.SendList) - 1; iNdEx >= 0; iNdEx-- { + if len(m.NodeAccountList) > 0 { + for iNdEx := len(m.NodeAccountList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.SendList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.NodeAccountList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -131,13 +141,13 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x1a } } - if len(m.NodeAccountList) > 0 { - for iNdEx := len(m.NodeAccountList) - 1; iNdEx >= 0; iNdEx-- { + if len(m.ReceiveList) > 0 { + for iNdEx := len(m.ReceiveList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.NodeAccountList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ReceiveList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -145,7 +155,21 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 + } + } + if len(m.SendList) > 0 { + for iNdEx := len(m.SendList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } } return len(dAtA) - i, nil @@ -168,14 +192,20 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - if len(m.NodeAccountList) > 0 { - for _, e := range m.NodeAccountList { + if len(m.SendList) > 0 { + for _, e := range m.SendList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.SendList) > 0 { - for _, e := range m.SendList { + if len(m.ReceiveList) > 0 { + for _, e := range m.ReceiveList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.NodeAccountList) > 0 { + for _, e := range m.NodeAccountList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } @@ -218,9 +248,9 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 3: + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeAccountList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SendList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -247,14 +277,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NodeAccountList = append(m.NodeAccountList, &NodeAccount{}) - if err := m.NodeAccountList[len(m.NodeAccountList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.SendList = append(m.SendList, &Send{}) + if err := m.SendList[len(m.SendList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SendList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ReceiveList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -281,8 +311,42 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SendList = append(m.SendList, &Send{}) - if err := m.SendList[len(m.SendList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ReceiveList = append(m.ReceiveList, &Receive{}) + if err := m.ReceiveList[len(m.ReceiveList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeAccountList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeAccountList = append(m.NodeAccountList, &NodeAccount{}) + if err := m.NodeAccountList[len(m.NodeAccountList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/metacore/types/keys.go b/x/metacore/types/keys.go index 01765f9408..1bc1c37744 100644 --- a/x/metacore/types/keys.go +++ b/x/metacore/types/keys.go @@ -49,3 +49,7 @@ const ( const ( SendKey = "Send-value-" ) + +const ( + ReceiveKey= "Receive-value-" +) diff --git a/x/metacore/types/query.pb.go b/x/metacore/types/query.pb.go index 44915611aa..576d4c0d3f 100644 --- a/x/metacore/types/query.pb.go +++ b/x/metacore/types/query.pb.go @@ -30,6 +30,190 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // this line is used by starport scaffolding # 3 +type QueryGetReceiveRequest struct { + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +} + +func (m *QueryGetReceiveRequest) Reset() { *m = QueryGetReceiveRequest{} } +func (m *QueryGetReceiveRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetReceiveRequest) ProtoMessage() {} +func (*QueryGetReceiveRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{0} +} +func (m *QueryGetReceiveRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetReceiveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetReceiveRequest.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 *QueryGetReceiveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetReceiveRequest.Merge(m, src) +} +func (m *QueryGetReceiveRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetReceiveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetReceiveRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetReceiveRequest proto.InternalMessageInfo + +func (m *QueryGetReceiveRequest) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +type QueryGetReceiveResponse struct { + Receive *Receive `protobuf:"bytes,1,opt,name=Receive,proto3" json:"Receive,omitempty"` +} + +func (m *QueryGetReceiveResponse) Reset() { *m = QueryGetReceiveResponse{} } +func (m *QueryGetReceiveResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetReceiveResponse) ProtoMessage() {} +func (*QueryGetReceiveResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{1} +} +func (m *QueryGetReceiveResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetReceiveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetReceiveResponse.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 *QueryGetReceiveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetReceiveResponse.Merge(m, src) +} +func (m *QueryGetReceiveResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetReceiveResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetReceiveResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetReceiveResponse proto.InternalMessageInfo + +func (m *QueryGetReceiveResponse) GetReceive() *Receive { + if m != nil { + return m.Receive + } + return nil +} + +type QueryAllReceiveRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllReceiveRequest) Reset() { *m = QueryAllReceiveRequest{} } +func (m *QueryAllReceiveRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllReceiveRequest) ProtoMessage() {} +func (*QueryAllReceiveRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{2} +} +func (m *QueryAllReceiveRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllReceiveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllReceiveRequest.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 *QueryAllReceiveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllReceiveRequest.Merge(m, src) +} +func (m *QueryAllReceiveRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllReceiveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllReceiveRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllReceiveRequest proto.InternalMessageInfo + +func (m *QueryAllReceiveRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllReceiveResponse struct { + Receive []*Receive `protobuf:"bytes,1,rep,name=Receive,proto3" json:"Receive,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllReceiveResponse) Reset() { *m = QueryAllReceiveResponse{} } +func (m *QueryAllReceiveResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllReceiveResponse) ProtoMessage() {} +func (*QueryAllReceiveResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc2a1267d2da6377, []int{3} +} +func (m *QueryAllReceiveResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllReceiveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllReceiveResponse.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 *QueryAllReceiveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllReceiveResponse.Merge(m, src) +} +func (m *QueryAllReceiveResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllReceiveResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllReceiveResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllReceiveResponse proto.InternalMessageInfo + +func (m *QueryAllReceiveResponse) GetReceive() []*Receive { + if m != nil { + return m.Receive + } + return nil +} + +func (m *QueryAllReceiveResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + type QueryGetSendRequest struct { Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` } @@ -38,7 +222,7 @@ func (m *QueryGetSendRequest) Reset() { *m = QueryGetSendRequest{} } func (m *QueryGetSendRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetSendRequest) ProtoMessage() {} func (*QueryGetSendRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{0} + return fileDescriptor_dc2a1267d2da6377, []int{4} } func (m *QueryGetSendRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -82,7 +266,7 @@ func (m *QueryGetSendResponse) Reset() { *m = QueryGetSendResponse{} } func (m *QueryGetSendResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetSendResponse) ProtoMessage() {} func (*QueryGetSendResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{1} + return fileDescriptor_dc2a1267d2da6377, []int{5} } func (m *QueryGetSendResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -126,7 +310,7 @@ func (m *QueryAllSendRequest) Reset() { *m = QueryAllSendRequest{} } func (m *QueryAllSendRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllSendRequest) ProtoMessage() {} func (*QueryAllSendRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{2} + return fileDescriptor_dc2a1267d2da6377, []int{6} } func (m *QueryAllSendRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -171,7 +355,7 @@ func (m *QueryAllSendResponse) Reset() { *m = QueryAllSendResponse{} } func (m *QueryAllSendResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllSendResponse) ProtoMessage() {} func (*QueryAllSendResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{3} + return fileDescriptor_dc2a1267d2da6377, []int{7} } func (m *QueryAllSendResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -222,7 +406,7 @@ func (m *QueryGetNodeAccountRequest) Reset() { *m = QueryGetNodeAccountR func (m *QueryGetNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountRequest) ProtoMessage() {} func (*QueryGetNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{4} + return fileDescriptor_dc2a1267d2da6377, []int{8} } func (m *QueryGetNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -266,7 +450,7 @@ func (m *QueryGetNodeAccountResponse) Reset() { *m = QueryGetNodeAccount func (m *QueryGetNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountResponse) ProtoMessage() {} func (*QueryGetNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{5} + return fileDescriptor_dc2a1267d2da6377, []int{9} } func (m *QueryGetNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -310,7 +494,7 @@ func (m *QueryAllNodeAccountRequest) Reset() { *m = QueryAllNodeAccountR func (m *QueryAllNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountRequest) ProtoMessage() {} func (*QueryAllNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{6} + return fileDescriptor_dc2a1267d2da6377, []int{10} } func (m *QueryAllNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -355,7 +539,7 @@ func (m *QueryAllNodeAccountResponse) Reset() { *m = QueryAllNodeAccount func (m *QueryAllNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountResponse) ProtoMessage() {} func (*QueryAllNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{7} + return fileDescriptor_dc2a1267d2da6377, []int{11} } func (m *QueryAllNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -405,7 +589,7 @@ func (m *QueryLastMetaHeightRequest) Reset() { *m = QueryLastMetaHeightR func (m *QueryLastMetaHeightRequest) String() string { return proto.CompactTextString(m) } func (*QueryLastMetaHeightRequest) ProtoMessage() {} func (*QueryLastMetaHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{8} + return fileDescriptor_dc2a1267d2da6377, []int{12} } func (m *QueryLastMetaHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -442,7 +626,7 @@ func (m *QueryLastMetaHeightResponse) Reset() { *m = QueryLastMetaHeight func (m *QueryLastMetaHeightResponse) String() string { return proto.CompactTextString(m) } func (*QueryLastMetaHeightResponse) ProtoMessage() {} func (*QueryLastMetaHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dc2a1267d2da6377, []int{9} + return fileDescriptor_dc2a1267d2da6377, []int{13} } func (m *QueryLastMetaHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -479,6 +663,10 @@ func (m *QueryLastMetaHeightResponse) GetHeight() uint64 { } func init() { + proto.RegisterType((*QueryGetReceiveRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetReceiveRequest") + proto.RegisterType((*QueryGetReceiveResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetReceiveResponse") + proto.RegisterType((*QueryAllReceiveRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllReceiveRequest") + proto.RegisterType((*QueryAllReceiveResponse)(nil), "MetaProtocol.metacore.metacore.QueryAllReceiveResponse") proto.RegisterType((*QueryGetSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryGetSendRequest") proto.RegisterType((*QueryGetSendResponse)(nil), "MetaProtocol.metacore.metacore.QueryGetSendResponse") proto.RegisterType((*QueryAllSendRequest)(nil), "MetaProtocol.metacore.metacore.QueryAllSendRequest") @@ -494,45 +682,53 @@ func init() { func init() { proto.RegisterFile("metacore/query.proto", fileDescriptor_dc2a1267d2da6377) } var fileDescriptor_dc2a1267d2da6377 = []byte{ - // 608 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6b, 0x13, 0x41, - 0x1c, 0xcd, 0xf4, 0x2f, 0x4e, 0xa1, 0x87, 0x69, 0x10, 0x49, 0xcb, 0x22, 0x8b, 0x5a, 0xb1, 0x66, - 0x87, 0xa4, 0xa9, 0x4a, 0xf5, 0x12, 0x0f, 0xd6, 0x43, 0x2b, 0x31, 0xde, 0x04, 0x91, 0xc9, 0xee, - 0xb0, 0x5d, 0xd8, 0xcc, 0xa4, 0x99, 0x89, 0xb4, 0x88, 0x17, 0x3f, 0x81, 0xe0, 0xc9, 0xb3, 0x20, - 0x7e, 0x01, 0xcf, 0x82, 0x78, 0xf0, 0x58, 0xf0, 0xe2, 0x51, 0x12, 0x3f, 0x88, 0xec, 0xcc, 0x64, - 0xb3, 0x9b, 0x6e, 0x9b, 0x4d, 0xdb, 0xdb, 0xcc, 0xe4, 0xf7, 0xde, 0xef, 0xbd, 0x37, 0xf3, 0xdb, - 0xc0, 0x62, 0x9b, 0x4a, 0xe2, 0xf2, 0x2e, 0xc5, 0x07, 0x3d, 0xda, 0x3d, 0x72, 0x3a, 0x5d, 0x2e, - 0x39, 0xb2, 0xf6, 0xa8, 0x24, 0x8d, 0x68, 0xe9, 0xf2, 0xd0, 0x19, 0x96, 0xc4, 0x8b, 0xd2, 0x9a, - 0xcf, 0xb9, 0x1f, 0x52, 0x4c, 0x3a, 0x01, 0x26, 0x8c, 0x71, 0x49, 0x64, 0xc0, 0x99, 0xd0, 0xe8, - 0xd2, 0x1d, 0x97, 0x8b, 0x36, 0x17, 0xb8, 0x45, 0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d0, 0xdd, 0x69, 0x9c, 0xa0, 0x1f, 0x00, 0x2e, 0xa7, 0xc7, 0x22, 0xa7, - 0x83, 0xcc, 0x49, 0xcb, 0xe9, 0x20, 0x7b, 0x0e, 0xed, 0xfb, 0xca, 0x41, 0x05, 0xe1, 0x89, 0x0e, - 0xc2, 0x14, 0xc1, 0xe3, 0xdd, 0x5f, 0x7d, 0x0b, 0x1c, 0xf7, 0x2d, 0xf0, 0xb7, 0x6f, 0x81, 0x0f, - 0x03, 0xab, 0x70, 0x3c, 0xb0, 0x0a, 0x7f, 0x06, 0x56, 0xe1, 0x65, 0xd5, 0x0f, 0xe4, 0x7e, 0xaf, - 0xe5, 0xb8, 0xbc, 0x7d, 0x1a, 0xe9, 0xe1, 0x68, 0x29, 0x8f, 0x3a, 0x54, 0xb4, 0x16, 0xd4, 0x9f, - 0xf1, 0xe6, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xa7, 0xd4, 0xef, 0x40, 0x08, 0x00, 0x00, + // 725 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x4f, 0xd4, 0x40, + 0x1c, 0x65, 0xf8, 0x1b, 0x87, 0x84, 0xc3, 0x40, 0xd0, 0x2c, 0xa4, 0x31, 0x13, 0x15, 0x02, 0xd2, + 0xc2, 0xf2, 0x37, 0xe8, 0x65, 0x3d, 0x88, 0x07, 0x30, 0xb8, 0xde, 0x8c, 0x46, 0xbb, 0xed, 0xa4, + 0x34, 0x19, 0x3a, 0xcb, 0x76, 0x96, 0x40, 0x8c, 0x17, 0xbf, 0x80, 0x26, 0x9e, 0x3c, 0x1b, 0x13, + 0x6f, 0x5e, 0xf4, 0x6c, 0x62, 0x3c, 0x78, 0x24, 0xf1, 0xe2, 0xd1, 0x80, 0x1f, 0xc4, 0x74, 0xfa, + 0x6b, 0x69, 0x77, 0x0b, 0xed, 0xae, 0x7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, 0xe8, 0xe4, 0x76, 0x27, 0x4e, 0xc8, 0x77, 0x84, 0xc7, + 0xd2, 0xfd, 0x53, 0xd0, 0x41, 0x66, 0xa5, 0x15, 0x74, 0x90, 0x5d, 0x78, 0x74, 0x5d, 0x39, 0x58, + 0x22, 0x46, 0xae, 0x03, 0x9e, 0x22, 0xb8, 0xb7, 0xfd, 0xf3, 0x54, 0x43, 0x27, 0xa7, 0x1a, 0xfa, + 0x73, 0xaa, 0xa1, 0xb7, 0x67, 0x5a, 0xdf, 0xc9, 0x99, 0xd6, 0xf7, 0xfb, 0x4c, 0xeb, 0x7b, 0x52, + 0x76, 0x5c, 0xb9, 0xd7, 0xac, 0xe9, 0x96, 0xd8, 0xbf, 0x88, 0xf4, 0xe8, 0xfc, 0x52, 0x1e, 0xd7, + 0x99, 0x5f, 0x1b, 0x56, 0xff, 0x46, 0x97, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x84, 0x52, 0x50, + 0x34, 0x59, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -547,6 +743,10 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { + // Queries a receive by index. + Receive(ctx context.Context, in *QueryGetReceiveRequest, opts ...grpc.CallOption) (*QueryGetReceiveResponse, error) + // Queries a list of receive items. + ReceiveAll(ctx context.Context, in *QueryAllReceiveRequest, opts ...grpc.CallOption) (*QueryAllReceiveResponse, error) // Queries a send by index. Send(ctx context.Context, in *QueryGetSendRequest, opts ...grpc.CallOption) (*QueryGetSendResponse, error) // Queries a list of send items. @@ -567,6 +767,24 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } +func (c *queryClient) Receive(ctx context.Context, in *QueryGetReceiveRequest, opts ...grpc.CallOption) (*QueryGetReceiveResponse, error) { + out := new(QueryGetReceiveResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/Receive", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ReceiveAll(ctx context.Context, in *QueryAllReceiveRequest, opts ...grpc.CallOption) (*QueryAllReceiveResponse, error) { + out := new(QueryAllReceiveResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/ReceiveAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Send(ctx context.Context, in *QueryGetSendRequest, opts ...grpc.CallOption) (*QueryGetSendResponse, error) { out := new(QueryGetSendResponse) err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Query/Send", in, out, opts...) @@ -614,6 +832,10 @@ func (c *queryClient) LastMetaHeight(ctx context.Context, in *QueryLastMetaHeigh // QueryServer is the server API for Query service. type QueryServer interface { + // Queries a receive by index. + Receive(context.Context, *QueryGetReceiveRequest) (*QueryGetReceiveResponse, error) + // Queries a list of receive items. + ReceiveAll(context.Context, *QueryAllReceiveRequest) (*QueryAllReceiveResponse, error) // Queries a send by index. Send(context.Context, *QueryGetSendRequest) (*QueryGetSendResponse, error) // Queries a list of send items. @@ -630,6 +852,12 @@ type QueryServer interface { type UnimplementedQueryServer struct { } +func (*UnimplementedQueryServer) Receive(ctx context.Context, req *QueryGetReceiveRequest) (*QueryGetReceiveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Receive not implemented") +} +func (*UnimplementedQueryServer) ReceiveAll(ctx context.Context, req *QueryAllReceiveRequest) (*QueryAllReceiveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReceiveAll not implemented") +} func (*UnimplementedQueryServer) Send(ctx context.Context, req *QueryGetSendRequest) (*QueryGetSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") } @@ -650,6 +878,42 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } +func _Query_Receive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetReceiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Receive(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/MetaProtocol.metacore.metacore.Query/Receive", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Receive(ctx, req.(*QueryGetReceiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ReceiveAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllReceiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ReceiveAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/MetaProtocol.metacore.metacore.Query/ReceiveAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ReceiveAll(ctx, req.(*QueryAllReceiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetSendRequest) if err := dec(in); err != nil { @@ -744,6 +1008,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "MetaProtocol.metacore.metacore.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "Receive", + Handler: _Query_Receive_Handler, + }, + { + MethodName: "ReceiveAll", + Handler: _Query_ReceiveAll_Handler, + }, { MethodName: "Send", Handler: _Query_Send_Handler, @@ -769,7 +1041,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "metacore/query.proto", } -func (m *QueryGetSendRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetReceiveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -779,12 +1051,12 @@ func (m *QueryGetSendRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetSendRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetReceiveRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetReceiveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -799,7 +1071,7 @@ func (m *QueryGetSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryGetSendResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetReceiveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -809,19 +1081,19 @@ func (m *QueryGetSendResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetSendResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetReceiveResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetReceiveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Send != nil { + if m.Receive != nil { { - size, err := m.Send.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Receive.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -834,7 +1106,7 @@ func (m *QueryGetSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllSendRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllReceiveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -844,12 +1116,12 @@ func (m *QueryAllSendRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllSendRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllReceiveRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllReceiveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -869,7 +1141,7 @@ func (m *QueryAllSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllSendResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllReceiveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -879,12 +1151,12 @@ func (m *QueryAllSendResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllSendResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllReceiveResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllReceiveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -901,10 +1173,10 @@ func (m *QueryAllSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Send) > 0 { - for iNdEx := len(m.Send) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Receive) > 0 { + for iNdEx := len(m.Receive) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Send[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Receive[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -918,7 +1190,7 @@ func (m *QueryAllSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryGetNodeAccountRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetSendRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -928,12 +1200,12 @@ func (m *QueryGetNodeAccountRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetNodeAccountRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetSendRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -948,7 +1220,7 @@ func (m *QueryGetNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryGetNodeAccountResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetSendResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -958,19 +1230,19 @@ func (m *QueryGetNodeAccountResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetNodeAccountResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetSendResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.NodeAccount != nil { + if m.Send != nil { { - size, err := m.NodeAccount.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Send.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -983,7 +1255,7 @@ func (m *QueryGetNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *QueryAllNodeAccountRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllSendRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -993,12 +1265,12 @@ func (m *QueryAllNodeAccountRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllNodeAccountRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllSendRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1018,7 +1290,7 @@ func (m *QueryAllNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryAllNodeAccountResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllSendResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1028,12 +1300,12 @@ func (m *QueryAllNodeAccountResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllNodeAccountResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllSendResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1050,10 +1322,10 @@ func (m *QueryAllNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, er i-- dAtA[i] = 0x12 } - if len(m.NodeAccount) > 0 { - for iNdEx := len(m.NodeAccount) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Send) > 0 { + for iNdEx := len(m.Send) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.NodeAccount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Send[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1067,7 +1339,7 @@ func (m *QueryAllNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *QueryLastMetaHeightRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetNodeAccountRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1077,20 +1349,27 @@ func (m *QueryLastMetaHeightRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryLastMetaHeightRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetNodeAccountRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryLastMetaHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *QueryLastMetaHeightResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetNodeAccountResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1100,23 +1379,165 @@ func (m *QueryLastMetaHeightResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryLastMetaHeightResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetNodeAccountResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryLastMetaHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Height != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} + if m.NodeAccount != nil { + { + size, err := m.NodeAccount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllNodeAccountRequest) 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 *QueryAllNodeAccountRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllNodeAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllNodeAccountResponse) 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 *QueryAllNodeAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllNodeAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.NodeAccount) > 0 { + for iNdEx := len(m.NodeAccount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NodeAccount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryLastMetaHeightRequest) 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 *QueryLastMetaHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLastMetaHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryLastMetaHeightResponse) 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 *QueryLastMetaHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLastMetaHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) @@ -1129,6 +1550,64 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryGetReceiveRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetReceiveResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Receive != nil { + l = m.Receive.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllReceiveRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllReceiveResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Receive) > 0 { + for _, e := range m.Receive { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryGetSendRequest) Size() (n int) { if m == nil { return 0 @@ -1272,6 +1751,380 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryGetReceiveRequest) 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 ErrIntOverflowQuery + } + 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: QueryGetReceiveRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetReceiveRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetReceiveResponse) 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 ErrIntOverflowQuery + } + 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: QueryGetReceiveResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetReceiveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receive", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Receive == nil { + m.Receive = &Receive{} + } + if err := m.Receive.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllReceiveRequest) 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 ErrIntOverflowQuery + } + 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: QueryAllReceiveRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllReceiveRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllReceiveResponse) 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 ErrIntOverflowQuery + } + 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: QueryAllReceiveResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllReceiveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receive", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receive = append(m.Receive, &Receive{}) + if err := m.Receive[len(m.Receive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryGetSendRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/metacore/types/query.pb.gw.go b/x/metacore/types/query.pb.gw.go index 613c2fd973..278198c99d 100644 --- a/x/metacore/types/query.pb.gw.go +++ b/x/metacore/types/query.pb.gw.go @@ -33,6 +33,96 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +func request_Query_Receive_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetReceiveRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + msg, err := client.Receive(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Receive_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetReceiveRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + msg, err := server.Receive(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ReceiveAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ReceiveAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllReceiveRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ReceiveAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ReceiveAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ReceiveAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllReceiveRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ReceiveAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ReceiveAll(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_Send_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetSendRequest var metadata runtime.ServerMetadata @@ -237,6 +327,52 @@ func local_request_Query_LastMetaHeight_0(ctx context.Context, marshaler runtime // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + mux.Handle("GET", pattern_Query_Receive_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Receive_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Receive_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ReceiveAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ReceiveAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ReceiveAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Send_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -393,6 +529,46 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + mux.Handle("GET", pattern_Query_Receive_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Receive_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Receive_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ReceiveAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ReceiveAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ReceiveAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Send_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -497,6 +673,10 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( + pattern_Query_Receive_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "receive", "index"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_ReceiveAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "receive"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Send_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"Meta-Protocol", "metacore", "send", "index"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_SendAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"Meta-Protocol", "metacore", "send"}, "", runtime.AssumeColonVerbOpt(true))) @@ -509,6 +689,10 @@ var ( ) var ( + forward_Query_Receive_0 = runtime.ForwardResponseMessage + + forward_Query_ReceiveAll_0 = runtime.ForwardResponseMessage + forward_Query_Send_0 = runtime.ForwardResponseMessage forward_Query_SendAll_0 = runtime.ForwardResponseMessage diff --git a/x/metacore/types/receive.pb.go b/x/metacore/types/receive.pb.go new file mode 100644 index 0000000000..a18576a914 --- /dev/null +++ b/x/metacore/types/receive.pb.go @@ -0,0 +1,601 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: metacore/receive.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Receive struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` + SendHash string `protobuf:"bytes,3,opt,name=sendHash,proto3" json:"sendHash,omitempty"` + OutTxHash string `protobuf:"bytes,4,opt,name=outTxHash,proto3" json:"outTxHash,omitempty"` + OutBlockHeight uint64 `protobuf:"varint,5,opt,name=outBlockHeight,proto3" json:"outBlockHeight,omitempty"` + FinalizedMetaHeight uint64 `protobuf:"varint,6,opt,name=finalizedMetaHeight,proto3" json:"finalizedMetaHeight,omitempty"` + Signers []string `protobuf:"bytes,7,rep,name=signers,proto3" json:"signers,omitempty"` +} + +func (m *Receive) Reset() { *m = Receive{} } +func (m *Receive) String() string { return proto.CompactTextString(m) } +func (*Receive) ProtoMessage() {} +func (*Receive) Descriptor() ([]byte, []int) { + return fileDescriptor_e79417efc64813d7, []int{0} +} +func (m *Receive) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Receive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Receive.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 *Receive) XXX_Merge(src proto.Message) { + xxx_messageInfo_Receive.Merge(m, src) +} +func (m *Receive) XXX_Size() int { + return m.Size() +} +func (m *Receive) XXX_DiscardUnknown() { + xxx_messageInfo_Receive.DiscardUnknown(m) +} + +var xxx_messageInfo_Receive proto.InternalMessageInfo + +func (m *Receive) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *Receive) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *Receive) GetSendHash() string { + if m != nil { + return m.SendHash + } + return "" +} + +func (m *Receive) GetOutTxHash() string { + if m != nil { + return m.OutTxHash + } + return "" +} + +func (m *Receive) GetOutBlockHeight() uint64 { + if m != nil { + return m.OutBlockHeight + } + return 0 +} + +func (m *Receive) GetFinalizedMetaHeight() uint64 { + if m != nil { + return m.FinalizedMetaHeight + } + return 0 +} + +func (m *Receive) GetSigners() []string { + if m != nil { + return m.Signers + } + return nil +} + +func init() { + proto.RegisterType((*Receive)(nil), "MetaProtocol.metacore.metacore.Receive") +} + +func init() { proto.RegisterFile("metacore/receive.proto", fileDescriptor_e79417efc64813d7) } + +var fileDescriptor_e79417efc64813d7 = []byte{ + // 278 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x50, 0xbb, 0x4e, 0xc3, 0x30, + 0x14, 0xad, 0xe9, 0x8b, 0x7a, 0x60, 0x30, 0x15, 0xb2, 0x2a, 0x64, 0x55, 0x0c, 0xa8, 0x0b, 0x09, + 0x82, 0x3f, 0xe8, 0xd4, 0x01, 0x24, 0x14, 0x31, 0xb1, 0xa5, 0xce, 0x25, 0xb1, 0x48, 0x73, 0x2b, + 0xc7, 0x41, 0x81, 0xaf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 0x45, 0xef, 0xe9, 0x26, 0x56, + 0x26, 0x29, 0xd6, 0x9e, 0xc4, 0x8d, 0x6f, 0x5f, 0x5d, 0xb5, 0x2b, 0xfa, 0xdd, 0xd4, 0xe5, 0x01, + 0x9a, 0xb7, 0x2d, 0xe4, 0xeb, 0x91, 0x9b, 0xef, 0xf6, 0x37, 0x00, 0x00, 0xff, 0xff, 0x79, 0xf9, + 0xcd, 0x3f, 0x8e, 0x01, 0x00, 0x00, +} + +func (m *Receive) 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 *Receive) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Receive) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signers) > 0 { + for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signers[iNdEx]) + copy(dAtA[i:], m.Signers[iNdEx]) + i = encodeVarintReceive(dAtA, i, uint64(len(m.Signers[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if m.FinalizedMetaHeight != 0 { + i = encodeVarintReceive(dAtA, i, uint64(m.FinalizedMetaHeight)) + i-- + dAtA[i] = 0x30 + } + if m.OutBlockHeight != 0 { + i = encodeVarintReceive(dAtA, i, uint64(m.OutBlockHeight)) + i-- + dAtA[i] = 0x28 + } + if len(m.OutTxHash) > 0 { + i -= len(m.OutTxHash) + copy(dAtA[i:], m.OutTxHash) + i = encodeVarintReceive(dAtA, i, uint64(len(m.OutTxHash))) + i-- + dAtA[i] = 0x22 + } + if len(m.SendHash) > 0 { + i -= len(m.SendHash) + copy(dAtA[i:], m.SendHash) + i = encodeVarintReceive(dAtA, i, uint64(len(m.SendHash))) + i-- + dAtA[i] = 0x1a + } + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintReceive(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintReceive(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintReceive(dAtA []byte, offset int, v uint64) int { + offset -= sovReceive(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Receive) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovReceive(uint64(l)) + } + l = len(m.Index) + if l > 0 { + n += 1 + l + sovReceive(uint64(l)) + } + l = len(m.SendHash) + if l > 0 { + n += 1 + l + sovReceive(uint64(l)) + } + l = len(m.OutTxHash) + if l > 0 { + n += 1 + l + sovReceive(uint64(l)) + } + if m.OutBlockHeight != 0 { + n += 1 + sovReceive(uint64(m.OutBlockHeight)) + } + if m.FinalizedMetaHeight != 0 { + n += 1 + sovReceive(uint64(m.FinalizedMetaHeight)) + } + if len(m.Signers) > 0 { + for _, s := range m.Signers { + l = len(s) + n += 1 + l + sovReceive(uint64(l)) + } + } + return n +} + +func sovReceive(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozReceive(x uint64) (n int) { + return sovReceive(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Receive) 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 ErrIntOverflowReceive + } + 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: Receive: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Receive: 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 ErrIntOverflowReceive + } + 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 ErrInvalidLengthReceive + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReceive + } + 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 Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReceive + } + 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 ErrInvalidLengthReceive + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReceive + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReceive + } + 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 ErrInvalidLengthReceive + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReceive + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutTxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReceive + } + 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 ErrInvalidLengthReceive + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReceive + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutBlockHeight", wireType) + } + m.OutBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReceive + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OutBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizedMetaHeight", wireType) + } + m.FinalizedMetaHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReceive + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FinalizedMetaHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReceive + } + 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 ErrInvalidLengthReceive + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReceive + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReceive(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReceive + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipReceive(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowReceive + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowReceive + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowReceive + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthReceive + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupReceive + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthReceive + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthReceive = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowReceive = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupReceive = fmt.Errorf("proto: unexpected end of group") +) From 533f56d37ec16d0395b2f8c0602f79f280b6510e Mon Sep 17 00:00:00 2001 From: brewmaster012 Date: Sat, 23 Oct 2021 02:03:46 -0500 Subject: [PATCH 10/10] receive confirm: voter logic --- cmd/metaclientd/tx.go | 22 +- cmd/metaclientd/voter_test.go | 31 +- docs/static/openapi.yml | 2 + proto/metacore/tx.proto | 12 + x/metacore/client/cli/query.go | 1 - x/metacore/client/cli/query_receive.go | 56 +- x/metacore/client/cli/query_receive_test.go | 6 +- x/metacore/client/cli/tx.go | 4 +- .../client/cli/tx_receive_confirmation.go | 45 ++ x/metacore/client/cli/tx_send_voter.go | 2 +- x/metacore/genesis.go | 28 +- x/metacore/handler.go | 4 + x/metacore/keeper/grpc_query_receive.go | 6 +- .../keeper/msg_server_receive_confirmation.go | 48 ++ x/metacore/keeper/msg_server_send_voter.go | 15 +- x/metacore/keeper/receive.go | 16 +- x/metacore/keeper/receive_test.go | 2 +- x/metacore/types/codec.go | 8 +- x/metacore/types/genesis.go | 22 +- x/metacore/types/keys.go | 2 +- .../types/message_receive_confirmation.go | 55 ++ x/metacore/types/message_send_voter.go | 2 +- x/metacore/types/tx.pb.go | 585 +++++++++++++++++- 23 files changed, 829 insertions(+), 145 deletions(-) create mode 100644 x/metacore/client/cli/tx_receive_confirmation.go create mode 100644 x/metacore/keeper/msg_server_receive_confirmation.go create mode 100644 x/metacore/types/message_receive_confirmation.go diff --git a/cmd/metaclientd/tx.go b/cmd/metaclientd/tx.go index c68f2d2e25..0e3b5a173d 100644 --- a/cmd/metaclientd/tx.go +++ b/cmd/metaclientd/tx.go @@ -6,7 +6,6 @@ import ( "github.com/rs/zerolog/log" ) - func (b *MetachainBridge) PostSend(sender string, senderChain string, receiver string, receiverChain string, mBurnt string, mMint string, message string, inTxHash string, inBlockHeight uint64) (string, error) { signerAddress := b.keys.GetSignerInfo().GetAddress().String() msg := types.NewMsgSendVoter(signerAddress, sender, senderChain, receiver, receiverChain, mBurnt, mMint, message, inTxHash, inBlockHeight) @@ -19,6 +18,17 @@ func (b *MetachainBridge) PostSend(sender string, senderChain string, receiver s return metaTxHash, nil } +func (b *MetachainBridge) PostReceiveConfirmation(sendHash string, outTxHash string, outBlockHeight uint64, mMint string) (string, error) { + signerAddress := b.keys.GetSignerInfo().GetAddress().String() + msg := types.NewMsgReceiveConfirmation(signerAddress, sendHash, outTxHash, outBlockHeight, mMint) + metaTxHash, err := b.Broadcast(msg) + if err != nil { + log.Err(err).Msg("PostReceiveConfirmation broadcast fail") + return "", err + } + return metaTxHash, nil +} + func (b *MetachainBridge) GetAllSend() ([]*types.Send, error) { client := types.NewQueryClient(b.grpcConn) resp, err := client.SendAll(context.Background(), &types.QueryAllSendRequest{}) @@ -27,4 +37,14 @@ func (b *MetachainBridge) GetAllSend() ([]*types.Send, error) { return nil, err } return resp.Send, nil +} + +func (b *MetachainBridge) GetAllReceive() ([]*types.Receive, error) { + client := types.NewQueryClient(b.grpcConn) + resp, err := client.ReceiveAll(context.Background(), &types.QueryAllReceiveRequest{}) + if err != nil { + log.Error().Err(err).Msg("query SendAll error") + return nil, err + } + return resp.Receive, nil } \ No newline at end of file diff --git a/cmd/metaclientd/voter_test.go b/cmd/metaclientd/voter_test.go index ba1450f28d..97ef04eab2 100644 --- a/cmd/metaclientd/voter_test.go +++ b/cmd/metaclientd/voter_test.go @@ -74,8 +74,6 @@ func (s *VoterSuite) SetUpTest(c *C) { } } - - func (s *VoterSuite) TestSendVoter(c *C) { b1 := s.bridge1 b2 := s.bridge2 @@ -103,17 +101,20 @@ func (s *VoterSuite) TestSendVoter(c *C) { log.Info().Msgf("sends: %v", sends) c.Assert(len(sends) >= 1, Equals, true) - //send := sends[0] - //tid := send.Index - //metaHash, err = b1.PostTxoutConfirmation(tid, "0xhashtxout", 1337, "0xnicetoken", 1773, "0xmywallet", 12345) - //timer3 := time.NewTimer(2 * time.Second) - //<-timer3.C - //metaHash, err = b2.PostTxoutConfirmation(tid, "0xhashtxout", 1337, "0xnicetoken", 1773, "0xmywallet", 12345) - // - //timer4 := time.NewTimer(2 * time.Second) - //<-timer4.C - // - //sends, err = b1.GetAllSend() - //c.Assert(err, IsNil) - //log.Info().Msgf("sends: %v", txouts) + send := sends[0] + + metaHash, err = b1.PostReceiveConfirmation(send.Index, "0xoutHash", 2123, "23245") + c.Assert(err, IsNil) + + timer3 := time.NewTimer(2 * time.Second) + <-timer3.C + + metaHash, err = b2.PostReceiveConfirmation(send.Index, "0xoutHash", 2123, "23245") + c.Assert(err, IsNil) + + receives, err := b2.GetAllReceive() + c.Assert(err, IsNil) + log.Info().Msgf("receives: %v", receives) + c.Assert(len(receives), Equals, 1) + } diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 87332b590d..b554a7a520 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -29888,6 +29888,8 @@ definitions: description: |- Version defines the versioning scheme used to negotiate the IBC verison in the connection handshake. + MetaProtocol.metacore.metacore.MsgReceiveConfirmationResponse: + type: object MetaProtocol.metacore.metacore.MsgSendVoterResponse: type: object MetaProtocol.metacore.metacore.MsgSetNodeKeysResponse: diff --git a/proto/metacore/tx.proto b/proto/metacore/tx.proto index 96457d41e4..1ff862fa10 100644 --- a/proto/metacore/tx.proto +++ b/proto/metacore/tx.proto @@ -9,11 +9,23 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; // Msg defines the Msg service. service Msg { // this line is used by starport scaffolding # proto/tx/rpc + rpc ReceiveConfirmation(MsgReceiveConfirmation) returns (MsgReceiveConfirmationResponse); rpc SendVoter(MsgSendVoter) returns (MsgSendVoterResponse); rpc SetNodeKeys(MsgSetNodeKeys) returns (MsgSetNodeKeysResponse); } // this line is used by starport scaffolding # proto/tx/message +message MsgReceiveConfirmation { + string creator = 1; + string sendHash = 2; + string outTxHash = 3; + uint64 outBlockHeight = 4; + string mMint = 5; +} + +message MsgReceiveConfirmationResponse { +} + message MsgSendVoter { string creator = 1; string sender = 2; diff --git a/x/metacore/client/cli/query.go b/x/metacore/client/cli/query.go index 0043c2f17b..4b23ebb8e3 100644 --- a/x/metacore/client/cli/query.go +++ b/x/metacore/client/cli/query.go @@ -29,7 +29,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdListReceive()) cmd.AddCommand(CmdShowReceive()) - cmd.AddCommand(CmdListSend()) cmd.AddCommand(CmdShowSend()) diff --git a/x/metacore/client/cli/query_receive.go b/x/metacore/client/cli/query_receive.go index 37daff1e93..3b275dc358 100644 --- a/x/metacore/client/cli/query_receive.go +++ b/x/metacore/client/cli/query_receive.go @@ -1,12 +1,12 @@ package cli import ( - "context" + "context" + "github.com/Meta-Protocol/metacore/x/metacore/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/Meta-Protocol/metacore/x/metacore/types" ) func CmdListReceive() *cobra.Command { @@ -14,32 +14,32 @@ func CmdListReceive() *cobra.Command { Use: "list-receive", Short: "list all receive", RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx := client.GetClientContextFromCmd(cmd) - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } - queryClient := types.NewQueryClient(clientCtx) + queryClient := types.NewQueryClient(clientCtx) - params := &types.QueryAllReceiveRequest{ - Pagination: pageReq, - } + params := &types.QueryAllReceiveRequest{ + Pagination: pageReq, + } - res, err := queryClient.ReceiveAll(context.Background(), params) - if err != nil { - return err - } + res, err := queryClient.ReceiveAll(context.Background(), params) + if err != nil { + return err + } - return clientCtx.PrintProto(res) + return clientCtx.PrintProto(res) }, } flags.AddPaginationFlagsToCmd(cmd, cmd.Use) flags.AddQueryFlagsToCmd(cmd) - return cmd + return cmd } func CmdShowReceive() *cobra.Command { @@ -48,24 +48,24 @@ func CmdShowReceive() *cobra.Command { Short: "shows a receive", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx := client.GetClientContextFromCmd(cmd) - queryClient := types.NewQueryClient(clientCtx) + queryClient := types.NewQueryClient(clientCtx) - params := &types.QueryGetReceiveRequest{ - Index: args[0], - } + params := &types.QueryGetReceiveRequest{ + Index: args[0], + } - res, err := queryClient.Receive(context.Background(), params) - if err != nil { - return err - } + res, err := queryClient.Receive(context.Background(), params) + if err != nil { + return err + } - return clientCtx.PrintProto(res) + return clientCtx.PrintProto(res) }, } flags.AddQueryFlagsToCmd(cmd) - return cmd + return cmd } diff --git a/x/metacore/client/cli/query_receive_test.go b/x/metacore/client/cli/query_receive_test.go index b661af69cf..1ebd446cbc 100644 --- a/x/metacore/client/cli/query_receive_test.go +++ b/x/metacore/client/cli/query_receive_test.go @@ -15,17 +15,17 @@ import ( "github.com/Meta-Protocol/metacore/testutil/network" "github.com/Meta-Protocol/metacore/x/metacore/client/cli" - "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/Meta-Protocol/metacore/x/metacore/types" ) func networkWithReceiveObjects(t *testing.T, n int) (*network.Network, []*types.Receive) { t.Helper() cfg := network.DefaultConfig() state := types.GenesisState{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) for i := 0; i < n; i++ { - state.ReceiveList = append(state.ReceiveList, &types.Receive{Creator: "ANY", Index: strconv.Itoa(i)}) + state.ReceiveList = append(state.ReceiveList, &types.Receive{Creator: "ANY", Index: strconv.Itoa(i), Signers: []string{}}) } buf, err := cfg.Codec.MarshalJSON(&state) require.NoError(t, err) diff --git a/x/metacore/client/cli/tx.go b/x/metacore/client/cli/tx.go index 351349a95e..43af9f7eef 100644 --- a/x/metacore/client/cli/tx.go +++ b/x/metacore/client/cli/tx.go @@ -30,11 +30,11 @@ func GetTxCmd() *cobra.Command { } // this line is used by starport scaffolding # 1 - cmd.AddCommand(CmdSendVoter()) + cmd.AddCommand(CmdReceiveConfirmation()) + cmd.AddCommand(CmdSendVoter()) cmd.AddCommand(CmdSetNodeKeys()) - return cmd } diff --git a/x/metacore/client/cli/tx_receive_confirmation.go b/x/metacore/client/cli/tx_receive_confirmation.go new file mode 100644 index 0000000000..49577227a8 --- /dev/null +++ b/x/metacore/client/cli/tx_receive_confirmation.go @@ -0,0 +1,45 @@ +package cli + +import ( + "github.com/spf13/cobra" + "strconv" + + "github.com/Meta-Protocol/metacore/x/metacore/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" +) + +var _ = strconv.Itoa(0) + +func CmdReceiveConfirmation() *cobra.Command { + cmd := &cobra.Command{ + Use: "receive-confirmation [sendHash] [outTxHash] [outBlockHeight] [mMint]", + Short: "Broadcast message receiveConfirmation", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) error { + argsSendHash := (args[0]) + argsOutTxHash := (args[1]) + argsOutBlockHeight, err := strconv.ParseInt(args[2], 10, 64) + if err != nil { + return err + } + argsMMint := (args[3]) + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgReceiveConfirmation(clientCtx.GetFromAddress().String(), (argsSendHash), (argsOutTxHash), uint64(argsOutBlockHeight), (argsMMint)) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/metacore/client/cli/tx_send_voter.go b/x/metacore/client/cli/tx_send_voter.go index da1bde5f08..efd7c9177a 100644 --- a/x/metacore/client/cli/tx_send_voter.go +++ b/x/metacore/client/cli/tx_send_voter.go @@ -26,7 +26,7 @@ func CmdSendVoter() *cobra.Command { argsMMint := (args[5]) argsMessage := (args[6]) argsInTxHash := (args[7]) - argsInBlockHeight,err := strconv.ParseInt(args[8], 10, 64) + argsInBlockHeight, err := strconv.ParseInt(args[8], 10, 64) if err != nil { return err } diff --git a/x/metacore/genesis.go b/x/metacore/genesis.go index c90674efe0..077f7a1c5a 100644 --- a/x/metacore/genesis.go +++ b/x/metacore/genesis.go @@ -10,26 +10,21 @@ import ( // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { // this line is used by starport scaffolding # genesis/module/init -// Set all the receive -for _, elem := range genState.ReceiveList { - k.SetReceive(ctx, *elem) -} - + // Set all the receive + for _, elem := range genState.ReceiveList { + k.SetReceive(ctx, *elem) + } // Set all the send for _, elem := range genState.SendList { k.SetSend(ctx, *elem) } - - // Set all the nodeAccount for _, elem := range genState.NodeAccountList { k.SetNodeAccount(ctx, *elem) } - - // this line is used by starport scaffolding # ibc/genesis/init } @@ -38,12 +33,12 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() // this line is used by starport scaffolding # genesis/module/export -// Get all receive -receiveList := k.GetAllReceive(ctx) -for _, elem := range receiveList { - elem := elem - genesis.ReceiveList = append(genesis.ReceiveList, &elem) -} + // Get all receive + receiveList := k.GetAllReceive(ctx) + for _, elem := range receiveList { + elem := elem + genesis.ReceiveList = append(genesis.ReceiveList, &elem) + } // Get all send sendList := k.GetAllSend(ctx) @@ -52,8 +47,6 @@ for _, elem := range receiveList { genesis.SendList = append(genesis.SendList, &elem) } - - // Get all nodeAccount nodeAccountList := k.GetAllNodeAccount(ctx) for _, elem := range nodeAccountList { @@ -61,7 +54,6 @@ for _, elem := range receiveList { genesis.NodeAccountList = append(genesis.NodeAccountList, &elem) } - // this line is used by starport scaffolding # ibc/genesis/export return genesis diff --git a/x/metacore/handler.go b/x/metacore/handler.go index 788c771214..dce79af7ad 100644 --- a/x/metacore/handler.go +++ b/x/metacore/handler.go @@ -18,6 +18,10 @@ func NewHandler(k keeper.Keeper) sdk.Handler { switch msg := msg.(type) { // this line is used by starport scaffolding # 1 + case *types.MsgReceiveConfirmation: + res, err := msgServer.ReceiveConfirmation(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgSendVoter: res, err := msgServer.SendVoter(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) diff --git a/x/metacore/keeper/grpc_query_receive.go b/x/metacore/keeper/grpc_query_receive.go index 1d1a0f1c8d..ef62051ead 100644 --- a/x/metacore/keeper/grpc_query_receive.go +++ b/x/metacore/keeper/grpc_query_receive.go @@ -3,10 +3,10 @@ package keeper import ( "context" + "github.com/Meta-Protocol/metacore/x/metacore/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/Meta-Protocol/metacore/x/metacore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -47,8 +47,8 @@ func (k Keeper) Receive(c context.Context, req *types.QueryGetReceiveRequest) (* val, found := k.GetReceive(ctx, req.Index) if !found { - return nil, status.Error(codes.InvalidArgument, "not found") + return nil, status.Error(codes.InvalidArgument, "not found") } return &types.QueryGetReceiveResponse{Receive: &val}, nil -} \ No newline at end of file +} diff --git a/x/metacore/keeper/msg_server_receive_confirmation.go b/x/metacore/keeper/msg_server_receive_confirmation.go new file mode 100644 index 0000000000..fddc9801cd --- /dev/null +++ b/x/metacore/keeper/msg_server_receive_confirmation.go @@ -0,0 +1,48 @@ +package keeper + +import ( + "context" + "fmt" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/Meta-Protocol/metacore/x/metacore/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) ReceiveConfirmation(goCtx context.Context, msg *types.MsgReceiveConfirmation) (*types.MsgReceiveConfirmationResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + index := msg.SendHash + send, isFound := k.GetSend(ctx, index) + if !isFound { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("sendHash %s does not exist", index)) + } + + if msg.MMint != send.MMint { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("MMint %s does not match send MMint %s", msg.MMint, send.MMint)) + } + + receiveIndex := msg.Digest() + receive, isFound := k.GetReceive(ctx, receiveIndex) + if !isFound { + receive = types.Receive{ + Creator: "", + Index: receiveIndex, + SendHash: index, + OutTxHash: msg.OutTxHash, + OutBlockHeight: msg.OutBlockHeight, + FinalizedMetaHeight: 0, + Signers: []string{msg.Creator}, + } + } else { + receive.Signers = append(receive.Signers, msg.Creator) + } + + //TODO: do proper super majority check + if len(receive.Signers) == 2 { + receive.FinalizedMetaHeight = uint64(ctx.BlockHeader().Height) + } + + k.SetReceive(ctx, receive) + return &types.MsgReceiveConfirmationResponse{}, nil +} diff --git a/x/metacore/keeper/msg_server_send_voter.go b/x/metacore/keeper/msg_server_send_voter.go index b0bbe232f9..61d0e0c77e 100644 --- a/x/metacore/keeper/msg_server_send_voter.go +++ b/x/metacore/keeper/msg_server_send_voter.go @@ -28,28 +28,15 @@ func (k msgServer) SendVoter(goCtx context.Context, msg *types.MsgSendVoter) (*t InTxHash: msg.InTxHash, InBlockHeight: msg.InBlockHeight, FinalizedMetaHeight: 0, - Signers: []string{msg.Creator}, + Signers: []string{msg.Creator}, } } //TODO: proper super majority needed if len(send.Signers) == 2 { send.FinalizedMetaHeight = uint64(ctx.BlockHeader().Height) - // create receive var to signal outbound tx - // also for collecting confirmation and store signers - receive := types.Receive{ - Creator: msg.Creator, - Index: index, - SendHash: index, - OutTxHash: "", - OutBlockHeight: 0, - FinalizedMetaHeight: 0, - Signers: []string{}, - } - k.SetReceive(ctx, receive) } - k.SetSend(ctx, send) return &types.MsgSendVoterResponse{}, nil diff --git a/x/metacore/keeper/receive.go b/x/metacore/keeper/receive.go index 7c32f83002..8150b3f9c4 100644 --- a/x/metacore/keeper/receive.go +++ b/x/metacore/keeper/receive.go @@ -1,14 +1,14 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/Meta-Protocol/metacore/x/metacore/types" "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" ) // SetReceive set a specific receive in the store from its index func (k Keeper) SetReceive(ctx sdk.Context, receive types.Receive) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ReceiveKey)) + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ReceiveKey)) b := k.cdc.MustMarshalBinaryBare(&receive) store.Set(types.KeyPrefix(receive.Index), b) } @@ -18,9 +18,9 @@ func (k Keeper) GetReceive(ctx sdk.Context, index string) (val types.Receive, fo store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ReceiveKey)) b := store.Get(types.KeyPrefix(index)) - if b == nil { - return val, false - } + if b == nil { + return val, false + } k.cdc.MustUnmarshalBinaryBare(b, &val) return val, true @@ -34,7 +34,7 @@ func (k Keeper) RemoveReceive(ctx sdk.Context, index string) { // GetAllReceive returns all receive func (k Keeper) GetAllReceive(ctx sdk.Context) (list []types.Receive) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ReceiveKey)) + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ReceiveKey)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -42,8 +42,8 @@ func (k Keeper) GetAllReceive(ctx sdk.Context) (list []types.Receive) { for ; iterator.Valid(); iterator.Next() { var val types.Receive k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) - list = append(list, val) + list = append(list, val) } - return + return } diff --git a/x/metacore/keeper/receive_test.go b/x/metacore/keeper/receive_test.go index b8b5c42203..0f7dd1be28 100644 --- a/x/metacore/keeper/receive_test.go +++ b/x/metacore/keeper/receive_test.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" - + "github.com/Meta-Protocol/metacore/x/metacore/types" ) diff --git a/x/metacore/types/codec.go b/x/metacore/types/codec.go index 58ba86a3f8..9239d7794e 100644 --- a/x/metacore/types/codec.go +++ b/x/metacore/types/codec.go @@ -9,16 +9,19 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { // this line is used by starport scaffolding # 2 - cdc.RegisterConcrete(&MsgSendVoter{}, "metacore/SendVoter", nil) + cdc.RegisterConcrete(&MsgReceiveConfirmation{}, "metacore/ReceiveConfirmation", nil) + cdc.RegisterConcrete(&MsgSendVoter{}, "metacore/SendVoter", nil) cdc.RegisterConcrete(&MsgSetNodeKeys{}, "metacore/SetNodeKeys", nil) - } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { // this line is used by starport scaffolding # 3 + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgReceiveConfirmation{}, + ) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSendVoter{}, ) @@ -27,7 +30,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgSetNodeKeys{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/metacore/types/genesis.go b/x/metacore/types/genesis.go index a4c4715795..1cdc81360d 100644 --- a/x/metacore/types/genesis.go +++ b/x/metacore/types/genesis.go @@ -13,9 +13,9 @@ func DefaultGenesis() *GenesisState { return &GenesisState{ // this line is used by starport scaffolding # ibc/genesistype/default // this line is used by starport scaffolding # genesis/types/default -ReceiveList: []*Receive{}, - SendList: []*Send{}, - NodeAccountList: []*NodeAccount{}, + ReceiveList: []*Receive{}, + SendList: []*Send{}, + NodeAccountList: []*NodeAccount{}, } } @@ -25,15 +25,15 @@ func (gs GenesisState) Validate() error { // this line is used by starport scaffolding # ibc/genesistype/validate // this line is used by starport scaffolding # genesis/types/validate -// Check for duplicated index in receive -receiveIndexMap := make(map[string]bool) + // Check for duplicated index in receive + receiveIndexMap := make(map[string]bool) -for _, elem := range gs.ReceiveList { - if _, ok := receiveIndexMap[elem.Index]; ok { - return fmt.Errorf("duplicated index for receive") + for _, elem := range gs.ReceiveList { + if _, ok := receiveIndexMap[elem.Index]; ok { + return fmt.Errorf("duplicated index for receive") + } + receiveIndexMap[elem.Index] = true } - receiveIndexMap[elem.Index] = true -} // Check for duplicated index in send sendIndexMap := make(map[string]bool) @@ -44,7 +44,6 @@ for _, elem := range gs.ReceiveList { sendIndexMap[elem.Index] = true } - // Check for duplicated index in nodeAccount nodeAccountIndexMap := make(map[string]bool) @@ -55,6 +54,5 @@ for _, elem := range gs.ReceiveList { nodeAccountIndexMap[elem.Index] = true } - return nil } diff --git a/x/metacore/types/keys.go b/x/metacore/types/keys.go index 1bc1c37744..91e49328ae 100644 --- a/x/metacore/types/keys.go +++ b/x/metacore/types/keys.go @@ -51,5 +51,5 @@ const ( ) const ( - ReceiveKey= "Receive-value-" + ReceiveKey = "Receive-value-" ) diff --git a/x/metacore/types/message_receive_confirmation.go b/x/metacore/types/message_receive_confirmation.go new file mode 100644 index 0000000000..333d716123 --- /dev/null +++ b/x/metacore/types/message_receive_confirmation.go @@ -0,0 +1,55 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/ethereum/go-ethereum/crypto" +) + +var _ sdk.Msg = &MsgReceiveConfirmation{} + +func NewMsgReceiveConfirmation(creator string, sendHash string, outTxHash string, outBlockHeight uint64, mMint string) *MsgReceiveConfirmation { + return &MsgReceiveConfirmation{ + Creator: creator, + SendHash: sendHash, + OutTxHash: outTxHash, + OutBlockHeight: outBlockHeight, + MMint: mMint, + } +} + +func (msg *MsgReceiveConfirmation) Route() string { + return RouterKey +} + +func (msg *MsgReceiveConfirmation) Type() string { + return "ReceiveConfirmation" +} + +func (msg *MsgReceiveConfirmation) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgReceiveConfirmation) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgReceiveConfirmation) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} + +func (msg *MsgReceiveConfirmation) Digest() string { + m := *msg + m.Creator = "" + hash := crypto.Keccak256Hash([]byte(m.String())) + return hash.Hex() +} diff --git a/x/metacore/types/message_send_voter.go b/x/metacore/types/message_send_voter.go index 9da3e38f46..63fb643f3a 100644 --- a/x/metacore/types/message_send_voter.go +++ b/x/metacore/types/message_send_voter.go @@ -58,4 +58,4 @@ func (msg *MsgSendVoter) Digest() string { m.Creator = "" hash := crypto.Keccak256Hash([]byte(m.String())) return hash.Hex() -} \ No newline at end of file +} diff --git a/x/metacore/types/tx.pb.go b/x/metacore/types/tx.pb.go index 06090ebce4..c720753c98 100644 --- a/x/metacore/types/tx.pb.go +++ b/x/metacore/types/tx.pb.go @@ -29,6 +29,118 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // this line is used by starport scaffolding # proto/tx/message +type MsgReceiveConfirmation struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + SendHash string `protobuf:"bytes,2,opt,name=sendHash,proto3" json:"sendHash,omitempty"` + OutTxHash string `protobuf:"bytes,3,opt,name=outTxHash,proto3" json:"outTxHash,omitempty"` + OutBlockHeight uint64 `protobuf:"varint,4,opt,name=outBlockHeight,proto3" json:"outBlockHeight,omitempty"` + MMint string `protobuf:"bytes,5,opt,name=mMint,proto3" json:"mMint,omitempty"` +} + +func (m *MsgReceiveConfirmation) Reset() { *m = MsgReceiveConfirmation{} } +func (m *MsgReceiveConfirmation) String() string { return proto.CompactTextString(m) } +func (*MsgReceiveConfirmation) ProtoMessage() {} +func (*MsgReceiveConfirmation) Descriptor() ([]byte, []int) { + return fileDescriptor_3410749d96999ade, []int{0} +} +func (m *MsgReceiveConfirmation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReceiveConfirmation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReceiveConfirmation.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 *MsgReceiveConfirmation) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReceiveConfirmation.Merge(m, src) +} +func (m *MsgReceiveConfirmation) XXX_Size() int { + return m.Size() +} +func (m *MsgReceiveConfirmation) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReceiveConfirmation.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReceiveConfirmation proto.InternalMessageInfo + +func (m *MsgReceiveConfirmation) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgReceiveConfirmation) GetSendHash() string { + if m != nil { + return m.SendHash + } + return "" +} + +func (m *MsgReceiveConfirmation) GetOutTxHash() string { + if m != nil { + return m.OutTxHash + } + return "" +} + +func (m *MsgReceiveConfirmation) GetOutBlockHeight() uint64 { + if m != nil { + return m.OutBlockHeight + } + return 0 +} + +func (m *MsgReceiveConfirmation) GetMMint() string { + if m != nil { + return m.MMint + } + return "" +} + +type MsgReceiveConfirmationResponse struct { +} + +func (m *MsgReceiveConfirmationResponse) Reset() { *m = MsgReceiveConfirmationResponse{} } +func (m *MsgReceiveConfirmationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgReceiveConfirmationResponse) ProtoMessage() {} +func (*MsgReceiveConfirmationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3410749d96999ade, []int{1} +} +func (m *MsgReceiveConfirmationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReceiveConfirmationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReceiveConfirmationResponse.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 *MsgReceiveConfirmationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReceiveConfirmationResponse.Merge(m, src) +} +func (m *MsgReceiveConfirmationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgReceiveConfirmationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReceiveConfirmationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReceiveConfirmationResponse proto.InternalMessageInfo + type MsgSendVoter struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` @@ -46,7 +158,7 @@ func (m *MsgSendVoter) Reset() { *m = MsgSendVoter{} } func (m *MsgSendVoter) String() string { return proto.CompactTextString(m) } func (*MsgSendVoter) ProtoMessage() {} func (*MsgSendVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{0} + return fileDescriptor_3410749d96999ade, []int{2} } func (m *MsgSendVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -152,7 +264,7 @@ func (m *MsgSendVoterResponse) Reset() { *m = MsgSendVoterResponse{} } func (m *MsgSendVoterResponse) String() string { return proto.CompactTextString(m) } func (*MsgSendVoterResponse) ProtoMessage() {} func (*MsgSendVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{1} + return fileDescriptor_3410749d96999ade, []int{3} } func (m *MsgSendVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -191,7 +303,7 @@ func (m *MsgSetNodeKeys) Reset() { *m = MsgSetNodeKeys{} } func (m *MsgSetNodeKeys) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeys) ProtoMessage() {} func (*MsgSetNodeKeys) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{2} + return fileDescriptor_3410749d96999ade, []int{4} } func (m *MsgSetNodeKeys) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -248,7 +360,7 @@ func (m *MsgSetNodeKeysResponse) Reset() { *m = MsgSetNodeKeysResponse{} func (m *MsgSetNodeKeysResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeysResponse) ProtoMessage() {} func (*MsgSetNodeKeysResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3410749d96999ade, []int{3} + return fileDescriptor_3410749d96999ade, []int{5} } func (m *MsgSetNodeKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -278,6 +390,8 @@ func (m *MsgSetNodeKeysResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetNodeKeysResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*MsgReceiveConfirmation)(nil), "MetaProtocol.metacore.metacore.MsgReceiveConfirmation") + proto.RegisterType((*MsgReceiveConfirmationResponse)(nil), "MetaProtocol.metacore.metacore.MsgReceiveConfirmationResponse") proto.RegisterType((*MsgSendVoter)(nil), "MetaProtocol.metacore.metacore.MsgSendVoter") proto.RegisterType((*MsgSendVoterResponse)(nil), "MetaProtocol.metacore.metacore.MsgSendVoterResponse") proto.RegisterType((*MsgSetNodeKeys)(nil), "MetaProtocol.metacore.metacore.MsgSetNodeKeys") @@ -287,35 +401,41 @@ func init() { func init() { proto.RegisterFile("metacore/tx.proto", fileDescriptor_3410749d96999ade) } var fileDescriptor_3410749d96999ade = []byte{ - // 443 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x3f, 0x6f, 0x1a, 0x31, - 0x14, 0xc7, 0xf9, 0x43, 0xc2, 0xa3, 0xad, 0x14, 0x37, 0x42, 0x16, 0xc3, 0x09, 0xa1, 0x0e, 0x19, - 0xda, 0x3b, 0x89, 0x56, 0x1d, 0x3a, 0x92, 0x25, 0x52, 0x4a, 0x85, 0x48, 0xd5, 0xa1, 0xdb, 0x71, - 0x3c, 0x1d, 0x56, 0x38, 0x1b, 0xd9, 0xbe, 0x08, 0xbe, 0x45, 0xb7, 0x7e, 0x8b, 0x7e, 0x8e, 0x8e, - 0x19, 0x3b, 0x56, 0x30, 0xf7, 0x3b, 0x54, 0xb6, 0x31, 0x1c, 0x43, 0xa3, 0x32, 0xf9, 0xfd, 0xde, - 0xef, 0xfd, 0xfd, 0xd9, 0x86, 0x8b, 0x02, 0x4d, 0x9a, 0x49, 0x85, 0x89, 0x59, 0xc4, 0x73, 0x25, - 0x8d, 0xa4, 0xd1, 0x00, 0x4d, 0x3a, 0xb4, 0x66, 0x26, 0x67, 0x71, 0xe0, 0xb7, 0x46, 0xfb, 0x65, - 0x26, 0x8b, 0x42, 0x8a, 0xc4, 0x1f, 0x3e, 0xa9, 0xfb, 0xe3, 0x08, 0x9e, 0x0d, 0x74, 0x7e, 0x87, - 0x62, 0xf2, 0x45, 0x1a, 0x54, 0x94, 0xc1, 0x59, 0xa6, 0x30, 0x35, 0x52, 0x31, 0xd2, 0x21, 0x57, - 0x8d, 0x51, 0x80, 0xb4, 0x05, 0x75, 0x8d, 0x62, 0x82, 0x8a, 0x1d, 0x39, 0x62, 0x83, 0x68, 0x07, - 0x9a, 0xde, 0xba, 0x9e, 0xa6, 0x5c, 0xb0, 0x63, 0x47, 0x56, 0x5d, 0xb4, 0x0d, 0xe7, 0x0a, 0x33,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ed, 0x77, 0x87, 0x44, 0x87, 0xc6, 0xb4, 0x84, 0x66, 0x55, 0xa8, 0xf8, - 0xbf, 0x8a, 0x6c, 0xe3, 0xdb, 0xef, 0x0f, 0x8b, 0x0f, 0x6d, 0xfb, 0x1f, 0x7f, 0xae, 0x22, 0xf2, - 0xb8, 0x8a, 0xc8, 0xef, 0x55, 0x44, 0xbe, 0xad, 0xa3, 0xda, 0xe3, 0x3a, 0xaa, 0xfd, 0x5a, 0x47, - 0xb5, 0xaf, 0xbd, 0x9c, 0x9b, 0x69, 0x39, 0xb6, 0x77, 0x90, 0xd8, 0xda, 0x6f, 0x42, 0xf1, 0x64, - 0xfb, 0xcf, 0x16, 0x3b, 0xd3, 0x2c, 0xe7, 0xa8, 0xc7, 0x75, 0xf7, 0x83, 0xde, 0xfe, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0xd4, 0x77, 0x84, 0x79, 0x8b, 0x03, 0x00, 0x00, + // 530 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4f, 0x6b, 0x13, 0x41, + 0x14, 0xef, 0xa6, 0x6d, 0xda, 0x7d, 0xd1, 0x42, 0xa7, 0x25, 0x2c, 0x41, 0x96, 0x10, 0x44, 0x7a, + 0xd0, 0x0d, 0x44, 0xe9, 0xc1, 0x83, 0x87, 0xe4, 0x52, 0xa8, 0x91, 0xb0, 0x15, 0x0f, 0xde, 0x36, + 0x9b, 0xe7, 0x66, 0x69, 0x76, 0x26, 0xcc, 0xcc, 0x96, 0xe4, 0x43, 0x08, 0xde, 0xfc, 0x0e, 0x1e, + 0xfc, 0x1c, 0x1e, 0x7b, 0xf4, 0x28, 0xc9, 0xe7, 0x10, 0x64, 0x66, 0xf6, 0x5f, 0x25, 0x86, 0xd6, + 0x53, 0xde, 0xff, 0xf7, 0xfb, 0xfd, 0xf2, 0x76, 0xe0, 0x38, 0x41, 0x19, 0x84, 0x8c, 0x63, 0x57, + 0x2e, 0xbc, 0x39, 0x67, 0x92, 0x11, 0x77, 0x88, 0x32, 0x18, 0x29, 0x33, 0x64, 0x33, 0x2f, 0xcf, + 0x17, 0x46, 0xeb, 0x24, 0x64, 0x49, 0xc2, 0x68, 0xd7, 0xfc, 0x98, 0xa6, 0xce, 0x37, 0x0b, 0x9a, + 0x43, 0x11, 0xf9, 0x18, 0x62, 0x7c, 0x83, 0x03, 0x46, 0x3f, 0xc5, 0x3c, 0x09, 0x64, 0xcc, 0x28, + 0x71, 0xe0, 0x20, 0xe4, 0x18, 0x48, 0xc6, 0x1d, 0xab, 0x6d, 0x9d, 0xd9, 0x7e, 0xee, 0x92, 0x16, + 0x1c, 0x0a, 0xa4, 0x93, 0x8b, 0x40, 0x4c, 0x9d, 0x9a, 0x4e, 0x15, 0x3e, 0x79, 0x02, 0x36, 0x4b, + 0xe5, 0xfb, 0x85, 0x4e, 0xee, 0xea, 0x64, 0x19, 0x20, 0xcf, 0xe0, 0x88, 0xa5, 0xb2, 0x3f, 0x63, + 0xe1, 0xf5, 0x05, 0xc6, 0xd1, 0x54, 0x3a, 0x7b, 0x6d, 0xeb, 0x6c, 0xcf, 0xff, 0x2b, 0x4a, 0x4e, + 0x61, 0x3f, 0x19, 0xc6, 0x54, 0x3a, 0xfb, 0x7a, 0x82, 0x71, 0x3a, 0x6d, 0x70, 0x37, 0x63, 0xf5, + 0x51, 0xcc, 0x19, 0x15, 0xd8, 0xf9, 0x5e, 0x83, 0x47, 0x43, 0x11, 0x5d, 0x21, 0x9d, 0x7c, 0x60, + 0x12, 0xf9, 0x16, 0x12, 0x4d, 0xa8, 0x2b, 0xd0, 0xc8, 0x33, 0x0a, 0x99, 0x47, 0xda, 0xd0, 0x30, + 0xd6, 0x60, 0x1a, 0xc4, 0x34, 0xa3, 0x50, 0x0d, 0x29, 0xfa, 0xdc, 0x60, 0xe0, 0x1a, 0xbe, 0xed, + 0x17, 0x3e, 0x79, 0x0a, 0x8f,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x3f, 0xac, 0x3e, 0x5f, 0xdb, + 0x7f, 0xfb, 0x63, 0xe5, 0x5a, 0xb7, 0x2b, 0xd7, 0xfa, 0xb5, 0x72, 0xad, 0x2f, 0x6b, 0x77, 0xe7, + 0x76, 0xed, 0xee, 0xfc, 0x5c, 0xbb, 0x3b, 0x1f, 0x7b, 0x51, 0x2c, 0xa7, 0xe9, 0x58, 0xdd, 0x44, + 0x57, 0xcd, 0x7e, 0x91, 0x0f, 0xef, 0x16, 0xcf, 0xd8, 0xa2, 0x34, 0xe5, 0x72, 0x8e, 0x62, 0x5c, + 0xd7, 0x0f, 0xd4, 0xcb, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x58, 0xcb, 0x84, 0x48, 0xea, 0x04, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -331,6 +451,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { // this line is used by starport scaffolding # proto/tx/rpc + ReceiveConfirmation(ctx context.Context, in *MsgReceiveConfirmation, opts ...grpc.CallOption) (*MsgReceiveConfirmationResponse, error) SendVoter(ctx context.Context, in *MsgSendVoter, opts ...grpc.CallOption) (*MsgSendVoterResponse, error) SetNodeKeys(ctx context.Context, in *MsgSetNodeKeys, opts ...grpc.CallOption) (*MsgSetNodeKeysResponse, error) } @@ -343,6 +464,15 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) ReceiveConfirmation(ctx context.Context, in *MsgReceiveConfirmation, opts ...grpc.CallOption) (*MsgReceiveConfirmationResponse, error) { + out := new(MsgReceiveConfirmationResponse) + err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Msg/ReceiveConfirmation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) SendVoter(ctx context.Context, in *MsgSendVoter, opts ...grpc.CallOption) (*MsgSendVoterResponse, error) { out := new(MsgSendVoterResponse) err := c.cc.Invoke(ctx, "/MetaProtocol.metacore.metacore.Msg/SendVoter", in, out, opts...) @@ -364,6 +494,7 @@ func (c *msgClient) SetNodeKeys(ctx context.Context, in *MsgSetNodeKeys, opts .. // MsgServer is the server API for Msg service. type MsgServer interface { // this line is used by starport scaffolding # proto/tx/rpc + ReceiveConfirmation(context.Context, *MsgReceiveConfirmation) (*MsgReceiveConfirmationResponse, error) SendVoter(context.Context, *MsgSendVoter) (*MsgSendVoterResponse, error) SetNodeKeys(context.Context, *MsgSetNodeKeys) (*MsgSetNodeKeysResponse, error) } @@ -372,6 +503,9 @@ type MsgServer interface { type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) ReceiveConfirmation(ctx context.Context, req *MsgReceiveConfirmation) (*MsgReceiveConfirmationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReceiveConfirmation not implemented") +} func (*UnimplementedMsgServer) SendVoter(ctx context.Context, req *MsgSendVoter) (*MsgSendVoterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendVoter not implemented") } @@ -383,6 +517,24 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_ReceiveConfirmation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReceiveConfirmation) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ReceiveConfirmation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/MetaProtocol.metacore.metacore.Msg/ReceiveConfirmation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ReceiveConfirmation(ctx, req.(*MsgReceiveConfirmation)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_SendVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgSendVoter) if err := dec(in); err != nil { @@ -423,6 +575,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "MetaProtocol.metacore.metacore.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "ReceiveConfirmation", + Handler: _Msg_ReceiveConfirmation_Handler, + }, { MethodName: "SendVoter", Handler: _Msg_SendVoter_Handler, @@ -436,6 +592,85 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "metacore/tx.proto", } +func (m *MsgReceiveConfirmation) 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 *MsgReceiveConfirmation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReceiveConfirmation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MMint) > 0 { + i -= len(m.MMint) + copy(dAtA[i:], m.MMint) + i = encodeVarintTx(dAtA, i, uint64(len(m.MMint))) + i-- + dAtA[i] = 0x2a + } + if m.OutBlockHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.OutBlockHeight)) + i-- + dAtA[i] = 0x20 + } + if len(m.OutTxHash) > 0 { + i -= len(m.OutTxHash) + copy(dAtA[i:], m.OutTxHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.OutTxHash))) + i-- + dAtA[i] = 0x1a + } + if len(m.SendHash) > 0 { + i -= len(m.SendHash) + copy(dAtA[i:], m.SendHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.SendHash))) + 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 *MsgReceiveConfirmationResponse) 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 *MsgReceiveConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReceiveConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgSendVoter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -633,6 +868,43 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgReceiveConfirmation) 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.SendHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OutTxHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.OutBlockHeight != 0 { + n += 1 + sovTx(uint64(m.OutBlockHeight)) + } + l = len(m.MMint) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgReceiveConfirmationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgSendVoter) Size() (n int) { if m == nil { return 0 @@ -726,6 +998,253 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgReceiveConfirmation) 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: MsgReceiveConfirmation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReceiveConfirmation: 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 SendHash", 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.SendHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutTxHash", 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.OutTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutBlockHeight", wireType) + } + m.OutBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OutBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MMint", 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.MMint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 *MsgReceiveConfirmationResponse) 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: MsgReceiveConfirmationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReceiveConfirmationResponse: 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 (m *MsgSendVoter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0