Skip to content

Commit 4ed5395

Browse files
authored
Merge pull request #667 from rsksmart/flyover-2.1.2
Flyover 2.1.2 -> QA-Test
2 parents e99920c + 40425d7 commit 4ed5395

File tree

184 files changed

+4794
-1540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+4794
-1540
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020

2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424

2525
- name: Set up Go
26-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
26+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
2727
with:
2828
go-version-file: 'go.mod'
2929

@@ -46,14 +46,15 @@ jobs:
4646

4747
steps:
4848
- name: Checkout
49-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5050

5151
- name: Set up Go
52-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
52+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
5353
with:
5454
go-version-file: 'go.mod'
5555

5656
- name: golangci-lint
57-
uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc #v4.0.1
57+
uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae #v6.2.0
5858
with:
59-
version: v1.55.2
59+
version: v1.63.4
60+
skip-pkg-cache: true

.github/workflows/codeql.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "master", "Stable-Test", "QA-Test"]
5+
branches: [ "master", "Stable-Test", "QA-Test", "flyover-*" ]
66
pull_request:
7-
branches: [ "master", "Stable-Test", "QA-Test"]
87
schedule:
98
- cron: "0 0 * * 1"
109

@@ -27,18 +26,18 @@ jobs:
2726

2827
steps:
2928
- name: Checkout
30-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3130

3231
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@5973e2313ac1b9aaedb1f911a1e91228cde07d28 # v2.26.0
32+
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
3433
with:
3534
languages: ${{ matrix.language }}
3635
queries: +security-and-quality
3736

3837
- name: Autobuild
39-
uses: github/codeql-action/autobuild@5973e2313ac1b9aaedb1f911a1e91228cde07d28 # v2.26.0
38+
uses: github/codeql-action/autobuild@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
4039

4140
- name: Perform CodeQL Analysis
42-
uses: github/codeql-action/analyze@5973e2313ac1b9aaedb1f911a1e91228cde07d28 # v2.26.0
41+
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
4342
with:
4443
category: "/language:${{ matrix.language }}"

.github/workflows/dependency-review.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ permissions:
66

77
jobs:
88
dependency-review:
9+
permissions:
10+
contents: read
11+
pull-requests: write
912
runs-on: ubuntu-latest
1013
steps:
1114
- name: 'Checkout Repository'
12-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1316
- name: 'Dependency Review'
14-
uses: actions/dependency-review-action@72eb03d02c7872a771aacd928f3123ac62ad6d3a # v4.3.3
17+
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
1518
with:
1619
comment-summary-in-pr: true

.github/workflows/deploy-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818

1919
steps:
2020
- name: Checkout code
21-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222

2323
- name: Configure AWS credentials
24-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
24+
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
2525
with:
2626
role-to-assume: ${{ secrets.DEV_ROLE_ARN }}
2727
aws-region: ${{ secrets.AWS_REGION }}

.github/workflows/e2e.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@ on:
66
pull_request:
77
branches: [ QA-Test, Stable-Test, master ]
88

9+
permissions: read-all
10+
911
jobs:
1012
e2e-test:
1113
name: Server initialization and health check
1214
runs-on: ubuntu-latest
1315
steps:
1416
- name: Checkout
15-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1618

1719
- name: Set up Go
18-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
20+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
1921
with:
2022
go-version-file: 'go.mod'
2123

2224
- name: Update env file
23-
run: cd docker-compose/local/ && ./gh-action-env.sh ${{ secrets.GITHUB_TOKEN }}
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: cd docker-compose/local/ && ./gh-action-env.sh $GITHUB_TOKEN
2428

2529
- name: Building LPS environment...
2630
run: cd docker-compose/local/ && LPS_STAGE=regtest sh lps-env.sh up

.github/workflows/scorecard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: "Checkout code"
25-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626
with:
2727
persist-credentials: false
2828

@@ -34,13 +34,13 @@ jobs:
3434
publish_results: true
3535

3636
- name: "Upload artifact"
37-
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
37+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
3838
with:
3939
name: SARIF file
4040
path: results.sarif
4141
retention-days: 5
4242

4343
- name: "Upload to code-scanning"
44-
uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
44+
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
4545
with:
4646
sarif_file: results.sarif

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ build/
2323
/utils/*
2424
/**/.env.regtest
2525
/**/gh_token.txt
26+
/**/geth_keystore/
2627
/**/local/cookie_jar.txt
2728
!sample-config.env
2829
/**/*.env

.golangci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,30 @@ run:
22
allow-parallel-runners: true
33
timeout: 3m
44
tests: true
5-
skip-dirs:
5+
issues:
6+
exclude-dirs:
67
- internal/adapters/dataproviders/rootstock/bindings
8+
- test/mocks
79
linters:
810
presets:
911
- bugs
1012
- complexity
1113
- unused
1214
- performance
1315
linters-settings:
16+
errcheck:
17+
check-type-assertions: true
18+
check-blank: true
19+
govet:
20+
enable:
21+
- nilness
22+
- defers
23+
- lostcancel
24+
- nilfunc
25+
- shadow
26+
- unusedwrite
1427
exhaustive:
15-
default-signifies-exhaustive: true
28+
default-signifies-exhaustive: true
29+
gosec:
30+
excludes:
31+
- G115 # TODO update project to cast safely

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/golangci/golangci-lint
3-
rev: v1.55.2
3+
rev: v1.63.4
44
hooks:
55
- id: golangci-lint-full
66
- repo: https://github.com/commitizen-tools/commitizen

Makefile

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
.PHONY: test all clean
1+
.PHONY: test all clean utils
22

33
COVER_FILE = coverage/cover.out
44
TEMPORAL_COVER_FILE =$(shell pwd)/coverage/cover.out.temp
55

66
filter_coverage_file = grep -v "internal/adapters/dataproviders/rootstock/bindings" $(1) > coverage/temp.txt && mv coverage/temp.txt $(1)
77

8+
define utils_build
9+
CGO_ENABLED=0 go build -v -o ./utils/update_provider_url ./cmd/utils/update_provider_url/update_provider_url.go
10+
CGO_ENABLED=0 go build -v -o ./utils/register_pegin ./cmd/utils/register_pegin/register_pegin.go
11+
CGO_ENABLED=0 go build -v -o ./utils/refund_user_pegout ./cmd/utils/refund_user_pegout/refund_user_pegout.go
12+
CGO_ENABLED=0 go build -v -o ./utils/key_conversion ./cmd/utils/key_conversion/key_conversion.go
13+
endef
14+
815
tools: download
916
go install github.com/parvez3019/go-swagger3@fef3d30b0707883c389261bf26297eebd10d7216 #v1.0.3
1017
go install golang.org/x/vuln/cmd/govulncheck@latest
1118
pip3 install pre-commit && pre-commit install
12-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.55.2
19+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.63.4
1320
brew install mockery && brew upgrade mockery # installation with brew is because mockery team doesnt recommend to install with go install, if you don't have brew feel free to comment this line and install mockery with other method
1421

1522
download:
@@ -23,12 +30,17 @@ validation: lint
2330
go mod verify
2431
govulncheck ./... # should fail on non informational vulnerabilities
2532

33+
COMMIT_TAG ?= $(shell git describe --exact-match --tags)
2634
COMMIT_HASH ?= $(shell git rev-parse HEAD)
2735
SOURCE_VERSION := $(COMMIT_HASH)
36+
SOURCE_TAG := $(COMMIT_TAG)
37+
2838
build: download
2939
mkdir -p build && cd build
30-
@echo "Building liquidity-provider-server $(SOURCE_VERSION)"
31-
CGO_ENABLED=0 go build -v -installsuffix 'static' -ldflags="-s -X 'main.BuildVersion=$(SOURCE_VERSION)' -X 'main.BuildTime=$(shell date)'" -o ./build/liquidity-provider-server ./cmd/application/main.go
40+
@echo "Building liquidity-provider-server $(SOURCE_TAG) ($(SOURCE_VERSION))"
41+
CGO_ENABLED=0 go build -v -installsuffix 'static' \
42+
-ldflags="-s -X 'main.BuildVersion=$(SOURCE_VERSION)' -X 'main.BuildTime=$(shell date)' -X 'github.com/rsksmart/liquidity-provider-server/internal/usecases/liquidity_provider.BuildVersion=$(SOURCE_TAG)' -X 'github.com/rsksmart/liquidity-provider-server/internal/usecases/liquidity_provider.BuildRevision=$(SOURCE_VERSION)'" \
43+
-o ./build/liquidity-provider-server ./cmd/application/main.go
3244

3345
api:
3446
go-swagger3 --module-path . \
@@ -38,26 +50,40 @@ api:
3850

3951
coverage: clean
4052
mkdir -p coverage
41-
go test -v -race -covermode=atomic -coverpkg=./pkg/...,./internal/...,./cmd/... -coverprofile=$(TEMPORAL_COVER_FILE) ./pkg/... ./internal/... ./cmd/...
53+
go test -timeout 30m -v -race -covermode=atomic -coverpkg=./pkg/...,./internal/...,./cmd/... -coverprofile=$(TEMPORAL_COVER_FILE) ./pkg/... ./internal/... ./cmd/...
4254
$(call filter_coverage_file, $(TEMPORAL_COVER_FILE))
4355
go tool cover -func "$(TEMPORAL_COVER_FILE)" && go tool cover -html="$(TEMPORAL_COVER_FILE)"
4456
rm $(TEMPORAL_COVER_FILE)
4557

4658
coverage-report: clean
4759
mkdir -p coverage
48-
go test -v -race -covermode=atomic -coverpkg=./pkg/...,./internal/...,./cmd/... -coverprofile=$(COVER_FILE) ./pkg/... ./internal/... ./cmd/...
60+
go test -timeout 30m -v -race -covermode=atomic -coverpkg=./pkg/...,./internal/...,./cmd/... -coverprofile=$(COVER_FILE) ./pkg/... ./internal/... ./cmd/...
4961
$(call filter_coverage_file, $(COVER_FILE))
5062

5163
test: clean
5264
mkdir -p coverage
53-
go test -v -race -covermode=atomic -coverpkg=./pkg/...,./internal/...,./cmd/... -coverprofile=$(TEMPORAL_COVER_FILE) ./pkg/... ./internal/... ./cmd/...
65+
go test -timeout 30m -v -race -covermode=atomic -coverpkg=./pkg/...,./internal/...,./cmd/... -coverprofile=$(TEMPORAL_COVER_FILE) ./pkg/... ./internal/... ./cmd/...
5466
$(call filter_coverage_file, $(TEMPORAL_COVER_FILE))
5567
go tool cover -func $(TEMPORAL_COVER_FILE)
5668
rm $(TEMPORAL_COVER_FILE)
5769

5870
clean:
5971
rm -rf build $(TEMPORAL_COVER_FILE)
6072

61-
utils:
62-
mkdir -p utils && cd utils
63-
CGO_ENABLED=0 go build -v -o ./utils/update_provider_url ./cmd/utils/update_provider_url.go
73+
utils: download
74+
rm -rf utils
75+
mkdir -p utils
76+
$(utils_build)
77+
78+
utils-docker:
79+
rm -rf utils
80+
mkdir -p utils
81+
docker build -f docker-compose/utils/Dockerfile --output=utils .
82+
83+
MONITOR_PORT ?= 8090
84+
monitoring:
85+
docker build -f docker-compose/monitoring/Dockerfile -t monitoring .
86+
docker run \
87+
-p $(MONITOR_PORT):$(MONITOR_PORT) \
88+
-e MONITOR_PORT=$(MONITOR_PORT) \
89+
monitoring

0 commit comments

Comments
 (0)