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

feat: init integration tests #150

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ build-hubble-contracts:
cd .contracts/ && npm ci && npm run generate

run-hardhat-node:
cd .contracts/ && npm run node
mkdir -p ./logs
cd .contracts/ && npm run node >> ../logs/node.log 2>&1 &

deploy-hubble-contracts:
cd .contracts/ && npm run deploy
Expand All @@ -24,6 +25,7 @@ lint:
golangci-lint run ./...

run-database:
docker stop mysql || true && docker rm mysql || true
docker run --name=mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql

init:
Expand All @@ -45,7 +47,12 @@ migrate-up:
migrate-down:
./build/hubble migration down --all

setup: build init load create-database migrate-up
get-submodules:
git submodule init && git submodule update -r

setup: build init load create-database migrate-up reset

setup-integration: run-database get-submodules build-hubble-contracts build-bindings run-hardhat-node deploy-hubble-contracts setup

start:
mkdir -p logs &
Expand Down
23 changes: 23 additions & 0 deletions integration/transfer_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package integration

import "testing"

// Requirements for integration tests
// It is assumed that we have node + golang + docker installed
// Perform setup

func TestTransfers(t *testing.T) {
// create 2 wallets

// perform 2 deposits

// assert for user states and accounts

// assert for tree roots

// create transfer tx

// send to aggregator

// assert for roots
}