diff --git a/.github/workflows/zksync-integration-test.yml b/.github/workflows/zksync-integration-test.yml index 7f82456d..0e7a3e18 100644 --- a/.github/workflows/zksync-integration-test.yml +++ b/.github/workflows/zksync-integration-test.yml @@ -3,9 +3,9 @@ on: push: branches: - main - - develop - pull_request: - types: [opened, synchronize, reopened] + # - develop + # pull_request: + # types: [opened, synchronize, reopened] workflow_dispatch: defaults: @@ -87,6 +87,8 @@ jobs: echo sleeping 250 to wait for ./start to setup sleep 250 + cat docker_output.log + export ZKSYNC_DIAMOND_PROXY_ADDRESS=$(cat docker_output.log | sed -n 's/.*CONTRACTS_DIAMOND_PROXY_ADDR=\(0x[a-fA-F0-9]*\).*/\1/p') echo stored ZKSYNC_DIAMOND_PROXY_ADDRESS variable: echo $ZKSYNC_DIAMOND_PROXY_ADDRESS diff --git a/.github/workflows/zksync-scripts/claim_payment.sh b/.github/workflows/zksync-scripts/claim_payment.sh index 696a916a..2abda169 100755 --- a/.github/workflows/zksync-scripts/claim_payment.sh +++ b/.github/workflows/zksync-scripts/claim_payment.sh @@ -15,7 +15,7 @@ echo "Withdrawing $BRIDGE_AMOUNT_ETH ETH" # == $BRIDGE_AMOUNT_WEI WEI" cast send --rpc-url $ETHEREUM_RPC --private-key $ETHEREUM_PRIVATE_KEY --gas-price 2000000000 \ $PAYMENT_REGISTRY_PROXY_ADDRESS "claimPaymentZKSync(uint256, address, uint256, uint256, uint256)" \ "0" $USER_ETHEREUM_PUBLIC_ADDRESS $BRIDGE_AMOUNT_WEI 2000000 800 \ - --value 5000000000000000000 > /dev/null + --value 5000000000000000000 BALANCE_ESCROW_L2_AFTER_CLAIMPAYMENT_WEI=$(cast balance --rpc-url http://localhost:3050 $ZKSYNC_ESCROW_CONTRACT_ADDRESS) #for assert.sh BALANCE_ESCROW_L2_AFTER_CLAIMPAYMENT=$(cast balance --rpc-url http://localhost:3050 --ether $ZKSYNC_ESCROW_CONTRACT_ADDRESS) #for logging diff --git a/contracts/zksync/hardhat.config.ts b/contracts/zksync/hardhat.config.ts index a40bf3d8..a95bfe77 100644 --- a/contracts/zksync/hardhat.config.ts +++ b/contracts/zksync/hardhat.config.ts @@ -44,7 +44,7 @@ const config: HardhatUserConfig = { }, }, zksolc: { - version: "latest", + version: "1.4.0", settings: { // find all available options in the official documentation // https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-solc.html#configuration diff --git a/mm-bot/Makefile b/mm-bot/Makefile index 2ea28b19..8f713e30 100644 --- a/mm-bot/Makefile +++ b/mm-bot/Makefile @@ -45,3 +45,7 @@ create_db: docker run --name $(container) -e POSTGRES_PASSWORD=$(password) -e POSTGRES_USER=$(user) -p 5432:5432 -d postgres sleep 5 # Wait for the PostgreSQL container to start (you can adjust this as needed) docker exec -it $(container) psql -U $(user) -c 'CREATE DATABASE "$(database)" WITH ENCODING "UTF-8";' + +tests: + @echo "Running tests..." + pytest ./tests/*_test.py diff --git a/mm-bot/README.md b/mm-bot/README.md index 756beee3..c96a0eea 100644 --- a/mm-bot/README.md +++ b/mm-bot/README.md @@ -120,9 +120,9 @@ To start the Bot, you can use the following command: make run ``` -## Test [TODO] +## Test To run the tests, you can use the following command: ```bash - +make tests ``` diff --git a/mm-bot/src/config/constants.py b/mm-bot/src/config/constants.py index 3344e386..d38f781e 100644 --- a/mm-bot/src/config/constants.py +++ b/mm-bot/src/config/constants.py @@ -41,3 +41,5 @@ LOGGING_DIRECTORY = os.getenv('LOGGING_DIRECTORY') PAYMENT_CLAIMER = os.getenv('PAYMENT_CLAIMER') + +SQL_LITE_DATABASE_URL = "sqlite:///:memory:" diff --git a/mm-bot/src/config/testing_config.py b/mm-bot/src/config/testing_config.py new file mode 100644 index 00000000..98519dbf --- /dev/null +++ b/mm-bot/src/config/testing_config.py @@ -0,0 +1,11 @@ +from sqlalchemy import create_engine +from sqlalchemy.orm import sessionmaker, declarative_base +from config import constants + +Engine = create_engine( + constants.SQL_LITE_DATABASE_URL, connect_args={"check_same_thread": False} +) + +SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=Engine) + +Base = declarative_base()