Skip to content

Commit

Permalink
Merge pull request #315 from michaelhly/remove-requests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey authored Oct 25, 2022
2 parents ec62afc + cdec33e commit 32119e6
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 141 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [0.27.3] - Unreleased

## Changed

- Remove `requests` dependency [(#315)](https://github.com/michaelhly/solana-py/pull/315)

## Fixed

- Fix flakiness in token client transactions [(#314)](https://github.com/michaelhly/solana-py/pull/314)

## [0.27.2] - 2022-10-15

## Changed
Expand Down
73 changes: 23 additions & 50 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ packages = [
python = "^3.7"
construct-typing = "^0.5.2"
httpx = "^0.23.0"
requests = "^2.24"
typing-extensions = ">=4.2.0"
cachetools = "^4.2.2"
types-cachetools = "^4.2.4"
Expand All @@ -42,7 +41,6 @@ flake8 = "^4.0.1"
isort = "^5.9.3"
pytest-docker = "^0.12.0"
bump2version = "^1.0.1"
types-requests = "^2.25.11"
pytest-asyncio = "^0.18.3"
pytest-cov = "^3.0.0"
asyncstdlib = "^3.10.2"
Expand Down
7 changes: 1 addition & 6 deletions src/solana/rpc/async_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@
from solana.transaction import Transaction

from .commitment import Commitment, Finalized
from .core import (
_COMMITMENT_TO_SOLDERS,
TransactionExpiredBlockheightExceededError,
UnconfirmedTxError,
_ClientCore,
)
from .core import _COMMITMENT_TO_SOLDERS, TransactionExpiredBlockheightExceededError, UnconfirmedTxError, _ClientCore
from .providers import async_http


Expand Down
30 changes: 15 additions & 15 deletions src/solana/rpc/providers/async_http.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Async HTTP RPC Provider."""
from typing import Dict, Optional, Type, overload, Tuple
from typing import Dict, Optional, Tuple, Type, overload

import httpx
from solders.rpc.requests import Body
Expand All @@ -11,28 +11,28 @@
DEFAULT_TIMEOUT,
T,
_after_request_unparsed,
_BodiesTup,
_BodiesTup1,
_BodiesTup2,
_BodiesTup3,
_BodiesTup4,
_BodiesTup5,
_HTTPProviderCore,
_parse_raw,
_parse_raw_batch,
_RespTup,
_RespTup1,
_RespTup2,
_RespTup3,
_RespTup4,
_RespTup5,
_Tup,
_Tup1,
_Tup2,
_Tup3,
_Tup4,
_Tup5,
_Tuples,
_RespTup,
_RespTup1,
_RespTup2,
_RespTup3,
_RespTup4,
_RespTup5,
_BodiesTup,
_BodiesTup1,
_BodiesTup2,
_BodiesTup3,
_BodiesTup4,
_BodiesTup5,
)


Expand Down Expand Up @@ -61,13 +61,13 @@ async def make_request(self, body: Body, parser: Type[T]) -> T:

async def make_request_unparsed(self, body: Body) -> str:
"""Make an async HTTP request to an http rpc endpoint."""
request_kwargs = self._before_request(body=body, is_async=True)
request_kwargs = self._before_request(body=body)
raw_response = await self.session.post(**request_kwargs)
return _after_request_unparsed(raw_response)

async def make_batch_request_unparsed(self, reqs: Tuple[Body, ...]) -> str:
"""Make an async HTTP request to an http rpc endpoint."""
request_kwargs = self._before_batch_request(reqs, is_async=True)
request_kwargs = self._before_batch_request(reqs)
raw_response = await self.session.post(**request_kwargs)
return _after_request_unparsed(raw_response)

Expand Down
Loading

0 comments on commit 32119e6

Please sign in to comment.