-
Notifications
You must be signed in to change notification settings - Fork 382
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
block_results
result.devlier_tx[i].ResponseBase.Data does not identify msg
#2055
Labels
🐞 bug
Something isn't working
investigating
This behavior is still being tested out
❓ question
Questions about Gno
Milestone
Comments
r3v4s
added
help wanted
❓ question
Questions about Gno
investigating
This behavior is still being tested out
labels
May 8, 2024
zivkovicmilos
pushed a commit
that referenced
this issue
May 15, 2024
… pair (#2063) related to #2055 I'm opening this pr to get some ideas. Currently, keeper does make response data with `\n` as separator to separate number of responses for single function. https://github.com/gnolang/gno/blob/80575054429e07c221f1453104dd0ad29e33291c/gno.land/pkg/sdk/vm/keeper.go#L307-L312 If single function returns 2 string, response may look like this ```text ("1" string) ("2" string) ``` However as describe in #2055, response for single tx with multi-msg really doesn't separate response values. So this pr adds `\n\n` as a separator for every function. ### sample contract ```go package returns func FuncNo() {} func Func2() (string, uint64) { return "asd", 123 } func Func3() (int64, string, uint64) { return -1, "hmm", 78978 } ``` ### call with multi-msg ```javascript await adena.DoContract({ messages: [ { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "FuncNo", "args": [] } }, { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "Func2", "args": [] } }, { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "FuncNo", "args": [] } }, { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "Func3", "args": [] } }, { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "FuncNo", "args": [] } } ], gasFee: 1, gasWanted: 2000000 }); ``` ### block_results from rpc with b64 encoded ``` KCJhc2QiIHN0cmluZykKKDEyMyB1aW50NjQpKC0xIGludDY0KQooImhtbSIgc3RyaW5nKQooNzg5NzggdWludDY0KQ ``` ### b64 decoded ``` ("asd" string) (123 uint64)(-1 int64) ("hmm" string) (78978 uint64) ``` two problem exists with above response 1. It needs to do something about function that doesn't return any value 2. It needs to divide results string for each function ### in this pr response b64 encoded ``` CgooImFzZCIgc3RyaW5nKQooMTIzIHVpbnQ2NCkKCgoKKC0xIGludDY0KQooImhtbSIgc3RyaW5nKQooNzg5NzggdWludDY0KQoKCgo ``` ### decode b64 and divide by '\n\n' ![image](https://github.com/gnolang/gno/assets/104744707/cf4ee0b8-a0d3-4fb8-aa59-68c814f8ef5b) From now, we know... 1. tx had 5 messages 2. first, third and fifth msg function doesn't return anything 3. second msg function return 2 values 4. fourth msg function return 3 values
leohhhn
pushed a commit
to leohhhn/gno
that referenced
this issue
May 21, 2024
… pair (gnolang#2063) related to gnolang#2055 I'm opening this pr to get some ideas. Currently, keeper does make response data with `\n` as separator to separate number of responses for single function. https://github.com/gnolang/gno/blob/80575054429e07c221f1453104dd0ad29e33291c/gno.land/pkg/sdk/vm/keeper.go#L307-L312 If single function returns 2 string, response may look like this ```text ("1" string) ("2" string) ``` However as describe in gnolang#2055, response for single tx with multi-msg really doesn't separate response values. So this pr adds `\n\n` as a separator for every function. ### sample contract ```go package returns func FuncNo() {} func Func2() (string, uint64) { return "asd", 123 } func Func3() (int64, string, uint64) { return -1, "hmm", 78978 } ``` ### call with multi-msg ```javascript await adena.DoContract({ messages: [ { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "FuncNo", "args": [] } }, { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "Func2", "args": [] } }, { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "FuncNo", "args": [] } }, { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "Func3", "args": [] } }, { "type": "/vm.m_call", "value": { "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "send": "", "pkg_path": "gno.land/r/r3v4/returns", "func": "FuncNo", "args": [] } } ], gasFee: 1, gasWanted: 2000000 }); ``` ### block_results from rpc with b64 encoded ``` KCJhc2QiIHN0cmluZykKKDEyMyB1aW50NjQpKC0xIGludDY0KQooImhtbSIgc3RyaW5nKQooNzg5NzggdWludDY0KQ ``` ### b64 decoded ``` ("asd" string) (123 uint64)(-1 int64) ("hmm" string) (78978 uint64) ``` two problem exists with above response 1. It needs to do something about function that doesn't return any value 2. It needs to divide results string for each function ### in this pr response b64 encoded ``` CgooImFzZCIgc3RyaW5nKQooMTIzIHVpbnQ2NCkKCgoKKC0xIGludDY0KQooImhtbSIgc3RyaW5nKQooNzg5NzggdWludDY0KQoKCgo ``` ### decode b64 and divide by '\n\n' ![image](https://github.com/gnolang/gno/assets/104744707/cf4ee0b8-a0d3-4fb8-aa59-68c814f8ef5b) From now, we know... 1. tx had 5 messages 2. first, third and fifth msg function doesn't return anything 3. second msg function return 2 values 4. fourth msg function return 3 values
Kouteki
modified the milestones:
🏗4️⃣ test4.gno.land,
🏗4️⃣ test4.gno.land [POST LAUNCH]
Jun 14, 2024
github-project-automation
bot
moved this from In Progress
to Done
in 🧙♂️gno.land core team
Sep 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
🐞 bug
Something isn't working
investigating
This behavior is still being tested out
❓ question
Questions about Gno
block_results
result.devlier_tx[i].ResponseBase.Data` does not identify msgDescription
deploy contract
multi-msg call via adena
result from rpc
block_results
https://rpc.gno.land/block_results?height=8924
decoded data
Problem
Proposed solution
\n\n
) // doesn't like it looks bit dirtyThe text was updated successfully, but these errors were encountered: