This commit is contained in:
rayoo 2026-05-21 20:14:43 -07:00 committed by GitHub
commit 83a373fd9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -397,6 +397,9 @@ func (c *Client) BatchCall(b []BatchElem) error {
//
// Note that batch calls may not be executed atomically on the server side.
func (c *Client) BatchCallContext(ctx context.Context, b []BatchElem) error {
if len(b) == 0 {
return &invalidRequestError{"empty batch"}
}
var (
msgs = make([]*jsonrpcMessage, len(b))
byID = make(map[string]int, len(b))