Tinkoff / invest-python

Tinkoff Invest Python gRPC client
https://tinkoff.github.io/invest-python/
Apache License 2.0
303 stars 88 forks source link

feat: get_sandbox_withdraw_limits fix #173

Closed SourInjir closed 1 year ago

SourInjir commented 1 year ago

1596, in get_sandbox_withdraw_limits return _grpc_helpers.protobuf_to_dataclass(response, WithdrawLimitsResponse) File "tinkoff/invest/_grpc_helpers.py", line 304, in protobuf_to_dataclass pb_value = getattr(pb_obj, unsafe_field_name) AttributeError: 'SandboxPayInResponse' object has no attribute 'money'

В методах get_sandbox_withdraw_limits ошибка (скорее всего копипаста) при формировании запроса к api

response, call = self.stub.SandboxPayIn.with_call( request=_grpc_helpers.dataclass_to_protobuff( request, operations_pb2.WithdrawLimitsRequest() ), metadata=self.metadata, )

В строке 1588 services.py идет обращение к неверному свойству self.stub.SandboxPayIn, должно быть self.stub.GetSandboxWithdrawLimits

response, call = self.stub.GetSandboxWithdrawLimits.with_call( request=_grpc_helpers.dataclass_to_protobuff( request, operations_pb2.WithdrawLimitsRequest() ), metadata=self.metadata, )

Аналогично в async_services.py 1494, должно быть: response_coro = self.stub.GetSandboxWithdrawLimits( request=_grpc_helpers.dataclass_to_protobuff( request, operations_pb2.WithdrawLimitsRequest() ), metadata=self.metadata, )