Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated of package io/ioutil #1055

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions x/leveragelp/client/cli/tx_add_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import (
"encoding/json"
"errors"
"io/ioutil"
"os"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down Expand Up @@ -104,7 +104,7 @@

func readPoolJSON(filename string) (types.AddPool, error) {
var pool types.AddPool
bz, err := ioutil.ReadFile(filename)
bz, err := os.ReadFile(filename)

Check warning on line 107 in x/leveragelp/client/cli/tx_add_pool.go

View check run for this annotation

Codecov / codecov/patch

x/leveragelp/client/cli/tx_add_pool.go#L107

Added line #L107 was not covered by tests
if err != nil {
return types.AddPool{}, err
}
Expand Down
4 changes: 2 additions & 2 deletions x/leveragelp/client/cli/tx_close_positions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import (
"encoding/json"
"io/ioutil"
"os"
"strconv"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -64,7 +64,7 @@

func readPositionRequestJSON(filename string) ([]types.PositionRequest, error) {
var positions []types.PositionRequest
bz, err := ioutil.ReadFile(filename)
bz, err := os.ReadFile(filename)

Check warning on line 67 in x/leveragelp/client/cli/tx_close_positions.go

View check run for this annotation

Codecov / codecov/patch

x/leveragelp/client/cli/tx_close_positions.go#L67

Added line #L67 was not covered by tests
if err != nil {
return []types.PositionRequest{}, err
}
Expand Down
4 changes: 2 additions & 2 deletions x/perpetual/client/cli/tx_close_positions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import (
"encoding/json"
"io/ioutil"
"os"
"strconv"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -76,7 +76,7 @@

func readPositionRequestJSON(filename string) ([]types.PositionRequest, error) {
var positions []types.PositionRequest
bz, err := ioutil.ReadFile(filename)
bz, err := os.ReadFile(filename)

Check warning on line 79 in x/perpetual/client/cli/tx_close_positions.go

View check run for this annotation

Codecov / codecov/patch

x/perpetual/client/cli/tx_close_positions.go#L79

Added line #L79 was not covered by tests
if err != nil {
return []types.PositionRequest{}, err
}
Expand Down
3 changes: 1 addition & 2 deletions x/tradeshield/client/cli/tx_perpetual_order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cli_test
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"testing"

Expand Down Expand Up @@ -71,7 +70,7 @@ func TestCancelPerpertualOrders(t *testing.T) {
ctx := net.Validators[0].ClientCtx
val := net.Validators[0]

tmpFile, err := ioutil.TempFile("", "ids.json")
tmpFile, err := os.CreateTemp("", "ids.json")
require.NoError(t, err)
defer os.Remove(tmpFile.Name())

Expand Down
4 changes: 2 additions & 2 deletions x/tradeshield/client/cli/tx_spot_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

import (
"encoding/json"
"io/ioutil"
"os"
"strconv"

"cosmossdk.io/math"
Expand Down Expand Up @@ -148,7 +148,7 @@ func CmdCancelSpotOrders() *cobra.Command {

func readPositionRequestJSON(filename string) ([]uint64, error) {
var positions []uint64
bz, err := ioutil.ReadFile(filename)
bz, err := os.ReadFile(filename)
if err != nil {
return []uint64{}, err
}
Expand Down
3 changes: 1 addition & 2 deletions x/tradeshield/client/cli/tx_spot_order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cli_test

import (
"encoding/json"
"io/ioutil"
"os"
"testing"

Expand All @@ -16,7 +15,7 @@ func TestCancelSpotOrders(t *testing.T) {
ctx := net.Validators[0].ClientCtx
val := net.Validators[0]

tmpFile, err := ioutil.TempFile("", "ids.json")
tmpFile, err := os.CreateTemp("", "ids.json")
require.NoError(t, err)
defer os.Remove(tmpFile.Name())

Expand Down
Loading