Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions tests/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from zksync_sdk.types.responses import Fee
import asyncio
from web3 import Account, HTTPProvider, Web3
from eth_utils import to_checksum_address

from zksync_sdk import (EthereumProvider, EthereumSignerWeb3, HttpJsonRPCTransport, Wallet, ZkSync,
ZkSyncLibrary, ZkSyncProviderV01, ZkSyncSigner, )
Expand Down Expand Up @@ -386,14 +387,14 @@ async def asyncSetUp(self) -> None:

async def test_approve_deposit(self):
token = Token(
address=Web3.toChecksumAddress('0xeb8f08a975ab53e34d8a0330e0d34de942c95926'),
address=to_checksum_address('0xeb8f08a975ab53e34d8a0330e0d34de942c95926'),
id=20, symbol='USDC',
decimals=18)
assert await self.ethereum_provider.approve_deposit(token, Decimal(1))

async def test_full_exit(self):
token = Token(
address=Web3.toChecksumAddress('0xD2084eA2AE4bBE1424E4fe3CDE25B713632fb988'),
address=to_checksum_address('0xD2084eA2AE4bBE1424E4fe3CDE25B713632fb988'),
id=20, symbol='BAT',
decimals=18)
assert await self.ethereum_provider.full_exit(token, 6713)
Expand All @@ -410,7 +411,7 @@ async def test_full_exit_nft(self):
"""
account_id = 36357
token = Token(
address=Web3.toChecksumAddress('0x5e71f0f9b891f22d79ff8697dd4e3e0db371cda5'),
address=to_checksum_address('0x5e71f0f9b891f22d79ff8697dd4e3e0db371cda5'),
id=70848,
symbol='NFT-70848',
decimals=0
Expand All @@ -419,7 +420,7 @@ async def test_full_exit_nft(self):

async def test_is_deposit_approved(self):
token = Token(
address=Web3.toChecksumAddress('0xD2084eA2AE4bBE1424E4fe3CDE25B713632fb988'),
address=to_checksum_address('0xD2084eA2AE4bBE1424E4fe3CDE25B713632fb988'),
id=20, symbol='BAT',
decimals=18)
assert await self.ethereum_provider.is_deposit_approved(token, 1)
Expand Down
2 changes: 1 addition & 1 deletion zksync_sdk/zksync.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _call_method(self, method_name, *args, amount=None, **kwargs):
transaction.update({'nonce': self.web3.eth.get_transaction_count(self.account.address)})
signed_tx = self.account.sign_transaction(transaction)
txn_hash = self.web3.eth.send_raw_transaction(signed_tx.rawTransaction)
txn_receipt = self.web3.eth.waitForTransactionReceipt(txn_hash)
txn_receipt = self.web3.eth.wait_for_transaction_receipt(txn_hash)
return txn_receipt


Expand Down
3 changes: 2 additions & 1 deletion zksync_sdk/zksync_provider/v01.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from decimal import Decimal
from typing import List, Optional, Union
from web3 import Web3
from eth_utils import to_checksum_address

from zksync_sdk.types import (AccountState, ContractAddress, EncodedTx, EthOpInfo, Fee, Token,
TokenLike, Tokens, TransactionDetails, TransactionWithSignature,
Expand All @@ -28,7 +29,7 @@ async def submit_tx(self, tx: EncodedTx, signature: Union[Optional[TxEthSignatur

async def get_tokens(self) -> Tokens:
data = await self.provider.request("tokens", None)
tokens = [Token(address=Web3.toChecksumAddress(token['address']),
tokens = [Token(address=to_checksum_address(token['address']),
id=token['id'],
symbol=token['symbol'],
decimals=token['decimals']
Expand Down