From eb85ae7d056377c6be04c93c4027b27ac8b6b380 Mon Sep 17 00:00:00 2001 From: 0xsuryansh Date: Sun, 2 Jul 2023 22:09:14 +0530 Subject: [PATCH] cleanup --- docs/static/openapi.yml | 225 ++++++++++++++++++ .../msg_server_submit_ethereum_state.go | 10 +- 2 files changed, 230 insertions(+), 5 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 26d7f9f..d5e8291 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -34923,6 +34923,173 @@ paths: format: int64 tags: - Query + /EVMStoreChain/evmstorechain/blockstoragestate: + get: + operationId: EvmstorechainEvmstorechainBlockstoragestateAll + responses: + '200': + description: A successful response. + schema: + type: object + properties: + blockstoragestate: + type: array + items: + type: object + properties: + blocknumber: + type: string + state: + type: string + format: uint64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + 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.count_total + 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 + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /EVMStoreChain/evmstorechain/blockstoragestate/{blocknumber}: + get: + summary: Queries a list of Blockstoragestate items. + operationId: EvmstorechainEvmstorechainBlockstoragestate + responses: + '200': + description: A successful response. + schema: + type: object + properties: + blockstoragestate: + type: object + properties: + blocknumber: + type: string + state: + 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: blocknumber + in: path + required: true + type: string + tags: + - Query /EVMStoreChain/evmstorechain/params: get: summary: Parameters queries the parameters of the module. @@ -70747,11 +70914,58 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. description: Period defines a length of time and amount of coins that will vest. + evmstorechain.evmstorechain.Blockstoragestate: + type: object + properties: + blocknumber: + type: string + state: + type: string + format: uint64 evmstorechain.evmstorechain.MsgSubmitEthereumStateResponse: type: object evmstorechain.evmstorechain.Params: type: object description: Params defines the parameters for the module. + evmstorechain.evmstorechain.QueryAllBlockstoragestateResponse: + type: object + properties: + blockstoragestate: + type: array + items: + type: object + properties: + blocknumber: + type: string + state: + type: string + format: uint64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + 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; + } evmstorechain.evmstorechain.QueryAllVoteResponse: type: object properties: @@ -70797,6 +71011,17 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + evmstorechain.evmstorechain.QueryGetBlockstoragestateResponse: + type: object + properties: + blockstoragestate: + type: object + properties: + blocknumber: + type: string + state: + type: string + format: uint64 evmstorechain.evmstorechain.QueryGetVoteResponse: type: object properties: diff --git a/x/evmstorechain/keeper/msg_server_submit_ethereum_state.go b/x/evmstorechain/keeper/msg_server_submit_ethereum_state.go index f4b181f..6e5e087 100644 --- a/x/evmstorechain/keeper/msg_server_submit_ethereum_state.go +++ b/x/evmstorechain/keeper/msg_server_submit_ethereum_state.go @@ -12,11 +12,11 @@ func (k msgServer) SubmitEthereumState(goCtx context.Context, msg *types.MsgSubm // TODO: Handling the message vote := types.Vote{ - Validator: msg.Creator, - Blocknumber: msg.Blocknumber, - State: msg.State, - } - k.AppendVote(ctx, vote) + Validator: msg.Creator, + Blocknumber: msg.Blocknumber, + State: msg.State, + } + k.AppendVote(ctx, vote) _ = ctx