refactor(slashing): spinout to new go module (#18201)
This commit is contained in:
parent
797ae0fe99
commit
86eaeed519
31
.github/workflows/test.yml
vendored
31
.github/workflows/test.yml
vendored
@ -1036,3 +1036,34 @@ jobs:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
with:
|
||||
projectBaseDir: x/gov/
|
||||
|
||||
test-x-slashing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.21"
|
||||
check-latest: true
|
||||
cache: true
|
||||
cache-dependency-path: x/slashing/go.sum
|
||||
- uses: technote-space/get-diff-action@v6.1.2
|
||||
id: git_diff
|
||||
with:
|
||||
PATTERNS: |
|
||||
x/slashing/**/*.go
|
||||
x/slashing/go.mod
|
||||
x/slashing/go.sum
|
||||
- name: tests
|
||||
if: env.GIT_DIFF
|
||||
run: |
|
||||
cd x/slashing
|
||||
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
|
||||
- name: sonarcloud
|
||||
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
|
||||
uses: SonarSource/sonarcloud-github-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
with:
|
||||
projectBaseDir: x/slashing/
|
||||
|
||||
@ -175,7 +175,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
* Remove depreacted `MakeTestingEncodingParams` from `simapp/params`
|
||||
* (x/group) [#17937](https://github.com/cosmos/cosmos-sdk/pull/17937) Groups module was moved to its own go.mod `cosmossdk.io/x/group`
|
||||
* (x/gov) [#18197](https://github.com/cosmos/cosmos-sdk/pull/18197) Gov module was moved to its own go.mod `cosmossdk.io/x/gov`
|
||||
* (x/gov) [#18199](https://github.com/cosmos/cosmos-sdk/pull/18199) Distribution module was moved to its own go.mod `cosmossdk.io/x/distribution`
|
||||
* (x/distribution) [#18199](https://github.com/cosmos/cosmos-sdk/pull/18199) Distribution module was moved to its own go.mod `cosmossdk.io/x/distribution`
|
||||
* (x/slashing) [#18201](https://github.com/cosmos/cosmos-sdk/pull/18201) Slashing module was moved to its own go.mod `cosmossdk.io/x/slashing`
|
||||
* (x/consensus) [#18041](https://github.com/cosmos/cosmos-sdk/pull/18041) `ToProtoConsensusParams()` returns an error
|
||||
* (x/slashing) [#18115](https://github.com/cosmos/cosmos-sdk/pull/18115) `NewValidatorSigningInfo` takes strings instead of `sdk.AccAddress`
|
||||
|
||||
|
||||
20
UPGRADING.md
20
UPGRADING.md
@ -34,6 +34,26 @@ Refer to SimApp `root_v2.go` and `root.go` for an example with an app v2 and a l
|
||||
|
||||
### Modules
|
||||
|
||||
#### `x/group`
|
||||
|
||||
Group was spun out into its own `go.mod`. To import it use `cosmossdk.io/x/group`
|
||||
|
||||
#### `x/gov`
|
||||
|
||||
Gov was spun out into its own `go.mod`. To import it use `cosmossdk.io/x/gov`
|
||||
|
||||
#### `x/distribution`
|
||||
|
||||
Distribution was spun out into its own `go.mod`. To import it use `cosmossdk.io/x/distribution`
|
||||
|
||||
#### `x/slashing`
|
||||
|
||||
Slashing was spun out into its own `go.mod`. To import it use `cosmossdk.io/x/slashing`
|
||||
|
||||
#### Params
|
||||
|
||||
A standalone Go module was created and it is accessible at "cosmossdk.io/x/params".
|
||||
|
||||
#### `**all**`
|
||||
|
||||
##### Genesis Interface
|
||||
|
||||
@ -160,3 +160,5 @@ replace github.com/cosmos/cosmos-sdk => ./../../
|
||||
replace cosmossdk.io/x/gov => ./../../x/gov
|
||||
|
||||
replace cosmossdk.io/x/distribution => ./../../x/distribution
|
||||
|
||||
replace cosmossdk.io/x/slashing => ./../../x/slashing
|
||||
|
||||
@ -16,6 +16,7 @@ COPY x/tx/go.mod x/tx/go.sum /work/x/tx/
|
||||
COPY x/protocolpool/go.mod x/protocolpool/go.sum /work/x/protocolpool/
|
||||
COPY x/gov/go.mod x/gov/go.sum /work/x/gov/
|
||||
COPY x/distribution/go.mod x/distribution/go.sum /work/x/distribution/
|
||||
COPY x/slashing/go.mod x/slashing/go.sum /work/x/slashing/
|
||||
RUN go mod download
|
||||
|
||||
COPY ./ /work
|
||||
|
||||
9
go.mod
9
go.mod
@ -14,10 +14,10 @@ require (
|
||||
cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/tx v0.11.0
|
||||
github.com/99designs/keyring v1.2.1
|
||||
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816
|
||||
github.com/bits-and-blooms/bitset v1.10.0
|
||||
github.com/cockroachdb/errors v1.11.1
|
||||
github.com/cometbft/cometbft v0.38.0
|
||||
github.com/cosmos/btcutil v1.0.5
|
||||
@ -69,6 +69,7 @@ require (
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
||||
github.com/DataDog/zstd v1.5.5 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.10.0 // indirect
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
|
||||
github.com/bufbuild/protocompile v0.6.0 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||
@ -169,7 +170,11 @@ require (
|
||||
// replace (
|
||||
// <temporary replace>
|
||||
// )
|
||||
replace cosmossdk.io/x/protocolpool => ./x/protocolpool
|
||||
// TODO remove after all modules have their own go.mods
|
||||
replace (
|
||||
cosmossdk.io/x/protocolpool => ./x/protocolpool
|
||||
cosmossdk.io/x/slashing => ./x/slashing
|
||||
)
|
||||
|
||||
replace cosmossdk.io/x/gov => ./x/gov
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import "cosmos/app/v1alpha1/module.proto";
|
||||
// Module is the config object of the slashing module.
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import: "github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
go_import: "cosmossdk.io/x/slashing"
|
||||
};
|
||||
|
||||
// authority defines the custom module authority. If not set, defaults to the governance module.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cosmos.slashing.v1beta1;
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
|
||||
option go_package = "cosmossdk.io/x/slashing/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/slashing/v1beta1/slashing.proto";
|
||||
|
||||
@ -8,7 +8,7 @@ import "cosmos/slashing/v1beta1/slashing.proto";
|
||||
import "cosmos_proto/cosmos.proto";
|
||||
import "amino/amino.proto";
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
|
||||
option go_package = "cosmossdk.io/x/slashing/types";
|
||||
|
||||
// Query provides defines the gRPC querier service
|
||||
service Query {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cosmos.slashing.v1beta1;
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
|
||||
option go_package = "cosmossdk.io/x/slashing/types";
|
||||
option (gogoproto.equal_all) = true;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cosmos.slashing.v1beta1;
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
|
||||
option go_package = "cosmossdk.io/x/slashing/types";
|
||||
option (gogoproto.equal_all) = true;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
@ -46,6 +46,9 @@ import (
|
||||
"cosmossdk.io/x/protocolpool"
|
||||
poolkeeper "cosmossdk.io/x/protocolpool/keeper"
|
||||
pooltypes "cosmossdk.io/x/protocolpool/types"
|
||||
"cosmossdk.io/x/slashing"
|
||||
slashingkeeper "cosmossdk.io/x/slashing/keeper"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
"cosmossdk.io/x/tx/signing"
|
||||
"cosmossdk.io/x/upgrade"
|
||||
upgradekeeper "cosmossdk.io/x/upgrade/keeper"
|
||||
@ -100,9 +103,6 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/x/mint"
|
||||
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
|
||||
@ -46,6 +46,8 @@ import (
|
||||
_ "cosmossdk.io/x/nft/module" // import for side-effects
|
||||
_ "cosmossdk.io/x/protocolpool" // import for side-effects
|
||||
pooltypes "cosmossdk.io/x/protocolpool/types"
|
||||
_ "cosmossdk.io/x/slashing" // import for side-effects
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
_ "cosmossdk.io/x/upgrade" // import for side-effects
|
||||
upgradetypes "cosmossdk.io/x/upgrade/types"
|
||||
|
||||
@ -67,8 +69,6 @@ import (
|
||||
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
@ -21,6 +21,7 @@ import (
|
||||
feegrantmodule "cosmossdk.io/x/feegrant/module"
|
||||
"cosmossdk.io/x/gov"
|
||||
group "cosmossdk.io/x/group/module"
|
||||
"cosmossdk.io/x/slashing"
|
||||
"cosmossdk.io/x/upgrade"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
@ -39,7 +40,6 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/x/crisis"
|
||||
"github.com/cosmos/cosmos-sdk/x/genutil"
|
||||
"github.com/cosmos/cosmos-sdk/x/mint"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
)
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ import (
|
||||
nftkeeper "cosmossdk.io/x/nft/keeper"
|
||||
_ "cosmossdk.io/x/protocolpool"
|
||||
poolkeeper "cosmossdk.io/x/protocolpool/keeper"
|
||||
slashingkeeper "cosmossdk.io/x/slashing/keeper"
|
||||
upgradekeeper "cosmossdk.io/x/upgrade/keeper"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
@ -43,7 +44,6 @@ import (
|
||||
consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
|
||||
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
|
||||
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
)
|
||||
|
||||
|
||||
@ -9,10 +9,10 @@ import (
|
||||
|
||||
"cosmossdk.io/collections"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
@ -37,6 +37,7 @@ require (
|
||||
cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/group v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000
|
||||
)
|
||||
|
||||
require (
|
||||
@ -218,6 +219,7 @@ replace (
|
||||
cosmossdk.io/x/group => ../x/group
|
||||
cosmossdk.io/x/nft => ../x/nft
|
||||
cosmossdk.io/x/protocolpool => ../x/protocolpool
|
||||
cosmossdk.io/x/slashing => ../x/slashing
|
||||
cosmossdk.io/x/upgrade => ../x/upgrade
|
||||
)
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ import (
|
||||
"cosmossdk.io/store"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
"cosmossdk.io/x/feegrant"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
@ -29,7 +30,6 @@ import (
|
||||
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/simulation"
|
||||
simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ require (
|
||||
cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/group v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000
|
||||
)
|
||||
|
||||
require (
|
||||
@ -216,6 +217,7 @@ replace (
|
||||
cosmossdk.io/x/nft => ../x/nft
|
||||
cosmossdk.io/x/params => ../x/params
|
||||
cosmossdk.io/x/protocolpool => ../x/protocolpool
|
||||
cosmossdk.io/x/slashing => ../x/slashing
|
||||
cosmossdk.io/x/upgrade => ../x/upgrade
|
||||
)
|
||||
|
||||
|
||||
@ -20,6 +20,10 @@ import (
|
||||
"cosmossdk.io/x/evidence/exported"
|
||||
"cosmossdk.io/x/evidence/keeper"
|
||||
evidencetypes "cosmossdk.io/x/evidence/types"
|
||||
"cosmossdk.io/x/slashing"
|
||||
slashingkeeper "cosmossdk.io/x/slashing/keeper"
|
||||
"cosmossdk.io/x/slashing/testutil"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
|
||||
@ -39,10 +43,6 @@ import (
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/testutil"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
stakingtestutil "github.com/cosmos/cosmos-sdk/x/staking/testutil"
|
||||
|
||||
@ -35,6 +35,7 @@ import (
|
||||
gov_v1_types "cosmossdk.io/x/gov/types/v1"
|
||||
gov_v1beta1_types "cosmossdk.io/x/gov/types/v1beta1"
|
||||
grouptypes "cosmossdk.io/x/group"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
upgradetypes "cosmossdk.io/x/upgrade/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
|
||||
@ -44,7 +45,6 @@ import (
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
|
||||
@ -11,6 +11,10 @@ import (
|
||||
"cosmossdk.io/core/comet"
|
||||
"cosmossdk.io/log"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
"cosmossdk.io/x/slashing"
|
||||
slashingkeeper "cosmossdk.io/x/slashing/keeper"
|
||||
"cosmossdk.io/x/slashing/testutil"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
|
||||
@ -26,10 +30,6 @@ import (
|
||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/testutil"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
stakingtestutil "github.com/cosmos/cosmos-sdk/x/staking/testutil"
|
||||
|
||||
@ -40,6 +40,8 @@ import (
|
||||
gov_v1_types "cosmossdk.io/x/gov/types/v1"
|
||||
gov_v1beta1_types "cosmossdk.io/x/gov/types/v1beta1"
|
||||
groupmodule "cosmossdk.io/x/group/module"
|
||||
"cosmossdk.io/x/slashing"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
"cosmossdk.io/x/tx/signing/aminojson"
|
||||
signing_testutil "cosmossdk.io/x/tx/signing/testutil"
|
||||
"cosmossdk.io/x/upgrade"
|
||||
@ -69,8 +71,6 @@ import (
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/consensus"
|
||||
"github.com/cosmos/cosmos-sdk/x/mint"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
@ -16,6 +16,7 @@ import (
|
||||
feegrantmodule "cosmossdk.io/x/feegrant/module"
|
||||
"cosmossdk.io/x/gov"
|
||||
groupmodule "cosmossdk.io/x/group/module"
|
||||
"cosmossdk.io/x/slashing"
|
||||
"cosmossdk.io/x/tx/decode"
|
||||
txsigning "cosmossdk.io/x/tx/signing"
|
||||
"cosmossdk.io/x/upgrade"
|
||||
@ -35,7 +36,6 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/x/bank"
|
||||
"github.com/cosmos/cosmos-sdk/x/consensus"
|
||||
"github.com/cosmos/cosmos-sdk/x/mint"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
)
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ replace (
|
||||
cosmossdk.io/x/group => ../../../x/group
|
||||
cosmossdk.io/x/nft => ../../../x/nft
|
||||
cosmossdk.io/x/protocolpool => ../../../x/protocolpool
|
||||
cosmossdk.io/x/slashing => ../../../x/slashing
|
||||
cosmossdk.io/x/upgrade => ../../../x/upgrade
|
||||
)
|
||||
|
||||
@ -57,6 +58,7 @@ require (
|
||||
cosmossdk.io/x/group v0.0.0-00010101000000-000000000000 // indirect
|
||||
cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f // indirect
|
||||
cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 // indirect
|
||||
cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000 // indirect
|
||||
cosmossdk.io/x/tx v0.11.0 // indirect
|
||||
cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f // indirect
|
||||
filippo.io/edwards25519 v1.0.0 // indirect
|
||||
|
||||
@ -160,3 +160,5 @@ replace github.com/cosmos/cosmos-sdk => ../../.
|
||||
replace cosmossdk.io/x/gov => ../gov
|
||||
|
||||
replace cosmossdk.io/x/distribution => ../distribution
|
||||
|
||||
replace cosmossdk.io/x/slashing => ../slashing
|
||||
|
||||
@ -161,3 +161,5 @@ replace github.com/cosmos/cosmos-sdk => ../../.
|
||||
replace cosmossdk.io/x/protocolpool => ../protocolpool
|
||||
|
||||
replace cosmossdk.io/x/gov => ../gov
|
||||
|
||||
replace cosmossdk.io/x/slashing => ../slashing
|
||||
|
||||
@ -11,6 +11,7 @@ require (
|
||||
cosmossdk.io/log v1.2.1
|
||||
cosmossdk.io/math v1.1.3-rc.1
|
||||
cosmossdk.io/store v1.0.0-rc.0
|
||||
cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000
|
||||
github.com/cometbft/cometbft v0.38.0
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3
|
||||
github.com/cosmos/cosmos-sdk v0.51.0
|
||||
@ -162,3 +163,5 @@ replace github.com/cosmos/cosmos-sdk => ../../.
|
||||
replace cosmossdk.io/x/gov => ../gov
|
||||
|
||||
replace cosmossdk.io/x/distribution => ../distribution
|
||||
|
||||
replace cosmossdk.io/x/slashing => ../slashing
|
||||
|
||||
@ -2,6 +2,7 @@ package testutil
|
||||
|
||||
import (
|
||||
_ "cosmossdk.io/x/evidence" // import as blank for app wiring
|
||||
_ "cosmossdk.io/x/slashing" // import as blank for app wiring
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/testutil/configurator"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring
|
||||
@ -9,7 +10,6 @@ import (
|
||||
_ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/slashing" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring
|
||||
)
|
||||
|
||||
|
||||
@ -163,3 +163,5 @@ replace github.com/cosmos/cosmos-sdk => ../../.
|
||||
replace cosmossdk.io/x/gov => ../gov
|
||||
|
||||
replace cosmossdk.io/x/distribution => ../distribution
|
||||
|
||||
replace cosmossdk.io/x/slashing => ../slashing
|
||||
|
||||
@ -163,3 +163,5 @@ replace github.com/cosmos/cosmos-sdk => ../../.
|
||||
replace cosmossdk.io/x/protocolpool => ../protocolpool
|
||||
|
||||
replace cosmossdk.io/x/distribution => ../distribution
|
||||
|
||||
replace cosmossdk.io/x/slashing => ../slashing
|
||||
|
||||
@ -164,3 +164,5 @@ replace github.com/cosmos/cosmos-sdk => ../../
|
||||
replace cosmossdk.io/x/gov => ../gov
|
||||
|
||||
replace cosmossdk.io/x/distribution => ../distribution
|
||||
|
||||
replace cosmossdk.io/x/slashing => ../slashing
|
||||
|
||||
@ -160,3 +160,5 @@ replace github.com/cosmos/cosmos-sdk => ../../.
|
||||
replace cosmossdk.io/x/gov => ../gov
|
||||
|
||||
replace cosmossdk.io/x/distribution => ../distribution
|
||||
|
||||
replace cosmossdk.io/x/slashing => ../slashing
|
||||
|
||||
@ -161,3 +161,5 @@ replace github.com/cosmos/cosmos-sdk => ../..
|
||||
replace cosmossdk.io/x/gov => ../gov
|
||||
|
||||
replace cosmossdk.io/x/distribution => ../distribution
|
||||
|
||||
replace cosmossdk.io/x/slashing => ../slashing
|
||||
|
||||
@ -164,3 +164,5 @@ replace github.com/cosmos/cosmos-sdk => ../../.
|
||||
replace cosmossdk.io/x/gov => ../gov
|
||||
|
||||
replace cosmossdk.io/x/distribution => ../distribution
|
||||
|
||||
replace cosmossdk.io/x/slashing => ../slashing
|
||||
|
||||
34
x/slashing/CHANGELOG.md
Normal file
34
x/slashing/CHANGELOG.md
Normal file
@ -0,0 +1,34 @@
|
||||
<!--
|
||||
Guiding Principles:
|
||||
Changelogs are for humans, not machines.
|
||||
There should be an entry for every single version.
|
||||
The same types of changes should be grouped.
|
||||
Versions and sections should be linkable.
|
||||
The latest version comes first.
|
||||
The release date of each version is displayed.
|
||||
Mention whether you follow Semantic Versioning.
|
||||
Usage:
|
||||
Change log entries are to be added to the Unreleased section under the
|
||||
appropriate stanza (see below). Each entry should ideally include a tag and
|
||||
the Github issue reference in the following format:
|
||||
* (<tag>) [#<issue-number>] Changelog message.
|
||||
Types of changes (Stanzas):
|
||||
"Features" for new features.
|
||||
"Improvements" for changes in existing functionality.
|
||||
"Deprecated" for soon-to-be removed features.
|
||||
"Bug Fixes" for any bug fixes.
|
||||
"API Breaking" for breaking exported APIs used by developers building on SDK.
|
||||
Ref: https://keepachangelog.com/en/1.0.0/
|
||||
-->
|
||||
|
||||
# Changelog
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Features
|
||||
|
||||
### Improvements
|
||||
|
||||
### API Breaking Changes
|
||||
|
||||
### Bug Fixes
|
||||
@ -4,10 +4,11 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/x/slashing/keeper"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/telemetry"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// BeginBlocker check for infraction evidence or downtime of validators
|
||||
|
||||
@ -9,14 +9,14 @@ import (
|
||||
"cosmossdk.io/core/comet"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/x/slashing"
|
||||
slashingkeeper "cosmossdk.io/x/slashing/keeper"
|
||||
"cosmossdk.io/x/slashing/testutil"
|
||||
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/testutil"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
stakingtestutil "github.com/cosmos/cosmos-sdk/x/staking/testutil"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
|
||||
@ -11,6 +11,8 @@ import (
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/math"
|
||||
"cosmossdk.io/x/slashing/keeper"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
codecaddress "github.com/cosmos/cosmos-sdk/codec/address"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
|
||||
@ -21,8 +23,6 @@ import (
|
||||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
169
x/slashing/go.mod
Normal file
169
x/slashing/go.mod
Normal file
@ -0,0 +1,169 @@
|
||||
module cosmossdk.io/x/slashing
|
||||
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.2
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
cosmossdk.io/errors v1.0.0
|
||||
cosmossdk.io/log v1.2.1
|
||||
cosmossdk.io/math v1.1.3-rc.1
|
||||
cosmossdk.io/store v1.0.0-rc.0
|
||||
cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190
|
||||
github.com/bits-and-blooms/bitset v1.10.0
|
||||
github.com/cockroachdb/errors v1.11.1
|
||||
github.com/cometbft/cometbft v0.38.0
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3
|
||||
github.com/cosmos/cosmos-sdk v0.51.0
|
||||
github.com/cosmos/gogoproto v1.4.11
|
||||
github.com/golang/mock v1.6.0
|
||||
github.com/golang/protobuf v1.5.3
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
||||
github.com/stretchr/testify v1.8.4
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97
|
||||
google.golang.org/grpc v1.59.0
|
||||
google.golang.org/protobuf v1.31.0
|
||||
gotest.tools/v3 v3.5.1
|
||||
)
|
||||
|
||||
require (
|
||||
cosmossdk.io/x/tx v0.11.0 // indirect
|
||||
filippo.io/edwards25519 v1.0.0 // indirect
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
||||
github.com/99designs/keyring v1.2.1 // indirect
|
||||
github.com/DataDog/zstd v1.5.5 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||
github.com/cespare/xxhash v1.1.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
|
||||
github.com/cockroachdb/pebble v0.0.0-20230824192853-9bb0864bdb98 // indirect
|
||||
github.com/cockroachdb/redact v1.1.5 // indirect
|
||||
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
|
||||
github.com/cometbft/cometbft-db v0.8.0 // indirect
|
||||
github.com/cosmos/btcutil v1.0.5 // indirect
|
||||
github.com/cosmos/cosmos-db v1.0.0 // indirect
|
||||
github.com/cosmos/go-bip39 v1.0.0 // indirect
|
||||
github.com/cosmos/gogogateway v1.2.0 // indirect
|
||||
github.com/cosmos/iavl v1.0.0-rc.1 // indirect
|
||||
github.com/cosmos/ics23/go v0.10.0 // indirect
|
||||
github.com/cosmos/ledger-cosmos-go v0.13.2 // indirect
|
||||
github.com/danieljoos/wincred v1.1.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
|
||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
||||
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
|
||||
github.com/dgraph-io/ristretto v0.1.1 // indirect
|
||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
|
||||
github.com/emicklei/dot v1.6.0 // indirect
|
||||
github.com/fatih/color v1.15.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.2 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/getsentry/sentry-go v0.23.0 // indirect
|
||||
github.com/go-kit/kit v0.12.0 // indirect
|
||||
github.com/go-kit/log v0.2.1 // indirect
|
||||
github.com/go-logfmt/logfmt v0.6.0 // indirect
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
|
||||
github.com/gogo/googleapis v1.4.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/glog v1.1.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/orderedcode v0.0.1 // indirect
|
||||
github.com/gorilla/handlers v1.5.1 // indirect
|
||||
github.com/gorilla/mux v1.8.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
||||
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||
github.com/hashicorp/go-metrics v0.5.1 // indirect
|
||||
github.com/hashicorp/go-plugin v1.5.2 // indirect
|
||||
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/yamux v0.1.1 // indirect
|
||||
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
|
||||
github.com/huandu/skiplist v1.2.0 // indirect
|
||||
github.com/iancoleman/strcase v0.3.0 // indirect
|
||||
github.com/improbable-eng/grpc-web v0.15.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jmhodges/levigo v1.0.0 // indirect
|
||||
github.com/klauspost/compress v1.17.0 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/lib/pq v1.10.7 // indirect
|
||||
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
||||
github.com/linxGnu/grocksdb v1.8.4 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
|
||||
github.com/minio/highwayhash v1.0.2 // indirect
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mtibben/percent v0.2.1 // indirect
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect
|
||||
github.com/oklog/run v1.1.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
github.com/petermattis/goid v0.0.0-20230808133559-b036b712a89b // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/prometheus/client_golang v1.17.0 // indirect
|
||||
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
|
||||
github.com/prometheus/common v0.45.0 // indirect
|
||||
github.com/prometheus/procfs v0.11.1 // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
||||
github.com/rs/cors v1.8.3 // indirect
|
||||
github.com/rs/zerolog v1.31.0 // indirect
|
||||
github.com/sagikazarmark/locafero v0.3.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/spf13/afero v1.10.0 // indirect
|
||||
github.com/spf13/cast v1.5.1 // indirect
|
||||
github.com/spf13/cobra v1.7.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/spf13/viper v1.17.0 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
|
||||
github.com/tendermint/go-amino v0.16.0 // indirect
|
||||
github.com/tidwall/btree v1.7.0 // indirect
|
||||
github.com/zondax/hid v0.9.2 // indirect
|
||||
github.com/zondax/ledger-go v0.14.3 // indirect
|
||||
go.etcd.io/bbolt v1.3.7 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/crypto v0.14.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
||||
golang.org/x/net v0.17.0 // indirect
|
||||
golang.org/x/sync v0.4.0 // indirect
|
||||
golang.org/x/sys v0.13.0 // indirect
|
||||
golang.org/x/term v0.13.0 // indirect
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
nhooyr.io/websocket v1.8.6 // indirect
|
||||
pgregory.net/rapid v1.1.0 // indirect
|
||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
||||
)
|
||||
|
||||
replace github.com/cosmos/cosmos-sdk => ../../.
|
||||
|
||||
// TODO remove post spinning out all modules
|
||||
replace (
|
||||
cosmossdk.io/x/distribution => ../distribution
|
||||
cosmossdk.io/x/gov => ../gov
|
||||
cosmossdk.io/x/protocolpool => ../protocolpool
|
||||
)
|
||||
1282
x/slashing/go.sum
Normal file
1282
x/slashing/go.sum
Normal file
File diff suppressed because it is too large
Load Diff
@ -3,8 +3,9 @@ package keeper
|
||||
import (
|
||||
"context"
|
||||
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
|
||||
@ -5,9 +5,10 @@ import (
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
|
||||
"cosmossdk.io/x/slashing/testutil"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
func (s *KeeperTestSuite) TestExportAndInitGenesis() {
|
||||
|
||||
@ -7,10 +7,10 @@ import (
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
"cosmossdk.io/store/prefix"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/runtime"
|
||||
"github.com/cosmos/cosmos-sdk/types/query"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
var _ types.QueryServer = Querier{}
|
||||
|
||||
@ -4,10 +4,11 @@ import (
|
||||
gocontext "context"
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/x/slashing/testutil"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/query"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/testutil"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
func (s *KeeperTestSuite) TestGRPCQueryParams() {
|
||||
|
||||
@ -7,9 +7,9 @@ import (
|
||||
"github.com/cometbft/cometbft/crypto"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
var _ types.StakingHooks = Hooks{}
|
||||
|
||||
@ -8,10 +8,10 @@ import (
|
||||
|
||||
st "cosmossdk.io/api/cosmos/staking/v1beta1"
|
||||
"cosmossdk.io/core/comet"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// HandleValidatorSignature handles a validator signature, must be called once per validator per block.
|
||||
|
||||
@ -9,11 +9,11 @@ import (
|
||||
storetypes "cosmossdk.io/core/store"
|
||||
"cosmossdk.io/log"
|
||||
sdkmath "cosmossdk.io/math"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// Keeper of the slashing store
|
||||
|
||||
@ -13,6 +13,9 @@ import (
|
||||
sdkmath "cosmossdk.io/math"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
govtypes "cosmossdk.io/x/gov/types"
|
||||
slashingkeeper "cosmossdk.io/x/slashing/keeper"
|
||||
slashingtestutil "cosmossdk.io/x/slashing/testutil"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/codec/address"
|
||||
@ -23,9 +26,6 @@ import (
|
||||
addresstypes "github.com/cosmos/cosmos-sdk/types/address"
|
||||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
slashingtestutil "github.com/cosmos/cosmos-sdk/x/slashing/testutil"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
var consAddr = sdk.ConsAddress(sdk.AccAddress([]byte("addr1_______________")))
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
v4 "cosmossdk.io/x/slashing/migrations/v4"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/runtime"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
v4 "github.com/cosmos/cosmos-sdk/x/slashing/migrations/v4"
|
||||
)
|
||||
|
||||
// Migrator is a struct for handling in-place store migrations.
|
||||
|
||||
@ -5,9 +5,9 @@ import (
|
||||
|
||||
"cosmossdk.io/errors"
|
||||
govtypes "cosmossdk.io/x/gov/types"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
var _ types.MsgServer = msgServer{}
|
||||
|
||||
@ -4,11 +4,11 @@ import (
|
||||
"time"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
|
||||
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
|
||||
@ -9,9 +9,9 @@ import (
|
||||
|
||||
"cosmossdk.io/collections"
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// HasValidatorSigningInfo returns if a given validator has signing information
|
||||
|
||||
@ -3,9 +3,10 @@ package keeper_test
|
||||
import (
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/x/slashing/testutil"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/testutil"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
func (s *KeeperTestSuite) TestValidatorSigningInfo() {
|
||||
|
||||
@ -4,9 +4,9 @@ import (
|
||||
"context"
|
||||
|
||||
"cosmossdk.io/errors"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// Unjail calls the staking Unjail function to unjail a validator if the
|
||||
|
||||
@ -6,10 +6,10 @@ import (
|
||||
|
||||
"cosmossdk.io/errors"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// Migrate migrates state to consensus version 4. Specifically, the migration
|
||||
|
||||
@ -8,13 +8,13 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
"cosmossdk.io/x/slashing"
|
||||
v4 "cosmossdk.io/x/slashing/migrations/v4"
|
||||
slashingtypes "cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
v4 "github.com/cosmos/cosmos-sdk/x/slashing/migrations/v4"
|
||||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
var consAddr = sdk.ConsAddress(sdk.AccAddress([]byte("addr1_______________")))
|
||||
|
||||
@ -12,6 +12,9 @@ import (
|
||||
store "cosmossdk.io/core/store"
|
||||
"cosmossdk.io/depinject"
|
||||
govtypes "cosmossdk.io/x/gov/types"
|
||||
"cosmossdk.io/x/slashing/keeper"
|
||||
"cosmossdk.io/x/slashing/simulation"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
@ -19,9 +22,6 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
staking "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
|
||||
@ -4,11 +4,12 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/kv"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
|
||||
|
||||
@ -7,14 +7,15 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"cosmossdk.io/x/slashing"
|
||||
"cosmossdk.io/x/slashing/simulation"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/kv"
|
||||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -7,10 +7,10 @@ import (
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/math"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
"github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// Simulation parameter constants
|
||||
|
||||
@ -9,13 +9,13 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
"cosmossdk.io/x/slashing/simulation"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
|
||||
|
||||
@ -4,6 +4,9 @@ import (
|
||||
"errors"
|
||||
"math/rand"
|
||||
|
||||
"cosmossdk.io/x/slashing/keeper"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
@ -13,8 +16,6 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// Simulation operation weights constants
|
||||
|
||||
@ -18,6 +18,10 @@ import (
|
||||
"cosmossdk.io/math"
|
||||
distributionkeeper "cosmossdk.io/x/distribution/keeper"
|
||||
distrtypes "cosmossdk.io/x/distribution/types"
|
||||
slashingkeeper "cosmossdk.io/x/slashing/keeper"
|
||||
"cosmossdk.io/x/slashing/simulation"
|
||||
"cosmossdk.io/x/slashing/testutil"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
@ -32,10 +36,6 @@ import (
|
||||
banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil"
|
||||
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
@ -5,12 +5,12 @@ import (
|
||||
"time"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/address"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// Simulation operation weights constants
|
||||
|
||||
@ -8,12 +8,12 @@ import (
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
"cosmossdk.io/x/slashing/simulation"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/address"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
func TestProposalMsgs(t *testing.T) {
|
||||
|
||||
14
x/slashing/sonar-project.properties
Normal file
14
x/slashing/sonar-project.properties
Normal file
@ -0,0 +1,14 @@
|
||||
sonar.projectKey=cosmos-sdk-x-slashing
|
||||
sonar.organization=cosmos
|
||||
|
||||
sonar.projectName=Cosmos SDK - x/slashing
|
||||
sonar.project.monorepo.enabled=true
|
||||
|
||||
sonar.sources=.
|
||||
sonar.exclusions=**/*_test.go
|
||||
sonar.tests=.
|
||||
sonar.test.inclusions=**/*_test.go
|
||||
sonar.go.coverage.reportPaths=coverage.out
|
||||
|
||||
sonar.sourceEncoding=UTF-8
|
||||
sonar.scm.provider=git
|
||||
@ -3,6 +3,7 @@ package testutil
|
||||
import (
|
||||
_ "cosmossdk.io/x/distribution" // import as blank for app wiring
|
||||
_ "cosmossdk.io/x/protocolpool" // import as blank for app wiring
|
||||
_ "cosmossdk.io/x/slashing" // import as blank for app wiring
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/testutil/configurator"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring
|
||||
@ -11,7 +12,6 @@ import (
|
||||
_ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/slashing" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring
|
||||
)
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
"cosmossdk.io/x/slashing/types"
|
||||
)
|
||||
|
||||
// TestParams construct default slashing params for tests.
|
||||
|
||||
@ -3,6 +3,7 @@ package testutil
|
||||
import (
|
||||
_ "cosmossdk.io/x/distribution" // import as blank for app wiring
|
||||
_ "cosmossdk.io/x/protocolpool" // import as blank for app wiring
|
||||
_ "cosmossdk.io/x/slashing" // import as blank for app wiring
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/testutil/configurator"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring
|
||||
@ -11,7 +12,6 @@ import (
|
||||
_ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/slashing" // import as blank for app wiring
|
||||
_ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring
|
||||
)
|
||||
|
||||
|
||||
@ -188,6 +188,7 @@ require (
|
||||
replace (
|
||||
cosmossdk.io/x/distribution => ../distribution
|
||||
cosmossdk.io/x/gov => ../gov
|
||||
cosmossdk.io/x/slashing => ../slashing
|
||||
github.com/cosmos/cosmos-sdk => ../../.
|
||||
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user