Skip to content

Commit

Permalink
Updated to latest solana version, dependency updates, more RPCs metho…
Browse files Browse the repository at this point in the history
…ds and last valid block height based confirmation strategy (#254)

* Add commitment to get_transaction in async_api

* add get_latest_blockhash and new confirmation strategy

* remove warn and update CHANGELOG.md

* adding warning to docs to use get_latest_blockhash

* add get_fee_for_message rpc call with tests included

* fix typo that made tests fail and CHANGELOG.md

* typo in docs

* better documentation for get_fee_for_message

* added error if transaction has not been compiled with tests

* renamed error

* lint fix

* typo fix

* move last_valid_blockheight to opts in send_transaction and send_raw_transaction. also add test_memo to .github/workflows/main.yml

* revert stubbed_sender to previous version

* forgot to change stubbed_sender in test_async_http_client.py

* fix lint

* remove stubbed_sender_token_token_account

* readme typo fix to make tests pass due to cloudflare outage
  • Loading branch information
crypt0miester authored Jun 22, 2022
1 parent ec5ea6a commit 649c3c6
Show file tree
Hide file tree
Showing 23 changed files with 612 additions and 199 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
"tests/integration/test_token_client.py",
"tests/integration/test_websockets.py",
"tests/integration/test_recent_performance_samples.py",
"tests/integration/test_memo.py",
"tests/unit",
"src", # doctests
]
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ dist
# solana validator logs
test-ledger/

#IDE Files
# IDE Files
.idea/

# pytest coverage
.coverage

# manual tests
testing.py
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@

## Fixed

- Use latest Solders version to make objects pickleable again [(#252)](https://github.com/michaelhly/solana-py/pull/252)
- Use latest Solders version to make objects pickleable again [(#252)](https://github.com/michaelhly/solana-py/pull/252).


## Changed

- Updated httpx to fix critical vulnerability [(#248)](https://github.com/michaelhly/solana-py/pull/248).
- Updated pytest, websockets, pytest-docker, pytest-asyncio to latest. [(#254)](https://github.com/michaelhly/solana-py/pull/254).
- Updated apischema to latest. [(#254)](https://github.com/michaelhly/solana-py/pull/254).


## Added

- Added `get_latest_blockhash` RPC Call. [(#254)](https://github.com/michaelhly/solana-py/pull/254).
- Added `get_fee_for_message` RPC Call. [(#254)](https://github.com/michaelhly/solana-py/pull/254).
- Added confirmation strategy which checks if the transaction has exceeded last valid blockheight. [(#254)](https://github.com/michaelhly/solana-py/pull/254).
- Added `asyncio_mode = auto` in pytest.ini. [(#248)](https://github.com/michaelhly/solana-py/pull/254).
- Added an optional `verify_signature` bool when `transaction.serialize()` is called [(#249)](https://github.com/michaelhly/solana-py/pull/249).
- Added Memo program [(#249)](https://github.com/michaelhly/solana-py/pull/249).


## [0.24.0] - 2022-06-04

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ from asyncstdlib import enumerate
from solana.rpc.websocket_api import connect

async def main():
async with connect("ws://api.devnet.solana.com") as websocket:
async with connect("wss://api.devnet.solana.com") as websocket:
await websocket.logs_subscribe()
first_resp = await websocket.recv()
subscription_id = first_resp.result
Expand All @@ -95,7 +95,7 @@ async def main():
await websocket.logs_unsubscribe(subscription_id)

# Alternatively, use the client as an infinite asynchronous iterator:
async with connect("ws://api.devnet.solana.com") as websocket:
async with connect("wss://api.devnet.solana.com") as websocket:
await websocket.logs_subscribe()
first_resp = await websocket.recv()
subscription_id = first_resp.result
Expand Down
108 changes: 72 additions & 36 deletions poetry.lock

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

10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ typing-extensions = ">=3.10.0"
cachetools = "^4.2.2"
types-cachetools = "^4.2.4"
jsonrpcclient = "^4.0.1"
websockets = "^10.1"
websockets = "^10.3"
jsonrpcserver = "^5.0.7"
apischema = "^0.16.1"
apischema = "^0.17.5"
based58 = "^0.1.0"
solders = "^0.2.0"

[tool.poetry.dev-dependencies]
black = "^22.3"
pytest = "^6.2.5"
pytest = "^7.1.2"
pylint = "^2.11.1"
mypy = "^0.910"
pydocstyle = "^6.1.1"
flake8 = "^4.0.1"
isort = "^5.9.3"
pytest-docker = "^0.10.3"
pytest-docker = "^0.12.0"
bump2version = "^1.0.1"
types-requests = "^2.25.11"
pytest-asyncio = "^0.16.0"
pytest-asyncio = "^0.18.3"
pytest-cov = "^3.0.0"
asyncstdlib = "^3.10.2"
mkdocstrings = "^0.18.0"
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[pytest]
addopts = --doctest-modules -p no:anyio
asyncio_mode = auto
markers =
integration: mark a test as a integration test.
Loading

0 comments on commit 649c3c6

Please sign in to comment.