forked from cerc-io/plugeth
all: replace uses of ioutil with io and os (#24869)
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -362,7 +363,7 @@ func TestJsonFiles(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
expectedFailure := strings.HasPrefix(fInfo.Name(), "expfail")
|
||||
data, err := ioutil.ReadFile(path.Join("testdata", fInfo.Name()))
|
||||
data, err := os.ReadFile(path.Join("testdata", fInfo.Name()))
|
||||
if err != nil {
|
||||
t.Errorf("Failed to read file %v: %v", fInfo.Name(), err)
|
||||
continue
|
||||
@@ -394,7 +395,7 @@ func TestFuzzerFiles(t *testing.T) {
|
||||
}
|
||||
verbose := false
|
||||
for i, fInfo := range testfiles {
|
||||
data, err := ioutil.ReadFile(path.Join(corpusdir, fInfo.Name()))
|
||||
data, err := os.ReadFile(path.Join(corpusdir, fInfo.Name()))
|
||||
if err != nil {
|
||||
t.Errorf("Failed to read file %v: %v", fInfo.Name(), err)
|
||||
continue
|
||||
|
||||
@@ -21,8 +21,8 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/big"
|
||||
"os"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
@@ -175,7 +175,7 @@ func (s *UIServerAPI) Export(ctx context.Context, addr common.Address) (json.Raw
|
||||
if wallet.URL().Scheme != keystore.KeyStoreScheme {
|
||||
return nil, fmt.Errorf("account is not a keystore-account")
|
||||
}
|
||||
return ioutil.ReadFile(wallet.URL().Path)
|
||||
return os.ReadFile(wallet.URL().Path)
|
||||
}
|
||||
|
||||
// Import tries to import the given keyJSON in the local keystore. The keyJSON data is expected to be
|
||||
|
||||
Reference in New Issue
Block a user