Skip to content

Commit

Permalink
Replace ioutil.WriteFile with os.WriteFile
Browse files Browse the repository at this point in the history
Signed-off-by: Priyansu Rout <priyansurout192004@gmail.com>
  • Loading branch information
Priyansurout authored and denyeart committed Jun 11, 2024
1 parent fb54947 commit aec91f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions common/deliverclient/blocksprovider/deliverer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package blocksprovider_test

import (
"fmt"
"io/ioutil"
"os"
"path"
"sync"
Expand Down Expand Up @@ -832,7 +831,7 @@ func generateCertificatesSmartBFT(confAppSmartBFT *genesisconfig.Profile, tlsCA
}

srvP := path.Join(certDir, fmt.Sprintf("server%d.crt", i))
err = ioutil.WriteFile(srvP, srvC.Cert, 0o644)
err = os.WriteFile(srvP, srvC.Cert, 0o644)
if err != nil {
return err
}
Expand All @@ -843,7 +842,7 @@ func generateCertificatesSmartBFT(confAppSmartBFT *genesisconfig.Profile, tlsCA
}

clnP := path.Join(certDir, fmt.Sprintf("client%d.crt", i))
err = ioutil.WriteFile(clnP, clnC.Cert, 0o644)
err = os.WriteFile(clnP, clnC.Cert, 0o644)
if err != nil {
return err
}
Expand Down
5 changes: 2 additions & 3 deletions core/deliverservice/deliveryclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package deliverservice

import (
"fmt"
"io/ioutil"
"os"
"path"
"testing"
Expand Down Expand Up @@ -456,13 +455,13 @@ func generateCertificatesSmartBFT(t *testing.T, confAppSmartBFT *genesisconfig.P
srvC, err := tlsCA.NewServerCertKeyPair(c.Host)
require.NoError(t, err)
srvP := path.Join(certDir, fmt.Sprintf("server%d.crt", i))
err = ioutil.WriteFile(srvP, srvC.Cert, 0o644)
err = os.WriteFile(srvP, srvC.Cert, 0o644)
require.NoError(t, err)

clnC, err := tlsCA.NewClientCertKeyPair()
require.NoError(t, err)
clnP := path.Join(certDir, fmt.Sprintf("client%d.crt", i))
err = ioutil.WriteFile(clnP, clnC.Cert, 0o644)
err = os.WriteFile(clnP, clnC.Cert, 0o644)
require.NoError(t, err)

c.Identity = srvP
Expand Down

0 comments on commit aec91f8

Please sign in to comment.