Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/peter-evans/create…
Browse files Browse the repository at this point in the history
…-pull-request-6.0.4
  • Loading branch information
SpicyLemon authored Apr 19, 2024
2 parents b1e7e99 + b004ae3 commit d03d625
Show file tree
Hide file tree
Showing 103 changed files with 481 additions and 379 deletions.
40 changes: 36 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,29 @@ linters-settings:

- cosmossdk.io/core
- cosmossdk.io/errors
- cosmossdk.io/log
- cosmossdk.io/math
- cosmossdk.io/store
- github.com/cosmos/go-bip39
- cosmossdk.io/x/evidence
- cosmossdk.io/x/evidence/keeper
- cosmossdk.io/x/evidence/types
- cosmossdk.io/x/feegrant
- cosmossdk.io/x/feegrant/keeper
- cosmossdk.io/x/feegrant/module
- cosmossdk.io/x/tx/signing
- cosmossdk.io/x/upgrade
- cosmossdk.io/x/upgrade/keeper
- cosmossdk.io/x/upgrade/types
- github.com/cosmos/cosmos-db
- github.com/cosmos/cosmos-sdk
- github.com/cosmos/ibc-go/v6
- github.com/cosmos/go-bip39
- github.com/cosmos/ibc-apps/modules/async-icq/v8
- github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper
- github.com/cosmos/ibc-apps/modules/async-icq/v8/types
- github.com/cosmos/ibc-go/modules/capability
- github.com/cosmos/ibc-go/modules/capability/keeper
- github.com/cosmos/ibc-go/modules/capability/types
- github.com/cosmos/ibc-go/v8

- github.com/CosmWasm/wasmd
- github.com/CosmWasm/wasmvm/types
Expand All @@ -107,6 +125,8 @@ linters-settings:

- github.com/grpc-ecosystem/grpc-gateway

- github.com/hashicorp/go-metrics

- github.com/provenance-io/provenance

- github.com/rakyll/statik/fs
Expand All @@ -120,6 +140,18 @@ linters-settings:
- github.com/stretchr/testify/assert
- github.com/stretchr/testify/suite

- github.com/cometbft/cometbft/abci/types
- github.com/cometbft/cometbft/config
- github.com/cometbft/cometbft/crypto
- github.com/cometbft/cometbft/crypto/tmhash
- github.com/cometbft/cometbft/libs/cli
- github.com/cometbft/cometbft/libs/json
- github.com/cometbft/cometbft/libs/os
- github.com/cometbft/cometbft/libs/rand
- github.com/cometbft/cometbft/proto/tendermint/types
- github.com/cometbft/cometbft/rpc/jsonrpc/types
- github.com/cometbft/cometbft/types
- github.com/cometbft/cometbft/types/time
- github.com/cometbft/cometbft-db

- github.com/tendermint/tendermint
Expand All @@ -138,14 +170,14 @@ linters-settings:
sections:
- standard
- default
- prefix(github.com/tendermint)
- prefix(github.com/cometbft)
- prefix(cosmossdk.io)
- prefix(github.com/cosmos)
- prefix(github.com/provenance-io)
- blank
- dot
govet:
check-shadowing: true
shadow: true
settings:
printf:
funcs:
Expand Down
13 changes: 8 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Remove unused navs [#1920](https://github.com/provenance-io/provenance/issues/1920).
* Remove emitting of EventTypeMessage [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Update genutil for sdk 50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Migrate module params from param space to module store.
* Attribute module param migration [#1927](https://github.com/provenance-io/provenance/pull/1927)
* Marker module param migration [#1934](https://github.com/provenance-io/provenance/pull/1934)
* Metadata module param migration [#1932](https://github.com/provenance-io/provenance/pull/1932)
* Msgfees module param migration [#1936](https://github.com/provenance-io/provenance/pull/1936)
* Migrate module params from param space to module store.[#1760](https://github.com/provenance-io/provenance/issues/1935)
* Attribute module param migration [#1927](https://github.com/provenance-io/provenance/pull/1927).
* Marker module param migration [#1934](https://github.com/provenance-io/provenance/pull/1934).
* Metadata module param migration [#1932](https://github.com/provenance-io/provenance/pull/1932).
* Msgfees module param migration [#1936](https://github.com/provenance-io/provenance/pull/1936).
* Name module param migration [#1937](https://github.com/provenance-io/provenance/pull/1937).
* IbcHooks module param migration [#1939](https://github.com/provenance-io/provenance/pull/1939).
* Restore the hold module [#1930](https://github.com/provenance-io/provenance/pull/1930).
* Restore gov-prop cli commands and fix next key decoding [#1930](https://github.com/provenance-io/provenance/pull/1930).
* Switch to InputOutputCoinsProv for exchange transfers [#1930](https://github.com/provenance-io/provenance/pull/1930).
Expand Down Expand Up @@ -114,6 +116,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Remove the startup warning issued when disable-iavl-fastnode is true (we recommend keeping it as true if you already have it that way) [PR 1874](https://github.com/provenance-io/provenance/pull/1874).
* Switch to `github.com/cometbft/cometbft-db` `v0.7.0` (from `github.com/tendermint/tm-db` `v0.6.7`) [PR 1874](https://github.com/provenance-io/provenance/pull/1874).
* Allow NAV volume to exceed a marker's supply [PR 1883](https://github.com/provenance-io/provenance/pull/1883).
* Update linter settings and fix import ordering [PR 1938](https://github.com/provenance-io/provenance/pull/1938).

### Deprecated

Expand Down
52 changes: 24 additions & 28 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import (
"path/filepath"
"strings"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
"github.com/spf13/viper"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

abci "github.com/cometbft/cometbft/abci/types"
cmtos "github.com/cometbft/cometbft/libs/os"

Expand All @@ -34,10 +33,6 @@ import (
upgradekeeper "cosmossdk.io/x/upgrade/keeper"
upgradetypes "cosmossdk.io/x/upgrade/types"

icq "github.com/cosmos/ibc-apps/modules/async-icq/v8"
icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types"

dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand All @@ -60,7 +55,6 @@ import (
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
"github.com/cosmos/cosmos-sdk/x/auth/tx"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Expand Down Expand Up @@ -107,7 +101,9 @@ import (
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/gogoproto/proto"

icq "github.com/cosmos/ibc-apps/modules/async-icq/v8"
icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types"
"github.com/cosmos/ibc-go/modules/capability"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
Expand Down Expand Up @@ -343,7 +339,7 @@ func New(
})
appCodec := codec.NewProtoCodec(interfaceRegistry)
legacyAmino := codec.NewLegacyAmino()
txConfig := tx.NewTxConfig(appCodec, tx.DefaultSignModes)
txConfig := authtx.NewTxConfig(appCodec, authtx.DefaultSignModes)

std.RegisterLegacyAminoCodec(legacyAmino)
std.RegisterInterfaces(interfaceRegistry)
Expand Down Expand Up @@ -451,13 +447,14 @@ func New(
)

// optional: enable sign mode textual by overwriting the default tx config (after setting the bank keeper)
enabledSignModes := append(tx.DefaultSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL)
txConfigOpts := tx.ConfigOptions{
enabledSignModes := authtx.DefaultSignModes
enabledSignModes = append(enabledSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL)
txConfigOpts := authtx.ConfigOptions{
EnabledSignModes: enabledSignModes,
TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper),
}
var err error
txConfig, err = tx.NewTxConfigWithOptions(appCodec, txConfigOpts)
txConfig, err = authtx.NewTxConfigWithOptions(appCodec, txConfigOpts)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -508,8 +505,8 @@ func New(

// Configure the hooks keeper
hooksKeeper := ibchookskeeper.NewKeeper(
appCodec,
keys[ibchookstypes.StoreKey],
app.GetSubspace(ibchookstypes.ModuleName),
app.IBCKeeper.ChannelKeeper,
nil,
)
Expand Down Expand Up @@ -551,12 +548,10 @@ func New(
hooksTransferModule := ibchooks.NewIBCMiddleware(&rateLimitingTransferModule, &app.HooksICS4Wrapper)
app.TransferStack = &hooksTransferModule

app.NameKeeper = namekeeper.NewKeeper(
appCodec, keys[nametypes.StoreKey], app.GetSubspace(nametypes.ModuleName),
)
app.NameKeeper = namekeeper.NewKeeper(appCodec, keys[nametypes.StoreKey])

app.AttributeKeeper = attributekeeper.NewKeeper(
appCodec, keys[attributetypes.StoreKey], app.GetSubspace(attributetypes.ModuleName), app.AccountKeeper, &app.NameKeeper,
appCodec, keys[attributetypes.StoreKey], app.AccountKeeper, &app.NameKeeper,
)

markerReqAttrBypassAddrs := []sdk.AccAddress{
Expand Down Expand Up @@ -991,7 +986,9 @@ func New(

app.mm.RegisterInvariants(app.CrisisKeeper)
app.configurator = module.NewConfigurator(app.appCodec, app.BaseApp.MsgServiceRouter(), app.GRPCQueryRouter())
app.mm.RegisterServices(app.configurator)
if err := app.mm.RegisterServices(app.configurator); err != nil {
panic(err)
}

app.sm = module.NewSimulationManager(
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
Expand Down Expand Up @@ -1183,7 +1180,7 @@ func filterBeginBlockerEvents(responseBeginBlock sdk.BeginBlock) []abci.Event {
func shouldFilterEvent(e abci.Event) bool {
if e.Type == distrtypes.EventTypeCommission || e.Type == distrtypes.EventTypeRewards || e.Type == distrtypes.EventTypeProposerReward || e.Type == banktypes.EventTypeTransfer || e.Type == banktypes.EventTypeCoinSpent || e.Type == banktypes.EventTypeCoinReceived {
for _, a := range e.Attributes {
if string(a.Key) == sdk.AttributeKeyAmount && len(a.Value) == 0 {
if a.Key == sdk.AttributeKeyAmount && len(a.Value) == 0 {
return true
}
}
Expand All @@ -1202,7 +1199,9 @@ func (app *App) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()); err != nil {
panic(err)
}
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
}

Expand Down Expand Up @@ -1361,9 +1360,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypesv1.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)

paramsKeeper.Subspace(nametypes.ModuleName) // TODO[1760]: params: Migrate name params.
paramsKeeper.Subspace(wasmtypes.ModuleName)
paramsKeeper.Subspace(triggertypes.ModuleName) // TODO[1760]: params: Migrate trigger params.

// register the key tables for legacy param subspaces
keyTable := ibcclienttypes.ParamKeyTable()
Expand All @@ -1372,9 +1369,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable())
paramsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable())

paramsKeeper.Subspace(icqtypes.ModuleName) // TODO[1760]: params: Migrate icq params.
paramsKeeper.Subspace(ibchookstypes.ModuleName) // TODO[1760]: params: Migrate ibc-hooks params.

return paramsKeeper
}

Expand Down Expand Up @@ -1421,7 +1415,9 @@ func (app *App) injectUpgrade(name string) { //nolint:unused // This is designed
// But the upgrade keeper often its own migration stuff that change some store key stuff.
// ScheduleUpgrade tries to read some of that changed store stuff and fails if the migration hasn't
// been applied yet. So we're doing things the hard way here.
app.UpgradeKeeper.ClearUpgradePlan(ctx)
if err := app.UpgradeKeeper.ClearUpgradePlan(ctx); err != nil {
panic(err)
}
store := ctx.KVStore(app.GetKey(upgradetypes.StoreKey))
bz := app.appCodec.MustMarshal(&plan)
store.Set(upgradetypes.PlanKey(), bz)
Expand Down
2 changes: 1 addition & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func logAddrs(t *testing.T, addrs []sdk.AccAddress, name string) {
}
}

func assertNoDupeAccountNumbers(t *testing.T, ctx sdk.Context, app *App, accts []sdk.AccountI, name string) bool {
func assertNoDupeAccountNumbers(t *testing.T, _ sdk.Context, _ *App, accts []sdk.AccountI, name string) bool {
t.Helper()
byAcctNum := map[uint64][]sdk.AccountI{}
acctNums := []uint64{}
Expand Down
9 changes: 7 additions & 2 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,17 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str
/* Handle slashing state. */

// reset start height on signing infos
app.SlashingKeeper.IterateValidatorSigningInfos(
err = app.SlashingKeeper.IterateValidatorSigningInfos(
ctx,
func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) {
info.StartHeight = 0
app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info)
if err := app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info); err != nil {
panic(fmt.Errorf("could not set validator signing for %s: %w", addr, err))
}
return false
},
)
if err != nil {
panic(fmt.Errorf("could not iterate validator signing infos: %w", err))
}
}
3 changes: 1 addition & 2 deletions app/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ func (t GroupCheckerFunc) IsGroupAddress(ctx sdk.Context, account sdk.AccAddress
func NewGroupCheckerFunc(querier GroupPolicyQuerier) GroupCheckerFunc {
return GroupCheckerFunc(func(ctx sdk.Context, account sdk.AccAddress) bool {
msg := &group.QueryGroupPolicyInfoRequest{Address: account.String()}
goCtx := sdk.WrapSDKContext(ctx)
_, err := querier.GroupPolicyInfo(goCtx, msg)
_, err := querier.GroupPolicyInfo(ctx, msg)
return err == nil
})
}
Loading

0 comments on commit d03d625

Please sign in to comment.