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

Make test_full_required_deposit_fee more flexible #66

Merged
merged 3 commits into from
Apr 24, 2024
Merged
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
13 changes: 5 additions & 8 deletions tests/integration/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,14 @@ def test_deposit_token(self):
self.assertGreater(balance_l2_after, balance_l2_beore)

def test_full_required_deposit_fee(self):
fee_data = FullDepositFee(
base_cost=285096500000000,
l1_gas_limit=110581,
l2_gas_limit=570193,
max_fee_per_gas=1500000010,
max_priority_fee_per_gas=1500000000,
)
fee = self.wallet.get_full_required_deposit_fee(
DepositTransaction(token=ADDRESS_DEFAULT, to=self.wallet.address)
)
self.assertEqual(fee, fee_data)
self.assertTrue(fee.base_cost > 0)
self.assertTrue(fee.l1_gas_limit > 0)
self.assertTrue(fee.l2_gas_limit > 0)
self.assertTrue(fee.max_fee_per_gas > 0)
self.assertTrue(fee.max_priority_fee_per_gas > 0)

def test_transfer_eth(self):
amount = 7_000_000_000
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/test_zksync_web3.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,6 @@ def test_contract_factory(self):
def test_get_all_account_balances(self):
balances = self.web3.zksync.zks_get_all_account_balances(self.account.address)

# @skip("Integration test, used for develop purposes only")
def test_get_token_price(self):
price = self.web3.zksync.zks_get_token_price(self.ETH_TOKEN.l2_address)

# @skip("Integration test, used for develop purposes only")
def test_get_l1_chain_id(self):
l1_chain_id = self.web3.zksync.zks_l1_chain_id()
Expand Down
42 changes: 21 additions & 21 deletions zksync2/module/zksync_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ class ZkSync(Eth, ABC):
request_formatters=zksync_get_request_formatters,
result_formatters=zksync_get_result_formatters,
)
_zks_get_proof: Method[
Callable[[HexStr, List[HexStr], int], StorageProof]
] = Method(
zks_get_proof_rpc,
mungers=[default_root_munger],
request_formatters=zksync_get_request_formatters,
_zks_get_proof: Method[Callable[[HexStr, List[HexStr], int], StorageProof]] = (
Method(
zks_get_proof_rpc,
mungers=[default_root_munger],
request_formatters=zksync_get_request_formatters,
)
)
_zks_estimate_gas_l1_to_l2: Method[Callable[[Transaction], int]] = Method(
zks_estimate_gas_l1_to_l2_rpc,
Expand All @@ -400,12 +400,12 @@ class ZkSync(Eth, ABC):
zks_l1_chain_id_rpc, mungers=None
)

_zks_get_all_account_balances: Method[
Callable[[Address], ZksAccountBalances]
] = Method(
zks_get_all_account_balances_rpc,
mungers=[default_root_munger],
result_formatters=zksync_get_result_formatters,
_zks_get_all_account_balances: Method[Callable[[Address], ZksAccountBalances]] = (
Method(
zks_get_all_account_balances_rpc,
mungers=[default_root_munger],
result_formatters=zksync_get_result_formatters,
)
)

_zks_get_bridge_contracts: Method[Callable[[], ZksBridgeAddresses]] = Method(
Expand Down Expand Up @@ -437,12 +437,12 @@ class ZkSync(Eth, ABC):
mungers=[default_root_munger],
request_formatters=zksync_get_request_formatters,
)
_eth_get_transaction_receipt: Method[
Callable[[HexStr], ZksTransactionReceipt]
] = Method(
eth_get_transaction_receipt_rpc,
mungers=[default_root_munger],
result_formatters=zksync_get_result_formatters,
_eth_get_transaction_receipt: Method[Callable[[HexStr], ZksTransactionReceipt]] = (
Method(
eth_get_transaction_receipt_rpc,
mungers=[default_root_munger],
result_formatters=zksync_get_result_formatters,
)
)
_eth_get_transaction_by_hash: Method[Callable[[HexStr], ZksTransactions]] = Method(
eth_get_transaction_by_hash_rpc,
Expand All @@ -457,9 +457,9 @@ class ZkSync(Eth, ABC):
Callable[[Address], ContractSourceDebugInfo]
] = Method(zks_get_contract_debug_info_rpc, mungers=[default_root_munger])

_zks_get_transaction_trace: Method[
Callable[[Address], ZksTransactionTrace]
] = Method(zks_get_transaction_trace_rpc, mungers=[default_root_munger])
_zks_get_transaction_trace: Method[Callable[[Address], ZksTransactionTrace]] = (
Method(zks_get_transaction_trace_rpc, mungers=[default_root_munger])
)

_zks_get_testnet_paymaster_address: Method[Callable[[], HexStr]] = Method(
zks_get_testnet_paymaster_address, mungers=[default_root_munger]
Expand Down
Loading