The gRPC Call method can take a long time and return multiple events, so change it to a gRPC stream. This PR has two commits. In the first commit,
In rpc.proto, change Call to return a stream. Run make generate.
In api.go, change Call to take a stream and use stream.Send to return the result.
In use-gno.ts, change call to return Promise<AsyncIterable<CallResponse>>.
In the devmode/index.tsx, use for await ... of to iterate over the results of gno.call
In the second commit, don't use ConnectRPC error details because of a communication bug in React Native for returning the error object in the gRPC stream. Instead, parse the error string to get the error number from "ErrType(#ErrNumber)".
The gRPC
Call
method can take a long time and return multiple events, so change it to a gRPC stream. This PR has two commits. In the first commit,Call
to return a stream. Runmake generate
.Call
to take a stream and usestream.Send
to return the result.call
to returnPromise<AsyncIterable<CallResponse>>
.for await ... of
to iterate over the results ofgno.call
In the second commit, don't use ConnectRPC error details because of a communication bug in React Native for returning the error object in the gRPC stream. Instead, parse the error string to get the error number from "ErrType(#ErrNumber)".