[#349] client: Use `context.Background` in `Dial` by default

Passing `nil` context to `rpc.Balance` leads to panic. To prevent panic,
we need to provide some default context in `Dial`.

Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
remotes/fyrchik/update-neo-go
Leonard Lyubich 2022-10-12 14:20:46 +04:00 committed by LeL
parent 8c682641bf
commit d2f3929b51
1 changed files with 4 additions and 0 deletions

View File

@ -105,6 +105,10 @@ func (c *Client) Dial(prm PrmDial) error {
c.setNeoFSAPIServer((*coreServer)(&c.c))
if prm.parentCtx == nil {
prm.parentCtx = context.Background()
}
// TODO: (neofs-api-go#382) perform generic dial stage of the client.Client
_, err := rpc.Balance(&c.c, new(v2accounting.BalanceRequest),
client.WithContext(prm.parentCtx),