Skip to content

Commit 991849b

Browse files
committed
pull in old versions
1 parent d4da7ef commit 991849b

File tree

8 files changed

+19
-20
lines changed

8 files changed

+19
-20
lines changed

docs/examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ And finally, send the transaction
709709

710710
.. code-block:: python
711711
712-
txn_hash = w3.eth.send_raw_transaction(signed_tx.raw_transaction)
712+
txn_hash = w3.eth.send_raw_transaction(signed_tx.rawTransaction)
713713
txn_receipt = w3.eth.wait_for_transaction_receipt(txn_hash)
714714
715715
Tip : afterwards you can use the value stored in ``txn_hash``, in an explorer like `etherscan`_ to view the transaction's details

docs/transactions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ if you don't opt for the middleware, you'll need to:
125125
signed = w3.eth.account.sign_transaction(transaction, pk)
126126
127127
# 3. Send the signed transaction
128-
tx_hash = w3.eth.send_raw_transaction(signed.raw_transaction)
128+
tx_hash = w3.eth.send_raw_transaction(signed.rawTransaction)
129129
tx = w3.eth.get_transaction(tx_hash)
130130
assert tx["from"] == acct2.address
131131
@@ -182,6 +182,6 @@ Executing a function on a smart contract requires sending a transaction, which i
182182
183183
# Send the raw transaction:
184184
assert billboard.functions.message().call() == "gm"
185-
tx_hash = w3.eth.send_raw_transaction(signed_tx.raw_transaction)
185+
tx_hash = w3.eth.send_raw_transaction(signed_tx.rawTransaction)
186186
w3.eth.wait_for_transaction_receipt(tx_hash)
187187
assert billboard.functions.message().call() == "gn"

docs/web3.eth.account.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ is provided by :meth:`w3.eth.sign() <web3.eth.Eth.sign>`.
214214
>>> signed_message = w3.eth.account.sign_message(message, private_key=private_key)
215215
>>> signed_message
216216
SignedMessage(messageHash=HexBytes('0x1476abb745d423bf09273f1afd887d951181d25adc66c4834a70491911b7f750'),
217-
message_hash=HexBytes('0x1476abb745d423bf09273f1afd887d951181d25adc66c4834a70491911b7f750'),
218217
r=104389933075820307925104709181714897380569894203213074526835978196648170704563,
219218
s=28205917190874851400050446352651915501321657673772411533993420917949420456142,
220219
v=28,
@@ -252,7 +251,7 @@ You might have produced the signed_message locally, as in
252251
... return Web3.to_hex(Web3.to_bytes(val).rjust(32, b'\0'))
253252

254253
>>> ec_recover_args = (msghash, v, r, s) = (
255-
... Web3.to_hex(signed_message.message_hash),
254+
... Web3.to_hex(signed_message.messageHash),
256255
... signed_message.v,
257256
... to_32byte_hex(signed_message.r),
258257
... to_32byte_hex(signed_message.s),
@@ -357,7 +356,7 @@ with :meth:`~web3.eth.Eth.send_raw_transaction`.
357356
... }
358357
>>> key = '0x4c0883a69102937d6231471b5dbb6204fe5129617082792ae468d01a3f362318'
359358
>>> signed = w3.eth.account.sign_transaction(transaction, key)
360-
>>> signed.raw_transaction
359+
>>> signed.rawTransaction
361360
HexBytes('0x02f8e20180843b9aca008477359400831e848094f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca0080f872f85994de0b295669a9fd93d5f28d9ec85e40f4cb697baef842a00000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000007d694bb9bc244d798123fde783fcc1c72d3bb8c189413c001a0b9ec671ccee417ff79e06e9e52bfa82b37cf1145affde486006072ca7a11cf8da0484a9beea46ff6a90ac76e7bbf3718db16a8b4b09cef477fb86cf4e123d98fde')
362361
>>> signed.hash
363362
HexBytes('0xe85ce7efa52c16cb5c469c7bde54fbd4911639fdfde08003f65525a85076d915')
@@ -369,7 +368,7 @@ with :meth:`~web3.eth.Eth.send_raw_transaction`.
369368
1
370369

371370
# When you run send_raw_transaction, you get back the hash of the transaction:
372-
>>> w3.eth.send_raw_transaction(signed.raw_transaction) # doctest: +SKIP
371+
>>> w3.eth.send_raw_transaction(signed.rawTransaction) # doctest: +SKIP
373372
'0xe85ce7efa52c16cb5c469c7bde54fbd4911639fdfde08003f65525a85076d915'
374373

375374
Sign a Contract Transaction
@@ -430,7 +429,7 @@ To sign a transaction locally that will invoke a smart contract:
430429
>>> signed_txn = w3.eth.account.sign_transaction(unicorn_txn, private_key=private_key)
431430
>>> signed_txn.hash
432431
HexBytes('0x748db062639a45e519dba934fce09c367c92043867409160c9989673439dc817')
433-
>>> signed_txn.raw_transaction
432+
>>> signed_txn.rawTransaction
434433
HexBytes('0x02f8b00180843b9aca0084773594008301117094fb6916095ca1df60bb79ce92ce3ea74c37c5d35980b844a9059cbb000000000000000000000000fb6916095ca1df60bb79ce92ce3ea74c37c5d3590000000000000000000000000000000000000000000000000000000000000001c001a0cec4150e52898cf1295cc4020ac0316cbf186071e7cdc5ec44eeb7cdda05afa2a06b0b3a09c7fb0112123c0bef1fd6334853a9dcf3cb5bab3ccd1f5baae926d449')
435434
>>> signed_txn.r
436435
93522894155654168208483453926995743737629589441154283159505514235904280342434
@@ -439,8 +438,8 @@ To sign a transaction locally that will invoke a smart contract:
439438
>>> signed_txn.v
440439
1
441440

442-
>>> w3.eth.send_raw_transaction(signed_txn.raw_transaction) # doctest: +SKIP
441+
>>> w3.eth.send_raw_transaction(signed_txn.rawTransaction) # doctest: +SKIP
443442

444443
# When you run send_raw_transaction, you get the same result as the hash of the transaction:
445-
>>> w3.to_hex(w3.keccak(signed_txn.raw_transaction))
444+
>>> w3.to_hex(w3.keccak(signed_txn.rawTransaction))
446445
'0x748db062639a45e519dba934fce09c367c92043867409160c9989673439dc817'

docs/web3.eth.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ The following methods are available on the ``web3.eth`` namespace.
797797
),
798798
private_key_for_senders_account,
799799
)
800-
>>> w3.eth.send_raw_transaction(signed_txn.raw_transaction)
800+
>>> w3.eth.send_raw_transaction(signed_txn.rawTransaction)
801801
HexBytes('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331')
802802
803803

tests/core/eth-module/test_accounts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def test_eth_account_sign(
268268
assert signed_message == expected_hash
269269

270270
signed = acct.sign_message(message, private_key=key)
271-
assert signed.message_hash == expected_hash
271+
assert signed.messageHash == expected_hash
272272
assert signed.v == v
273273
assert signed.r == r
274274
assert signed.s == s
@@ -421,14 +421,14 @@ def test_eth_account_sign_transaction(
421421
assert signed.r == r
422422
assert signed.s == s
423423
assert signed.v == v
424-
assert signed.raw_transaction == expected_raw_tx
424+
assert signed.rawTransaction == expected_raw_tx
425425
assert signed.hash == tx_hash
426426

427427
account = acct.from_key(private_key)
428428
assert account.sign_transaction(txn) == signed
429429

430430
expected_sender = acct.from_key(private_key).address
431-
assert acct.recover_transaction(signed.raw_transaction) == expected_sender
431+
assert acct.recover_transaction(signed.rawTransaction) == expected_sender
432432

433433

434434
@pytest.mark.parametrize(
@@ -452,7 +452,7 @@ def test_eth_account_sign_transaction_from_eth_test(acct, transaction_info):
452452

453453
# confirm that signed transaction can be recovered to the sender
454454
expected_sender = acct.from_key(key).address
455-
assert acct.recover_transaction(signed.raw_transaction) == expected_sender
455+
assert acct.recover_transaction(signed.rawTransaction) == expected_sender
456456

457457

458458
@pytest.mark.parametrize(

tests/core/eth-module/test_transactions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def test_eth_send_raw_blob_transaction(w3):
388388

389389
signed = acct.sign_transaction(tx, blobs=[blob_data])
390390

391-
tx_hash = w3.eth.send_raw_transaction(signed.raw_transaction)
391+
tx_hash = w3.eth.send_raw_transaction(signed.rawTransaction)
392392
transaction = w3.eth.get_transaction(tx_hash)
393393

394394
assert len(transaction["blobVersionedHashes"]) == 1
@@ -457,7 +457,7 @@ async def test_async_send_raw_blob_transaction(async_w3):
457457

458458
signed = acct.sign_transaction(tx, blobs=[blob_data])
459459

460-
tx_hash = await async_w3.eth.send_raw_transaction(signed.raw_transaction)
460+
tx_hash = await async_w3.eth.send_raw_transaction(signed.rawTransaction)
461461
transaction = await async_w3.eth.get_transaction(tx_hash)
462462

463463
assert len(transaction["blobVersionedHashes"]) == 1

web3/_utils/module_testing/eth_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3688,7 +3688,7 @@ def test_eth_send_raw_transaction(
36883688
# unlocked_account private key:
36893689
"0x392f63a79b1ff8774845f3fa69de4a13800a59e7083f5187f1558f0797ad0f01",
36903690
)
3691-
txn_hash = w3.eth.send_raw_transaction(signed_tx.raw_transaction)
3691+
txn_hash = w3.eth.send_raw_transaction(signed_tx.rawTransaction)
36923692
assert txn_hash == signed_tx.hash
36933693

36943694
def test_eth_call(self, w3: "Web3", math_contract: "Contract") -> None:

web3/middleware/signing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def middleware(method: RPCEndpoint, params: Any) -> RPCResponse:
176176
return make_request(method, params)
177177

178178
account = accounts[transaction["from"]]
179-
raw_tx = account.sign_transaction(transaction).raw_transaction
179+
raw_tx = account.sign_transaction(transaction).rawTransaction
180180

181181
return make_request(RPCEndpoint("eth_sendRawTransaction"), [raw_tx.hex()])
182182

@@ -227,7 +227,7 @@ async def middleware(method: RPCEndpoint, params: Any) -> RPCResponse:
227227
return await make_request(method, params)
228228

229229
account = accounts[to_checksum_address(tx_from)]
230-
raw_tx = account.sign_transaction(filled_transaction).raw_transaction
230+
raw_tx = account.sign_transaction(filled_transaction).rawTransaction
231231

232232
return await make_request(
233233
RPCEndpoint("eth_sendRawTransaction"),

0 commit comments

Comments
 (0)