Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor instance module to cosmos style #1653

Merged
merged 6 commits into from
Feb 12, 2020

Conversation

krhubert
Copy link
Contributor

Dep: #1651

Please note that passing cosmos client to service or process sdk is just a temporary solution until all modules will move to x dir/

@krhubert krhubert self-assigned this Feb 11, 2020
x/instance/client/rest/query.go Outdated Show resolved Hide resolved
x/instance/client/rest/query.go Outdated Show resolved Hide resolved
x/instance/internal/types/querier.go Outdated Show resolved Hide resolved
@NicolasMahe NicolasMahe added this to the next milestone Feb 12, 2020
@NicolasMahe NicolasMahe added release:change Pull requests that change something existant release:add Pull requests that add something and removed release:change Pull requests that change something existant labels Feb 12, 2020
Copy link
Member

@NicolasMahe NicolasMahe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the command instance get doesn't work:

➜  engine git:(refactor/cosmos-instance-module) ./bin/mesg-cli query instance get 8sYvgq4TqzZo7cdyMqR7fYKbUvvhXbecMcSBcBjjuYSF
could not get instance
ABCIQuery: RPC error -32603 - Internal error: runtime error: index out of range [0] with length 0

the hash is correct:

➜  engine git:(refactor/cosmos-instance-module) ./bin/mesg-cli query instance list
[{"hash":"8sYvgq4TqzZo7cdyMqR7fYKbUvvhXbecMcSBcBjjuYSF","serviceHash":"8P4Dm57fr8EFA4HQ4XK8rMnQcc4De6eDxSD5bHZ5oKWW","envHash":"6LfKoQQMqb8fYgA1PwBPKMhFaJ59Fn3DWw6qTRri4zjN"}]

same issue with rest:

➜  engine git:(refactor/cosmos-instance-module) curl 127.0.0.1:1317/instance/get
{
  "jsonrpc": "2.0",
  "id": -1,
  "error": {
    "code": -32603,
    "message": "Internal error",
    "data": "runtime error: index out of range [0] with length 0"
  }
}
➜  engine git:(refactor/cosmos-instance-module) curl 127.0.0.1:1317/instance/get/8sYvgq4TqzZo7cdyMqR7fYKbUvvhXbecMcSBcBjjuYSF
404 page not found

it's look like you try to use one function for both endpoint:
https://github.com/mesg-foundation/engine/pull/1653/files#diff-87961d244ba475f23c501d75dee36448R13-R46
let's create one function per endpoint for now like other cosmos module:
https://github.com/cosmos/cosmos-sdk/blob/master/x/mint/client/rest/query.go

@krhubert krhubert force-pushed the refactor/cosmos-instance-module branch from ff93b31 to 92ff3ac Compare February 12, 2020 08:08
@NicolasMahe NicolasMahe force-pushed the refactor/cosmos-instance-module branch from c76eb70 to 0564530 Compare February 12, 2020 11:19
@NicolasMahe NicolasMahe merged commit ee1f338 into dev Feb 12, 2020
@NicolasMahe NicolasMahe deleted the refactor/cosmos-instance-module branch February 12, 2020 11:49
@NicolasMahe NicolasMahe changed the title Refactor/cosmos instance module Refactor instance module to cosmos style Mar 2, 2020
@NicolasMahe NicolasMahe added release:change Pull requests that change something existant and removed release:add Pull requests that add something labels Mar 2, 2020
@NicolasMahe NicolasMahe mentioned this pull request Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:change Pull requests that change something existant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants