Skip to content

Commit

Permalink
Update go workflow files versions
Browse files Browse the repository at this point in the history
Signed-off-by: Stanislav Viyachev <[email protected]>
  • Loading branch information
Coiling-Dragon committed Nov 9, 2023
1 parent 942f142 commit d306be2
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 43 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/go-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
name: Setup GO Env
with:
go-version: '1.18'
go-version: '1.20'
- name: Cache Go modules
uses: actions/cache@v2
with:
Expand All @@ -19,7 +19,7 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Build hedera-eth-bridge-validator
run: go build -i -o validator cmd/*
run: go build -o validator cmd/*
- name: Upload Binary as artifact
uses: actions/upload-artifact@master
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
name: Setup GO Env
with:
go-version: '1.18'
go-version: '1.20'
- name: Cache Go Test modules
uses: actions/cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mainnet-deploy-to-vms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
deploy_mainnet_dave:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mainnet-release-gcr-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: |
! contains(github.event.release.tag_name, '-rc-')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/outdated-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
go-mod-outdated:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
name: Setup GO Env
with:
go-version: '1.18'
go-version: '1.20'
- name: Run go-mod-outdated
run: go list -u -m -json all | docker run --rm -i psampaz/go-mod-outdated -update -direct -ci
6 changes: 3 additions & 3 deletions .github/workflows/run-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
name: Setup GO Env
with:
go-version: '1.18'
go-version: '1.20'
- name: Cache Go E2E Test modules
uses: actions/cache@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/staticcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: WillAbides/setup-go-faster@v1.8.0
- uses: WillAbides/setup-go-faster@v1.9.1
with:
go-version: "1.18.x"
go-version: "1.20"
- uses: dominikh/[email protected]
with:
checks: "all,-ST*,-S1002,-S1005,-S1008,-S1023,-S1039,-U1000"
version: "2022.1.3"
install-go: false
install-go: true
8 changes: 4 additions & 4 deletions .github/workflows/testnet-deploy-to-vms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
deploy_testnet_alice:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
deploy_testnet_bob:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
deploy_testnet_carol:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
deploy_testnet_dave:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testnet-release-gcr-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: |
contains(github.event.release.tag_name, '-rc-')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions app/clients/hedera/mirror-node/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package mirror_node
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"
"time"
Expand Down Expand Up @@ -622,5 +622,5 @@ func (c Client) getTopicMessagesByQuery(query string) ([]message.Message, error)
func readResponseBody(response *http.Response) ([]byte, error) {
defer response.Body.Close()

return ioutil.ReadAll(response.Body)
return io.ReadAll(response.Body)
}
3 changes: 1 addition & 2 deletions app/helper/http/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"bytes"
"encoding/json"
"io"
"io/ioutil"
)

func EncodeBodyContent(content interface{}) (io.ReadCloser, error) {
Expand All @@ -30,7 +29,7 @@ func EncodeBodyContent(content interface{}) (io.ReadCloser, error) {
return nil, encodeErr
}
encodedResponseReader := bytes.NewReader(encodedResponseBuffer.Bytes())
encodedResponseReaderCloser := ioutil.NopCloser(encodedResponseReader)
encodedResponseReaderCloser := io.NopCloser(encodedResponseReader)

return encodedResponseReaderCloser, nil
}
6 changes: 3 additions & 3 deletions app/router/transfer-reset/transfer-reset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/json"
"errors"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"testing"
Expand Down Expand Up @@ -51,7 +51,7 @@ func Test_GetTransferSuccess(t *testing.T) {
handler(w, req)
res := w.Result()
defer res.Body.Close()
data, _ := ioutil.ReadAll(res.Body)
data, _ := io.ReadAll(res.Body)

assert.Equal(t, http.StatusOK, res.StatusCode)
assert.Equal(t, "OK", string(data))
Expand Down Expand Up @@ -146,7 +146,7 @@ func Test_GetTransferSuccess_FailsWithEmptyPassword(t *testing.T) {
"SourceChainId": 1,
"TargetChainId": 2,
"SourceToken": "token",
"Password": "",
"Password": "",
}

reqBody, _ := json.Marshal(body)
Expand Down
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package config

import (
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -64,7 +63,7 @@ func GetConfig(config interface{}, path string) error {
log.Fatal(err)
}

yamlFile, err := ioutil.ReadFile(filename)
yamlFile, err := os.ReadFile(filename)
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion config/loggcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ func (f *GCEFormatter) Format(entry *logrus.Entry) ([]byte, error) {
return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err)
}
return append(serialized, '\n'), nil
}
}
4 changes: 2 additions & 2 deletions e2e/clients/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package clients
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"time"
)
Expand Down Expand Up @@ -68,5 +68,5 @@ func (v *Validator) get(url string) ([]byte, error) {
return nil, fmt.Errorf("GET resolved with status [%d].", response.StatusCode)
}

return ioutil.ReadAll(response.Body)
return io.ReadAll(response.Body)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ package main
import (
"flag"
"fmt"
"math"
"os"
"strconv"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/limechain/hedera-eth-bridge-validator/app/clients/evm"
Expand All @@ -30,9 +34,6 @@ import (
"github.com/limechain/hedera-eth-bridge-validator/scripts/bridge/setup/parser"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
"io/ioutil"
"math"
"strconv"
)

const (
Expand Down Expand Up @@ -101,7 +102,7 @@ func createOutputFile(extendedBridgeCfg *parser.ExtendedBridge) {
if err != nil {
panic(fmt.Sprintf("Failed to marshal extended bridge config to yaml. Err: [%s]", err))
}
err = ioutil.WriteFile(outputFilePath, extendedBridgeYml, 0644)
err = os.WriteFile(outputFilePath, extendedBridgeYml, 0644)
if err != nil {
panic(fmt.Sprintf("failed to write new-bridge.yml file. Err: [%s]", err))
}
Expand Down
9 changes: 5 additions & 4 deletions scripts/bridge/update-config/cmd/prepare-update-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import (
"encoding/hex"
"flag"
"fmt"
"os"
"time"

"github.com/hashgraph/hedera-sdk-go/v2"
"github.com/limechain/hedera-eth-bridge-validator/scripts/bridge/update-config"
update_config "github.com/limechain/hedera-eth-bridge-validator/scripts/bridge/update-config"
clientScript "github.com/limechain/hedera-eth-bridge-validator/scripts/client"
"io/ioutil"
"time"
)

func main() {
Expand All @@ -51,7 +52,7 @@ func main() {
}

func parseParams(configPath *string, topicId *string, executorId *string, nodeAccountId *string) ([]byte, hedera.TopicID, hedera.AccountID, hedera.AccountID) {
content, err := ioutil.ReadFile(*configPath)
content, err := os.ReadFile(*configPath)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit d306be2

Please sign in to comment.