diff --git a/command/genesis/utils.go b/command/genesis/utils.go index 561178615d..47f3bf81cf 100644 --- a/command/genesis/utils.go +++ b/command/genesis/utils.go @@ -4,7 +4,6 @@ import ( "encoding/hex" "errors" "fmt" - "io/ioutil" "math/big" "os" "path/filepath" @@ -219,7 +218,7 @@ func GetValidatorKeyFiles(rootDir, filePrefix string) ([]string, error) { rootDir = "." } - files, err := ioutil.ReadDir(rootDir) + files, err := os.ReadDir(rootDir) if err != nil { return nil, err } diff --git a/e2e-polybft/framework/test-cluster.go b/e2e-polybft/framework/test-cluster.go index cce2586b18..c4befa07f6 100644 --- a/e2e-polybft/framework/test-cluster.go +++ b/e2e-polybft/framework/test-cluster.go @@ -5,7 +5,6 @@ import ( "encoding/hex" "fmt" "io" - "io/ioutil" "math/big" "os" "os/exec" @@ -1085,11 +1084,11 @@ func CopyDir(source, destination string) error { return nil } - data, err := ioutil.ReadFile(filepath.Join(source, relPath)) + data, err := os.ReadFile(filepath.Join(source, relPath)) if err != nil { return err } - return ioutil.WriteFile(filepath.Join(destination, relPath), data, 0600) + return os.WriteFile(filepath.Join(destination, relPath), data, 0600) }) } diff --git a/e2e-polybft/framework/test-server.go b/e2e-polybft/framework/test-server.go index ff4950938e..4a424db8ef 100644 --- a/e2e-polybft/framework/test-server.go +++ b/e2e-polybft/framework/test-server.go @@ -3,8 +3,8 @@ package framework import ( "errors" "fmt" - "io/ioutil" "math/big" + "os" "strconv" "strings" "sync/atomic" @@ -120,7 +120,7 @@ func NewTestServer(t *testing.T, clusterConfig *TestClusterConfig, } if config.DataDir == "" { - dataDir, err := ioutil.TempDir("/tmp", "edge-e2e-") + dataDir, err := os.MkdirTemp("/tmp", "edge-e2e-") require.NoError(t, err) config.DataDir = dataDir diff --git a/e2e/genesis_test.go b/e2e/genesis_test.go index 5fb8fbfef5..3d0eaa3701 100644 --- a/e2e/genesis_test.go +++ b/e2e/genesis_test.go @@ -3,8 +3,8 @@ package e2e import ( "context" "fmt" - "io/ioutil" "math/big" + "os" "path/filepath" "regexp" "strings" @@ -229,7 +229,7 @@ func TestGenesis_Predeployment(t *testing.T) { clt := srv.JSONRPC() // Extract the contract ABI from the metadata test file - content, err := ioutil.ReadFile(artifactPath) + content, err := os.ReadFile(artifactPath) if err != nil { t.Fatalf("unable to open JSON file, %v", err) } diff --git a/tracker/event_tracker_store_test.go b/tracker/event_tracker_store_test.go index ba70b22e91..fb97f21005 100644 --- a/tracker/event_tracker_store_test.go +++ b/tracker/event_tracker_store_test.go @@ -2,7 +2,6 @@ package tracker import ( "encoding/hex" - "io/ioutil" "os" "path/filepath" "testing" @@ -19,7 +18,7 @@ func createSetupDB(subscriber eventSubscription, numBlockConfirmations uint64) s return func(t *testing.T) (store.Store, func()) { t.Helper() - dir, err := ioutil.TempDir("/tmp", "boltdb-test") + dir, err := os.MkdirTemp("/tmp", "boltdb-test") require.NoError(t, err) path := filepath.Join(dir, "test.db")