-
Notifications
You must be signed in to change notification settings - Fork 4.1k
chore(x/staking): use cosmossdk.io/core/codec instead of github.com/cosmos/cosmos-sdk/codec
#23289
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ import ( | |||||||||||||||||
|
|
||||||||||||||||||
| storetypes "cosmossdk.io/store/types" | ||||||||||||||||||
|
|
||||||||||||||||||
| "github.com/cosmos/cosmos-sdk/codec" | ||||||||||||||||||
| "cosmossdk.io/core/codec" | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Fix import ordering. The imports need to be reordered according to the project's guidelines: import (
"context"
storetypes "cosmossdk.io/store/types"
- "cosmossdk.io/core/codec"
+
+ "cosmossdk.io/core/codec"
)
🧰 Tools🪛 golangci-lint (1.62.2)8-8: File is not (gci) 🪛 GitHub Actions: Lint[error] 6-8: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix import ordering. The imports need to be ordered according to the following pattern:
import (
"context"
storetypes "cosmossdk.io/store/types"
- "cosmossdk.io/core/codec"
+
+ "cosmossdk.io/core/codec"
)📝 Committable suggestion
Suggested change
🧰 Tools🪛 golangci-lint (1.62.2)8-8: File is not (gci) 🪛 GitHub Actions: Lint[error] 6-8: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order |
||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| // MigrateStore performs in-place store migrations from v5 to v6. | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,8 +18,8 @@ import ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cosmossdk.io/x/staking/keeper" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cosmossdk.io/x/staking/types" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cosmossdk.io/core/codec" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cosmossdk.io/core/codec" | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" | |
| "github.com/spf13/cobra" | |
| "google.golang.org/grpc" | |
| "cosmossdk.io/collections" | |
| "cosmossdk.io/core/appmodule" | |
| "cosmossdk.io/core/codec" | |
| "cosmossdk.io/core/registry" | |
| "cosmossdk.io/depinject" | |
| "cosmossdk.io/schema" | |
| "cosmossdk.io/x/staking/client/cli" | |
| "cosmossdk.io/x/staking/keeper" | |
| "cosmossdk.io/x/staking/types" | |
| "github.com/cosmos/cosmos-sdk/client" | |
| "github.com/cosmos/cosmos-sdk/types/module" | |
| ) |
🧰 Tools
🪛 GitHub Actions: Lint
[error] 13-21: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix import ordering.
The imports need to be ordered according to the following pattern:
- standard
- default
- prefix(cosmossdk.io)
- prefix(github.com/cosmos/cosmos-sdk)
import (
"context"
"encoding/json"
"fmt"
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
"google.golang.org/grpc"
"cosmossdk.io/collections"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/registry"
"cosmossdk.io/depinject"
"cosmossdk.io/schema"
"cosmossdk.io/x/staking/client/cli"
"cosmossdk.io/x/staking/keeper"
"cosmossdk.io/x/staking/types"
- "cosmossdk.io/core/codec"
+
+ "cosmossdk.io/core/codec"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/types/module"
)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "cosmossdk.io/core/codec" | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" | |
| "github.com/spf13/cobra" | |
| "google.golang.org/grpc" | |
| "cosmossdk.io/collections" | |
| "cosmossdk.io/core/appmodule" | |
| "cosmossdk.io/core/registry" | |
| "cosmossdk.io/core/codec" | |
| "cosmossdk.io/depinject" | |
| "cosmossdk.io/schema" | |
| "cosmossdk.io/x/staking/client/cli" | |
| "cosmossdk.io/x/staking/keeper" | |
| "cosmossdk.io/x/staking/types" | |
| "github.com/cosmos/cosmos-sdk/client" | |
| "github.com/cosmos/cosmos-sdk/types/module" | |
| ) |
🧰 Tools
🪛 GitHub Actions: Lint
[error] 13-21: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,7 +7,7 @@ import ( | |||||||||||||||||||||||||
| "cosmossdk.io/math" | ||||||||||||||||||||||||||
| "cosmossdk.io/x/staking/types" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| "github.com/cosmos/cosmos-sdk/codec" | ||||||||||||||||||||||||||
| "cosmossdk.io/core/codec" | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| "cosmossdk.io/core/codec" | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "cosmossdk.io/math" | |
| "cosmossdk.io/x/staking/types" | |
| "cosmossdk.io/core/codec" | |
| sdk "github.com/cosmos/cosmos-sdk/types" | |
| "github.com/cosmos/cosmos-sdk/types/kv" | |
| ) |
🧰 Tools
🪛 golangci-lint (1.62.2)
10-10: File is not gci-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
(gci)
🪛 GitHub Actions: Lint
[error] 6-10: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix import ordering.
The imports need to be ordered according to the following pattern:
- standard
- default
- prefix(cosmossdk.io)
- prefix(github.com/cosmos/cosmos-sdk)
import (
"bytes"
"fmt"
"cosmossdk.io/math"
"cosmossdk.io/x/staking/types"
- "cosmossdk.io/core/codec"
+
+ "cosmossdk.io/core/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
)Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 golangci-lint (1.62.2)
10-10: File is not gci-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
(gci)
🪛 GitHub Actions: Lint
[error] 6-10: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ import ( | |
| "cosmossdk.io/core/address" | ||
| "cosmossdk.io/math" | ||
|
|
||
| "github.com/cosmos/cosmos-sdk/codec" | ||
| "cosmossdk.io/core/codec" | ||
|
||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| ) | ||
|
|
||
|
|
@@ -26,7 +26,11 @@ func NewDelegation(delegatorAddr, validatorAddr string, shares math.LegacyDec) D | |
|
|
||
| // MustMarshalDelegation returns the delegation bytes. Panics if fails | ||
| func MustMarshalDelegation(cdc codec.BinaryCodec, delegation Delegation) []byte { | ||
| return cdc.MustMarshal(&delegation) | ||
| data, err := cdc.Marshal(&delegation) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| return data | ||
| } | ||
|
|
||
| // MustUnmarshalDelegation return the unmarshaled delegation from bytes. | ||
|
|
@@ -143,7 +147,11 @@ func (ubd *UnbondingDelegation) RemoveEntry(i int64) { | |
|
|
||
| // return the unbonding delegation | ||
| func MustMarshalUBD(cdc codec.BinaryCodec, ubd UnbondingDelegation) []byte { | ||
| return cdc.MustMarshal(&ubd) | ||
| data, err := cdc.Marshal(&ubd) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| return data | ||
| } | ||
|
|
||
| // unmarshal a unbonding delegation from a store value | ||
|
|
@@ -234,7 +242,11 @@ func (red *Redelegation) RemoveEntry(i int64) { | |
|
|
||
| // MustMarshalRED returns the Redelegation bytes. Panics if fails. | ||
| func MustMarshalRED(cdc codec.BinaryCodec, red Redelegation) []byte { | ||
| return cdc.MustMarshal(&red) | ||
| data, err := cdc.Marshal(&red) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| return data | ||
| } | ||
|
|
||
| // MustUnmarshalRED unmarshals a redelegation from a store value. Panics if fails. | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,7 @@ import ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cosmossdk.io/errors" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cosmossdk.io/math" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "github.com/cosmos/cosmos-sdk/codec" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cosmossdk.io/core/codec" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cosmossdk.io/core/codec" | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "net/url" | |
| "sort" | |
| "strings" | |
| "time" | |
| gogoprotoany "github.com/cosmos/gogoproto/types/any" | |
| "cosmossdk.io/core/address" | |
| "cosmossdk.io/core/appmodule" | |
| "cosmossdk.io/core/codec" | |
| "cosmossdk.io/errors" | |
| "cosmossdk.io/math" | |
| codectypes "github.com/cosmos/cosmos-sdk/codec/types" | |
| cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" | |
| sdk "github.com/cosmos/cosmos-sdk/types" | |
| sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | |
| ) |
🧰 Tools
🪛 golangci-lint (1.62.2)
18-18: File is not gci-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
(gci)
🪛 GitHub Actions: Lint
[error] 14-18: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix import ordering.
The imports need to be reordered according to the project's guidelines:
- Standard library imports
- Third-party imports
cosmossdk.ioimportsgithub.zerozr99.workers.dev/cosmos/cosmos-sdkimports
🧰 Tools
🪛 golangci-lint (1.62.2)
18-18: File is not gci-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
(gci)
🪛 GitHub Actions: Lint
[error] 14-18: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix import ordering.
The imports need to be reordered according to the project's guidelines:
import (
+ "bytes"
+ "fmt"
+ "net/url"
+ "sort"
+ "strings"
+ "time"
+
+ gogoprotoany "github.com/cosmos/gogoproto/types/any"
+
+ "cosmossdk.io/core/address"
+ "cosmossdk.io/core/appmodule"
+ "cosmossdk.io/core/codec"
+ "cosmossdk.io/errors"
+ "cosmossdk.io/math"
+
+ codectypes "github.com/cosmos/cosmos-sdk/codec/types"
+ cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "cosmossdk.io/core/codec" | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "net/url" | |
| "sort" | |
| "strings" | |
| "time" | |
| gogoprotoany "github.com/cosmos/gogoproto/types/any" | |
| "cosmossdk.io/core/address" | |
| "cosmossdk.io/core/appmodule" | |
| "cosmossdk.io/core/codec" | |
| "cosmossdk.io/errors" | |
| "cosmossdk.io/math" | |
| codectypes "github.com/cosmos/cosmos-sdk/codec/types" | |
| cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" | |
| sdk "github.com/cosmos/cosmos-sdk/types" | |
| sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | |
| ) |
🧰 Tools
🪛 golangci-lint (1.62.2)
18-18: File is not gci-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
(gci)
🪛 GitHub Actions: Lint
[error] 14-18: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix import ordering to match project guidelines.
The imports need to be reordered following the project's guidelines: standard libs, default libs, cosmossdk.io prefixed imports, and github.com/cosmos/cosmos-sdk prefixed imports.
🧰 Tools
🪛 golangci-lint (1.62.2)
8-8: File is not
gci-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order(gci)
🪛 GitHub Actions: Lint
[error] 6-8: File is not properly formatted with gci. Import ordering needs to follow: --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order