Skip to content

Commit

Permalink
feat(staking)!: add consensus and validator address codec in staking (#…
Browse files Browse the repository at this point in the history
…16959)

Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
(cherry picked from commit e0be2b8)

# Conflicts:
#	client/v2/go.mod
#	client/v2/go.sum
#	simapp/go.mod
#	simapp/go.sum
#	tests/go.mod
#	tests/go.sum
#	x/staking/keeper/keeper_test.go
  • Loading branch information
julienrbrt authored and mergify[bot] committed Jul 13, 2023
1 parent 77562a6 commit 3b7b0aa
Show file tree
Hide file tree
Showing 38 changed files with 209 additions and 133 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### API Breaking Changes

* (staking) [#16959](https://github.com/cosmos/cosmos-sdk/pull/16959) Add validator and consensus address codec as staking keeper arguments.
* (types) [#16272](https://github.com/cosmos/cosmos-sdk/pull/16272) From now the `FeeGranter` in the `FeeTx` interface takes the byte type instead of string.
* (testutil) [#16899](https://github.com/cosmos/cosmos-sdk/pull/16899) The *cli testutil* `QueryBalancesExec` has been removed. Use the gRPC or REST query instead.
* (x/auth) [#16650](https://github.com/cosmos/cosmos-sdk/pull/16650) The *cli testutil* `QueryAccountExec` has been removed. Use the gRPC or REST query instead.
Expand Down Expand Up @@ -95,7 +96,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (x/staking) [#16324](https://github.com/cosmos/cosmos-sdk/pull/16324) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error`. Notable changes:
* `Validator` method now returns `types.ErrNoValidatorFound` instead of `nil` when not found.
* (x/auth) [#16621](https://github.com/cosmos/cosmos-sdk/pull/16621), [#16768](https://github.com/cosmos/cosmos-sdk/pull/16768) Pass address codecs to auth new keeper constructor.
* (x/auth) [#16621](https://github.com/cosmos/cosmos-sdk/pull/16621) Pass address codec to auth new keeper constructor.
* (x/auth/vesting) [#16741](https://github.com/cosmos/cosmos-sdk/pull/16741) Vesting account constructor now return an error with the result of their validate function.

## [v0.50.0-alpha.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.0-alpha.0) - 2023-06-07
Expand Down
4 changes: 2 additions & 2 deletions client/v2/autocli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

// AppOptions are autocli options for an app. These options can be built via depinject based on an app config. Ex:
Expand All @@ -39,7 +39,7 @@ type AppOptions struct {

// AddressCodec is the address codec to use for the app.
AddressCodec address.Codec
ValidatorAddressCodec authtypes.ValidatorAddressCodec
ValidatorAddressCodec stakingtypes.ValidatorAddressCodec
}

// EnhanceRootCommand enhances the provided root command with autocli AppOptions,
Expand Down
8 changes: 6 additions & 2 deletions client/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ module cosmossdk.io/client/v2
go 1.20

require (
cosmossdk.io/api v0.5.0
cosmossdk.io/api v0.6.0
cosmossdk.io/core v0.9.0
cosmossdk.io/depinject v1.0.0-alpha.3
github.com/cockroachdb/errors v1.10.0
github.com/cosmos/cosmos-proto v1.0.0-beta.3
<<<<<<< HEAD
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1
=======
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230712155822-3b269baa9c90
>>>>>>> e0be2b80f (feat(staking)!: add consensus and validator address codec in staking (#16959))
github.com/cosmos/gogoproto v1.4.10
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
Expand All @@ -22,7 +26,7 @@ require (
require (
cosmossdk.io/collections v0.3.0 // indirect
cosmossdk.io/errors v1.0.0 // indirect
cosmossdk.io/log v1.1.0 // indirect
cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca // indirect
cosmossdk.io/math v1.0.1 // indirect
cosmossdk.io/store v1.0.0-alpha.1 // indirect
cosmossdk.io/x/tx v0.8.0 // indirect
Expand Down
14 changes: 10 additions & 4 deletions client/v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc=
cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE=
cosmossdk.io/api v0.6.0 h1:AEpx/sRZaQEusARZqAxbg20zRXnS6e1F+uoal39trOM=
cosmossdk.io/api v0.6.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M=
cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08=
cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg=
cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic=
Expand All @@ -45,8 +45,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z
cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0=
cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4=
cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ=
cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c=
cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg=
cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k=
cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ=
Expand Down Expand Up @@ -98,6 +98,7 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s=
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c=
github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U=
github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ=
Expand Down Expand Up @@ -160,8 +161,13 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0
github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U=
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
<<<<<<< HEAD
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1 h1:7ERS+ZW1tTly/DLfUwjMB6h80wtlNGBcFjI2Eb9eZIU=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1/go.mod h1:xee+suLR+WgtzSQBr0jjXQsvb1FIteMfnEzbr2Lk+4w=
=======
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230712155822-3b269baa9c90 h1:DBxe7gSu1/UPsSqsimostzeis6P732bBTbxG511s/WA=
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230712155822-3b269baa9c90/go.mod h1:L/QMvN62eJFdeaf5AlQPI3g4dSwwsdPA5YCnMbxCvjc=
>>>>>>> e0be2b80f (feat(staking)!: add consensus and validator address codec in staking (#16959))
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ go 1.20
module github.com/cosmos/cosmos-sdk

require (
cosmossdk.io/api v0.5.0
cosmossdk.io/api v0.6.0
cosmossdk.io/collections v0.3.0
cosmossdk.io/core v0.9.0
cosmossdk.io/depinject v1.0.0-alpha.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc=
cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE=
cosmossdk.io/api v0.6.0 h1:AEpx/sRZaQEusARZqAxbg20zRXnS6e1F+uoal39trOM=
cosmossdk.io/api v0.6.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M=
cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08=
cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg=
cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic=
Expand Down
4 changes: 2 additions & 2 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func NewSimApp(
bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore)

// add keepers
app.AccountKeeper = authkeeper.NewAccountKeeper(appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, authcodec.NewBech32Codec(sdk.Bech32MainPrefix), authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String())
app.AccountKeeper = authkeeper.NewAccountKeeper(appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String())

app.BankKeeper = bankkeeper.NewBaseKeeper(
appCodec,
Expand All @@ -291,7 +291,7 @@ func NewSimApp(
logger,
)
app.StakingKeeper = stakingkeeper.NewKeeper(
appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
)
app.MintKeeper = mintkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[minttypes.StoreKey]), app.StakingKeeper, app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String())

Expand Down
10 changes: 7 additions & 3 deletions simapp/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ var (
Name: authtypes.ModuleName,
Config: appconfig.WrapAny(&authmodulev1.Module{
Bech32Prefix: "cosmos",
Bech32PrefixValidator: "cosmosvaloper",
ModuleAccountPermissions: moduleAccPerms,
// By default modules authority is the governance module. This is configurable with the following:
// Authority: "group", // A custom module authority can be set using a module name
Expand All @@ -186,8 +185,13 @@ var (
}),
},
{
Name: stakingtypes.ModuleName,
Config: appconfig.WrapAny(&stakingmodulev1.Module{}),
Name: stakingtypes.ModuleName,
Config: appconfig.WrapAny(&stakingmodulev1.Module{
// NOTE: specifying a prefix is only necessary when using bech32 addresses
// If not specfied, the auth Bech32Prefix appended with "valoper" and "valcons" is used by default
Bech32PrefixValidator: "cosmosvaloper",
Bech32PrefixConsensus: "cosmosvalcons",
}),
},
{
Name: slashingtypes.ModuleName,
Expand Down
18 changes: 13 additions & 5 deletions simapp/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/types/msgservice"
"github.com/cosmos/cosmos-sdk/x/auth"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module"
"github.com/cosmos/cosmos-sdk/x/bank"
Expand All @@ -42,6 +41,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/params"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

func TestSimAppExportAndBlockedAddrs(t *testing.T) {
Expand Down Expand Up @@ -315,21 +315,25 @@ func (c customAddressCodec) BytesToString(bz []byte) (string, error) {

func TestAddressCodecFactory(t *testing.T) {
var addrCodec address.Codec
var valAddressCodec authtypes.ValidatorAddressCodec
var valAddressCodec stakingtypes.ValidatorAddressCodec
var consAddressCodec stakingtypes.ConsensusAddressCodec

err := depinject.Inject(
depinject.Configs(
network.MinimumAppConfig(),
depinject.Supply(log.NewNopLogger()),
),
&addrCodec, &valAddressCodec)
&addrCodec, &valAddressCodec, &consAddressCodec)
require.NoError(t, err)
require.NotNil(t, addrCodec)
_, ok := addrCodec.(customAddressCodec)
require.False(t, ok)
require.NotNil(t, valAddressCodec)
_, ok = valAddressCodec.(customAddressCodec)
require.False(t, ok)
require.NotNil(t, consAddressCodec)
_, ok = consAddressCodec.(customAddressCodec)
require.False(t, ok)

// Set the address codec to the custom one
err = depinject.Inject(
Expand All @@ -338,15 +342,19 @@ func TestAddressCodecFactory(t *testing.T) {
depinject.Supply(
log.NewNopLogger(),
func() address.Codec { return customAddressCodec{} },
func() authtypes.ValidatorAddressCodec { return customAddressCodec{} },
func() stakingtypes.ValidatorAddressCodec { return customAddressCodec{} },
func() stakingtypes.ConsensusAddressCodec { return customAddressCodec{} },
),
),
&addrCodec, &valAddressCodec)
&addrCodec, &valAddressCodec, &consAddressCodec)
require.NoError(t, err)
require.NotNil(t, addrCodec)
_, ok = addrCodec.(customAddressCodec)
require.True(t, ok)
require.NotNil(t, valAddressCodec)
_, ok = valAddressCodec.(customAddressCodec)
require.True(t, ok)
require.NotNil(t, consAddressCodec)
_, ok = consAddressCodec.(customAddressCodec)
require.True(t, ok)
}
18 changes: 13 additions & 5 deletions simapp/app_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,28 @@ func NewSimApp(
// add it below. By default the auth module uses simulation.RandomGenesisAccounts.
//
// authtypes.RandomGenesisAccountsFn(simulation.RandomGenesisAccounts),

//
// For providing a custom a base account type add it below.
// By default the auth module uses authtypes.ProtoBaseAccount().
//
// func() sdk.AccountI { return authtypes.ProtoBaseAccount() },

//
// For providing a different address codec, add it below.
// By default the auth module uses a Bech32 address codec,
// with the prefix defined in the auth module configuration.
// NOTE, if a custom address codec is provided, a custom validator
// address codec must be provided as well.
//
// func() address.Codec { return <- custom address codec type -> }
// func() auth.ValidatorAddressCodec { return <- custom validator address codec type -> }

//
// STAKING
//
// For provinding a different validator and consensus address codec, add it below.
// By default the staking module uses the bech32 prefix provided in the auth config,
// and appends "valoper" and "valcons" for validator and consensus addresses respectively.
// When providing a custom address codec in auth, a custom codec must be provided here as well.
//
// func() stakingtypes.ValidatorAddressCodec { return <- custom validator address codec type -> }
// func() stakingtypes.ConsensusAddressCodec { return <- custom consensus address codec type -> }

//
// MINT
Expand Down
5 changes: 5 additions & 0 deletions simapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ module cosmossdk.io/simapp
go 1.20

require (
<<<<<<< HEAD
cosmossdk.io/api v0.5.0
cosmossdk.io/client/v2 v2.0.0-20230706173432-bc5eb31751de
=======
cosmossdk.io/api v0.6.0
cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860
>>>>>>> e0be2b80f (feat(staking)!: add consensus and validator address codec in staking (#16959))
cosmossdk.io/core v0.9.0
cosmossdk.io/depinject v1.0.0-alpha.3
cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca
Expand Down
5 changes: 5 additions & 0 deletions simapp/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,15 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX
cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg=
cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
<<<<<<< HEAD
cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc=
cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE=
cosmossdk.io/client/v2 v2.0.0-20230706173432-bc5eb31751de h1:RVE6LX+OPeQhz9kgzAcrC7Zot34leCc1S6d6Zhp7t3c=
cosmossdk.io/client/v2 v2.0.0-20230706173432-bc5eb31751de/go.mod h1:fVvL7eswXH3VmJVr96BYjovTXXriU6OjUPktjXxOmNU=
=======
cosmossdk.io/api v0.6.0 h1:AEpx/sRZaQEusARZqAxbg20zRXnS6e1F+uoal39trOM=
cosmossdk.io/api v0.6.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M=
>>>>>>> e0be2b80f (feat(staking)!: add consensus and validator address codec in staking (#16959))
cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08=
cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg=
cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic=
Expand Down
5 changes: 5 additions & 0 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ module github.com/cosmos/cosmos-sdk/tests
go 1.20

require (
<<<<<<< HEAD
cosmossdk.io/api v0.5.0
cosmossdk.io/collections v0.3.0 // indirect
=======
cosmossdk.io/api v0.6.0
cosmossdk.io/collections v0.3.0
>>>>>>> e0be2b80f (feat(staking)!: add consensus and validator address codec in staking (#16959))
cosmossdk.io/core v0.9.0
cosmossdk.io/depinject v1.0.0-alpha.3
cosmossdk.io/errors v1.0.0
Expand Down
5 changes: 5 additions & 0 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,15 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX
cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg=
cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
<<<<<<< HEAD
cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc=
cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE=
cosmossdk.io/client/v2 v2.0.0-20230706173432-bc5eb31751de h1:RVE6LX+OPeQhz9kgzAcrC7Zot34leCc1S6d6Zhp7t3c=
cosmossdk.io/client/v2 v2.0.0-20230706173432-bc5eb31751de/go.mod h1:fVvL7eswXH3VmJVr96BYjovTXXriU6OjUPktjXxOmNU=
=======
cosmossdk.io/api v0.6.0 h1:AEpx/sRZaQEusARZqAxbg20zRXnS6e1F+uoal39trOM=
cosmossdk.io/api v0.6.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M=
>>>>>>> e0be2b80f (feat(staking)!: add consensus and validator address codec in staking (#16959))
cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08=
cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg=
cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic=
Expand Down
1 change: 0 additions & 1 deletion tests/integration/bank/keeper/deterministic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture {
authtypes.ProtoBaseAccount,
maccPerms,
addresscodec.NewBech32Codec(sdk.Bech32MainPrefix),
addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr),
sdk.Bech32MainPrefix,
authority.String(),
)
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/distribution/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func initFixture(t testing.TB) *fixture {
authtypes.ProtoBaseAccount,
maccPerms,
addresscodec.NewBech32Codec(sdk.Bech32MainPrefix),
addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr),
sdk.Bech32MainPrefix,
authority.String(),
)
Expand All @@ -99,7 +98,7 @@ func initFixture(t testing.TB) *fixture {
log.NewNopLogger(),
)

stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String())
stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr))

distrKeeper := distrkeeper.NewKeeper(
cdc, runtime.NewKVStoreService(keys[distrtypes.StoreKey]), accountKeeper, bankKeeper, stakingKeeper, distrtypes.ModuleName, authority.String(),
Expand Down
Loading

0 comments on commit 3b7b0aa

Please sign in to comment.