You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sending an HTTP RPC batch, with a single item in the batch, the Send fails with the following message: unable to send RPC batch, unable to unmarshal response body, json: cannot unmarshal object into Go value of type rpctypes.RPCResponses
Your environment
Go version - go version go1.23.5 darwin/arm64
OS and CPU architecture - macOS 15.2
Gno commit hash causing the issue - 815cf51273a20cd7752c72d5903b02d373584a65 (master)
Steps to reproduce
Run a local gno node with --lazy, and run this Go script:
package main
import (
"context""fmt""time""github.com/gnolang/gno/tm2/pkg/bft/rpc/client"
core_types "github.com/gnolang/gno/tm2/pkg/bft/rpc/core/types"
)
funcmain() {
c, err:=client.NewHTTPClient("http://127.0.0.1:26657")
iferr!=nil {
panic(err)
}
// Create the batchb:=c.NewBatch()
iferr=b.Status(); err!=nil {
panic(err)
}
// Send the batchctx, cancelFn:=context.WithTimeout(context.Background(), time.Second*10)
defercancelFn()
resp, err:=b.Send(ctx)
iferr!=nil {
panic(err)
}
// Parse the responsefori, resultRaw:=rangeresp {
result, ok:=resultRaw.(*core_types.ResultStatus)
if!ok {
panic("unable to cast batch result into ResultStatus")
}
fmt.Printf("Status %d: %v\n", i, result)
}
}
Expected behavior
The single response should be wrapped in an RPCResponses type
Actual behavior
There is an error returned:
panic: unable to send RPC batch, unable to unmarshal response body, json: cannot unmarshal object into Go value of type rpctypes.RPCResponses
goroutine 1 [running]:
main.main()
/Users/zmilos/Work/go-test/main.go:37 +0x290
exit status 2
Logs
unable to send RPC batch, unable to unmarshal response body, json: cannot unmarshal object into Go value of type rpctypes.RPCResponses
Proposed solution
If you have an idea of how to fix this issue, please write it down here, so we can begin discussing it
The text was updated successfully, but these errors were encountered:
RPC HTTP
Batch
doesn't support 1 item responsesDescription
When sending an HTTP RPC batch, with a single item in the batch, the
Send
fails with the following message:unable to send RPC batch, unable to unmarshal response body, json: cannot unmarshal object into Go value of type rpctypes.RPCResponses
Your environment
815cf51273a20cd7752c72d5903b02d373584a65
(master)Steps to reproduce
Run a local gno node with
--lazy
, and run this Go script:Expected behavior
The single response should be wrapped in an
RPCResponses
typeActual behavior
There is an error returned:
Logs
unable to send RPC batch, unable to unmarshal response body, json: cannot unmarshal object into Go value of type rpctypes.RPCResponses
Proposed solution
If you have an idea of how to fix this issue, please write it down here, so we can begin discussing it
The text was updated successfully, but these errors were encountered: