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

Provide Bridgehub support #70

Merged
merged 15 commits into from
Jun 6, 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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Run tests
on:
push:
branches: [ main, beta ]
branches: [ master, beta ]
workflow_dispatch:
pull_request:
branches: [ main, beta ]
branches: [ master, beta ]
types: [ opened, reopened, synchronize ]

permissions:
Expand All @@ -30,7 +30,7 @@ jobs:
run: |
git clone https://github.com/matter-labs/local-setup.git
pushd local-setup
./start.sh
./start-zk-chains.sh
popd
- name: Prepare environment
run: make prepare-environment
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ check-code-format:
black --check zksync2 scripts tests

format-code:
black zksync2 scripts tests

wait:
python scripts/wait.py
black zksync2 scripts tests
27 changes: 24 additions & 3 deletions scripts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def main():
from zksync2.module.module_builder import ZkSyncBuilder
from zksync2.signer.eth_signer import PrivateKeyEthSigner

zksync = ZkSyncBuilder.build("http://127.0.0.1:3050")
eth_web3 = Web3(Web3.HTTPProvider("http://127.0.0.1:8545"))
zksync = ZkSyncBuilder.build("http://127.0.0.1:15100")
eth_web3 = Web3(Web3.HTTPProvider("http://127.0.0.1:15045"))
account: LocalAccount = Account.from_key(
"0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110"
)
Expand All @@ -41,16 +41,37 @@ def main():

def deposit_token(wallet, eth_web3: Web3, zksync: Web3, zksync_contract):
from zksync2.core.types import DepositTransaction
from zksync2.manage_contracts.utils import get_test_net_erc20_token
from zksync2.core.types import EthBlockParams

amount = 50
amount = 100
l1_address = load_token()

token_contract = eth_web3.eth.contract(
Web3.to_checksum_address(l1_address), abi=get_test_net_erc20_token()
)
mint_tx = token_contract.functions.mint(wallet.address, 10000).build_transaction(
{
"nonce": eth_web3.eth.get_transaction_count(
wallet.address, EthBlockParams.LATEST.value
),
"from": wallet.address,
"maxPriorityFeePerGas": 1_000_000,
"maxFeePerGas": eth_web3.eth.gas_price,
}
)

signed = wallet.sign_transaction(mint_tx)
tx_hash = eth_web3.eth.send_raw_transaction(signed.rawTransaction)
eth_web3.eth.wait_for_transaction_receipt(tx_hash, timeout=240, poll_latency=0.5)

tx_hash = wallet.deposit(
DepositTransaction(
Web3.to_checksum_address(l1_address),
amount,
wallet.address,
approve_erc20=True,
approve_base_erc20=True,
refund_recipient=wallet.address,
)
)
Expand Down
41 changes: 0 additions & 41 deletions scripts/wait.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/integration/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ class TestEnvironment:


LOCAL_ENV = TestEnvironment(
EnvType.LOCAL_HOST, "http://127.0.0.1:3050", "http://127.0.0.1:8545"
EnvType.LOCAL_HOST, "http://localhost:15100", "http://127.0.0.1:15045"
)
Loading
Loading