-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
There was a problem hiding this 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
ff93b31
to
92ff3ac
Compare
c76eb70
to
0564530
Compare
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/