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

Fix SDK errors #58

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
8 changes: 4 additions & 4 deletions tests/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,14 @@ async def asyncSetUp(self) -> None:

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

async def test_is_deposit_approved(self):
token = Token(
address=Web3.toChecksumAddress('0xD2084eA2AE4bBE1424E4fe3CDE25B713632fb988'),
address=Web3.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/types/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class NFT(Token):
content_hash: str
creator_address: str
serial_id: int
decimals = 0
decimals: int = 0

def decimal_amount(self, amount: int) -> Decimal:
return Decimal(amount)
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
2 changes: 1 addition & 1 deletion zksync_sdk/zksync_provider/v01.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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=Web3.to_checksum_address(token['address']),
id=token['id'],
symbol=token['symbol'],
decimals=token['decimals']
Expand Down