Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 798b061

Browse filesBrowse files
committed
fix: fixed warnings from use of camelCase web3 methods
1 parent 791a221 commit 798b061
Copy full SHA for 798b061

File tree

Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed

‎tests/test_uniswap.py

Copy file name to clipboardExpand all lines: tests/test_uniswap.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_assets(client: Uniswap):
5353
logger.info("Buying...")
5454

5555
tx = client.make_trade_output(tokens["ETH"], token_addr, amount)
56-
client.w3.eth.waitForTransactionReceipt(tx)
56+
client.w3.eth.wait_for_transaction_receipt(tx)
5757

5858

5959
@pytest.fixture(scope="module")
@@ -218,7 +218,7 @@ def get_exchange_rate(
218218
)
219219
def test_add_liquidity(self, client: Uniswap, web3: Web3, token, max_eth):
220220
r = client.add_liquidity(token, max_eth)
221-
tx = web3.eth.waitForTransactionReceipt(r, timeout=6000)
221+
tx = web3.eth.wait_for_transaction_receipt(r, timeout=6000)
222222
assert tx.status
223223

224224
@pytest.mark.skip
@@ -235,7 +235,7 @@ def test_remove_liquidity(
235235
):
236236
with expectation:
237237
r = client.remove_liquidity(token, max_token)
238-
tx = web3.eth.waitForTransactionReceipt(r)
238+
tx = web3.eth.wait_for_transaction_receipt(r)
239239
assert tx.status
240240

241241
# ------ Make Trade ----------------------------------------------------------------
@@ -273,7 +273,7 @@ def test_make_trade(
273273
bal_in_before = client.get_token_balance(input_token)
274274

275275
txid = client.make_trade(input_token, output_token, qty, recipient)
276-
tx = web3.eth.waitForTransactionReceipt(txid)
276+
tx = web3.eth.wait_for_transaction_receipt(txid)
277277
assert tx.status
278278

279279
# TODO: Checks for ETH, taking gas into account
@@ -323,7 +323,7 @@ def test_make_trade_output(
323323
balance_before = client.get_token_balance(output_token)
324324

325325
r = client.make_trade_output(input_token, output_token, qty, recipient)
326-
tx = web3.eth.waitForTransactionReceipt(r, timeout=30)
326+
tx = web3.eth.wait_for_transaction_receipt(r, timeout=30)
327327
assert tx.status
328328

329329
# TODO: Checks for ETH, taking gas into account

‎uniswap/uniswap.py

Copy file name to clipboardExpand all lines: uniswap/uniswap.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(
9595
raise Exception(f"Unknown netid: {netid}")
9696
logger.info(f"Using {self.w3} ('{self.network}')")
9797

98-
self.last_nonce: Nonce = self.w3.eth.getTransactionCount(self.address)
98+
self.last_nonce: Nonce = self.w3.eth.get_transaction_count(self.address)
9999

100100
# This code automatically approves you for trading on the exchange.
101101
# max_approval is to allow the contract to exchange on your behalf.
@@ -1051,7 +1051,7 @@ def approve(self, token: AddressLike, max_approval: Optional[int] = None) -> Non
10511051
)
10521052
logger.warning(f"Approving {_addr_to_str(token)}...")
10531053
tx = self._build_and_send_tx(function)
1054-
self.w3.eth.waitForTransactionReceipt(tx, timeout=6000)
1054+
self.w3.eth.wait_for_transaction_receipt(tx, timeout=6000)
10551055

10561056
# Add extra sleep to let tx propogate correctly
10571057
time.sleep(1)
@@ -1103,7 +1103,7 @@ def _get_tx_params(self, value: Wei = Wei(0), gas: Wei = Wei(250000)) -> TxParam
11031103
"value": value,
11041104
"gas": gas,
11051105
"nonce": max(
1106-
self.last_nonce, self.w3.eth.getTransactionCount(self.address)
1106+
self.last_nonce, self.w3.eth.get_transaction_count(self.address)
11071107
),
11081108
}
11091109

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.