Skip to content

Commit

Permalink
add paraswap log (#7)
Browse files Browse the repository at this point in the history
* add paraswap log

* add parser to worker
  • Loading branch information
ductm54 authored Mar 21, 2023
1 parent 6ea974e commit 14d673c
Show file tree
Hide file tree
Showing 10 changed files with 557 additions and 21 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
branch_tag: ${{ steps.get_tag.outputs.branch_tag }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Extract branch
shell: bash
Expand Down Expand Up @@ -75,15 +75,15 @@ jobs:
- name: Add git config for Go private module
run: git config --global url."https://${{ secrets.GH_PAT }}:x-oauth-basic@github.com/".insteadOf https://github.com/
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: "1.19.x"
go-version: "1.20.x"
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: v1.46.2
version: v1.51.1
args: --config=.golangci.yml
skip-pkg-cache: true
skip-build-cache: true
Expand All @@ -108,11 +108,11 @@ jobs:
- prepare
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: "1.19.x"
go-version: "1.20.x"
- name: Run test
run: go test -race -v ./...

Expand All @@ -126,7 +126,7 @@ jobs:
COMMIT_TAG: ${{ needs.prepare.outputs.commit_tag }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Prepare images
id: images
shell: bash
Expand Down Expand Up @@ -172,14 +172,14 @@ jobs:
run: gcloud auth configure-docker

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-${{ env.SERVICE }}-buildx
if: github.event_name != 'pull_request'

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
push: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
runs-on: [ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master
Expand All @@ -55,13 +55,13 @@ jobs:
run: gcloud auth configure-docker

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-${{ env.SERVICE }}-buildx

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
push: true
Expand Down Expand Up @@ -94,14 +94,14 @@ jobs:
VERSION_TAG: ${{ needs.prepare.outputs.version_tag }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: "1.19.x"
go-version: "1.20.x"

- name: Setup Git
run: |
Expand Down
2 changes: 2 additions & 0 deletions cmd/tradelogs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/KyberNetwork/tradelogs/internal/dbutil"
"github.com/KyberNetwork/tradelogs/internal/evmlistenerclient"
"github.com/KyberNetwork/tradelogs/internal/parser/kyberswap"
"github.com/KyberNetwork/tradelogs/internal/parser/paraswap"
"github.com/KyberNetwork/tradelogs/internal/parser/tokenlon"
"github.com/KyberNetwork/tradelogs/internal/parser/zxotc"
"github.com/KyberNetwork/tradelogs/internal/parser/zxrfq"
Expand Down Expand Up @@ -68,6 +69,7 @@ func run(c *cli.Context) error {
zxotc.MustNewParser(),
zxrfq.MustNewParser(),
tokenlon.MustNewParser(),
paraswap.MustNewParser(),
)
if err != nil {
l.Errorw("Error while init worker")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/KyberNetwork/tradelogs

go 1.19
go 1.20

require (
github.com/KyberNetwork/cclog v1.0.1
Expand Down
51 changes: 51 additions & 0 deletions internal/parser/paraswap/abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "orderHash",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "maker",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "makerAsset",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "makerAmount",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "taker",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "takerAsset",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "takerAmount",
"type": "uint256"
}
],
"name": "OrderFilled",
"type": "event"
}
]
1 change: 1 addition & 0 deletions internal/parser/paraswap/gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abigen --abi=abi.json --pkg=paraswap --out=paraswap.go -type OrderFilled
Loading

0 comments on commit 14d673c

Please sign in to comment.