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

OrderBook Subgraph testing CI #36

Closed
wants to merge 172 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
a21d6ef
added setup with modifications
NanezX Sep 20, 2023
100626d
added older ts tests to be ported
NanezX Sep 20, 2023
b7431fb
removed ts tests
NanezX Sep 30, 2023
785f79a
subgraph cli test flakes
NanezX Oct 2, 2023
79b0eeb
nix flake update
NanezX Oct 2, 2023
05b3ed8
update flake nix
NanezX Oct 3, 2023
d620e2d
nix changes
NanezX Oct 3, 2023
54015bc
test flake
NanezX Oct 3, 2023
5e03321
update lock flake
NanezX Oct 3, 2023
3613d9e
wip nix flake tooling
NanezX Oct 3, 2023
3e5e447
Merge pull request #31 from rainprotocol/2023-30-09-subgraph-cli
NanezX Oct 3, 2023
0365632
Merge branch 'main' into 2023-09-07-sg-setup-repo
NanezX Oct 5, 2023
17a6464
wip
NanezX Oct 6, 2023
d3ead02
wip: updating artifacts for expression deployer
NanezX Oct 6, 2023
6511d07
wip: silent warning
NanezX Oct 6, 2023
782489a
wip: missing await
NanezX Oct 6, 2023
d11aafc
unused ABI
NanezX Oct 6, 2023
9eea91f
wip: queries ob
NanezX Oct 13, 2023
992026c
wip: queries ob
NanezX Oct 13, 2023
70722ae
wip: sg test ci
NanezX Oct 13, 2023
0669cc2
wip: fix misspell docker compose file
NanezX Oct 13, 2023
5e433d9
wip: fix wrong module
NanezX Oct 13, 2023
9687287
wip: removed unused deps in sg package.json
NanezX Oct 14, 2023
ed9ccb0
remove submodule recursive
NanezX Oct 14, 2023
406080d
Merge pull request #32 from rainprotocol/2023-10-13-ci-sg
NanezX Oct 14, 2023
71aa55c
wip: refactor setup - better structuring
NanezX Oct 16, 2023
8049f00
wip: moving test into same file
NanezX Oct 16, 2023
aa98eb5
wip: cbor decoder for rain meta docs
NanezX Oct 17, 2023
29942de
wip: handle response error when decode cbor
NanezX Oct 17, 2023
a6e9147
wip: missing encode rain docs. added queries
NanezX Oct 17, 2023
cb057e7
update subgraph code
NanezX Oct 19, 2023
c7f0ae8
wip: more queries
NanezX Oct 19, 2023
5b2e9e2
decode cbor implementation
NanezX Oct 19, 2023
c180820
improve meta tests
NanezX Oct 19, 2023
796dd52
wip: more queries
NanezX Oct 19, 2023
2076e49
nix command to update abis
NanezX Oct 19, 2023
a26d841
update abis on ci
NanezX Oct 19, 2023
ee19970
fix woring directory nix
NanezX Oct 19, 2023
0a52a56
wip: order queries
NanezX Oct 19, 2023
b7cef60
wip: order response
NanezX Oct 19, 2023
99c7fcb
remove generate sg abis
NanezX Oct 19, 2023
9965493
ignore generated test abi json files
NanezX Oct 19, 2023
997a94e
fixed ERC20Mock for testing
NanezX Oct 19, 2023
6a679c4
removing wait inside queries
NanezX Oct 19, 2023
3e473f1
fix: wrong abi json name in ci
NanezX Oct 19, 2023
44e7823
wip: query for order entities
NanezX Oct 20, 2023
e058dfd
wip: update to borrow tx to get events
NanezX Oct 20, 2023
b03042a
wip: json order
NanezX Oct 20, 2023
b4128ea
wip: fix expression json string
NanezX Oct 20, 2023
12d1299
wip: update get logs
NanezX Oct 20, 2023
3e2d972
wip: expression json string fix
NanezX Oct 20, 2023
ade391a
wip: expression json string fix
NanezX Oct 20, 2023
ba01d3d
wip: expression json string fix
NanezX Oct 20, 2023
dc08507
wip: json string serialization
NanezX Oct 20, 2023
ab27db4
wip: order query add order
NanezX Oct 20, 2023
6cba4c3
query entity order addOrder
NanezX Oct 20, 2023
aff84f4
fix transaction id entity
NanezX Oct 20, 2023
5990468
modularize config generation in tests
NanezX Oct 20, 2023
c3f4156
wip: modularize config tests
NanezX Oct 20, 2023
d75e0ad
wip: add and remove order
NanezX Oct 21, 2023
e9227ec
order remove test
NanezX Oct 21, 2023
c350cab
wip: io query
NanezX Oct 21, 2023
0f364e7
wip: io mod query
NanezX Oct 21, 2023
11b56f8
io query
NanezX Oct 21, 2023
22bd7d4
wip: multicall batch
NanezX Oct 21, 2023
9becc6e
wip: fn selector for multicalls
NanezX Oct 22, 2023
4852c63
fn to build multi order call
NanezX Oct 22, 2023
7e77593
sending multicall
NanezX Oct 22, 2023
fbcdff6
wip: multi order encode working
NanezX Oct 23, 2023
f8872d3
splitted tests
NanezX Oct 23, 2023
e70e474
wip: arbitraries vaultIds
NanezX Oct 23, 2023
cc5c5e1
wip: random vaultIds for token vault tests
NanezX Oct 23, 2023
8cbaa11
wip: random vaultIds for token vault tests
NanezX Oct 23, 2023
f6ea748
back to deploy sg
NanezX Oct 23, 2023
9a1eb36
assign a vault id for est the vailt
NanezX Oct 23, 2023
c52359c
wip: query vault query with different token vault
NanezX Oct 23, 2023
9486499
moving wait for sg sync
NanezX Oct 23, 2023
c8a56ea
test response for vault
NanezX Oct 23, 2023
d9f0bf4
remove unused ethers crate
NanezX Oct 23, 2023
2b6dde0
adding nix command ci-test with single thread
NanezX Oct 23, 2023
4c9b556
removing print
NanezX Oct 23, 2023
3774eca
wip: vault after deposit
NanezX Oct 23, 2023
5ca5cdb
modularize the mint token
NanezX Oct 23, 2023
faccb17
wip: improve encode calls
NanezX Oct 23, 2023
4174f8b
wip: using ethcall abi encoder implement by abigen
NanezX Oct 23, 2023
1b4b95e
wip: multi deposit tx bytes
NanezX Oct 23, 2023
c42d78e
multi call deposit with config
NanezX Oct 23, 2023
ada5baf
wip: query with tx hash
NanezX Oct 23, 2023
15744ec
wip: activate sg deploy ci
NanezX Oct 23, 2023
beb72a6
query test for vault after deposits
NanezX Oct 23, 2023
cf96252
query test for vault after deposits
NanezX Oct 23, 2023
8c2a7bd
testing whole entity after deposit
NanezX Oct 23, 2023
d43d57d
test vault after add order and deposit
NanezX Oct 23, 2023
bf41370
wip: clearing
NanezX Oct 23, 2023
69d0098
obtaining add order events from users
NanezX Oct 24, 2023
f86863d
removing expect from vault entity clear test
NanezX Oct 24, 2023
45b3d2a
removing expect from vault entity clear test
NanezX Oct 24, 2023
47eb1c0
wip: clear function tx
NanezX Oct 25, 2023
95e771c
wip: debug clear order
NanezX Oct 26, 2023
748e1a0
wip:foundry test for clear orders
NanezX Oct 27, 2023
22cbfc1
wip: token match in clear order
NanezX Oct 27, 2023
14eef1e
wip: token match in clear order
NanezX Oct 27, 2023
19ccb1e
wip: reduce io
NanezX Oct 27, 2023
f6b6807
wip clear order with mocks
NanezX Oct 27, 2023
53440de
wip: clear test
NanezX Oct 27, 2023
cca90e2
adding comments to the test
NanezX Oct 27, 2023
277262c
Merge branch 'main' into 2023-09-07-sg-setup-repo
NanezX Oct 29, 2023
1005f8c
wip: rewrite for events decoders
NanezX Oct 30, 2023
9d8fe9b
remove print consoles
NanezX Oct 30, 2023
1b17006
wip: single test
NanezX Oct 30, 2023
a066c56
update response results
NanezX Oct 30, 2023
7d9f107
order clear finished
NanezX Oct 30, 2023
bd3e0e4
get block data
NanezX Oct 30, 2023
f6b1f19
deposit test
NanezX Oct 30, 2023
215c9a9
wip: fix wrong decimals
NanezX Oct 30, 2023
e89a266
wip: fix wrong decimals
NanezX Oct 30, 2023
be2a347
fix to decimals in erc20 entity
NanezX Oct 30, 2023
7d6a82a
fix with erc20 entities and testd not waiting
NanezX Oct 30, 2023
c7b3102
wip: order clear rewrite
NanezX Oct 30, 2023
017d3c4
wip: missing clear entity
NanezX Oct 30, 2023
9926187
Merge branch 'main' into 2023-09-07-sg-setup-repo
NanezX Oct 30, 2023
0168b83
wip: finishing test
NanezX Oct 31, 2023
fce4a26
missing comment clear
NanezX Oct 31, 2023
1c922d2
fix: format erc20 address query
NanezX Oct 31, 2023
40725e1
fix format display numbers
NanezX Oct 31, 2023
0dc0dd9
fix: wrong order hashes
NanezX Nov 1, 2023
0012935
fix wrong convertion
NanezX Nov 1, 2023
435aeef
fix hash kecck256
NanezX Nov 1, 2023
58f90f9
improve take order event
NanezX Nov 1, 2023
0b06b36
fix: deploy expression deployer once
NanezX Nov 1, 2023
a470883
wip: test take order
NanezX Nov 1, 2023
ebb1be6
single deployer across tests
NanezX Nov 1, 2023
25c5da4
single deployer across tests
NanezX Nov 1, 2023
5d265c3
fix: bounty entity
NanezX Nov 1, 2023
ba0149b
clear state changes
NanezX Nov 1, 2023
8250737
clear state changes
NanezX Nov 1, 2023
362d351
missing token vault in take orders
NanezX Nov 1, 2023
d94908b
missing take order entity test
NanezX Nov 1, 2023
be3c832
missing take order entity test
NanezX Nov 1, 2023
e19b252
test in ci
NanezX Nov 1, 2023
1498f2d
fix on context entities
NanezX Nov 1, 2023
b019669
fix: wrong tokens based on perspective
NanezX Nov 1, 2023
d1c2d57
tests finished
NanezX Nov 1, 2023
8f1c73f
wip: context query
NanezX Nov 1, 2023
21fa7cb
test context entity
NanezX Nov 1, 2023
cced33e
finished tests
NanezX Nov 1, 2023
1d7bf72
finished tests
NanezX Nov 1, 2023
6d9de0f
finished tests
NanezX Nov 1, 2023
477c104
fix with parse U256 to Address
NanezX Nov 2, 2023
6f7cfa5
generating schema.json from ci
NanezX Nov 2, 2023
c39f90d
delete old nix shell
NanezX Nov 2, 2023
4093ccc
silent unused functions
NanezX Nov 2, 2023
e0fd224
update sg test workflow
NanezX Nov 2, 2023
159b9b1
wip: ci test generated
NanezX Nov 2, 2023
97a9c6d
wip: ci test generated
NanezX Nov 2, 2023
80f2be7
wip: ci test generated
NanezX Nov 2, 2023
76e9014
wip: check write schema
NanezX Nov 2, 2023
be31ad9
fix to forge fmt check
NanezX Nov 2, 2023
de363fb
Merge branch '2023-09-07-sg-setup-repo' into 2023-11-01-generate-sche…
NanezX Nov 2, 2023
c8caa12
wip: graphql client in nix
NanezX Nov 2, 2023
0ea6b1f
wip: ci tests with schema
NanezX Nov 3, 2023
069fce4
debug ci tests
NanezX Nov 3, 2023
b9373ca
ci debug
NanezX Nov 3, 2023
1d2d812
using fixed schema but generating anyway
NanezX Nov 3, 2023
e7c2d39
wip ci
NanezX Nov 3, 2023
54d447d
missing workflow
NanezX Nov 3, 2023
908db3d
Merge branch '2023-11-01-generate-schema-json' into 2023-11-02-wip-ci-sg
NanezX Nov 3, 2023
b4654fb
Merge pull request #38 from rainprotocol/2023-11-02-wip-ci-sg
NanezX Nov 3, 2023
f16ce04
wip: generate using fixed on repo
NanezX Nov 3, 2023
5289f7c
Revert "wip: generate using fixed on repo"
NanezX Nov 3, 2023
92a3094
Merge pull request #37 from rainprotocol/2023-11-01-generate-schema-json
NanezX Nov 7, 2023
f7030aa
fix deploy command
NanezX Nov 7, 2023
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
45 changes: 45 additions & 0 deletions .github/workflows/subgraph-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: OrderBook Subgraph CI
on: [push]

jobs:
subgraph-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4

- uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Forge shallow install
run: forge install --shallow

- name: Start docker container
run: docker-compose -f subgraph/docker/docker-compose.yaml up -d

- name: Initialize setup
working-directory: ./subgraph
run: nix run .#init-setup

- name: Install rustup stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: install npm dependencies
working-directory: ./subgraph
run: npm install

- name: Run test
working-directory: ./subgraph
run: nix run .#ci-test

- name: Stop docker container
run: docker-compose -f subgraph/docker/docker-compose.yaml down
32 changes: 32 additions & 0 deletions subgraph/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# subgraph
/build
/generated
/subgraph.yaml
/abis/*.json


# Rust generated files
/tests/generated/abigen
# Ignore all JSON files
/tests/generated/*.json
# But include ERC20Mock.json
!/tests/generated/ERC20Mock.json

# npm
/node_modules

# hardhat
/cache

#vscode
.vscode

#docker
/docker/data


# Echidna
/target


/todo.txt
24 changes: 24 additions & 0 deletions subgraph/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Deps
node_modules
lib
out
schema
utils

## Hardhat
cache
artifacts
contracts
typechain

## Subgraph
subgraph.template.yaml
build
generated
./docker
/docker/**/*
/docker/*
/docker/data/postgres
/scripts
contracts
utils
Loading
Loading