From b1897d158bd231065f75bc7dde8b9510a883b213 Mon Sep 17 00:00:00 2001 From: Samuel Hawksby-Robinson Date: Tue, 19 Mar 2024 13:03:56 +0000 Subject: [PATCH] finished accounts_test.go --- account/accounts_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/account/accounts_test.go b/account/accounts_test.go index f7d60282d..139205618 100644 --- a/account/accounts_test.go +++ b/account/accounts_test.go @@ -4,7 +4,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "path/filepath" "testing" @@ -328,7 +327,7 @@ func (s *ManagerTestSuite) TestMigrateKeyStoreDir() { err := os.Mkdir(newKeyDir, 0777) s.Require().NoError(err) - files, _ := ioutil.ReadDir(newKeyDir) + files, _ := os.ReadDir(newKeyDir) s.Equal(0, len(files)) address := types.HexToAddress(s.walletAddress).Hex() @@ -336,21 +335,21 @@ func (s *ManagerTestSuite) TestMigrateKeyStoreDir() { err = s.accManager.MigrateKeyStoreDir(oldKeyDir, newKeyDir, addresses) s.Require().NoError(err) - files, _ = ioutil.ReadDir(newKeyDir) + files, _ = os.ReadDir(newKeyDir) s.Equal(1, len(files)) } func (s *ManagerTestSuite) TestReEncryptKey() { var firstKeyPath string - files, _ := ioutil.ReadDir(s.keydir) + files, _ := os.ReadDir(s.keydir) - // thiere is only one file in this dir, + // there is only one file in this dir, // is there a better way to reference it? for _, f := range files { firstKeyPath = filepath.Join(s.keydir, f.Name()) } - rawKey, _ := ioutil.ReadFile(firstKeyPath) + rawKey, _ := os.ReadFile(firstKeyPath) reEncryptedKey, _ := s.accManager.ReEncryptKey(rawKey, testPassword, newTestPassword) type Key struct { @@ -392,7 +391,7 @@ func (s *ManagerTestSuite) TestReEncryptKeyStoreDir() { // walk should not throw callback errors s.Require().NoError(err) - rawKeyFile, err := ioutil.ReadFile(path) + rawKeyFile, err := os.ReadFile(path) s.Require().NoError(err) // should not decrypt with old password