Skip to content

Commit

Permalink
Merge pull request #270 from multiversx/feat/v3
Browse files Browse the repository at this point in the history
Feat/v3
  • Loading branch information
iulianpascalau authored Nov 14, 2024
2 parents 2f32d82 + 4394136 commit 59e4ee6
Show file tree
Hide file tree
Showing 244 changed files with 36,325 additions and 3,957 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.17.6
go-version: 1.20.7
id: go

- name: Check out code into the Go module directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.17.6
go-version: 1.20.7
id: go

- name: Check out code into the Go module directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.17.6
go-version: 1.20.7
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17.6
go-version: 1.20.7
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.45.2
version: v1.53.2

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:

jobs:
test:
name: Unit
name: Unit & Integration
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.17.6
go-version: 1.20.7
id: go

- name: Check out code
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/slow-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests

on:
push:
branches: [ main, feat/* ]
pull_request:
branches: [ main, feat/* ]

jobs:
test:
name: Slow
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.20.7
id: go

- name: Check out code
uses: actions/checkout@v3

- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Slow tests
run: make slow-tests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
/esdata
.env
*.log
# prevent accidental commit of key files
*.pem

mytestnet/**

Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ build-cmd:
(cd cmd && go build)

clean-test:
go clean -testcache ./...

clean: clean-test
go clean -cache ./...
go clean ./...
go clean -testcache

test: clean-test
go test ./...
Expand All @@ -21,6 +17,11 @@ test-coverage:
@echo "Running unit tests"
CURRENT_DIRECTORY=$(CURRENT_DIRECTORY) go test -cover -coverprofile=coverage.txt -covermode=atomic -v ${TESTS_TO_RUN}

slow-tests: clean-test
@docker compose -f docker/docker-compose.yml build
@docker compose -f docker/docker-compose.yml up & go test ./integrationTests/... -v -timeout 40m -tags slow
@docker compose -f docker/docker-compose.yml down -v

lint-install:
ifeq (,$(wildcard test -f bin/golangci-lint))
@echo "Installing golint"
Expand Down
8 changes: 4 additions & 4 deletions api/gin/webServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ var log = logger.GetOrCreate("api")
type ArgsNewWebServer struct {
Facade shared.FacadeHandler
ApiConfig config.ApiRoutesConfig
AntiFloodConfig config.AntifloodConfig
AntiFloodConfig config.WebAntifloodConfig
}

type webServer struct {
sync.RWMutex
facade shared.FacadeHandler
apiConfig config.ApiRoutesConfig
antiFloodConfig config.AntifloodConfig
antiFloodConfig config.WebAntifloodConfig
httpServer chainShared.HttpServerCloser
groups map[string]shared.GroupHandler
cancelFunc func()
Expand Down Expand Up @@ -116,9 +116,9 @@ func (ws *webServer) StartHttpServer() error {

ws.registerRoutes(engine)

server := &http.Server{Addr: ws.facade.RestApiInterface(), Handler: engine}
serverInstance := &http.Server{Addr: ws.facade.RestApiInterface(), Handler: engine}
log.Debug("creating gin web sever", "interface", ws.facade.RestApiInterface())
ws.httpServer, err = NewHttpServer(server)
ws.httpServer, err = NewHttpServer(serverInstance)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion api/gin/webServer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func createMockArgsNewWebServer() ArgsNewWebServer {
},
APIPackages: make(map[string]config.APIPackageConfig),
},
AntiFloodConfig: config.AntifloodConfig{
AntiFloodConfig: config.WebAntifloodConfig{
Enabled: true,
WebServer: config.WebServerAntifloodConfig{
SimultaneousRequests: 1,
Expand Down
Loading

0 comments on commit 59e4ee6

Please sign in to comment.