Skip to content

Commit

Permalink
fix: change send/decode to node (#2)
Browse files Browse the repository at this point in the history
* fix: change sendd/decode to node

* Update pr-qa-sec.yaml

* fix: CIs

* fix: add need on ensure-code

* fix: pull-request.yaml

Co-authored-by: Matheus Brito <41240291+matbrito@users.noreply.github.com>
  • Loading branch information
2yuri and matbrito authored Oct 21, 2022
1 parent 7ebba21 commit 948465e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 222 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/pr-qa-sec.yaml

This file was deleted.

69 changes: 14 additions & 55 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,19 @@
name: Pull Request

on: [pull_request]
on:
pull_request:
branches:
- develop
- master
push:
branches:
- develop
- master

jobs:
config:
uses: klever-io/workflow-calls/.github/workflows/go-setup.yaml@master
with:
with_vendor: false
with_cache: false
go_private: "github.com/klever-io/*"
ensure-code:
uses: klever-io/workflow-calls/.github/workflows/go-ci.yaml@master
secrets:
git_user: ${{ secrets.GIT_USER }}
git_pass: ${{ secrets.GIT_PASS }}

build:
needs: [config]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-go@v2
with:
go-version: "1.18"

- name: cache vendored dependencies
id: cache-vendor
uses: actions/cache@v2
with:
path: vendor
key: ${{ hashFiles('**/go.sum') }}-${{ secrets.CACHE_VERSION }}

- name: GoImports Formatter
run: |
go install golang.org/x/tools/cmd/goimports@latest
go mod tidy
goimports -w -d $(find . -type f -name '*.go' -not -name '*.pb.go' -not -name '*_setter.go' -not -path "./vendor/*")
# If there are any diffs from goimports or go mod tidy, fail.
- name: Verify no changes from goimports and go mod tidy
run: |
if [ -n "$(git status --porcelain)" ]; then
exit 1
fi
- name: vendor dependencies
run: |
go mod vendor
go install github.com/goware/modvendor@latest
modvendor -copy="**/*.c **/*.h **/*.proto **/*.a" -v
if: steps.cache-vendor.outputs.cache-hit != 'true'

- name: ensure code is buildable
run: |
go vet ./...
- name: ensure all test is passing
run: |
go clean -testcache
go test ./...
sonar_host_url: ${{ secrets.SONAR_HOST_URL }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
twingate_sa: ${{ secrets.TWINGATE_SERVICE_ACCOUNT }}
59 changes: 0 additions & 59 deletions .github/workflows/push-develop.yaml

This file was deleted.

56 changes: 8 additions & 48 deletions .github/workflows/push-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,14 @@ on:
- master

jobs:
config:
uses: klever-io/workflow-calls/.github/workflows/go-setup.yaml@master
with:
with_vendor: false
with_cache: false
go_private: "github.com/klever-io/*"
secrets:
git_user: ${{ secrets.GIT_USER }}
git_pass: ${{ secrets.GIT_PASS }}

build:
needs: [config]
generate-release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GIT_PASS }}
steps:
- uses: actions/checkout@v2

- uses: actions/setup-go@v2
with:
go-version: "1.18"

- name: cache vendored dependencies
id: cache-vendor
uses: actions/cache@v2
- id: release
uses: rymndhng/release-on-push-action@master
with:
path: vendor
key: ${{ hashFiles('**/go.sum') }}-${{ secrets.CACHE_VERSION }}

- name: GoImports Formatter
run: |
go install golang.org/x/tools/cmd/goimports@latest
go mod tidy
goimports -w -d $(find . -type f -name '*.go' -not -name '*.pb.go' -not -name '*_setter.go' -not -path "./vendor/*")
# If there are any diffs from goimports or go mod tidy, fail.
- name: Verify no changes from goimports and go mod tidy
run: |
if [ -n "$(git status --porcelain)" ]; then
exit 1
fi
- name: vendor dependencies
run: |
go mod vendor
go install github.com/goware/modvendor@latest
modvendor -copy="**/*.c **/*.h **/*.proto **/*.a" -v
if: steps.cache-vendor.outputs.cache-hit != 'true'

- name: ensure code is buildable
run: |
go vet ./...
bump_version_scheme: minor
use_github_release_notes: true
tag_prefix: v
41 changes: 0 additions & 41 deletions .github/workflows/reusable.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
.vscode
4 changes: 2 additions & 2 deletions provider/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (kc *kleverChain) Decode(tx *models.Transaction) (*models.TransactionAPI, e
return result.Data.Transaction, nil
}

err = kc.httpClient.Post(fmt.Sprintf("%s/transaction/decode", kc.networkConfig.GetAPIUri()), string(body), nil, &result)
err = kc.httpClient.Post(fmt.Sprintf("%s/transaction/decode", kc.networkConfig.GetNodeUri()), string(body), nil, &result)

return result.Data.Transaction, err
}
Expand Down Expand Up @@ -122,7 +122,7 @@ func (kc *kleverChain) PrepareTransaction(request *models.SendTXRequest) (*model
return nil, err
}

err = kc.httpClient.Post(fmt.Sprintf("%s/transaction/send", kc.networkConfig.GetAPIUri()), string(body), nil, &result)
err = kc.httpClient.Post(fmt.Sprintf("%s/transaction/send", kc.networkConfig.GetNodeUri()), string(body), nil, &result)

return result.Data.Transaction, err
}
Expand Down

0 comments on commit 948465e

Please sign in to comment.