Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate transaction module #442

Merged
merged 24 commits into from
Oct 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
42af4a2
delete pointless test
kevinheavey Jul 5, 2024
00da75e
remove transaction module
kevinheavey Jul 5, 2024
9404f6e
small docstring fix
kevinheavey Jul 5, 2024
1441a2b
update sync send_transaction method
kevinheavey Jul 5, 2024
a791b4c
update _simulate_transaction_body
kevinheavey Jul 5, 2024
aefa01c
update token client to use solders transaction
kevinheavey Jul 5, 2024
12d0a6e
unused import
kevinheavey Jul 5, 2024
5742d5a
update integration tests to use solders transaction
kevinheavey Jul 5, 2024
3b57d5a
fix some send_transaction calls
kevinheavey Jul 5, 2024
8076411
remove references to compile_message()
kevinheavey Jul 5, 2024
7b04bf7
missing await
kevinheavey Jul 5, 2024
dee1b3a
remove unnecessary .sign() calls
kevinheavey Jul 5, 2024
a5ae4f0
try use real blockhash in get_fee_for_message tests
kevinheavey Jul 5, 2024
1c54661
fix _create_account_args
kevinheavey Jul 5, 2024
37b4b75
fix _create_multisig_args
kevinheavey Jul 5, 2024
47adbf6
Merge remote-tracking branch 'origin/master' into remove-transaction
michaelhly Oct 12, 2024
e4b3a64
Deprecate transaction module instead of removal
michaelhly Oct 12, 2024
482a34d
Update depcrecation message
michaelhly Oct 12, 2024
91b4e0c
Lint
michaelhly Oct 12, 2024
48ba546
Add back send_legacy_transaction rpc methods
michaelhly Oct 12, 2024
bc9155f
Add deprecation warning
michaelhly Oct 12, 2024
1d7ed08
Rename
michaelhly Oct 12, 2024
5799680
Add back unit test for legacy transaction
michaelhly Oct 12, 2024
858b9d8
Less diff
michaelhly Oct 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove references to compile_message()
kevinheavey committed Jul 5, 2024
commit 80764119b2eb7ec80c142aa7584ac9d255b9ac5b
2 changes: 1 addition & 1 deletion src/solana/rpc/async_api.py
Original file line number Diff line number Diff line change
@@ -423,7 +423,7 @@ async def get_fee_for_message(
>>> msg = Message([transfer(TransferParams(
... from_pubkey=sender.pubkey(), to_pubkey=receiver.pubkey(), lamports=1000))])
>>> solana_client = AsyncClient("http://localhost:8899")
>>> (await solana_client.get_fee_for_message(txn.compile_message())).value # doctest: +SKIP
>>> (await solana_client.get_fee_for_message(msg)).value # doctest: +SKIP
5000
"""
body = self._get_fee_for_message_body(message, commitment)
7 changes: 3 additions & 4 deletions tests/integration/test_async_http_client.py
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@

import pytest
import solders.system_program as sp
from solders.hash import Hash
from solders.keypair import Keypair
from solders.message import MessageV0, Message
from solders.pubkey import Pubkey
@@ -300,14 +301,12 @@ async def test_get_fee_for_transaction_message(stubbed_sender, stubbed_receiver,
recent_blockhash = resp.value.blockhash
assert recent_blockhash is not None
# Create transfer tx transfer lamports from stubbed sender to stubbed_receiver
blockhash = (await test_http_client_async.get_latest_blockhash()).value.blockhash
ixs = [
sp.transfer(sp.TransferParams(from_pubkey=stubbed_sender.pubkey(), to_pubkey=stubbed_receiver, lamports=1000))
]
msg = Message.new_with_blockhash(ixs, stubbed_sender.pubkey(), blockhash)
transfer_tx = Transaction([stubbed_sender], msg, blockhash)
msg = Message.new_with_blockhash(ixs, stubbed_sender.pubkey(), Hash.default())
# Get fee for transaction message
fee_resp = await test_http_client_async.get_fee_for_message(transfer_tx.compile_message())
fee_resp = await test_http_client_async.get_fee_for_message(msg)
assert_valid_response(fee_resp)
assert fee_resp.value is not None

7 changes: 3 additions & 4 deletions tests/integration/test_http_client.py
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@

import pytest
import solders.system_program as sp
from solders.hash import Hash
from solders.keypair import Keypair
from solders.message import MessageV0, Message
from solders.pubkey import Pubkey
@@ -273,14 +274,12 @@ def test_get_fee_for_transaction(stubbed_sender, stubbed_receiver, test_http_cli
recent_blockhash = resp.value.blockhash
assert recent_blockhash is not None
# Create transfer tx transfer lamports from stubbed sender to stubbed_receiver
blockhash = test_http_client.get_latest_blockhash().value.blockhash
ixs = [
sp.transfer(sp.TransferParams(from_pubkey=stubbed_sender.pubkey(), to_pubkey=stubbed_receiver, lamports=1000))
]
msg = Message.new_with_blockhash(ixs, stubbed_sender.pubkey(), blockhash)
transfer_tx = Transaction([stubbed_sender], msg, blockhash)
msg = Message.new_with_blockhash(ixs, stubbed_sender.pubkey(), Hash.default())
# get fee for transaction
fee_resp = test_http_client.get_fee_for_message(transfer_tx.compile_message())
fee_resp = test_http_client.get_fee_for_message(msg)
assert_valid_response(fee_resp)
assert fee_resp.value is not None