diff --git a/cmd/metaclientd/tx.go b/cmd/metaclientd/tx.go index 4d24239ad5..0e3b5a173d 100644 --- a/cmd/metaclientd/tx.go +++ b/cmd/metaclientd/tx.go @@ -6,44 +6,45 @@ 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) { +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.NewMsgCreateTxinVoter( - signerAddress, - txHash, sourceAsset, sourceAmount, mBurnt, destAsset, - fromAddress, toAddress, blockHeight, - ) + 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("PostTxIn broadcast fail") + log.Err(err).Msg("PostSend 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) { +func (b *MetachainBridge) PostReceiveConfirmation(sendHash string, outTxHash string, outBlockHeight uint64, mMint string) (string, error) { signerAddress := b.keys.GetSignerInfo().GetAddress().String() - msg := types.NewMsgTxoutConfirmationVoter(signerAddress, txoutId, txHash, mMint, destinationAsset, destinationAmount, toAddress, blockHeight) + msg := types.NewMsgReceiveConfirmation(signerAddress, sendHash, outTxHash, outBlockHeight, mMint) metaTxHash, err := b.Broadcast(msg) if err != nil { - log.Err(err).Msg("PostTxoutConfirmation broadcast fail") + log.Err(err).Msg("PostReceiveConfirmation broadcast fail") return "", err } return metaTxHash, nil } -// Get all current Txout from MetaCore -func (b *MetachainBridge) GetAllTxout() ([]*types.Txout, error){ +func (b *MetachainBridge) GetAllSend() ([]*types.Send, error) { client := types.NewQueryClient(b.grpcConn) - resp, err := client.TxoutAll(context.Background(), &types.QueryAllTxoutRequest{}) + resp, err := client.SendAll(context.Background(), &types.QueryAllSendRequest{}) if err != nil { - log.Error().Err(err).Msg("query TxoutAll error") + log.Error().Err(err).Msg("query SendAll error") return nil, err } - return resp.Txout, nil + 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 5f5597133b..97ef04eab2 100644 --- a/cmd/metaclientd/voter_test.go +++ b/cmd/metaclientd/voter_test.go @@ -74,45 +74,47 @@ func (s *VoterSuite) SetUpTest(c *C) { } } -func (s *VoterSuite) TestObservedTxIn(c *C) { +func (s *VoterSuite) TestSendVoter(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", + metaHash, err := b1.PostSend("0xfrom", "Ethereum", "0xto", "BSC", "123456", "23245", "little message", "0xtxhash", 123123) c.Assert(err, IsNil) - log.Info().Msgf("PostTxIn metaHash %s", metaHash) + log.Info().Msgf("PostSend 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", + metaHash, err = b2.PostSend("0xfrom", "Ethereum", "0xto", "BSC", "123456", "23245", "little message", "0xtxhash", 123123) c.Assert(err, IsNil) - log.Info().Msgf("Second PostTxIn metaHash %s", metaHash) + log.Info().Msgf("Second PostSend metaHash %s", metaHash) // wait for the next block timer2 := time.NewTimer(2 * time.Second) <-timer2.C - txouts, err := b1.GetAllTxout() + sends, err := b1.GetAllSend() + c.Assert(err, IsNil) + log.Info().Msgf("sends: %v", sends) + c.Assert(len(sends) >= 1, Equals, true) + + send := sends[0] + + metaHash, err = b1.PostReceiveConfirmation(send.Index, "0xoutHash", 2123, "23245") 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 + metaHash, err = b2.PostReceiveConfirmation(send.Index, "0xoutHash", 2123, "23245") + c.Assert(err, IsNil) - txouts, err = b1.GetAllTxout() + receives, err := b2.GetAllReceive() c.Assert(err, IsNil) - log.Info().Msgf("txouts: %v", txouts) + 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 8876011513..b554a7a520 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -19332,17 +19332,17 @@ paths: type: string tags: - Query - /Meta-Protocol/metacore/metacore/txin: + /Meta-Protocol/metacore/metacore/receive: get: - summary: Queries a list of txin items. - operationId: MetaProtocolMetacoreMetacoreTxinAll + summary: Queries a list of receive items. + operationId: MetaProtocolMetacoreMetacoreReceiveAll responses: '200': description: A successful response. schema: type: object properties: - Txin: + Receive: type: array items: type: object @@ -19351,32 +19351,20 @@ paths: type: string index: type: string - txHash: + sendHash: type: string - sourceAsset: + outTxHash: type: string - sourceAmount: + outBlockHeight: type: string format: uint64 - mBurnt: - type: string - format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: + finalizedMetaHeight: type: string format: uint64 signers: type: array items: type: string - finalizedHeight: - type: string - format: uint64 pagination: type: object properties: @@ -19471,49 +19459,37 @@ paths: type: boolean tags: - Query - '/Meta-Protocol/metacore/metacore/txin/{index}': + '/Meta-Protocol/metacore/metacore/receive/{index}': get: - summary: Queries a txin by index. - operationId: MetaProtocolMetacoreMetacoreTxin + summary: Queries a receive by index. + operationId: MetaProtocolMetacoreMetacoreReceive responses: '200': description: A successful response. schema: type: object properties: - Txin: + Receive: type: object properties: creator: type: string index: type: string - txHash: - type: string - sourceAsset: + sendHash: type: string - sourceAmount: + outTxHash: type: string - format: uint64 - mBurnt: + outBlockHeight: type: string format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: + finalizedMetaHeight: type: string format: uint64 signers: type: array items: type: string - finalizedHeight: - type: string - format: uint64 default: description: An unexpected error response. schema: @@ -19539,432 +19515,17 @@ paths: 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: + /Meta-Protocol/metacore/metacore/send: get: - summary: Queries a list of txoutConfirmation items. - operationId: MetaProtocolMetacoreMetacoreTxoutConfirmationAll + summary: Queries a list of send items. + operationId: MetaProtocolMetacoreMetacoreSendAll responses: '200': description: A successful response. schema: type: object properties: - TxoutConfirmation: + Send: type: array items: type: object @@ -19973,31 +19534,32 @@ paths: type: string index: type: string - txoutId: + sender: type: string - format: uint64 - txHash: + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: type: string mMint: type: string - format: uint64 - destinationAsset: + message: type: string - destinationAmount: + inTxHash: type: string - format: uint64 - 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: @@ -20092,48 +19654,49 @@ paths: type: boolean tags: - Query - '/Meta-Protocol/metacore/metacore/txoutConfirmation/{index}': + '/Meta-Protocol/metacore/metacore/send/{index}': get: - summary: Queries a txoutConfirmation by index. - operationId: MetaProtocolMetacoreMetacoreTxoutConfirmation + summary: Queries a send by index. + operationId: MetaProtocolMetacoreMetacoreSend responses: '200': description: A successful response. schema: type: object properties: - TxoutConfirmation: + Send: type: object properties: creator: type: string index: type: string - txoutId: + sender: type: string - format: uint64 - txHash: + senderChain: + type: string + receiver: + type: string + receiverChain: + type: string + mBurnt: type: string mMint: type: string - format: uint64 - destinationAsset: + message: type: string - destinationAmount: + inTxHash: type: string - format: uint64 - toAddress: + inBlockHeight: type: string - blockHeight: + format: uint64 + finalizedMetaHeight: type: string format: uint64 signers: type: array items: type: string - finalizedHeight: - type: string - format: uint64 default: description: An unexpected error response. schema: @@ -30325,11 +29888,11 @@ definitions: description: |- Version defines the versioning scheme used to negotiate the IBC verison in the connection handshake. - MetaProtocol.metacore.metacore.MsgCreateTxinVoterResponse: + MetaProtocol.metacore.metacore.MsgReceiveConfirmationResponse: type: object - MetaProtocol.metacore.metacore.MsgSetNodeKeysResponse: + MetaProtocol.metacore.metacore.MsgSendVoterResponse: type: object - MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoterResponse: + MetaProtocol.metacore.metacore.MsgSetNodeKeysResponse: type: object MetaProtocol.metacore.metacore.NodeAccount: type: object @@ -30427,10 +29990,10 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - MetaProtocol.metacore.metacore.QueryAllTxinResponse: + MetaProtocol.metacore.metacore.QueryAllReceiveResponse: type: object properties: - Txin: + Receive: type: array items: type: object @@ -30439,88 +30002,20 @@ definitions: type: string index: type: string - txHash: + sendHash: type: string - sourceAsset: + outTxHash: type: string - sourceAmount: - type: string - format: uint64 - mBurnt: + outBlockHeight: type: string format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: + finalizedMetaHeight: 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: @@ -30546,10 +30041,10 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - MetaProtocol.metacore.metacore.QueryAllTxoutConfirmationResponse: + MetaProtocol.metacore.metacore.QueryAllSendResponse: type: object properties: - TxoutConfirmation: + Send: type: array items: type: object @@ -30558,101 +30053,32 @@ definitions: 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; - } - MetaProtocol.metacore.metacore.QueryAllTxoutResponse: - type: object - properties: - Txout: - type: array - items: - type: object - properties: - creator: - type: string - id: + sender: type: string - format: uint64 - txinHash: + senderChain: type: string - sourceAsset: + receiver: type: string - sourceAmount: + 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: @@ -30709,286 +30135,126 @@ definitions: - Active - Disabled default: Unknown - MetaProtocol.metacore.metacore.QueryGetTxinResponse: + MetaProtocol.metacore.metacore.QueryGetReceiveResponse: type: object properties: - Txin: + Receive: type: object properties: creator: type: string index: type: string - txHash: + sendHash: type: string - sourceAsset: + outTxHash: type: string - sourceAmount: - type: string - format: uint64 - mBurnt: + outBlockHeight: type: string format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: + finalizedMetaHeight: 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: + MetaProtocol.metacore.metacore.QueryGetSendResponse: type: object properties: - TxoutConfirmation: + Send: 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: + sender: 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: + senderChain: type: string - id: + receiver: type: string - format: uint64 - txinHash: - type: string - sourceAsset: + receiverChain: type: string - sourceAmount: - 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 MetaProtocol.metacore.metacore.QueryLastMetaHeightResponse: type: object properties: Height: type: string format: uint64 - MetaProtocol.metacore.metacore.Txin: + MetaProtocol.metacore.metacore.Receive: type: object properties: creator: type: string index: type: string - txHash: - type: string - sourceAsset: + sendHash: type: string - sourceAmount: + outTxHash: type: string - format: uint64 - mBurnt: + outBlockHeight: type: string format: uint64 - destinationAsset: - type: string - fromAddress: - type: string - toAddress: - type: string - blockHeight: + finalizedMetaHeight: type: string format: uint64 signers: type: array items: type: string - finalizedHeight: - type: string - format: uint64 - MetaProtocol.metacore.metacore.TxinVoter: + MetaProtocol.metacore.metacore.Send: 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: + sender: type: string - format: uint64 - txinHash: + senderChain: type: string - sourceAsset: + receiver: type: string - sourceAmount: + receiverChain: 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: + message: type: string - format: uint64 - destinationAsset: + inTxHash: type: string - destinationAmount: + inBlockHeight: type: string format: uint64 - toAddress: - type: string - blockHeight: + finalizedMetaHeight: 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 44376be0c8..9ef7e9a2af 100644 --- a/proto/metacore/genesis.proto +++ b/proto/metacore/genesis.proto @@ -2,22 +2,17 @@ syntax = "proto3"; package MetaProtocol.metacore.metacore; // this line is used by starport scaffolding # genesis/proto/import -import "metacore/txout_confirmation.proto"; -import "metacore/txout.proto"; +import "metacore/receive.proto"; +import "metacore/send.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"; // GenesisState defines the metacore module's genesis state. message GenesisState { // this line is used by starport scaffolding # genesis/proto/state - 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 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 - 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 585beb7e34..00f9c30b93 100644 --- a/proto/metacore/query.proto +++ b/proto/metacore/query.proto @@ -4,11 +4,9 @@ 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/txout_confirmation.proto"; -import "metacore/txout.proto"; +import "metacore/receive.proto"; +import "metacore/send.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"; @@ -16,25 +14,25 @@ option go_package = "github.com/Meta-Protocol/metacore/x/metacore/types"; service Query { // this line is used by starport scaffolding # 2 - // Queries a txoutConfirmation by index. - rpc TxoutConfirmation(QueryGetTxoutConfirmationRequest) returns (QueryGetTxoutConfirmationResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txoutConfirmation/{index}"; + // 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 txoutConfirmation items. - rpc TxoutConfirmationAll(QueryAllTxoutConfirmationRequest) returns (QueryAllTxoutConfirmationResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txoutConfirmation"; + // Queries a list of receive items. + rpc ReceiveAll(QueryAllReceiveRequest) returns (QueryAllReceiveResponse) { + option (google.api.http).get = "/Meta-Protocol/metacore/metacore/receive"; } - // Queries a txout by id. - rpc Txout(QueryGetTxoutRequest) returns (QueryGetTxoutResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txout/{id}"; + // 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 txout items. - rpc TxoutAll(QueryAllTxoutRequest) returns (QueryAllTxoutResponse) { - option (google.api.http).get = "/Meta-Protocol/metacore/metacore/txout"; + // Queries a list of send items. + rpc SendAll(QueryAllSendRequest) returns (QueryAllSendResponse) { + option (google.api.http).get = "/Meta-Protocol/metacore/metacore/send"; } @@ -55,62 +53,43 @@ 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"; - } } // this line is used by starport scaffolding # 3 -message QueryGetTxoutConfirmationRequest { +message QueryGetReceiveRequest { string index = 1; } -message QueryGetTxoutConfirmationResponse { - TxoutConfirmation TxoutConfirmation = 1; +message QueryGetReceiveResponse { + Receive Receive = 1; } -message QueryAllTxoutConfirmationRequest { +message QueryAllReceiveRequest { cosmos.base.query.v1beta1.PageRequest pagination = 1; } -message QueryAllTxoutConfirmationResponse { - repeated TxoutConfirmation TxoutConfirmation = 1; +message QueryAllReceiveResponse { + repeated Receive Receive = 1; cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryGetTxoutRequest { - uint64 id = 1; +message QueryGetSendRequest { + string index = 1; } -message QueryGetTxoutResponse { - Txout Txout = 1; +message QueryGetSendResponse { + Send Send = 1; } -message QueryAllTxoutRequest { +message QueryAllSendRequest { cosmos.base.query.v1beta1.PageRequest pagination = 1; } -message QueryAllTxoutResponse { - repeated Txout Txout = 1; +message QueryAllSendResponse { + repeated Send Send = 1; cosmos.base.query.v1beta1.PageResponse pagination = 2; } + message QueryGetNodeAccountRequest { string index = 1; } @@ -133,36 +112,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/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/proto/metacore/send.proto b/proto/metacore/send.proto new file mode 100644 index 0000000000..cd8ce9c2b3 --- /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; + uint64 finalizedMetaHeight = 12; + repeated string signers = 13; +} diff --git a/proto/metacore/tx.proto b/proto/metacore/tx.proto index 13905b885c..1ff862fa10 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"; @@ -10,24 +9,37 @@ 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 TxoutConfirmationVoter(MsgTxoutConfirmationVoter) returns (MsgTxoutConfirmationVoterResponse); + rpc ReceiveConfirmation(MsgReceiveConfirmation) returns (MsgReceiveConfirmationResponse); + rpc SendVoter(MsgSendVoter) returns (MsgSendVoterResponse); rpc SetNodeKeys(MsgSetNodeKeys) returns (MsgSetNodeKeysResponse); - rpc CreateTxinVoter(MsgCreateTxinVoter) returns (MsgCreateTxinVoterResponse); } // this line is used by starport scaffolding # proto/tx/message -message MsgTxoutConfirmationVoter { +message MsgReceiveConfirmation { string creator = 1; - uint64 txoutId = 2; - string txHash = 3; - uint64 mMint = 4; - string destinationAsset = 5; - uint64 destinationAmount = 6; - string toAddress = 7; - uint64 blockHeight = 8; + string sendHash = 2; + string outTxHash = 3; + uint64 outBlockHeight = 4; + string mMint = 5; } -message MsgTxoutConfirmationVoterResponse { +message MsgReceiveConfirmationResponse { +} + +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; + uint64 inBlockHeight = 10; +} + +message MsgSendVoterResponse { } message MsgSetNodeKeys { @@ -38,17 +50,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 6649d43b38..4b23ebb8e3 100644 --- a/x/metacore/client/cli/query.go +++ b/x/metacore/client/cli/query.go @@ -26,22 +26,16 @@ func GetQueryCmd(queryRoute string) *cobra.Command { // this line is used by starport scaffolding # 1 - cmd.AddCommand(CmdListTxoutConfirmation()) - cmd.AddCommand(CmdShowTxoutConfirmation()) + cmd.AddCommand(CmdListReceive()) + cmd.AddCommand(CmdShowReceive()) - cmd.AddCommand(CmdListTxout()) - cmd.AddCommand(CmdShowTxout()) + cmd.AddCommand(CmdListSend()) + cmd.AddCommand(CmdShowSend()) 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_voter.go b/x/metacore/client/cli/query_receive.go similarity index 70% rename from x/metacore/client/cli/query_txin_voter.go rename to x/metacore/client/cli/query_receive.go index 04ab607162..3b275dc358 100644 --- a/x/metacore/client/cli/query_txin_voter.go +++ b/x/metacore/client/cli/query_receive.go @@ -9,10 +9,10 @@ import ( "github.com/spf13/cobra" ) -func CmdListTxinVoter() *cobra.Command { +func CmdListReceive() *cobra.Command { cmd := &cobra.Command{ - Use: "list-txin-voter", - Short: "list all TxinVoter", + Use: "list-receive", + Short: "list all receive", RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) @@ -23,11 +23,11 @@ func CmdListTxinVoter() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - params := &types.QueryAllTxinVoterRequest{ + params := &types.QueryAllReceiveRequest{ Pagination: pageReq, } - res, err := queryClient.TxinVoterAll(context.Background(), params) + res, err := queryClient.ReceiveAll(context.Background(), params) if err != nil { return err } @@ -42,21 +42,21 @@ func CmdListTxinVoter() *cobra.Command { return cmd } -func CmdShowTxinVoter() *cobra.Command { +func CmdShowReceive() *cobra.Command { cmd := &cobra.Command{ - Use: "show-txin-voter [index]", - Short: "shows a TxinVoter", + 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.QueryGetTxinVoterRequest{ + params := &types.QueryGetReceiveRequest{ Index: args[0], } - res, err := queryClient.TxinVoter(context.Background(), params) + res, err := queryClient.Receive(context.Background(), params) if err != nil { return err } diff --git a/x/metacore/client/cli/query_txin_voter_test.go b/x/metacore/client/cli/query_receive_test.go similarity index 72% rename from x/metacore/client/cli/query_txin_voter_test.go rename to x/metacore/client/cli/query_receive_test.go index 7c4466365f..1ebd446cbc 100644 --- a/x/metacore/client/cli/query_txin_voter_test.go +++ b/x/metacore/client/cli/query_receive_test.go @@ -18,23 +18,23 @@ import ( "github.com/Meta-Protocol/metacore/x/metacore/types" ) -func networkWithTxinVoterObjects(t *testing.T, n int) (*network.Network, []*types.TxinVoter) { +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.TxinVoterList = append(state.TxinVoterList, &types.TxinVoter{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) cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.TxinVoterList + return network.New(t, cfg), state.ReceiveList } -func TestShowTxinVoter(t *testing.T) { - net, objs := networkWithTxinVoterObjects(t, 2) +func TestShowReceive(t *testing.T) { + net, objs := networkWithReceiveObjects(t, 2) ctx := net.Validators[0].ClientCtx common := []string{ @@ -45,7 +45,7 @@ func TestShowTxinVoter(t *testing.T) { id string args []string err error - obj *types.TxinVoter + obj *types.Receive }{ { desc: "found", @@ -64,24 +64,24 @@ func TestShowTxinVoter(t *testing.T) { 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) + 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.QueryGetTxinVoterResponse + var resp types.QueryGetReceiveResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.TxinVoter) - require.Equal(t, tc.obj, resp.TxinVoter) + require.NotNil(t, resp.Receive) + require.Equal(t, tc.obj, resp.Receive) } }) } } -func TestListTxinVoter(t *testing.T) { - net, objs := networkWithTxinVoterObjects(t, 5) +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 { @@ -103,12 +103,12 @@ func TestListTxinVoter(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) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListReceive(), args) require.NoError(t, err) - var resp types.QueryAllTxinVoterResponse + 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.TxinVoter[j-i]) + assert.Equal(t, objs[j], resp.Receive[j-i]) } } }) @@ -117,24 +117,24 @@ func TestListTxinVoter(t *testing.T) { 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) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListReceive(), args) require.NoError(t, err) - var resp types.QueryAllTxinVoterResponse + 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.TxinVoter[j-i]) + 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.CmdListTxinVoter(), args) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListReceive(), args) require.NoError(t, err) - var resp types.QueryAllTxinVoterResponse + 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.TxinVoter) + require.Equal(t, objs, resp.Receive) }) } diff --git a/x/metacore/client/cli/query_txin.go b/x/metacore/client/cli/query_send.go similarity index 73% rename from x/metacore/client/cli/query_txin.go rename to x/metacore/client/cli/query_send.go index a11593cbc1..220e29a653 100644 --- a/x/metacore/client/cli/query_txin.go +++ b/x/metacore/client/cli/query_send.go @@ -9,10 +9,10 @@ import ( "github.com/spf13/cobra" ) -func CmdListTxin() *cobra.Command { +func CmdListSend() *cobra.Command { cmd := &cobra.Command{ - Use: "list-txin", - Short: "list all Txin", + Use: "list-send", + Short: "list all Send", RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) @@ -23,11 +23,11 @@ func CmdListTxin() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - params := &types.QueryAllTxinRequest{ + params := &types.QueryAllSendRequest{ Pagination: pageReq, } - res, err := queryClient.TxinAll(context.Background(), params) + res, err := queryClient.SendAll(context.Background(), params) if err != nil { return err } @@ -42,21 +42,21 @@ func CmdListTxin() *cobra.Command { return cmd } -func CmdShowTxin() *cobra.Command { +func CmdShowSend() *cobra.Command { cmd := &cobra.Command{ - Use: "show-txin [index]", - Short: "shows a Txin", + 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.QueryGetTxinRequest{ + params := &types.QueryGetSendRequest{ Index: args[0], } - res, err := queryClient.Txin(context.Background(), params) + res, err := queryClient.Send(context.Background(), params) if err != nil { return err } diff --git a/x/metacore/client/cli/query_txin_test.go b/x/metacore/client/cli/query_send_test.go similarity index 75% rename from x/metacore/client/cli/query_txin_test.go rename to x/metacore/client/cli/query_send_test.go index 0d35ef9f60..ec82139d7c 100644 --- a/x/metacore/client/cli/query_txin_test.go +++ b/x/metacore/client/cli/query_send_test.go @@ -18,23 +18,23 @@ import ( "github.com/Meta-Protocol/metacore/x/metacore/types" ) -func networkWithTxinObjects(t *testing.T, n int) (*network.Network, []*types.Txin) { +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.TxinList = append(state.TxinList, &types.Txin{Creator: "ANY", Index: strconv.Itoa(i), Signers: []string{"A", "B"}}) + 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) cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.TxinList + return network.New(t, cfg), state.SendList } -func TestShowTxin(t *testing.T) { - net, objs := networkWithTxinObjects(t, 2) +func TestShowSend(t *testing.T) { + net, objs := networkWithSendObjects(t, 2) ctx := net.Validators[0].ClientCtx common := []string{ @@ -45,7 +45,7 @@ func TestShowTxin(t *testing.T) { id string args []string err error - obj *types.Txin + obj *types.Send }{ { desc: "found", @@ -64,24 +64,24 @@ func TestShowTxin(t *testing.T) { 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) + 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.QueryGetTxinResponse + var resp types.QueryGetSendResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.Txin) - require.Equal(t, tc.obj, resp.Txin) + require.NotNil(t, resp.Send) + require.Equal(t, tc.obj, resp.Send) } }) } } -func TestListTxin(t *testing.T) { - net, objs := networkWithTxinObjects(t, 5) +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 { @@ -103,12 +103,12 @@ func TestListTxin(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) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListSend(), args) require.NoError(t, err) - var resp types.QueryAllTxinResponse + 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.Txin[j-i]) + assert.Equal(t, objs[j], resp.Send[j-i]) } } }) @@ -117,24 +117,24 @@ func TestListTxin(t *testing.T) { 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) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListSend(), args) require.NoError(t, err) - var resp types.QueryAllTxinResponse + 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.Txin[j-i]) + 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.CmdListTxin(), args) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListSend(), args) require.NoError(t, err) - var resp types.QueryAllTxinResponse + 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.Txin) + require.Equal(t, objs, resp.Send) }) } 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 6a4a254a66..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(CmdTxoutConfirmationVoter()) + cmd.AddCommand(CmdReceiveConfirmation()) - cmd.AddCommand(CmdSetNodeKeys()) + cmd.AddCommand(CmdSendVoter()) - cmd.AddCommand(CmdCreateTxinVoter()) + 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.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_txin_voter_test.go b/x/metacore/client/cli/tx_send_test.go similarity index 86% rename from x/metacore/client/cli/tx_txin_voter_test.go rename to x/metacore/client/cli/tx_send_test.go index 8f23db8c44..031e1011c3 100644 --- a/x/metacore/client/cli/tx_txin_voter_test.go +++ b/x/metacore/client/cli/tx_send_test.go @@ -13,13 +13,13 @@ import ( "github.com/Meta-Protocol/metacore/x/metacore/client/cli" ) -func TestCreateTxinVoter(t *testing.T) { +func TestCreateSend(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"} + fields := []string{"xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "xyz", "123", "xyz", "123"} for _, tc := range []struct { desc string id string @@ -43,7 +43,7 @@ func TestCreateTxinVoter(t *testing.T) { args := []string{tc.id} args = append(args, fields...) args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateTxinVoter(), args) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdCreateSend(), args) if tc.err != nil { require.ErrorIs(t, err, tc.err) } else { 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..efd7c9177a --- /dev/null +++ b/x/metacore/client/cli/tx_send_voter.go @@ -0,0 +1,49 @@ +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 := (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 + } + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgSendVoter(clientCtx.GetFromAddress().String(), (argsSender), (argsSenderChain), (argsReceiver), (argsReceiverChain), (argsMBurnt), (argsMMint), (argsMessage), (argsInTxHash), uint64(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/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_txout_confirmation_voter.go b/x/metacore/client/cli/tx_txout_confirmation_voter.go deleted file mode 100644 index be3a31f9bb..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 c2ee29e0ac..077f7a1c5a 100644 --- a/x/metacore/genesis.go +++ b/x/metacore/genesis.go @@ -10,34 +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 txoutConfirmation - for _, elem := range genState.TxoutConfirmationList { - k.SetTxoutConfirmation(ctx, *elem) + // Set all the receive + for _, elem := range genState.ReceiveList { + k.SetReceive(ctx, *elem) } - // Set all the txout - for _, elem := range genState.TxoutList { - k.SetTxout(ctx, *elem) + // Set all the send + for _, elem := range genState.SendList { + k.SetSend(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 } @@ -46,23 +33,20 @@ 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 txoutConfirmation - txoutConfirmationList := k.GetAllTxoutConfirmation(ctx) - for _, elem := range txoutConfirmationList { + // Get all receive + receiveList := k.GetAllReceive(ctx) + for _, elem := range receiveList { elem := elem - genesis.TxoutConfirmationList = append(genesis.TxoutConfirmationList, &elem) + genesis.ReceiveList = append(genesis.ReceiveList, &elem) } - // Get all txout - txoutList := k.GetAllTxout(ctx) - for _, elem := range txoutList { + // Get all send + sendList := k.GetAllSend(ctx) + for _, elem := range sendList { elem := elem - genesis.TxoutList = append(genesis.TxoutList, &elem) + genesis.SendList = append(genesis.SendList, &elem) } - // Set the current count - genesis.TxoutCount = k.GetTxoutCount(ctx) - // Get all nodeAccount nodeAccountList := k.GetAllNodeAccount(ctx) for _, elem := range nodeAccountList { @@ -70,20 +54,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 return genesis diff --git a/x/metacore/handler.go b/x/metacore/handler.go index 8b816aa47e..dce79af7ad 100644 --- a/x/metacore/handler.go +++ b/x/metacore/handler.go @@ -18,16 +18,16 @@ func NewHandler(k keeper.Keeper) sdk.Handler { switch msg := msg.(type) { // this line is used by starport scaffolding # 1 - case *types.MsgTxoutConfirmationVoter: - res, err := msgServer.TxoutConfirmationVoter(sdk.WrapSDKContext(ctx), msg) + case *types.MsgReceiveConfirmation: + res, err := msgServer.ReceiveConfirmation(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgSetNodeKeys: - res, err := msgServer.SetNodeKeys(sdk.WrapSDKContext(ctx), msg) + case *types.MsgSendVoter: + res, err := msgServer.SendVoter(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateTxinVoter: - res, err := msgServer.CreateTxinVoter(sdk.WrapSDKContext(ctx), msg) + case *types.MsgSetNodeKeys: + res, err := msgServer.SetNodeKeys(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) default: diff --git a/x/metacore/keeper/grpc_query_receive.go b/x/metacore/keeper/grpc_query_receive.go new file mode 100644 index 0000000000..ef62051ead --- /dev/null +++ b/x/metacore/keeper/grpc_query_receive.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) 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 +} diff --git a/x/metacore/keeper/grpc_query_txin_voter_test.go b/x/metacore/keeper/grpc_query_receive_test.go similarity index 62% rename from x/metacore/keeper/grpc_query_txin_voter_test.go rename to x/metacore/keeper/grpc_query_receive_test.go index a5a35adaf9..49dcce028b 100644 --- a/x/metacore/keeper/grpc_query_txin_voter_test.go +++ b/x/metacore/keeper/grpc_query_receive_test.go @@ -13,29 +13,29 @@ import ( "github.com/Meta-Protocol/metacore/x/metacore/types" ) -func TestTxinVoterQuerySingle(t *testing.T) { +func TestReceiveQuerySingle(t *testing.T) { keeper, ctx := setupKeeper(t) wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxinVoter(keeper, ctx, 2) + msgs := createNReceive(keeper, ctx, 2) for _, tc := range []struct { desc string - request *types.QueryGetTxinVoterRequest - response *types.QueryGetTxinVoterResponse + request *types.QueryGetReceiveRequest + response *types.QueryGetReceiveResponse err error }{ { desc: "First", - request: &types.QueryGetTxinVoterRequest{Index: msgs[0].Index}, - response: &types.QueryGetTxinVoterResponse{TxinVoter: &msgs[0]}, + request: &types.QueryGetReceiveRequest{Index: msgs[0].Index}, + response: &types.QueryGetReceiveResponse{Receive: &msgs[0]}, }, { desc: "Second", - request: &types.QueryGetTxinVoterRequest{Index: msgs[1].Index}, - response: &types.QueryGetTxinVoterResponse{TxinVoter: &msgs[1]}, + request: &types.QueryGetReceiveRequest{Index: msgs[1].Index}, + response: &types.QueryGetReceiveResponse{Receive: &msgs[1]}, }, { desc: "KeyNotFound", - request: &types.QueryGetTxinVoterRequest{Index: "missing"}, + request: &types.QueryGetReceiveRequest{Index: "missing"}, err: status.Error(codes.InvalidArgument, "not found"), }, { @@ -45,7 +45,7 @@ func TestTxinVoterQuerySingle(t *testing.T) { } { tc := tc t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.TxinVoter(wctx, tc.request) + response, err := keeper.Receive(wctx, tc.request) if tc.err != nil { require.ErrorIs(t, err, tc.err) } else { @@ -55,13 +55,13 @@ func TestTxinVoterQuerySingle(t *testing.T) { } } -func TestTxinVoterQueryPaginated(t *testing.T) { +func TestReceiveQueryPaginated(t *testing.T) { keeper, ctx := setupKeeper(t) wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxinVoter(keeper, ctx, 5) + msgs := createNReceive(keeper, ctx, 5) - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllTxinVoterRequest { - return &types.QueryAllTxinVoterRequest{ + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllReceiveRequest { + return &types.QueryAllReceiveRequest{ Pagination: &query.PageRequest{ Key: next, Offset: offset, @@ -73,10 +73,10 @@ func TestTxinVoterQueryPaginated(t *testing.T) { 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)) + 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.TxinVoter[j-i]) + assert.Equal(t, &msgs[j], resp.Receive[j-i]) } } }) @@ -84,21 +84,21 @@ func TestTxinVoterQueryPaginated(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)) + 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.TxinVoter[j-i]) + assert.Equal(t, &msgs[j], resp.Receive[j-i]) } next = resp.Pagination.NextKey } }) t.Run("Total", func(t *testing.T) { - resp, err := keeper.TxinVoterAll(wctx, request(nil, 0, 0, true)) + 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.TxinVoterAll(wctx, nil) + _, err := keeper.ReceiveAll(wctx, nil) require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) }) } diff --git a/x/metacore/keeper/grpc_query_txin.go b/x/metacore/keeper/grpc_query_send.go similarity index 55% rename from x/metacore/keeper/grpc_query_txin.go rename to x/metacore/keeper/grpc_query_send.go index 290bc14430..11c3172cb6 100644 --- a/x/metacore/keeper/grpc_query_txin.go +++ b/x/metacore/keeper/grpc_query_send.go @@ -11,24 +11,24 @@ import ( "google.golang.org/grpc/status" ) -func (k Keeper) TxinAll(c context.Context, req *types.QueryAllTxinRequest) (*types.QueryAllTxinResponse, error) { +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 txins []*types.Txin + var sends []*types.Send ctx := sdk.UnwrapSDKContext(c) store := ctx.KVStore(k.storeKey) - txinStore := prefix.NewStore(store, types.KeyPrefix(types.TxinKey)) + sendStore := prefix.NewStore(store, types.KeyPrefix(types.SendKey)) - 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 { + 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 } - txins = append(txins, &txin) + sends = append(sends, &send) return nil }) @@ -36,19 +36,19 @@ func (k Keeper) TxinAll(c context.Context, req *types.QueryAllTxinRequest) (*typ return nil, status.Error(codes.Internal, err.Error()) } - return &types.QueryAllTxinResponse{Txin: txins, Pagination: pageRes}, nil + return &types.QueryAllSendResponse{Send: sends, Pagination: pageRes}, nil } -func (k Keeper) Txin(c context.Context, req *types.QueryGetTxinRequest) (*types.QueryGetTxinResponse, error) { +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.GetTxin(ctx, req.Index) + val, found := k.GetSend(ctx, req.Index) if !found { return nil, status.Error(codes.InvalidArgument, "not found") } - return &types.QueryGetTxinResponse{Txin: &val}, nil + return &types.QueryGetSendResponse{Send: &val}, nil } diff --git a/x/metacore/keeper/grpc_query_txin_test.go b/x/metacore/keeper/grpc_query_send_test.go similarity index 65% rename from x/metacore/keeper/grpc_query_txin_test.go rename to x/metacore/keeper/grpc_query_send_test.go index 4b5033f6ba..540c7103b8 100644 --- a/x/metacore/keeper/grpc_query_txin_test.go +++ b/x/metacore/keeper/grpc_query_send_test.go @@ -13,29 +13,29 @@ import ( "github.com/Meta-Protocol/metacore/x/metacore/types" ) -func TestTxinQuerySingle(t *testing.T) { +func TestSendQuerySingle(t *testing.T) { keeper, ctx := setupKeeper(t) wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxin(keeper, ctx, 2) + msgs := createNSend(keeper, ctx, 2) for _, tc := range []struct { desc string - request *types.QueryGetTxinRequest - response *types.QueryGetTxinResponse + request *types.QueryGetSendRequest + response *types.QueryGetSendResponse err error }{ { desc: "First", - request: &types.QueryGetTxinRequest{Index: msgs[0].Index}, - response: &types.QueryGetTxinResponse{Txin: &msgs[0]}, + request: &types.QueryGetSendRequest{Index: msgs[0].Index}, + response: &types.QueryGetSendResponse{Send: &msgs[0]}, }, { desc: "Second", - request: &types.QueryGetTxinRequest{Index: msgs[1].Index}, - response: &types.QueryGetTxinResponse{Txin: &msgs[1]}, + request: &types.QueryGetSendRequest{Index: msgs[1].Index}, + response: &types.QueryGetSendResponse{Send: &msgs[1]}, }, { desc: "KeyNotFound", - request: &types.QueryGetTxinRequest{Index: "missing"}, + request: &types.QueryGetSendRequest{Index: "missing"}, err: status.Error(codes.InvalidArgument, "not found"), }, { @@ -45,7 +45,7 @@ func TestTxinQuerySingle(t *testing.T) { } { tc := tc t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.Txin(wctx, tc.request) + response, err := keeper.Send(wctx, tc.request) if tc.err != nil { require.ErrorIs(t, err, tc.err) } else { @@ -55,13 +55,13 @@ func TestTxinQuerySingle(t *testing.T) { } } -func TestTxinQueryPaginated(t *testing.T) { +func TestSendQueryPaginated(t *testing.T) { keeper, ctx := setupKeeper(t) wctx := sdk.WrapSDKContext(ctx) - msgs := createNTxin(keeper, ctx, 5) + msgs := createNSend(keeper, ctx, 5) - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllTxinRequest { - return &types.QueryAllTxinRequest{ + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllSendRequest { + return &types.QueryAllSendRequest{ Pagination: &query.PageRequest{ Key: next, Offset: offset, @@ -73,10 +73,10 @@ func TestTxinQueryPaginated(t *testing.T) { 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)) + 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.Txin[j-i]) + assert.Equal(t, &msgs[j], resp.Send[j-i]) } } }) @@ -84,21 +84,21 @@ func TestTxinQueryPaginated(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)) + 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.Txin[j-i]) + assert.Equal(t, &msgs[j], resp.Send[j-i]) } next = resp.Pagination.NextKey } }) t.Run("Total", func(t *testing.T) { - resp, err := keeper.TxinAll(wctx, request(nil, 0, 0, true)) + 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.TxinAll(wctx, nil) + _, err := keeper.SendAll(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_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_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.go b/x/metacore/keeper/msg_server_send.go new file mode 100644 index 0000000000..a257f2bba6 --- /dev/null +++ b/x/metacore/keeper/msg_server_send.go @@ -0,0 +1,46 @@ +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) + + send, isFound := k.GetSend(ctx, msg.Index) + if !isFound { + send = types.Send{ + Index: msg.Index, + Creator: "", + Sender: msg.Sender, + SenderChain: msg.SenderChain, + Receiver: msg.Receiver, + ReceiverChain: msg.ReceiverChain, + MBurnt: msg.MBurnt, + MMint: "", + Message: msg.Message, + InTxHash: msg.InTxHash, + InBlockHeight: msg.InBlockHeight, + 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) + + + return &types.MsgCreateSendResponse{}, nil +} diff --git a/x/metacore/keeper/msg_server_txin_voter_test.go b/x/metacore/keeper/msg_server_send_test.go similarity index 60% rename from x/metacore/keeper/msg_server_txin_voter_test.go rename to x/metacore/keeper/msg_server_send_test.go index 705cc75fb1..02010adaa2 100644 --- a/x/metacore/keeper/msg_server_txin_voter_test.go +++ b/x/metacore/keeper/msg_server_send_test.go @@ -11,17 +11,17 @@ import ( "github.com/Meta-Protocol/metacore/x/metacore/types" ) -func TestTxinVoterMsgServerCreate(t *testing.T) { +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("txhash%d-%s", i, creator) - expected := &types.MsgCreateTxinVoter{Creator: creator, TxHash: fmt.Sprintf("txhash%d", i), Index: idx} - _, err := srv.CreateTxinVoter(wctx, expected) + idx := fmt.Sprintf("%d", i) + expected := &types.MsgCreateSend{Creator: creator, Index: idx} + _, err := srv.CreateSend(wctx, expected) require.NoError(t, err) - rst, found := keeper.GetTxinVoter(ctx, expected.Index) + rst, found := keeper.GetSend(ctx, expected.Index) require.True(t, found) assert.Equal(t, expected.Creator, rst.Creator) } 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..61d0e0c77e --- /dev/null +++ b/x/metacore/keeper/msg_server_send_voter.go @@ -0,0 +1,43 @@ +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) + + 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/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_txout_confirmation_voter.go b/x/metacore/keeper/msg_server_txout_confirmation_voter.go deleted file mode 100644 index cbd32b1117..0000000000 --- a/x/metacore/keeper/msg_server_txout_confirmation_voter.go +++ /dev/null @@ -1,54 +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_voter.go b/x/metacore/keeper/receive.go similarity index 52% rename from x/metacore/keeper/txin_voter.go rename to x/metacore/keeper/receive.go index 5566fe1e40..8150b3f9c4 100644 --- a/x/metacore/keeper/txin_voter.go +++ b/x/metacore/keeper/receive.go @@ -6,16 +6,16 @@ import ( 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) +// 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) } -// 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)) +// 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 { @@ -26,21 +26,21 @@ func (k Keeper) GetTxinVoter(ctx sdk.Context, index string) (val types.TxinVoter 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)) +// 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)) } -// 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)) +// 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.TxinVoter + var val types.Receive k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) list = append(list, val) } diff --git a/x/metacore/keeper/receive_test.go b/x/metacore/keeper/receive_test.go new file mode 100644 index 0000000000..0f7dd1be28 --- /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/keeper/txin.go b/x/metacore/keeper/send.go similarity index 57% rename from x/metacore/keeper/txin.go rename to x/metacore/keeper/send.go index b1969f2faa..6a27c47946 100644 --- a/x/metacore/keeper/txin.go +++ b/x/metacore/keeper/send.go @@ -6,16 +6,16 @@ import ( 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) +// 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) } -// 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)) +// 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 { @@ -26,21 +26,21 @@ func (k Keeper) GetTxin(ctx sdk.Context, index string) (val types.Txin, found bo 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)) +// 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)) } -// 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)) +// 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.Txin + var val types.Send k.cdc.MustUnmarshalBinaryBare(iterator.Value(), &val) list = append(list, val) } diff --git a/x/metacore/keeper/txin_test.go b/x/metacore/keeper/send_test.go similarity index 50% rename from x/metacore/keeper/txin_test.go rename to x/metacore/keeper/send_test.go index 5e2b1705cd..838c8d7986 100644 --- a/x/metacore/keeper/txin_test.go +++ b/x/metacore/keeper/send_test.go @@ -10,37 +10,37 @@ import ( "github.com/Meta-Protocol/metacore/x/metacore/types" ) -func createNTxin(keeper *Keeper, ctx sdk.Context, n int) []types.Txin { - items := make([]types.Txin, n) +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.SetTxin(ctx, items[i]) + keeper.SetSend(ctx, items[i]) } return items } -func TestTxinGet(t *testing.T) { +func TestSendGet(t *testing.T) { keeper, ctx := setupKeeper(t) - items := createNTxin(keeper, ctx, 10) + items := createNSend(keeper, ctx, 10) for _, item := range items { - rst, found := keeper.GetTxin(ctx, item.Index) + rst, found := keeper.GetSend(ctx, item.Index) assert.True(t, found) assert.Equal(t, item, rst) } } -func TestTxinRemove(t *testing.T) { +func TestSendRemove(t *testing.T) { keeper, ctx := setupKeeper(t) - items := createNTxin(keeper, ctx, 10) + items := createNSend(keeper, ctx, 10) for _, item := range items { - keeper.RemoveTxin(ctx, item.Index) - _, found := keeper.GetTxin(ctx, item.Index) + keeper.RemoveSend(ctx, item.Index) + _, found := keeper.GetSend(ctx, item.Index) assert.False(t, found) } } -func TestTxinGetAll(t *testing.T) { +func TestSendGetAll(t *testing.T) { keeper, ctx := setupKeeper(t) - items := createNTxin(keeper, ctx, 10) - assert.Equal(t, items, keeper.GetAllTxin(ctx)) + items := createNSend(keeper, ctx, 10) + assert.Equal(t, items, keeper.GetAllSend(ctx)) } 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 e011d33616..9239d7794e 100644 --- a/x/metacore/types/codec.go +++ b/x/metacore/types/codec.go @@ -9,24 +9,25 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { // this line is used by starport scaffolding # 2 - cdc.RegisterConcrete(&MsgTxoutConfirmationVoter{}, "metacore/TxoutConfirmationVoter", nil) + cdc.RegisterConcrete(&MsgReceiveConfirmation{}, "metacore/ReceiveConfirmation", nil) - cdc.RegisterConcrete(&MsgSetNodeKeys{}, "metacore/SetNodeKeys", nil) + cdc.RegisterConcrete(&MsgSendVoter{}, "metacore/SendVoter", nil) - cdc.RegisterConcrete(&MsgCreateTxinVoter{}, "metacore/CreateTxinVoter", 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), - &MsgTxoutConfirmationVoter{}, + &MsgReceiveConfirmation{}, ) registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgSetNodeKeys{}, + &MsgSendVoter{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgCreateTxinVoter{}, + &MsgSetNodeKeys{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/metacore/types/genesis.go b/x/metacore/types/genesis.go index 8d284300af..1cdc81360d 100644 --- a/x/metacore/types/genesis.go +++ b/x/metacore/types/genesis.go @@ -13,11 +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 - TxoutConfirmationList: []*TxoutConfirmation{}, - TxoutList: []*Txout{}, - NodeAccountList: []*NodeAccount{}, - TxinVoterList: []*TxinVoter{}, - TxinList: []*Txin{}, + ReceiveList: []*Receive{}, + SendList: []*Send{}, + NodeAccountList: []*NodeAccount{}, } } @@ -27,24 +25,25 @@ 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 txoutConfirmation - txoutConfirmationIndexMap := make(map[string]bool) + // Check for duplicated index in receive + receiveIndexMap := make(map[string]bool) - for _, elem := range gs.TxoutConfirmationList { - if _, ok := txoutConfirmationIndexMap[elem.Index]; ok { - return fmt.Errorf("duplicated index for txoutConfirmation") + for _, elem := range gs.ReceiveList { + if _, ok := receiveIndexMap[elem.Index]; ok { + return fmt.Errorf("duplicated index for receive") } - txoutConfirmationIndexMap[elem.Index] = true + receiveIndexMap[elem.Index] = true } - // Check for duplicated ID in txout - txoutIdMap := make(map[uint64]bool) + // Check for duplicated index in send + sendIndexMap := make(map[string]bool) - for _, elem := range gs.TxoutList { - if _, ok := txoutIdMap[elem.Id]; ok { - return fmt.Errorf("duplicated id for txout") + for _, elem := range gs.SendList { + if _, ok := sendIndexMap[elem.Index]; ok { + return fmt.Errorf("duplicated index for send") } - txoutIdMap[elem.Id] = true + sendIndexMap[elem.Index] = true } + // Check for duplicated index in nodeAccount nodeAccountIndexMap := make(map[string]bool) @@ -54,24 +53,6 @@ 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 17ad7ccbef..22e35231d9 100644 --- a/x/metacore/types/genesis.pb.go +++ b/x/metacore/types/genesis.pb.go @@ -25,12 +25,9 @@ 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 - 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,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"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -66,27 +63,20 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetTxoutConfirmationList() []*TxoutConfirmation { +func (m *GenesisState) GetSendList() []*Send { if m != nil { - return m.TxoutConfirmationList + return m.SendList } return nil } -func (m *GenesisState) GetTxoutList() []*Txout { +func (m *GenesisState) GetReceiveList() []*Receive { if m != nil { - return m.TxoutList + return m.ReceiveList } 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 @@ -94,20 +84,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") } @@ -115,29 +91,23 @@ 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, 0x98, 0xf2, 0x65, 0xdc, 0xdc, 0xca, 0x58, 0x84, - 0xec, 0xbc, 0x29, 0xe0, 0x6e, 0xd4, 0x5a, 0xcb, 0xb5, 0x42, 0x71, 0xf7, 0xb3, 0x88, 0x96, 0x2f, - 0xc2, 0xbd, 0x6f, 0xc1, 0x01, 0x8e, 0x7b, 0x68, 0xc3, 0x0c, 0x6b, 0x65, 0xd6, 0x69, 0x0b, 0x0f, - 0x2a, 0xe5, 0x5a, 0xb1, 0xbe, 0xd4, 0x3c, 0xb6, 0xff, 0xff, 0x96, 0x7d, 0x37, 0x69, 0xa6, 0x7f, - 0xf3, 0x70, 0x0b, 0x2d, 0x9a, 0x86, 0x81, 0x97, 0x0c, 0x7c, 0x7f, 0x26, 0x38, 0x4d, 0x7d, 0x98, - 0x20, 0x14, 0xd1, 0x7d, 0x09, 0x95, 0xf9, 0x9a, 0x55, 0x2f, 0xd1, 0x8c, 0x82, 0xef, 0xd1, 0xaa, - 0x0e, 0xe9, 0x2c, 0xcc, 0xc8, 0x8c, 0x2a, 0x9a, 0x51, 0x87, 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, + // 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, 0x84, 0xbe, 0xa2, 0xd4, 0xe4, 0xd4, 0xcc, 0xb2, 0x54, 0x88, 0x3e, 0x29, + 0x61, 0xb8, 0x78, 0x71, 0x6a, 0x5e, 0x0a, 0x54, 0x50, 0x1a, 0x2e, 0x98, 0x97, 0x9f, 0x92, 0x1a, + 0x9f, 0x98, 0x9c, 0x9c, 0x5f, 0x9a, 0x57, 0x02, 0x91, 0x54, 0xfa, 0xc4, 0xc8, 0xc5, 0xe3, 0x0e, + 0xb1, 0x3b, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0xc8, 0x81, 0x8b, 0x03, 0xa4, 0xd7, 0x27, 0xb3, 0xb8, + 0x44, 0x82, 0x51, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x45, 0x0f, 0xbf, 0x6b, 0xf4, 0x82, 0x53, 0xf3, + 0x52, 0x82, 0xe0, 0xba, 0x84, 0x3c, 0xb9, 0xb8, 0xa1, 0xae, 0x02, 0x1b, 0xc2, 0x04, 0x36, 0x44, + 0x9d, 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) { @@ -160,39 +130,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - 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-- { { @@ -207,10 +144,10 @@ 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-- { + if len(m.ReceiveList) > 0 { + for iNdEx := len(m.ReceiveList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TxinVoterList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ReceiveList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -221,10 +158,10 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x12 } } - if len(m.TxinList) > 0 { - for iNdEx := len(m.TxinList) - 1; iNdEx >= 0; iNdEx-- { + if len(m.SendList) > 0 { + for iNdEx := len(m.SendList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TxinList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.SendList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -255,14 +192,14 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - if len(m.TxinList) > 0 { - for _, e := range m.TxinList { + if len(m.SendList) > 0 { + for _, e := range m.SendList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.TxinVoterList) > 0 { - for _, e := range m.TxinVoterList { + if len(m.ReceiveList) > 0 { + for _, e := range m.ReceiveList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } @@ -273,21 +210,6 @@ func (m *GenesisState) Size() (n int) { 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)) - } - } return n } @@ -328,7 +250,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxinList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SendList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -355,14 +277,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { 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 { + 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 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxinVoterList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ReceiveList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -389,8 +311,8 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { 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 { + m.ReceiveList = append(m.ReceiveList, &Receive{}) + if err := m.ReceiveList[len(m.ReceiveList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -428,93 +350,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 default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/metacore/types/keys.go b/x/metacore/types/keys.go index 25b1950754..91e49328ae 100644 --- a/x/metacore/types/keys.go +++ b/x/metacore/types/keys.go @@ -45,3 +45,11 @@ const ( const ( TxoutConfirmationKey = "TxoutConfirmation-value-" ) + +const ( + SendKey = "Send-value-" +) + +const ( + 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 new file mode 100644 index 0000000000..63fb643f3a --- /dev/null +++ b/x/metacore/types/message_send_voter.go @@ -0,0 +1,61 @@ +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 uint64) *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 { + //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() +} 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_send.go b/x/metacore/types/messages_send.go new file mode 100644 index 0000000000..2d719b0d50 --- /dev/null +++ b/x/metacore/types/messages_send.go @@ -0,0 +1,72 @@ +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{} + +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 { + //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/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 835cff8be6..576d4c0d3f 100644 --- a/x/metacore/types/query.pb.go +++ b/x/metacore/types/query.pb.go @@ -30,22 +30,22 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // this line is used by starport scaffolding # 3 -type QueryGetTxoutConfirmationRequest struct { +type QueryGetReceiveRequest 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) { +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 *QueryGetTxoutConfirmationRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryGetReceiveRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetTxoutConfirmationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetReceiveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetTxoutConfirmationRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetReceiveRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -55,41 +55,41 @@ func (m *QueryGetTxoutConfirmationRequest) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } -func (m *QueryGetTxoutConfirmationRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxoutConfirmationRequest.Merge(m, src) +func (m *QueryGetReceiveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetReceiveRequest.Merge(m, src) } -func (m *QueryGetTxoutConfirmationRequest) XXX_Size() int { +func (m *QueryGetReceiveRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetTxoutConfirmationRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxoutConfirmationRequest.DiscardUnknown(m) +func (m *QueryGetReceiveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetReceiveRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetTxoutConfirmationRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryGetReceiveRequest proto.InternalMessageInfo -func (m *QueryGetTxoutConfirmationRequest) GetIndex() string { +func (m *QueryGetReceiveRequest) GetIndex() string { if m != nil { return m.Index } return "" } -type QueryGetTxoutConfirmationResponse struct { - TxoutConfirmation *TxoutConfirmation `protobuf:"bytes,1,opt,name=TxoutConfirmation,proto3" json:"TxoutConfirmation,omitempty"` +type QueryGetReceiveResponse struct { + Receive *Receive `protobuf:"bytes,1,opt,name=Receive,proto3" json:"Receive,omitempty"` } -func (m *QueryGetTxoutConfirmationResponse) Reset() { *m = QueryGetTxoutConfirmationResponse{} } -func (m *QueryGetTxoutConfirmationResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxoutConfirmationResponse) ProtoMessage() {} -func (*QueryGetTxoutConfirmationResponse) Descriptor() ([]byte, []int) { +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 *QueryGetTxoutConfirmationResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryGetReceiveResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetTxoutConfirmationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetReceiveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetTxoutConfirmationResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetReceiveResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -99,41 +99,41 @@ func (m *QueryGetTxoutConfirmationResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *QueryGetTxoutConfirmationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxoutConfirmationResponse.Merge(m, src) +func (m *QueryGetReceiveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetReceiveResponse.Merge(m, src) } -func (m *QueryGetTxoutConfirmationResponse) XXX_Size() int { +func (m *QueryGetReceiveResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetTxoutConfirmationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxoutConfirmationResponse.DiscardUnknown(m) +func (m *QueryGetReceiveResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetReceiveResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetTxoutConfirmationResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryGetReceiveResponse proto.InternalMessageInfo -func (m *QueryGetTxoutConfirmationResponse) GetTxoutConfirmation() *TxoutConfirmation { +func (m *QueryGetReceiveResponse) GetReceive() *Receive { if m != nil { - return m.TxoutConfirmation + return m.Receive } return nil } -type QueryAllTxoutConfirmationRequest struct { +type QueryAllReceiveRequest 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) { +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 *QueryAllTxoutConfirmationRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAllReceiveRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllTxoutConfirmationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllReceiveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllTxoutConfirmationRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllReceiveRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -143,42 +143,42 @@ func (m *QueryAllTxoutConfirmationRequest) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } -func (m *QueryAllTxoutConfirmationRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxoutConfirmationRequest.Merge(m, src) +func (m *QueryAllReceiveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllReceiveRequest.Merge(m, src) } -func (m *QueryAllTxoutConfirmationRequest) XXX_Size() int { +func (m *QueryAllReceiveRequest) XXX_Size() int { return m.Size() } -func (m *QueryAllTxoutConfirmationRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxoutConfirmationRequest.DiscardUnknown(m) +func (m *QueryAllReceiveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllReceiveRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllTxoutConfirmationRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAllReceiveRequest proto.InternalMessageInfo -func (m *QueryAllTxoutConfirmationRequest) GetPagination() *query.PageRequest { +func (m *QueryAllReceiveRequest) 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"` +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 *QueryAllTxoutConfirmationResponse) Reset() { *m = QueryAllTxoutConfirmationResponse{} } -func (m *QueryAllTxoutConfirmationResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxoutConfirmationResponse) ProtoMessage() {} -func (*QueryAllTxoutConfirmationResponse) Descriptor() ([]byte, []int) { +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 *QueryAllTxoutConfirmationResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAllReceiveResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllTxoutConfirmationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllReceiveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllTxoutConfirmationResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllReceiveResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -188,48 +188,48 @@ func (m *QueryAllTxoutConfirmationResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *QueryAllTxoutConfirmationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxoutConfirmationResponse.Merge(m, src) +func (m *QueryAllReceiveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllReceiveResponse.Merge(m, src) } -func (m *QueryAllTxoutConfirmationResponse) XXX_Size() int { +func (m *QueryAllReceiveResponse) XXX_Size() int { return m.Size() } -func (m *QueryAllTxoutConfirmationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxoutConfirmationResponse.DiscardUnknown(m) +func (m *QueryAllReceiveResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllReceiveResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllTxoutConfirmationResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAllReceiveResponse proto.InternalMessageInfo -func (m *QueryAllTxoutConfirmationResponse) GetTxoutConfirmation() []*TxoutConfirmation { +func (m *QueryAllReceiveResponse) GetReceive() []*Receive { if m != nil { - return m.TxoutConfirmation + return m.Receive } return nil } -func (m *QueryAllTxoutConfirmationResponse) GetPagination() *query.PageResponse { +func (m *QueryAllReceiveResponse) 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"` +type QueryGetSendRequest struct { + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` } -func (m *QueryGetTxoutRequest) Reset() { *m = QueryGetTxoutRequest{} } -func (m *QueryGetTxoutRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxoutRequest) ProtoMessage() {} -func (*QueryGetTxoutRequest) Descriptor() ([]byte, []int) { +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{4} } -func (m *QueryGetTxoutRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryGetSendRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetTxoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetSendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetTxoutRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetSendRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -239,41 +239,41 @@ func (m *QueryGetTxoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *QueryGetTxoutRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxoutRequest.Merge(m, src) +func (m *QueryGetSendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSendRequest.Merge(m, src) } -func (m *QueryGetTxoutRequest) XXX_Size() int { +func (m *QueryGetSendRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetTxoutRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxoutRequest.DiscardUnknown(m) +func (m *QueryGetSendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSendRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetTxoutRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryGetSendRequest proto.InternalMessageInfo -func (m *QueryGetTxoutRequest) GetId() uint64 { +func (m *QueryGetSendRequest) GetIndex() string { if m != nil { - return m.Id + return m.Index } - return 0 + return "" } -type QueryGetTxoutResponse struct { - Txout *Txout `protobuf:"bytes,1,opt,name=Txout,proto3" json:"Txout,omitempty"` +type QueryGetSendResponse struct { + Send *Send `protobuf:"bytes,1,opt,name=Send,proto3" json:"Send,omitempty"` } -func (m *QueryGetTxoutResponse) Reset() { *m = QueryGetTxoutResponse{} } -func (m *QueryGetTxoutResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetTxoutResponse) ProtoMessage() {} -func (*QueryGetTxoutResponse) Descriptor() ([]byte, []int) { +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{5} } -func (m *QueryGetTxoutResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryGetSendResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetTxoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetTxoutResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetSendResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -283,41 +283,41 @@ func (m *QueryGetTxoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *QueryGetTxoutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTxoutResponse.Merge(m, src) +func (m *QueryGetSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSendResponse.Merge(m, src) } -func (m *QueryGetTxoutResponse) XXX_Size() int { +func (m *QueryGetSendResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetTxoutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTxoutResponse.DiscardUnknown(m) +func (m *QueryGetSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSendResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetTxoutResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryGetSendResponse proto.InternalMessageInfo -func (m *QueryGetTxoutResponse) GetTxout() *Txout { +func (m *QueryGetSendResponse) GetSend() *Send { if m != nil { - return m.Txout + return m.Send } return nil } -type QueryAllTxoutRequest struct { +type QueryAllSendRequest 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) { +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{6} } -func (m *QueryAllTxoutRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAllSendRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllTxoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllSendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllTxoutRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllSendRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -327,42 +327,42 @@ func (m *QueryAllTxoutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *QueryAllTxoutRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxoutRequest.Merge(m, src) +func (m *QueryAllSendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllSendRequest.Merge(m, src) } -func (m *QueryAllTxoutRequest) XXX_Size() int { +func (m *QueryAllSendRequest) XXX_Size() int { return m.Size() } -func (m *QueryAllTxoutRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxoutRequest.DiscardUnknown(m) +func (m *QueryAllSendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllSendRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllTxoutRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAllSendRequest proto.InternalMessageInfo -func (m *QueryAllTxoutRequest) GetPagination() *query.PageRequest { +func (m *QueryAllSendRequest) 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"` +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 *QueryAllTxoutResponse) Reset() { *m = QueryAllTxoutResponse{} } -func (m *QueryAllTxoutResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllTxoutResponse) ProtoMessage() {} -func (*QueryAllTxoutResponse) Descriptor() ([]byte, []int) { +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{7} } -func (m *QueryAllTxoutResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAllSendResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllTxoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllTxoutResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllSendResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -372,26 +372,26 @@ func (m *QueryAllTxoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *QueryAllTxoutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllTxoutResponse.Merge(m, src) +func (m *QueryAllSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllSendResponse.Merge(m, src) } -func (m *QueryAllTxoutResponse) XXX_Size() int { +func (m *QueryAllSendResponse) XXX_Size() int { return m.Size() } -func (m *QueryAllTxoutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllTxoutResponse.DiscardUnknown(m) +func (m *QueryAllSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllSendResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllTxoutResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAllSendResponse proto.InternalMessageInfo -func (m *QueryAllTxoutResponse) GetTxout() []*Txout { +func (m *QueryAllSendResponse) GetSend() []*Send { if m != nil { - return m.Txout + return m.Send } return nil } -func (m *QueryAllTxoutResponse) GetPagination() *query.PageResponse { +func (m *QueryAllSendResponse) GetPagination() *query.PageResponse { if m != nil { return m.Pagination } @@ -662,465 +662,73 @@ func (m *QueryLastMetaHeightResponse) GetHeight() uint64 { return 0 } -type QueryGetTxinVoterRequest struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` -} - -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{14} -} -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{15} -} -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{16} -} -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{17} -} -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{18} -} -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{19} -} -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{20} -} -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{21} -} -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((*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((*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") + 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") - 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{ - // 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, 0x99, 0xac, 0xf4, 0x35, 0x59, 0x31, 0x0c, 0x6e, 0x29, 0x96, 0xc6, 0x0d, - 0xd3, 0x89, 0xce, 0xaf, 0x75, 0xb8, 0xd9, 0xe3, 0xa6, 0xdc, 0x56, 0x4c, 0x48, 0x2b, 0x9f, 0x94, - 0xda, 0xcc, 0x52, 0x4a, 0x72, 0x5f, 0xe9, 0x6a, 0x86, 0x98, 0x0c, 0x73, 0x17, 0xbd, 0xfa, 0xd6, - 0x29, 0x1f, 0x5a, 0xad, 0x0e, 0x37, 0x3e, 0xd6, 0x06, 0x3d, 0xff, 0x94, 0x5c, 0x70, 0x0a, 0x8c, - 0x3e, 0xf6, 0x46, 0x0d, 0xae, 0xb2, 0x96, 0xd2, 0xe9, 0xf0, 0xa1, 0xe1, 0xbe, 0x7c, 0xe4, 0x0b, - 0xd1, 0x8c, 0xd6, 0x09, 0xb7, 0xd8, 0x00, 0x5e, 0x3d, 0x08, 0xbc, 0x72, 0x06, 0x69, 0x0d, 0x3f, - 0x7d, 0xcf, 0xd6, 0xb9, 0xcb, 0xac, 0x43, 0xbb, 0xc6, 0x5b, 0x3e, 0x15, 0x4d, 0x76, 0x3c, 0x64, - 0xa6, 0x45, 0x72, 0x78, 0x5e, 0x33, 0x54, 0x76, 0xfa, 0x10, 0x3d, 0x45, 0xab, 0xf7, 0x9a, 0xce, - 0x03, 0xfd, 0x0c, 0xe1, 0xc5, 0x88, 0x50, 0xb3, 0xcf, 0x0d, 0x93, 0x91, 0x16, 0x7e, 0x61, 0xe2, - 0xa5, 0xc8, 0x73, 0xbf, 0x5c, 0x92, 0xa2, 0xbd, 0x96, 0x26, 0xb3, 0x4e, 0xe6, 0xa2, 0x9f, 0x00, - 0x40, 0x43, 0xd7, 0x6f, 0x04, 0x78, 0x1b, 0xe3, 0x91, 0xfd, 0x50, 0x7d, 0x59, 0x72, 0xd6, 0x4a, - 0xb2, 0xd7, 0x4a, 0x72, 0xb6, 0x00, 0xac, 0x95, 0x74, 0xa0, 0x74, 0x19, 0xc4, 0x36, 0x7d, 0x91, - 0xf4, 0x0f, 0x17, 0x39, 0xbc, 0x58, 0x34, 0x72, 0x36, 0x2d, 0x64, 0xb2, 0x1b, 0xc0, 0xc9, 0x08, - 0x9c, 0x95, 0xa9, 0x38, 0x8e, 0xba, 0x00, 0xcf, 0x32, 0xce, 0x05, 0x56, 0xd0, 0xf5, 0x6b, 0x01, - 0x67, 0x34, 0x55, 0xf8, 0x74, 0xa7, 0x99, 0xd1, 0x54, 0x7a, 0x88, 0x5f, 0x1c, 0x9b, 0x07, 0xa8, - 0x5b, 0x78, 0x5e, 0x0c, 0x80, 0xa7, 0x4b, 0xb1, 0xf0, 0x9a, 0x4e, 0x0c, 0xfd, 0x08, 0xaa, 0xbb, - 0x66, 0xa6, 0xbd, 0x5a, 0x5f, 0x21, 0x90, 0x3d, 0x2a, 0x30, 0x29, 0x3b, 0x9b, 0x54, 0x76, 0x7a, - 0xee, 0x97, 0x71, 0xde, 0x75, 0xf5, 0x5d, 0xae, 0xb2, 0x86, 0x73, 0x8e, 0xa3, 0x0f, 0x9d, 0x8e, - 0x1f, 0x87, 0xc6, 0x00, 0xd8, 0x3e, 0xbe, 0xef, 0x1b, 0x06, 0xef, 0xd6, 0xa7, 0xe1, 0xf9, 0x33, - 0xf9, 0xe3, 0xa9, 0x0a, 0x0a, 0x1b, 0xba, 0x1e, 0xa2, 0x30, 0xad, 0x75, 0xfa, 0x11, 0x01, 0xd4, - 0x78, 0x99, 0x9b, 0xa0, 0xb2, 0xb7, 0x81, 0x4a, 0x6f, 0xfd, 0x9e, 0x80, 0x3b, 0x7b, 0x8a, 0x69, - 0xd9, 0x62, 0xde, 0x61, 0x5a, 0xf7, 0xc8, 0x75, 0x87, 0x6e, 0x02, 0xd4, 0xf8, 0x5b, 0x80, 0x7a, - 0x09, 0xdf, 0x75, 0x46, 0xe0, 0x98, 0xc1, 0x13, 0x7d, 0x15, 0x3f, 0x1c, 0x1d, 0x35, 0xcd, 0x78, - 0xdf, 0xfe, 0x7e, 0x47, 0x6f, 0x09, 0x15, 0x3f, 0x0a, 0x89, 0x80, 0x32, 0xbb, 0xf8, 0x9e, 0x37, - 0x08, 0x4b, 0xf4, 0xca, 0xf4, 0xdd, 0xee, 0x66, 0x19, 0xc5, 0xd2, 0x36, 0xe8, 0x12, 0x67, 0x69, - 0x4c, 0x57, 0x5a, 0x1b, 0xe1, 0x7b, 0x04, 0x28, 0xc1, 0x22, 0xe1, 0x28, 0xd9, 0x59, 0x51, 0xd2, - 0xdb, 0x00, 0xeb, 0xf8, 0x81, 0xdf, 0xf9, 0xe8, 0x65, 0x3a, 0xf0, 0x7f, 0x6b, 0xb5, 0xd1, 0x6d, - 0x51, 0xc3, 0x77, 0xec, 0x67, 0xb0, 0xed, 0xe5, 0x38, 0x44, 0x4d, 0x11, 0x41, 0x3f, 0x84, 0xf2, - 0xe0, 0x56, 0xda, 0xab, 0xf1, 0x25, 0xf2, 0x7f, 0x9f, 0x43, 0x15, 0x67, 0x93, 0x29, 0x4e, 0xcd, - 0xf9, 0xf2, 0x0f, 0xcf, 0xe3, 0x79, 0xa1, 0x8d, 0xfc, 0x83, 0x42, 0x6e, 0x5b, 0xf2, 0xe6, 0x34, - 0x51, 0xd3, 0x7a, 0x9e, 0x7c, 0xe3, 0x16, 0x19, 0x1c, 0xc1, 0x74, 0xe7, 0xd3, 0x3f, 0xff, 0xfb, - 0x22, 0xb3, 0x4d, 0xea, 0xb2, 0x9d, 0xaa, 0xe8, 0xe6, 0x92, 0xbd, 0x36, 0x2c, 0xd8, 0xdd, 0xf9, - 0x73, 0xc8, 0xe7, 0x62, 0xd3, 0x5c, 0x90, 0xbf, 0x10, 0xce, 0x4d, 0x54, 0x68, 0xe8, 0x7a, 0x4c, - 0xc2, 0x88, 0xa6, 0x28, 0x26, 0x61, 0x54, 0xa7, 0x43, 0xeb, 0x82, 0xb0, 0x4a, 0xca, 0xc9, 0x09, - 0xc9, 0x77, 0x08, 0x2e, 0x61, 0x52, 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, + // 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, 0x7b, 0x6b, 0xa7, 0xf3, 0xde, 0xef, 0xbd, 0x37, 0xdb, 0xd7, + 0xc5, 0x13, 0xfb, 0x4c, 0x9a, 0x96, 0x68, 0x30, 0xe3, 0xa0, 0xc9, 0x1a, 0xc7, 0x7a, 0xbd, 0x21, + 0xa4, 0x20, 0xda, 0x0e, 0x93, 0xe6, 0x6e, 0x70, 0x69, 0x09, 0xae, 0x47, 0x5b, 0xe2, 0x8b, 0xd2, + 0xb4, 0x23, 0x84, 0xc3, 0x99, 0x61, 0xd6, 0x5d, 0xc3, 0xf4, 0x3c, 0x21, 0x4d, 0xe9, 0x0a, 0xcf, + 0x0f, 0xd1, 0xa5, 0x39, 0x4b, 0xf8, 0xfb, 0xc2, 0x37, 0x6a, 0xa6, 0x0f, 0xb4, 0xc6, 0xe1, 0x52, + 0x8d, 0x49, 0x73, 0xc9, 0xa8, 0x9b, 0x8e, 0xeb, 0xa9, 0xcd, 0xb0, 0x77, 0x32, 0x9e, 0xdf, 0x60, + 0x16, 0x73, 0x0f, 0x19, 0xac, 0x8f, 0xc7, 0xeb, 0x3e, 0xf3, 0x6c, 0x58, 0x9c, 0x8a, 0x17, 0x3d, + 0x61, 0xb3, 0xe7, 0xa6, 0x65, 0x89, 0xa6, 0x27, 0xc3, 0x87, 0x54, 0xc7, 0x93, 0x8f, 0x82, 0x59, + 0x5b, 0x4c, 0x56, 0x43, 0xaa, 0x2a, 0x3b, 0x68, 0x32, 0x5f, 0x92, 0x09, 0x3c, 0xe4, 0x7a, 0x36, + 0x3b, 0xba, 0x86, 0xae, 0xa3, 0xd9, 0x2b, 0xd5, 0xf0, 0x86, 0x3e, 0xc5, 0x57, 0xdb, 0xf6, 0xfb, + 0x75, 0xe1, 0xf9, 0x8c, 0x54, 0xf0, 0x08, 0x2c, 0x29, 0xc8, 0x68, 0x79, 0x46, 0xbf, 0x3c, 0x10, + 0x3d, 0x62, 0x88, 0x70, 0xf4, 0x05, 0xa8, 0xa9, 0x70, 0xde, 0xa2, 0xe6, 0x3e, 0xc6, 0xe7, 0x29, + 0x00, 0xff, 0x2d, 0x3d, 0x8c, 0x4c, 0x0f, 0x22, 0xd3, 0xc3, 0x93, 0x80, 0xc8, 0xf4, 0x5d, 0xd3, + 0x89, 0xb0, 0xd5, 0x04, 0x92, 0x7e, 0x44, 0x60, 0x20, 0x39, 0x22, 0xcb, 0xc0, 0x40, 0x37, 0x06, + 0xc8, 0x56, 0x4a, 0x66, 0x3f, 0xc4, 0x90, 0x27, 0x33, 0x9c, 0x9f, 0xd2, 0x39, 0x8f, 0xc7, 0xa3, + 0x9c, 0x1f, 0x33, 0xcf, 0xbe, 0xfc, 0x50, 0x76, 0xf1, 0x44, 0x7a, 0x33, 0x18, 0xda, 0xc0, 0x83, + 0xc1, 0x3d, 0xc4, 0x75, 0x23, 0xcf, 0x8d, 0xc2, 0x2a, 0x04, 0x7d, 0x06, 0xe3, 0x2b, 0x9c, 0x27, + 0xc7, 0xf7, 0xea, 0x14, 0xde, 0x23, 0x50, 0x1c, 0xf3, 0xb7, 0x29, 0x1e, 0xe8, 0x4c, 0x71, 0xef, + 0x92, 0x2f, 0xe3, 0x52, 0x14, 0xe6, 0x43, 0x61, 0xb3, 0x4a, 0xf8, 0xba, 0x5c, 0x7e, 0x00, 0x1c, + 0x4f, 0x65, 0x62, 0xc0, 0xd5, 0x0e, 0x1e, 0x4d, 0x2c, 0x43, 0x6e, 0xf3, 0x79, 0xe6, 0x92, 0x4c, + 0x49, 0x3c, 0xb5, 0x41, 0x61, 0x85, 0xf3, 0x0c, 0x85, 0xbd, 0x3a, 0xa3, 0xaf, 0x08, 0x4c, 0xb5, + 0x8e, 0xb9, 0xc8, 0xd4, 0xc0, 0xff, 0x98, 0xea, 0xdd, 0xf9, 0x4d, 0x43, 0x3a, 0xdb, 0xa6, 0x2f, + 0x03, 0x31, 0x0f, 0x98, 0xeb, 0xec, 0x45, 0xe9, 0xd0, 0x55, 0x30, 0xd5, 0xfa, 0x14, 0x4c, 0x4d, + 0xe2, 0xe1, 0x70, 0x45, 0x05, 0x37, 0x58, 0x85, 0xbb, 0xf2, 0x1b, 0x8c, 0x87, 0x14, 0x8e, 0x7c, + 0x41, 0x71, 0x4b, 0x90, 0xb5, 0x3c, 0xb7, 0xd9, 0xd5, 0x5a, 0x5a, 0xef, 0x18, 0x17, 0xca, 0xa3, + 0x1b, 0xaf, 0x7f, 0xfd, 0x7d, 0xd7, 0x5f, 0x26, 0x8b, 0x46, 0x40, 0xb0, 0x10, 0x31, 0x18, 0x71, + 0xc3, 0xb7, 0x7e, 0x17, 0x8c, 0x97, 0xea, 0x07, 0xfa, 0x8a, 0x7c, 0x46, 0x18, 0x03, 0x5b, 0x85, + 0xf3, 0x82, 0xca, 0xdb, 0x6a, 0xb8, 0xa0, 0xf2, 0xf6, 0x6e, 0xa5, 0x8b, 0x4a, 0xf9, 0x1c, 0x99, + 0x2d, 0xaa, 0x9c, 0x7c, 0x42, 0x61, 0x17, 0x90, 0xe5, 0xa2, 0x69, 0x25, 0x9a, 0xaa, 0xb4, 0xd2, + 0x19, 0x08, 0x54, 0xae, 0x2a, 0x95, 0x06, 0x59, 0xc8, 0x55, 0x19, 0x7c, 0x5f, 0xe3, 0x70, 0x3f, + 0x20, 0x3c, 0x12, 0xf0, 0x04, 0xc9, 0x2e, 0x17, 0x4d, 0xa8, 0x73, 0xb5, 0x2d, 0x65, 0x49, 0x17, + 0x94, 0xda, 0x19, 0x72, 0xb3, 0x90, 0x5a, 0xf2, 0x03, 0xa5, 0xde, 0x58, 0xb2, 0x59, 0x34, 0xa2, + 0xf6, 0x92, 0x29, 0xdd, 0xe9, 0x0a, 0x0b, 0xba, 0xef, 0x2a, 0xdd, 0x6b, 0x64, 0x25, 0x57, 0xb7, + 0x77, 0x8e, 0x8e, 0xc3, 0xfe, 0x86, 0xf0, 0x58, 0x82, 0x35, 0xc8, 0x7c, 0xb3, 0x68, 0x7c, 0x5d, + 0x3b, 0xc9, 0xee, 0x40, 0xba, 0xa2, 0x9c, 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. @@ -1135,28 +743,20 @@ 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 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 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. + SendAll(ctx context.Context, in *QueryAllSendRequest, opts ...grpc.CallOption) (*QueryAllSendResponse, 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 { @@ -1167,36 +767,36 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -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...) +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) 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) 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) 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) 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) 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...) +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 } @@ -1230,83 +830,39 @@ func (c *queryClient) LastMetaHeight(ctx context.Context, in *QueryLastMetaHeigh 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 +// 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. + SendAll(context.Context, *QueryAllSendRequest) (*QueryAllSendResponse, 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) } -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 +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { } -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...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // 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. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) TxoutConfirmation(ctx context.Context, req *QueryGetTxoutConfirmationRequest) (*QueryGetTxoutConfirmationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmation not implemented") +func (*UnimplementedQueryServer) Receive(ctx context.Context, req *QueryGetReceiveRequest) (*QueryGetReceiveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Receive not implemented") } -func (*UnimplementedQueryServer) TxoutConfirmationAll(ctx context.Context, req *QueryAllTxoutConfirmationRequest) (*QueryAllTxoutConfirmationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmationAll not implemented") +func (*UnimplementedQueryServer) ReceiveAll(ctx context.Context, req *QueryAllReceiveRequest) (*QueryAllReceiveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReceiveAll not implemented") } -func (*UnimplementedQueryServer) Txout(ctx context.Context, req *QueryGetTxoutRequest) (*QueryGetTxoutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Txout not implemented") +func (*UnimplementedQueryServer) Send(ctx context.Context, req *QueryGetSendRequest) (*QueryGetSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") } -func (*UnimplementedQueryServer) TxoutAll(ctx context.Context, req *QueryAllTxoutRequest) (*QueryAllTxoutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxoutAll not implemented") +func (*UnimplementedQueryServer) SendAll(ctx context.Context, req *QueryAllSendRequest) (*QueryAllSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendAll not implemented") } func (*UnimplementedQueryServer) NodeAccount(ctx context.Context, req *QueryGetNodeAccountRequest) (*QueryGetNodeAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NodeAccount not implemented") @@ -1317,91 +873,79 @@ 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) } -func _Query_TxoutConfirmation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetTxoutConfirmationRequest) +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).TxoutConfirmation(ctx, in) + return srv.(QueryServer).Receive(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/TxoutConfirmation", + FullMethod: "/MetaProtocol.metacore.metacore.Query/Receive", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TxoutConfirmation(ctx, req.(*QueryGetTxoutConfirmationRequest)) + return srv.(QueryServer).Receive(ctx, req.(*QueryGetReceiveRequest)) } 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) +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).TxoutConfirmationAll(ctx, in) + return srv.(QueryServer).ReceiveAll(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/TxoutConfirmationAll", + FullMethod: "/MetaProtocol.metacore.metacore.Query/ReceiveAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TxoutConfirmationAll(ctx, req.(*QueryAllTxoutConfirmationRequest)) + return srv.(QueryServer).ReceiveAll(ctx, req.(*QueryAllReceiveRequest)) } 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) +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).Txout(ctx, in) + return srv.(QueryServer).Send(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/Txout", + FullMethod: "/MetaProtocol.metacore.metacore.Query/Send", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Txout(ctx, req.(*QueryGetTxoutRequest)) + return srv.(QueryServer).Send(ctx, req.(*QueryGetSendRequest)) } 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) +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).TxoutAll(ctx, in) + return srv.(QueryServer).SendAll(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Query/TxoutAll", + FullMethod: "/MetaProtocol.metacore.metacore.Query/SendAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TxoutAll(ctx, req.(*QueryAllTxoutRequest)) + return srv.(QueryServer).SendAll(ctx, req.(*QueryAllSendRequest)) } return interceptor(ctx, in, info, handler) } @@ -1460,97 +1004,25 @@ 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), Methods: []grpc.MethodDesc{ { - MethodName: "TxoutConfirmation", - Handler: _Query_TxoutConfirmation_Handler, + MethodName: "Receive", + Handler: _Query_Receive_Handler, }, { - MethodName: "TxoutConfirmationAll", - Handler: _Query_TxoutConfirmationAll_Handler, + MethodName: "ReceiveAll", + Handler: _Query_ReceiveAll_Handler, }, { - MethodName: "Txout", - Handler: _Query_Txout_Handler, + MethodName: "Send", + Handler: _Query_Send_Handler, }, { - MethodName: "TxoutAll", - Handler: _Query_TxoutAll_Handler, + MethodName: "SendAll", + Handler: _Query_SendAll_Handler, }, { MethodName: "NodeAccount", @@ -1564,28 +1036,12 @@ 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", } -func (m *QueryGetTxoutConfirmationRequest) 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]) @@ -1595,12 +1051,12 @@ func (m *QueryGetTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetReceiveRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetReceiveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1615,7 +1071,7 @@ func (m *QueryGetTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryGetTxoutConfirmationResponse) 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]) @@ -1625,19 +1081,19 @@ func (m *QueryGetTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetReceiveResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetReceiveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.TxoutConfirmation != nil { + if m.Receive != nil { { - size, err := m.TxoutConfirmation.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Receive.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1650,7 +1106,7 @@ func (m *QueryGetTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *QueryAllTxoutConfirmationRequest) 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]) @@ -1660,12 +1116,12 @@ func (m *QueryAllTxoutConfirmationRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutConfirmationRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllReceiveRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllReceiveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1685,7 +1141,7 @@ func (m *QueryAllTxoutConfirmationRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryAllTxoutConfirmationResponse) 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]) @@ -1695,12 +1151,12 @@ func (m *QueryAllTxoutConfirmationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllReceiveResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllReceiveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1717,10 +1173,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.Receive) > 0 { + for iNdEx := len(m.Receive) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TxoutConfirmation[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Receive[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1734,7 +1190,7 @@ func (m *QueryAllTxoutConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *QueryGetTxoutRequest) 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]) @@ -1744,25 +1200,27 @@ func (m *QueryGetTxoutRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetSendRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetSendRequest) 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 *QueryGetSendResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1772,19 +1230,19 @@ func (m *QueryGetTxoutResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetTxoutResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetSendResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Txout != nil { + if m.Send != nil { { - size, err := m.Txout.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Send.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1797,7 +1255,7 @@ func (m *QueryGetTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllTxoutRequest) 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]) @@ -1807,12 +1265,12 @@ func (m *QueryAllTxoutRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllSendRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1832,7 +1290,7 @@ func (m *QueryAllTxoutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllTxoutResponse) 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]) @@ -1842,12 +1300,12 @@ func (m *QueryAllTxoutResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTxoutResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllSendResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1864,10 +1322,10 @@ func (m *QueryAllTxoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Txout) > 0 { - for iNdEx := len(m.Txout) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Send) > 0 { + for iNdEx := len(m.Send) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Txout[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Send[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2081,421 +1539,124 @@ func (m *QueryLastMetaHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, er 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 +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 -} - -func (m *QueryGetTxinVoterRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *QueryGetTxinVoterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryGetReceiveRequest) Size() (n int) { + if m == nil { + return 0 + } 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 + l = len(m.Index) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + return n } -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 +func (m *QueryGetReceiveResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + if m.Receive != nil { + l = m.Receive.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryGetTxinVoterResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +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 *QueryGetTxinVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryAllReceiveResponse) Size() (n int) { + if m == nil { + return 0 + } 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)) + if len(m.Receive) > 0 { + for _, e := range m.Receive { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } - i-- - dAtA[i] = 0xa } - return len(dAtA) - i, nil + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n } -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 +func (m *QueryGetSendRequest) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryAllTxinVoterRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +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 *QueryAllTxinVoterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryAllSendRequest) 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 + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + return n } -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 +func (m *QueryAllSendResponse) Size() (n int) { + if m == nil { + return 0 } - 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 *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 len(m.Send) > 0 { + for _, e := range m.Send { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } } if m.Pagination != nil { @@ -2557,891 +1718,40 @@ func (m *QueryAllNodeAccountResponse) Size() (n int) { } } 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 *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 - } + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *QueryLastMetaHeightRequest) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + return n } -func (m *QueryGetNodeAccountRequest) Unmarshal(dAtA []byte) error { + +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 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 *QueryGetReceiveRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3464,10 +1774,10 @@ func (m *QueryGetNodeAccountRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetNodeAccountRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetReceiveRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetNodeAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetReceiveRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3523,179 +1833,7 @@ func (m *QueryGetNodeAccountRequest) Unmarshal(dAtA []byte) error { } 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 { +func (m *QueryGetReceiveResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3708,59 +1846,25 @@ func (m *QueryAllNodeAccountResponse) Unmarshal(dAtA []byte) error { 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 + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 2: + } + 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 Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Receive", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3787,10 +1891,10 @@ func (m *QueryAllNodeAccountResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + if m.Receive == nil { + m.Receive = &Receive{} } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Receive.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3815,7 +1919,7 @@ func (m *QueryAllNodeAccountResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryLastMetaHeightRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllReceiveRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3838,12 +1942,48 @@ func (m *QueryLastMetaHeightRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryLastMetaHeightRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllReceiveRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLastMetaHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + 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:]) @@ -3865,7 +2005,7 @@ func (m *QueryLastMetaHeightRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryLastMetaHeightResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllReceiveResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3888,17 +2028,17 @@ func (m *QueryLastMetaHeightResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryLastMetaHeightResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllReceiveResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLastMetaHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllReceiveResponse: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receive", wireType) } - m.Height = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3908,11 +2048,62 @@ func (m *QueryLastMetaHeightResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Height |= uint64(b&0x7F) << shift + 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:]) @@ -3934,7 +2125,7 @@ func (m *QueryLastMetaHeightResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetTxinVoterRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetSendRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3957,10 +2148,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: @@ -4016,7 +2207,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 { @@ -4039,15 +2230,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 { @@ -4074,10 +2265,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 @@ -4102,7 +2293,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 { @@ -4125,10 +2316,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: @@ -4188,7 +2379,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 { @@ -4211,15 +2402,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 { @@ -4246,8 +2437,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 @@ -4308,7 +2499,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 { @@ -4331,10 +2522,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: @@ -4390,7 +2581,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 { @@ -4413,15 +2604,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 { @@ -4448,10 +2639,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 @@ -4476,7 +2667,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 { @@ -4499,10 +2690,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: @@ -4562,7 +2753,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 { @@ -4585,15 +2776,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 { @@ -4620,8 +2811,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 @@ -4682,6 +2873,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 9f92800041..278198c99d 100644 --- a/x/metacore/types/query.pb.gw.go +++ b/x/metacore/types/query.pb.gw.go @@ -33,8 +33,8 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join -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 +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 ( @@ -55,13 +55,13 @@ func request_Query_TxoutConfirmation_0(ctx context.Context, marshaler runtime.Ma 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)) + msg, err := client.Receive(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 +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 ( @@ -82,49 +82,49 @@ func local_request_Query_TxoutConfirmation_0(ctx context.Context, marshaler runt return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) } - msg, err := server.TxoutConfirmation(ctx, &protoReq) + msg, err := server.Receive(ctx, &protoReq) return msg, metadata, err } var ( - filter_Query_TxoutConfirmationAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_ReceiveAll_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 +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_TxoutConfirmationAll_0); err != nil { + 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.TxoutConfirmationAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ReceiveAll(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 +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_TxoutConfirmationAll_0); err != nil { + 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.TxoutConfirmationAll(ctx, &protoReq) + msg, err := server.ReceiveAll(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 +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 ( @@ -134,24 +134,24 @@ func request_Query_Txout_0(ctx context.Context, marshaler runtime.Marshaler, cli _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["index"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") } - protoReq.Id, err = runtime.Uint64(val) + protoReq.Index, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) } - msg, err := client.Txout(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.Send(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 +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 ( @@ -161,54 +161,54 @@ func local_request_Query_Txout_0(ctx context.Context, marshaler runtime.Marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["index"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") } - protoReq.Id, err = runtime.Uint64(val) + protoReq.Index, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) } - msg, err := server.Txout(ctx, &protoReq) + msg, err := server.Send(ctx, &protoReq) return msg, metadata, err } var ( - filter_Query_TxoutAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_SendAll_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 +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_TxoutAll_0); err != nil { + 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.TxoutAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.SendAll(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 +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_TxoutAll_0); err != nil { + 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.TxoutAll(ctx, &protoReq) + msg, err := server.SendAll(ctx, &protoReq) return msg, metadata, err } @@ -321,193 +321,13 @@ func local_request_Query_LastMetaHeight_0(ctx context.Context, marshaler runtime } -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_TxoutConfirmation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + 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 @@ -518,7 +338,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_TxoutConfirmation_0(rctx, inboundMarshaler, server, req, pathParams) + 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 { @@ -526,11 +346,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_TxoutConfirmation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Receive_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) { + 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 @@ -541,7 +361,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_TxoutConfirmationAll_0(rctx, inboundMarshaler, server, req, pathParams) + 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 { @@ -549,11 +369,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_TxoutConfirmationAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ReceiveAll_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) { + 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 @@ -564,7 +384,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 { @@ -572,11 +392,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 @@ -587,7 +407,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 { @@ -595,7 +415,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()...) }) @@ -668,98 +488,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 } @@ -801,7 +529,7 @@ 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_TxoutConfirmation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + 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) @@ -810,18 +538,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_TxoutConfirmation_0(rctx, inboundMarshaler, client, req, pathParams) + 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_TxoutConfirmation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Receive_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) { + 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) @@ -830,18 +558,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_TxoutConfirmationAll_0(rctx, inboundMarshaler, client, req, pathParams) + 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_TxoutConfirmationAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ReceiveAll_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) { + 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) @@ -850,18 +578,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Txout_0(rctx, inboundMarshaler, client, req, pathParams) + 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_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() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -870,14 +598,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_TxoutAll_0(rctx, inboundMarshaler, client, req, pathParams) + 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_TxoutAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_SendAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -941,133 +669,37 @@ 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 } var ( - 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_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_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_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_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_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_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_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_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 ( - forward_Query_TxoutConfirmation_0 = runtime.ForwardResponseMessage + forward_Query_Receive_0 = runtime.ForwardResponseMessage - forward_Query_TxoutConfirmationAll_0 = runtime.ForwardResponseMessage + forward_Query_ReceiveAll_0 = runtime.ForwardResponseMessage - forward_Query_Txout_0 = runtime.ForwardResponseMessage + forward_Query_Send_0 = runtime.ForwardResponseMessage - forward_Query_TxoutAll_0 = runtime.ForwardResponseMessage + forward_Query_SendAll_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/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, 0xe0, 0xb3, 0x18, 0x3b, 0x32, 0xa2, 0x64, 0xe0, 0x37, 0x90, 0x9d, 0x26, + 0x95, 0x10, 0xdb, 0x79, 0xdd, 0x2b, 0x9d, 0x43, 0xcf, 0x36, 0x60, 0x42, 0x89, 0x1a, 0x7c, 0x0d, + 0x12, 0xd4, 0x2b, 0x78, 0x5b, 0x8d, 0x06, 0x99, 0xb8, 0x07, 0x13, 0x3e, 0x58, 0x28, 0x31, 0xf5, + 0xda, 0x50, 0x07, 0x66, 0xd3, 0x18, 0x63, 0x74, 0x51, 0xdf, 0xa2, 0xe6, 0xea, 0xe2, 0x87, 0xd0, + 0x71, 0xd0, 0xfc, 0x61, 0x9c, 0x8e, 0xa5, 0x86, 0xd0, 0xa0, 0xe6, 0x64, 0x4e, 0x16, 0x93, 0xa0, + 0xa5, 0x6c, 0x4a, 0x87, 0x2a, 0x8b, 0xa0, 0xe4, 0x47, 0x4e, 0x6f, 0x08, 0x9b, 0xd1, 0xe3, 0x1c, + 0xb2, 0x68, 0x15, 0xe6, 0x09, 0xef, 0x3b, 0xa3, 0xe3, 0xec, 0x9c, 0x4e, 0xb0, 0x30, 0x8f, 0xa5, + 0x33, 0x07, 0xce, 0x3c, 0x08, 0xec, 0x92, 0x9e, 0x60, 0x61, 0x96, 0x29, 0xca, 0x97, 0x15, 0xa8, + 0x38, 0x31, 0x7c, 0x38, 0x27, 0x8b, 0x41, 0xf0, 0x47, 0x65, 0xd7, 0xf4, 0xf4, 0x59, 0x65, 0x61, + 0xaa, 0xde, 0x21, 0xb2, 0xf5, 0xf6, 0xe1, 0x91, 0x0b, 0xff, 0x67, 0xd9, 0x0e, 0xb9, 0x8a, 0x33, + 0xd0, 0x39, 0x1f, 0xcf, 0xfb, 0xb6, 0xc3, 0x9e, 0x2e, 0xef, 0x3e, 0x2b, 0x41, 0x76, 0x95, 0x20, + 0xdf, 0x95, 0x20, 0x1f, 0xb5, 0xe8, 0xed, 0x6a, 0xd1, 0xfb, 0xaa, 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") +) diff --git a/x/metacore/types/send.pb.go b/x/metacore/types/send.pb.go new file mode 100644 index 0000000000..7b152c6c67 --- /dev/null +++ b/x/metacore/types/send.pb.go @@ -0,0 +1,911 @@ +// 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"` + FinalizedMetaHeight uint64 `protobuf:"varint,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{} } +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) GetFinalizedMetaHeight() uint64 { + if m != nil { + return m.FinalizedMetaHeight + } + return 0 +} + +func (m *Send) GetSigners() []string { + if m != nil { + return m.Signers + } + return nil +} + +func init() { + proto.RegisterType((*Send)(nil), "MetaProtocol.metacore.metacore.Send") +} + +func init() { proto.RegisterFile("metacore/send.proto", fileDescriptor_c81f0328df818595) } + +var fileDescriptor_c81f0328df818595 = []byte{ + // 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) { + 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 { + 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 m.FinalizedMetaHeight != 0 { + i = encodeVarintSend(dAtA, i, uint64(m.FinalizedMetaHeight)) + i-- + dAtA[i] = 0x60 + } + 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)) + } + if m.FinalizedMetaHeight != 0 { + n += 1 + sovSend(uint64(m.FinalizedMetaHeight)) + } + if len(m.Signers) > 0 { + for _, s := range m.Signers { + l = len(s) + 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 != 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 != 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 ErrIntOverflowSend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FinalizedMetaHeight |= 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 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 + 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..c720753c98 100644 --- a/x/metacore/types/tx.pb.go +++ b/x/metacore/types/tx.pb.go @@ -29,29 +29,26 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // this line is used by starport scaffolding # proto/tx/message -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) { +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 *MsgTxoutConfirmationVoter) XXX_Unmarshal(b []byte) error { +func (m *MsgReceiveConfirmation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgTxoutConfirmationVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgReceiveConfirmation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgTxoutConfirmationVoter.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgReceiveConfirmation.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -61,89 +58,68 @@ func (m *MsgTxoutConfirmationVoter) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *MsgTxoutConfirmationVoter) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTxoutConfirmationVoter.Merge(m, src) +func (m *MsgReceiveConfirmation) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReceiveConfirmation.Merge(m, src) } -func (m *MsgTxoutConfirmationVoter) XXX_Size() int { +func (m *MsgReceiveConfirmation) XXX_Size() int { return m.Size() } -func (m *MsgTxoutConfirmationVoter) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTxoutConfirmationVoter.DiscardUnknown(m) +func (m *MsgReceiveConfirmation) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReceiveConfirmation.DiscardUnknown(m) } -var xxx_messageInfo_MsgTxoutConfirmationVoter proto.InternalMessageInfo +var xxx_messageInfo_MsgReceiveConfirmation proto.InternalMessageInfo -func (m *MsgTxoutConfirmationVoter) GetCreator() string { +func (m *MsgReceiveConfirmation) GetCreator() string { if m != nil { return m.Creator } return "" } -func (m *MsgTxoutConfirmationVoter) GetTxoutId() uint64 { +func (m *MsgReceiveConfirmation) GetSendHash() string { if m != nil { - return m.TxoutId - } - return 0 -} - -func (m *MsgTxoutConfirmationVoter) GetTxHash() string { - if m != nil { - return m.TxHash + return m.SendHash } return "" } -func (m *MsgTxoutConfirmationVoter) GetMMint() uint64 { - if m != nil { - return m.MMint - } - return 0 -} - -func (m *MsgTxoutConfirmationVoter) GetDestinationAsset() string { +func (m *MsgReceiveConfirmation) GetOutTxHash() string { if m != nil { - return m.DestinationAsset + return m.OutTxHash } return "" } -func (m *MsgTxoutConfirmationVoter) GetDestinationAmount() uint64 { +func (m *MsgReceiveConfirmation) GetOutBlockHeight() uint64 { if m != nil { - return m.DestinationAmount + return m.OutBlockHeight } return 0 } -func (m *MsgTxoutConfirmationVoter) GetToAddress() string { +func (m *MsgReceiveConfirmation) GetMMint() string { if m != nil { - return m.ToAddress + return m.MMint } return "" } -func (m *MsgTxoutConfirmationVoter) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -type MsgTxoutConfirmationVoterResponse struct { +type MsgReceiveConfirmationResponse struct { } -func (m *MsgTxoutConfirmationVoterResponse) Reset() { *m = MsgTxoutConfirmationVoterResponse{} } -func (m *MsgTxoutConfirmationVoterResponse) String() string { return proto.CompactTextString(m) } -func (*MsgTxoutConfirmationVoterResponse) ProtoMessage() {} -func (*MsgTxoutConfirmationVoterResponse) Descriptor() ([]byte, []int) { +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 *MsgTxoutConfirmationVoterResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgReceiveConfirmationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgTxoutConfirmationVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgReceiveConfirmationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgTxoutConfirmationVoterResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgReceiveConfirmationResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -153,36 +129,43 @@ func (m *MsgTxoutConfirmationVoterResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *MsgTxoutConfirmationVoterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTxoutConfirmationVoterResponse.Merge(m, src) +func (m *MsgReceiveConfirmationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReceiveConfirmationResponse.Merge(m, src) } -func (m *MsgTxoutConfirmationVoterResponse) XXX_Size() int { +func (m *MsgReceiveConfirmationResponse) XXX_Size() int { return m.Size() } -func (m *MsgTxoutConfirmationVoterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTxoutConfirmationVoterResponse.DiscardUnknown(m) +func (m *MsgReceiveConfirmationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReceiveConfirmationResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgTxoutConfirmationVoterResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgReceiveConfirmationResponse 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"` - ValidatorConsensusPubkey string `protobuf:"bytes,3,opt,name=validatorConsensusPubkey,proto3" json:"validatorConsensusPubkey,omitempty"` +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 uint64 `protobuf:"varint,10,opt,name=inBlockHeight,proto3" json:"inBlockHeight,omitempty"` } -func (m *MsgSetNodeKeys) Reset() { *m = MsgSetNodeKeys{} } -func (m *MsgSetNodeKeys) String() string { return proto.CompactTextString(m) } -func (*MsgSetNodeKeys) ProtoMessage() {} -func (*MsgSetNodeKeys) Descriptor() ([]byte, []int) { +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{2} } -func (m *MsgSetNodeKeys) XXX_Unmarshal(b []byte) error { +func (m *MsgSendVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgSetNodeKeys) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgSendVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgSetNodeKeys.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgSendVoter.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -192,54 +175,103 @@ func (m *MsgSetNodeKeys) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *MsgSetNodeKeys) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetNodeKeys.Merge(m, src) +func (m *MsgSendVoter) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendVoter.Merge(m, src) } -func (m *MsgSetNodeKeys) XXX_Size() int { +func (m *MsgSendVoter) XXX_Size() int { return m.Size() } -func (m *MsgSetNodeKeys) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetNodeKeys.DiscardUnknown(m) +func (m *MsgSendVoter) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendVoter.DiscardUnknown(m) } -var xxx_messageInfo_MsgSetNodeKeys proto.InternalMessageInfo +var xxx_messageInfo_MsgSendVoter proto.InternalMessageInfo -func (m *MsgSetNodeKeys) GetCreator() string { +func (m *MsgSendVoter) GetCreator() string { if m != nil { return m.Creator } return "" } -func (m *MsgSetNodeKeys) GetPubkeySet() *common.PubKeySet { +func (m *MsgSendVoter) GetSender() string { if m != nil { - return m.PubkeySet + return m.Sender } - return nil + return "" } -func (m *MsgSetNodeKeys) GetValidatorConsensusPubkey() string { +func (m *MsgSendVoter) GetSenderChain() string { if m != nil { - return m.ValidatorConsensusPubkey + return m.SenderChain } return "" } -type MsgSetNodeKeysResponse struct { +func (m *MsgSendVoter) GetReceiver() string { + if m != nil { + return m.Receiver + } + return "" } -func (m *MsgSetNodeKeysResponse) Reset() { *m = MsgSetNodeKeysResponse{} } -func (m *MsgSetNodeKeysResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSetNodeKeysResponse) ProtoMessage() {} -func (*MsgSetNodeKeysResponse) Descriptor() ([]byte, []int) { +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() uint64 { + if m != nil { + return m.InBlockHeight + } + return 0 +} + +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{3} } -func (m *MsgSetNodeKeysResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgSendVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgSetNodeKeysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgSendVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgSetNodeKeysResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgSendVoterResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -249,43 +281,36 @@ func (m *MsgSetNodeKeysResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *MsgSetNodeKeysResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetNodeKeysResponse.Merge(m, src) +func (m *MsgSendVoterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendVoterResponse.Merge(m, src) } -func (m *MsgSetNodeKeysResponse) XXX_Size() int { +func (m *MsgSendVoterResponse) XXX_Size() int { return m.Size() } -func (m *MsgSetNodeKeysResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetNodeKeysResponse.DiscardUnknown(m) +func (m *MsgSendVoterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendVoterResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgSetNodeKeysResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgSendVoterResponse 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"` + ValidatorConsensusPubkey string `protobuf:"bytes,3,opt,name=validatorConsensusPubkey,proto3" json:"validatorConsensusPubkey,omitempty"` +} -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) { +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} } -func (m *MsgCreateTxinVoter) XXX_Unmarshal(b []byte) error { +func (m *MsgSetNodeKeys) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgCreateTxinVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgSetNodeKeys) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgCreateTxinVoter.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgSetNodeKeys.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -295,103 +320,54 @@ func (m *MsgCreateTxinVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MsgCreateTxinVoter) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateTxinVoter.Merge(m, src) +func (m *MsgSetNodeKeys) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetNodeKeys.Merge(m, src) } -func (m *MsgCreateTxinVoter) XXX_Size() int { +func (m *MsgSetNodeKeys) XXX_Size() int { return m.Size() } -func (m *MsgCreateTxinVoter) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateTxinVoter.DiscardUnknown(m) +func (m *MsgSetNodeKeys) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetNodeKeys.DiscardUnknown(m) } -var xxx_messageInfo_MsgCreateTxinVoter proto.InternalMessageInfo +var xxx_messageInfo_MsgSetNodeKeys proto.InternalMessageInfo -func (m *MsgCreateTxinVoter) GetCreator() string { +func (m *MsgSetNodeKeys) 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 { +func (m *MsgSetNodeKeys) GetPubkeySet() *common.PubKeySet { if m != nil { - return m.FromAddress + return m.PubkeySet } - return "" + return nil } -func (m *MsgCreateTxinVoter) GetToAddress() string { +func (m *MsgSetNodeKeys) GetValidatorConsensusPubkey() string { if m != nil { - return m.ToAddress + return m.ValidatorConsensusPubkey } return "" } -func (m *MsgCreateTxinVoter) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -type MsgCreateTxinVoterResponse struct { +type MsgSetNodeKeysResponse struct { } -func (m *MsgCreateTxinVoterResponse) Reset() { *m = MsgCreateTxinVoterResponse{} } -func (m *MsgCreateTxinVoterResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateTxinVoterResponse) ProtoMessage() {} -func (*MsgCreateTxinVoterResponse) Descriptor() ([]byte, []int) { +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} } -func (m *MsgCreateTxinVoterResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgSetNodeKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgCreateTxinVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgSetNodeKeysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgCreateTxinVoterResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgSetNodeKeysResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -401,67 +377,65 @@ func (m *MsgCreateTxinVoterResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *MsgCreateTxinVoterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateTxinVoterResponse.Merge(m, src) +func (m *MsgSetNodeKeysResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetNodeKeysResponse.Merge(m, src) } -func (m *MsgCreateTxinVoterResponse) XXX_Size() int { +func (m *MsgSetNodeKeysResponse) XXX_Size() int { return m.Size() } -func (m *MsgCreateTxinVoterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateTxinVoterResponse.DiscardUnknown(m) +func (m *MsgSetNodeKeysResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetNodeKeysResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgCreateTxinVoterResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgSetNodeKeysResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgTxoutConfirmationVoter)(nil), "MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoter") - proto.RegisterType((*MsgTxoutConfirmationVoterResponse)(nil), "MetaProtocol.metacore.metacore.MsgTxoutConfirmationVoterResponse") + 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") 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{ - // 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, 0x86, 0xe2, 0xfa, 0xdf, 0x2e, 0x29, 0x27, 0x41, 0x4c, 0x55, 0x5f, 0x58, 0xd4, - 0xf3, 0xa8, 0xdf, 0x8d, 0x3f, 0x31, 0xd8, 0xb9, 0x2a, 0xc2, 0x9e, 0xc1, 0x9c, 0xb3, 0x88, 0x86, - 0x7c, 0x40, 0xfd, 0x73, 0x37, 0xf0, 0x4c, 0xee, 0x52, 0xff, 0x8b, 0x20, 0x22, 0x0c, 0x35, 0x2b, - 0x20, 0x26, 0xa7, 0x01, 0x56, 0xda, 0xca, 0x41, 0x7d, 0x94, 0x84, 0x22, 0xc3, 0x05, 0xe7, 0xa3, - 0x8d, 0x8b, 0x6d, 0xe5, 0xa0, 0x3c, 0x4a, 0x42, 0xd4, 0x82, 0x2a, 0x8f, 0x8e, 0x4d, 0x36, 0xc1, - 0x25, 0x49, 0x59, 0x45, 0x68, 0x17, 0x2a, 0x9e, 0xe1, 0xfa, 0x1c, 0x97, 0xe5, 0xfd, 0x38, 0x40, - 0xaf, 0xe1, 0xb9, 0x4d, 0x18, 0x77, 0x7d, 0xd9, 0xb5, 0xcf, 0x18, 0xe1, 0xb8, 0x22, 0x79, 0x5b, - 0x38, 0x7a, 0x03, 0xcd, 0x2c, 0xe6, 0xd1, 0xd0, 0xe7, 0xb8, 0x2a, 0xab, 0x6d, 0x27, 0xd0, 0x3e, - 0xd4, 0x39, 0xed, 0xdb, 0x76, 0x40, 0x18, 0xc3, 0x35, 0x59, 0x72, 0x0d, 0xa0, 0x36, 0x34, 0xc6, - 0x53, 0x6a, 0x5d, 0x1c, 0x13, 0xd7, 0x99, 0x70, 0xbc, 0x23, 0xab, 0x64, 0xa1, 0xce, 0x2b, 0x78, - 0x99, 0x2b, 0xcc, 0x88, 0xb0, 0x19, 0xf5, 0x19, 0xe9, 0x5c, 0x29, 0xf0, 0xd4, 0x60, 0xce, 0x29, - 0xe1, 0x9f, 0xa9, 0x4d, 0x4e, 0xc8, 0x9c, 0xdd, 0xa1, 0x59, 0x17, 0xea, 0xb3, 0x70, 0x7c, 0x41, - 0xe6, 0xa7, 0x84, 0x4b, 0xd5, 0x1a, 0xbd, 0xa6, 0xbe, 0xda, 0xc6, 0x30, 0x1c, 0x9f, 0xc8, 0xc4, - 0x68, 0x7d, 0x07, 0x1d, 0x02, 0xbe, 0x34, 0xa7, 0xae, 0x2d, 0xd8, 0x03, 0xd1, 0xcf, 0x67, 0x21, - 0x1b, 0xca, 0xf4, 0x4a, 0xdc, 0xdc, 0x7c, 0x07, 0x43, 0x6b, 0x73, 0xb0, 0x74, 0xe6, 0xeb, 0x22, - 0x20, 0x83, 0x39, 0x03, 0x31, 0x15, 0x39, 0x8b, 0xdc, 0x7b, 0x77, 0xbd, 0x0b, 0x15, 0xd7, 0xb7, - 0x49, 0x24, 0x67, 0xae, 0x8f, 0xe2, 0x20, 0x77, 0xcf, 0x6d, 0x68, 0x30, 0x1a, 0x06, 0x16, 0x89, - 0x97, 0x59, 0x96, 0xc9, 0x2c, 0x84, 0x3a, 0xf0, 0x64, 0x15, 0xc6, 0x2b, 0xac, 0x48, 0xf1, 0x37, - 0x30, 0x51, 0xdd, 0x3b, 0x0a, 0x83, 0x74, 0xc1, 0xab, 0xe8, 0x9f, 0x7e, 0xa9, 0xe5, 0xf8, 0xa5, - 0x0d, 0x8d, 0xf3, 0x80, 0x7a, 0x89, 0x07, 0x76, 0xe2, 0x49, 0x32, 0xd0, 0xa6, 0x47, 0xea, 0xf7, - 0x78, 0x04, 0xb6, 0x3d, 0xb2, 0x0f, 0xea, 0xb6, 0x92, 0x89, 0xd0, 0xbd, 0x5f, 0x25, 0x28, 0x19, - 0xcc, 0x41, 0x3f, 0x15, 0x68, 0xe5, 0x3c, 0xb0, 0x0f, 0xfa, 0xdd, 0xef, 0x59, 0xcf, 0xb5, 0xa0, - 0xda, 0xff, 0x6f, 0x6a, 0x32, 0x20, 0x0a, 0xa1, 0x91, 0x75, 0xae, 0xfe, 0x80, 0x8a, 0x99, 0xfb, - 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, + // 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, 0x73, 0xdb, 0xf4, 0x1b, 0x02, 0x77, 0x83, 0x6a, 0x77, 0xd2, 0x4f, + 0x39, 0x95, 0x4e, 0xdd, 0xec, 0x36, 0x5e, 0x49, 0xfb, 0xa0, 0x42, 0x5b, 0x71, 0x48, 0x50, 0x88, + 0x20, 0x42, 0xe7, 0xd0, 0x70, 0xc8, 0x5c, 0x85, 0x24, 0xa6, 0x99, 0xd6, 0xb6, 0x41, 0x92, 0xfb, + 0x0a, 0x49, 0x4c, 0xab, 0x4a, 0x83, 0x56, 0xfa, 0x6e, 0xb0, 0xd3, 0x84, 0xd3, 0xaa, 0x5e, 0x85, + 0x90, 0x5f, 0x2d, 0x38, 0xd2, 0x09, 0xf9, 0x8e, 0x4d, 0xf0, 0x12, 0x97, 0x62, 0x8b, 0x94, 0x5d, + 0xb0, 0xe7, 0xe9, 0xf8, 0x1a, 0x97, 0x57, 0x28, 0xb5, 0x9a, 0x8d, 0xde, 0xb1, 0x97, 0x9d, 0xd9, + 0x28, 0x1d, 0x5f, 0xea, 0x84, 0x5f, 0xd6, 0x90, 0xd7, 0xe0, 0xdc, 0x04, 0xb3, 0x78, 0xa2, 0xba, + 0x07, 0x6a, 0x1f, 0x15, 0xa9, 0x18, 0xe9, 0x74, 0x26, 0xf8, 0x3f, 0xf3, 0x1d, 0x47, 0x1f, 0x6c, + 0x05, 0x58, 0x8e, 0xb9, 0xf7, 0xbb, 0x06, 0xbb, 0x43, 0x11, 0x91, 0xcf, 0x16, 0x9c, 0x6c, 0x3a, + 0xe8, 0x73, 0x6f, 0xfb, 0x17, 0xe2, 0x6d, 0x3e, 0xae, 0xd6, 0x9b, 0xff, 0xeb, 0xcb, 0x71, 0x11, + 0x06, 0x76, 0x79, 0x90, 0xcf, 0xef, 0x31, 0xac, 0xa8, 0x6e, 0xbd, 0x7a, 0x48, 0x75, 0xb1, 0x30, + 0x85, 0x46, 0xf5, 0x8f, 0xf3, 0xee, 0x35, 0xa4, 0xa8, 0x6f, 0x9d, 0x3f, 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. @@ -477,9 +451,9 @@ 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 - TxoutConfirmationVoter(ctx context.Context, in *MsgTxoutConfirmationVoter, opts ...grpc.CallOption) (*MsgTxoutConfirmationVoterResponse, error) + 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) - CreateTxinVoter(ctx context.Context, in *MsgCreateTxinVoter, opts ...grpc.CallOption) (*MsgCreateTxinVoterResponse, error) } type msgClient struct { @@ -490,27 +464,27 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -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...) +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) 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...) +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) 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...) +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...) if err != nil { return nil, err } @@ -520,79 +494,79 @@ 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 - TxoutConfirmationVoter(context.Context, *MsgTxoutConfirmationVoter) (*MsgTxoutConfirmationVoterResponse, error) + ReceiveConfirmation(context.Context, *MsgReceiveConfirmation) (*MsgReceiveConfirmationResponse, error) + SendVoter(context.Context, *MsgSendVoter) (*MsgSendVoterResponse, error) SetNodeKeys(context.Context, *MsgSetNodeKeys) (*MsgSetNodeKeysResponse, error) - CreateTxinVoter(context.Context, *MsgCreateTxinVoter) (*MsgCreateTxinVoterResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) TxoutConfirmationVoter(ctx context.Context, req *MsgTxoutConfirmationVoter) (*MsgTxoutConfirmationVoterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TxoutConfirmationVoter not implemented") +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") } 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) } -func _Msg_TxoutConfirmationVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTxoutConfirmationVoter) +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).TxoutConfirmationVoter(ctx, in) + return srv.(MsgServer).ReceiveConfirmation(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Msg/TxoutConfirmationVoter", + FullMethod: "/MetaProtocol.metacore.metacore.Msg/ReceiveConfirmation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).TxoutConfirmationVoter(ctx, req.(*MsgTxoutConfirmationVoter)) + return srv.(MsgServer).ReceiveConfirmation(ctx, req.(*MsgReceiveConfirmation)) } 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) +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).SetNodeKeys(ctx, in) + return srv.(MsgServer).SendVoter(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Msg/SetNodeKeys", + FullMethod: "/MetaProtocol.metacore.metacore.Msg/SendVoter", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetNodeKeys(ctx, req.(*MsgSetNodeKeys)) + return srv.(MsgServer).SendVoter(ctx, req.(*MsgSendVoter)) } 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) +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 { return nil, err } if interceptor == nil { - return srv.(MsgServer).CreateTxinVoter(ctx, in) + return srv.(MsgServer).SetNodeKeys(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/MetaProtocol.metacore.metacore.Msg/CreateTxinVoter", + FullMethod: "/MetaProtocol.metacore.metacore.Msg/SetNodeKeys", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateTxinVoter(ctx, req.(*MsgCreateTxinVoter)) + return srv.(MsgServer).SetNodeKeys(ctx, req.(*MsgSetNodeKeys)) } return interceptor(ctx, in, info, handler) } @@ -602,23 +576,23 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "TxoutConfirmationVoter", - Handler: _Msg_TxoutConfirmationVoter_Handler, + MethodName: "ReceiveConfirmation", + Handler: _Msg_ReceiveConfirmation_Handler, }, { - MethodName: "SetNodeKeys", - Handler: _Msg_SetNodeKeys_Handler, + MethodName: "SendVoter", + Handler: _Msg_SendVoter_Handler, }, { - MethodName: "CreateTxinVoter", - Handler: _Msg_CreateTxinVoter_Handler, + MethodName: "SetNodeKeys", + Handler: _Msg_SetNodeKeys_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "metacore/tx.proto", } -func (m *MsgTxoutConfirmationVoter) Marshal() (dAtA []byte, err error) { +func (m *MsgReceiveConfirmation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -628,56 +602,41 @@ func (m *MsgTxoutConfirmationVoter) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgTxoutConfirmationVoter) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgReceiveConfirmation) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgTxoutConfirmationVoter) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgReceiveConfirmation) 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))) + 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.MMint != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MMint)) + if m.OutBlockHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.OutBlockHeight)) 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.OutTxHash) > 0 { + i -= len(m.OutTxHash) + copy(dAtA[i:], m.OutTxHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.OutTxHash))) i-- dAtA[i] = 0x1a } - if m.TxoutId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.TxoutId)) + 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] = 0x10 + dAtA[i] = 0x12 } if len(m.Creator) > 0 { i -= len(m.Creator) @@ -689,7 +648,7 @@ func (m *MsgTxoutConfirmationVoter) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *MsgTxoutConfirmationVoterResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgReceiveConfirmationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -699,12 +658,12 @@ func (m *MsgTxoutConfirmationVoterResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgTxoutConfirmationVoterResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgReceiveConfirmationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgTxoutConfirmationVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgReceiveConfirmationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -712,7 +671,7 @@ func (m *MsgTxoutConfirmationVoterResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *MsgSetNodeKeys) Marshal() (dAtA []byte, err error) { +func (m *MsgSendVoter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -722,32 +681,74 @@ func (m *MsgSetNodeKeys) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSetNodeKeys) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSendVoter) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSetNodeKeys) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSendVoter) 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))) + if m.InBlockHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.InBlockHeight)) + i-- + dAtA[i] = 0x50 + } + 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 m.PubkeySet != nil { - { - size, err := m.PubkeySet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } + 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 } @@ -761,7 +762,7 @@ func (m *MsgSetNodeKeys) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgSetNodeKeysResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgSendVoterResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -771,12 +772,12 @@ func (m *MsgSetNodeKeysResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSetNodeKeysResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSendVoterResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSetNodeKeysResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSendVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -784,7 +785,7 @@ func (m *MsgSetNodeKeysResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *MsgCreateTxinVoter) 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]) @@ -794,70 +795,32 @@ func (m *MsgCreateTxinVoter) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateTxinVoter) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSetNodeKeys) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateTxinVoter) 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)) + 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] = 0x50 + dAtA[i] = 0x1a } - 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))) + 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 } @@ -871,7 +834,7 @@ func (m *MsgCreateTxinVoter) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgCreateTxinVoterResponse) 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]) @@ -881,12 +844,12 @@ func (m *MsgCreateTxinVoterResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateTxinVoterResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSetNodeKeysResponse) 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 @@ -905,7 +868,7 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgTxoutConfirmationVoter) Size() (n int) { +func (m *MsgReceiveConfirmation) Size() (n int) { if m == nil { return 0 } @@ -915,34 +878,25 @@ 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.TxHash) + l = len(m.SendHash) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.MMint != 0 { - n += 1 + sovTx(uint64(m.MMint)) - } - l = len(m.DestinationAsset) + l = len(m.OutTxHash) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.DestinationAmount != 0 { - n += 1 + sovTx(uint64(m.DestinationAmount)) + if m.OutBlockHeight != 0 { + n += 1 + sovTx(uint64(m.OutBlockHeight)) } - l = len(m.ToAddress) + l = len(m.MMint) 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) { +func (m *MsgReceiveConfirmationResponse) Size() (n int) { if m == nil { return 0 } @@ -951,7 +905,7 @@ func (m *MsgTxoutConfirmationVoterResponse) Size() (n int) { return n } -func (m *MsgSetNodeKeys) Size() (n int) { +func (m *MsgSendVoter) Size() (n int) { if m == nil { return 0 } @@ -961,18 +915,45 @@ func (m *MsgSetNodeKeys) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.PubkeySet != nil { - l = m.PubkeySet.Size() + l = len(m.Sender) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ValidatorConsensusPubkey) + 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)) + } + if m.InBlockHeight != 0 { + n += 1 + sovTx(uint64(m.InBlockHeight)) + } return n } -func (m *MsgSetNodeKeysResponse) Size() (n int) { +func (m *MsgSendVoterResponse) Size() (n int) { if m == nil { return 0 } @@ -981,7 +962,7 @@ func (m *MsgSetNodeKeysResponse) Size() (n int) { return n } -func (m *MsgCreateTxinVoter) Size() (n int) { +func (m *MsgSetNodeKeys) Size() (n int) { if m == nil { return 0 } @@ -991,43 +972,18 @@ func (m *MsgCreateTxinVoter) Size() (n int) { 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 { + if m.PubkeySet != nil { + l = m.PubkeySet.Size() n += 1 + l + sovTx(uint64(l)) } - l = len(m.ToAddress) + l = len(m.ValidatorConsensusPubkey) 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) { +func (m *MsgSetNodeKeysResponse) Size() (n int) { if m == nil { return 0 } @@ -1042,7 +998,7 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { +func (m *MsgReceiveConfirmation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1065,10 +1021,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: MsgReceiveConfirmation: 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: MsgReceiveConfirmation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1104,78 +1060,8 @@ 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) - } - m.TxoutId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TxoutId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 != 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) + return fmt.Errorf("proto: wrong wireType = %d for field SendHash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1203,30 +1089,11 @@ func (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DestinationAsset = string(dAtA[iNdEx:postIndex]) + m.SendHash = 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: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OutTxHash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1254,198 +1121,30 @@ func (m *MsgTxoutConfirmationVoter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ToAddress = string(dAtA[iNdEx:postIndex]) + m.OutTxHash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) - } - m.BlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *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{} + return fmt.Errorf("proto: wrong wireType = %d for field OutBlockHeight", wireType) } - if err := m.PubkeySet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + 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 + } } - iNdEx = postIndex - case 3: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorConsensusPubkey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MMint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1473,7 +1172,7 @@ func (m *MsgSetNodeKeys) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorConsensusPubkey = string(dAtA[iNdEx:postIndex]) + m.MMint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1496,7 +1195,7 @@ func (m *MsgSetNodeKeys) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetNodeKeysResponse) Unmarshal(dAtA []byte) error { +func (m *MsgReceiveConfirmationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1519,10 +1218,10 @@ func (m *MsgSetNodeKeysResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetNodeKeysResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgReceiveConfirmationResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetNodeKeysResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgReceiveConfirmationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1546,7 +1245,7 @@ func (m *MsgSetNodeKeysResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { +func (m *MsgSendVoter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1569,10 +1268,10 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateTxinVoter: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSendVoter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateTxinVoter: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSendVoter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1609,7 +1308,7 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1637,11 +1336,11 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Index = string(dAtA[iNdEx:postIndex]) + m.Sender = string(dAtA[iNdEx:postIndex]) 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 SenderChain", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1669,11 +1368,11 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TxHash = string(dAtA[iNdEx:postIndex]) + m.SenderChain = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAsset", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1701,13 +1400,13 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SourceAsset = string(dAtA[iNdEx:postIndex]) + m.Receiver = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceAmount", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReceiverChain", wireType) } - m.SourceAmount = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1717,16 +1416,29 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SourceAmount |= uint64(b&0x7F) << shift + 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 != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MBurnt", wireType) } - m.MBurnt = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1736,14 +1448,27 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MBurnt |= uint64(b&0x7F) << shift + 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 DestinationAsset", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MMint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1771,11 +1496,11 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DestinationAsset = string(dAtA[iNdEx:postIndex]) + m.MMint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1803,11 +1528,11 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FromAddress = string(dAtA[iNdEx:postIndex]) + m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InTxHash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1835,13 +1560,200 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ToAddress = string(dAtA[iNdEx:postIndex]) + m.InTxHash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + 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 + } + } + 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 } - m.BlockHeight = 0 + 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 @@ -1851,11 +1763,24 @@ func (m *MsgCreateTxinVoter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.BlockHeight |= uint64(b&0x7F) << shift + 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:]) @@ -1877,7 +1802,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 { @@ -1900,10 +1825,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, 0x9d, 0xd4, 0x16, 0xf7, 0x50, 0x93, 0x8b, 0x98, 0xe5, 0xe4, 0xc8, 0xf0, 0xd2, - 0xe0, 0x73, 0xd4, 0x82, 0x7c, 0x1c, 0xea, 0x39, 0x69, 0x18, 0x5c, 0x39, 0xec, 0xa1, 0x8e, 0x96, - 0x99, 0x8a, 0xd8, 0x50, 0x6b, 0x06, 0xc4, 0x31, 0xe1, 0x21, 0xc2, 0x7d, 0xd4, 0xad, 0x6c, 0x2a, - 0x33, 0x01, 0xa4, 0xe9, 0xd9, 0xbe, 0x33, 0xf9, 0xc5, 0x8a, 0xee, 0xe9, 0x28, 0x53, 0x02, 0x48, - 0xcb, 0xa4, 0x95, 0xc3, 0xd7, 0xe8, 0x34, 0x66, 0x1a, 0xb8, 0x08, 0x81, 0x4b, 0x51, 0x8e, 0x68, - 0x9b, 0x11, 0xff, 0x78, 0xb1, 0xc9, 0x4c, 0xc9, 0x74, 0x18, 0xc7, 0x8a, 0x69, 0x4d, 0x8e, 0xcb, - 0x4d, 0x0e, 0x10, 0xbe, 0x44, 0x2e, 0xc8, 0x3a, 0x77, 0x4d, 0xbe, 0x07, 0x45, 0xfd, 0x74, 0x21, - 0xa3, 0x97, 0x31, 0xe3, 0xc9, 0x1c, 0x08, 0x32, 0x8b, 0x1c, 0x22, 0x4c, 0x51, 0x5b, 0xf3, 0x44, - 0x30, 0xa5, 0x49, 0xc7, 0x6b, 0xf8, 0xee, 0xc8, 0x59, 0x7d, 0x5d, 0x59, 0x93, 0x1a, 0x62, 0x1f, - 0x9d, 0xcc, 0xb8, 0x08, 0x17, 0xfc, 0x8d, 0xc5, 0x55, 0x97, 0xae, 0xe9, 0xf2, 0x17, 0x8f, 0xee, - 0x57, 0x1b, 0x6a, 0xaf, 0x37, 0xd4, 0xfe, 0xde, 0x50, 0xfb, 0x63, 0x4b, 0xad, 0xf5, 0x96, 0x5a, - 0x9f, 0x5b, 0x6a, 0x3d, 0xdf, 0x26, 0x1c, 0xe6, 0xd9, 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, 0x54, 0x96, 0x76, 0x48, 0x53, 0xe9, - 0x44, 0x16, 0xac, 0xee, 0x79, 0x69, 0xe8, 0x29, 0x69, 0x61, 0x31, 0x8e, 0xed, 0x8c, 0x1d, 0x78, - 0xbc, 0x71, 0xb4, 0x4b, 0x8e, 0x2c, 0xe4, 0x46, 0xc8, 0xa1, 0xb5, 0x12, 0x59, 0xc3, 0x87, 0xfb, - 0x88, 0xf6, 0xc8, 0xf1, 0xc6, 0x66, 0x90, 0x6b, 0x64, 0xcd, 0x6e, 0xd0, 0x6f, 0x4c, 0xfe, 0x30, - 0x37, 0x3d, 0x1b, 0xe5, 0x46, 0x23, 0x6b, 0xf9, 0x74, 0xe3, 0xe8, 0x25, 0x39, 0x49, 0xa4, 0x45, - 0xa5, 0x63, 0x54, 0xa0, 0xcb, 0x15, 0x6d, 0xbf, 0xe2, 0x1f, 0x77, 0x97, 0xbc, 0x18, 0xc8, 0x86, - 0x49, 0x62, 0xa4, 0xb5, 0xec, 0xb0, 0xbc, 0x64, 0x0f, 0xd1, 0x0b, 0x12, 0x22, 0x54, 0x79, 0xe8, - 0xf3, 0x1d, 0x70, 0xff, 0xa7, 0x73, 0x10, 0xaf, 0x63, 0xa9, 0xd2, 0x19, 0x32, 0xe2, 0x0f, 0xd9, - 0x47, 0xa3, 0xdb, 0xaf, 0x15, 0x0f, 0x96, 0x2b, 0x1e, 0xfc, 0xac, 0x78, 0xf0, 0xb1, 0xe6, 0xb5, - 0xe5, 0x9a, 0xd7, 0xbe, 0xd7, 0xbc, 0xf6, 0x74, 0x9d, 0x2a, 0x9c, 0xe5, 0xd3, 0x81, 0x80, 0x2c, - 0x72, 0xe5, 0x5c, 0x55, 0xed, 0x44, 0xdb, 0x16, 0x8b, 0x9d, 0xc4, 0xf7, 0x85, 0xb4, 0xd3, 0x96, - 0xaf, 0xe5, 0xe6, 0x37, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x2a, 0x5d, 0x51, 0xe9, 0x01, 0x00, 0x00, -} - -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, 0x7b, 0xaa, 0x2a, 0x78, - 0x91, 0x2a, 0x0e, 0x81, 0xb4, 0xdc, 0xe6, 0xfb, 0x7d, 0xe3, 0x6f, 0x3c, 0xd2, 0xa0, 0x5e, 0xc2, - 0x20, 0x08, 0xa5, 0x62, 0x3e, 0x6c, 0x64, 0x0a, 0xc3, 0xb5, 0x92, 0x20, 0x31, 0x9d, 0x32, 0x08, - 0x6e, 0xb3, 0x32, 0x94, 0xab, 0x61, 0xd1, 0x72, 0x2a, 0xfa, 0xbd, 0x58, 0xc6, 0xd2, 0xb4, 0xfa, - 0x59, 0x95, 0xbf, 0x1a, 0xbc, 0x54, 0x51, 0xfd, 0x2e, 0x4b, 0xc1, 0x04, 0x35, 0x43, 0xc5, 0x02, - 0x90, 0x8a, 0xd8, 0xae, 0xed, 0x39, 0xb3, 0x42, 0xe2, 0x2e, 0xaa, 0xf0, 0x88, 0x54, 0x5c, 0xdb, - 0xab, 0xcd, 0x2a, 0x3c, 0xc2, 0x7d, 0xd4, 0x82, 0x0d, 0x17, 0x93, 0x40, 0x2f, 0x49, 0xd5, 0xb4, - 0x9e, 0x34, 0x76, 0x51, 0x5b, 0xcb, 0x54, 0x85, 0x6c, 0xa4, 0x35, 0x03, 0x52, 0x33, 0x76, 0x19, - 0xe1, 0x01, 0xea, 0x1c, 0x65, 0x22, 0x53, 0x01, 0xa4, 0x6e, 0x72, 0x3f, 0x31, 0xfc, 0x0b, 0x35, - 0x92, 0x71, 0xaa, 0x04, 0x90, 0x86, 0x71, 0x8f, 0x0a, 0xf7, 0x50, 0x3d, 0x99, 0x72, 0x01, 0xa4, - 0x69, 0x70, 0x2e, 0xf0, 0x5f, 0xf4, 0x23, 0x62, 0x1a, 0xb8, 0x08, 0x80, 0x4b, 0x91, 0x0f, 0x6e, - 0x99, 0xc1, 0x17, 0x1c, 0xff, 0x43, 0x3f, 0xcb, 0x2c, 0xff, 0x82, 0x63, 0xd2, 0x2e, 0x8d, 0x6c, - 0x9b, 0x85, 0x92, 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, - 0x56, 0x9c, 0xb4, 0x62, 0x88, 0xc1, 0x54, 0xfd, 0x5c, 0xad, 0xaf, 0x2e, 0x7e, 0x4a, 0xa4, 0xf9, - 0x94, 0x23, 0xef, 0xf6, 0x88, 0x94, 0x91, 0x7a, 0x98, 0x8a, 0x00, 0x21, 0x65, 0xb6, 0x6b, 0x7b, - 0xce, 0xa0, 0xb0, 0xb4, 0x45, 0xaa, 0x52, 0x45, 0x22, 0x63, 0x25, 0x93, 0xaf, 0x4d, 0xde, 0x37, - 0xff, 0xba, 0x8f, 0x58, 0xd9, 0xb5, 0xbd, 0xca, 0xa0, 0xb0, 0xf4, 0x98, 0xd4, 0x30, 0xeb, 0x05, - 0x7a, 0xcc, 0x2a, 0xe6, 0x60, 0xe3, 0x72, 0x4e, 0xd2, 0x97, 0x0a, 0x59, 0xd5, 0xf4, 0xd7, 0x86, - 0x5e, 0x92, 0xa3, 0x48, 0x68, 0x94, 0xca, 0x7c, 0xa3, 0xa3, 0xb5, 0x40, 0x56, 0x33, 0x77, 0x07, - 0x39, 0xbd, 0x22, 0xcd, 0xfd, 0x2c, 0x81, 0x99, 0x42, 0x56, 0x37, 0xb4, 0xc3, 0x07, 0x7a, 0x4a, - 0x1c, 0x84, 0x4e, 0x14, 0xa5, 0x42, 0x6b, 0xf6, 0xcf, 0x20, 0x77, 0x01, 0x75, 0x49, 0x63, 0x38, - 0x81, 0xf0, 0xb5, 0x27, 0x64, 0x3c, 0x46, 0xe6, 0x18, 0xca, 0x7e, 0x44, 0x39, 0xa9, 0x6b, 0x19, - 0x2b, 0x91, 0x6a, 0x46, 0xdc, 0xb2, 0xe7, 0x74, 0x2b, 0xf3, 0xaf, 0x33, 0x6b, 0x50, 0x84, 0xd4, - 0x23, 0xff, 0x47, 0x52, 0x05, 0x13, 0xf9, 0x2e, 0xa2, 0x0d, 0xa5, 0x61, 0x28, 0x7f, 0xe3, 0xee, - 0xc3, 0x7c, 0xc9, 0xed, 0xc5, 0x92, 0xdb, 0xdf, 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") -)