Skip to content

Commit

Permalink
Merge branch 'main' into nullpointer0x00/msgfees-param-store-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed Apr 16, 2024
2 parents 3123253 + bca9164 commit a614504
Show file tree
Hide file tree
Showing 67 changed files with 786 additions and 1,036 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/proto-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
git commit -S -m "Update buf.lock to latest commit hash"
- name: Create Pull Request
id: cpr
uses: peter-evans/[email protected].2
uses: peter-evans/[email protected].3
with:
base: main
branch: provenanceio-bot/patch-buf-lock
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* 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)
* 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).
* Use fields of the SimulationState for the encoders needed for simulations [#1931](https://github.com/provenance-io/provenance/pull/1931).

### Dependencies

Expand All @@ -72,6 +76,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
- Bump `github.com/cometbft/cometbft` from 0.38.5 to 0.38.6 ([#1912](https://github.com/provenance-io/provenance/pull/1912))
- Bump `cosmossdk.io/x/upgrade` from 0.1.0 to 0.1.1 ([#1913](https://github.com/provenance-io/provenance/pull/1913))
- Bump `github.com/hashicorp/go-metrics` from 0.5.2 to 0.5.3 ([#1914](https://github.com/provenance-io/provenance/pull/1914))
- Bump `peter-evans/create-pull-request` from 6.0.2 to 6.0.3 ([#1929](https://github.com/provenance-io/provenance/pull/1929))

---

Expand Down
26 changes: 6 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ install: go.sum
CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install $(BUILD_FLAGS) ./cmd/provenanced

build: validate-go-version go.sum
# TODO[1760]: Remove this delay once we're stable again.
# TODO[1760]: Remove this delay once we're stable again.
@if [ -z "${ACK_50}" ]; then printf '\033[93mWARNING:\033[0m This branch is currently unstable and should not be built for use.\n To bypass this 10 second delay: ACK_50=1 make build\n'; sleep 10; fi
mkdir -p $(BUILDDIR)
CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build -o $(BUILDDIR)/ $(BUILD_FLAGS) ./cmd/provenanced
Expand Down Expand Up @@ -330,50 +330,36 @@ PACKAGES := $(shell $(GO) list ./... 2>/dev/null || true)
PACKAGES_NOSIMULATION := $(filter-out %/simulation%,$(PACKAGES))
PACKAGES_SIMULATION := $(filter %/simulation%,$(PACKAGES))

TEST_PACKAGES=./...
TEST_TARGETS := test-unit test-unit-amino test-unit-proto test-ledger-mock test-race test-ledger test-race
TEST_PACKAGES ?= ./...
TEST_TARGETS := test-unit test-unit-proto test-ledger-mock test-race test-ledger build-tests

# Test runs-specific rules. To add a new test target, just add
# a new rule, customise TAGS, ARGS and/or TEST_PACKAGES ad libitum, and
# append the new rule to the TEST_TARGETS list.
test-unit: TAGS+=cgo ledger test_ledger_mock norace
test-unit-amino: TAGS+=ledger test_ledger_mock test_amino norace
build-tests: TAGS+=cgo ledger test_ledger_mock norace
build-tests: ARGS+=-run='ZYX_NOPE_NOPE_XYZ'
test-ledger: TAGS+=cgo ledger norace
test-ledger-mock: TAGS+=ledger test_ledger_mock norace
test-race: ARGS+=-race
test-race: TAGS+=cgo ledger test_ledger_mock
test-race: TEST_PACKAGES=$(PACKAGES_NOSIMULATION)
$(TEST_TARGETS): run-tests

# check-* compiles and collects tests without running them
# note: go test -c doesn't support multiple packages yet (https://github.com/golang/go/issues/15513)
CHECK_TEST_TARGETS := check-test-unit check-test-unit-amino
check-test-unit: TAGS+=cgo ledger test_ledger_mock norace
check-test-unit-amino: TAGS+=ledger test_ledger_mock test_amino norace
$(CHECK_TEST_TARGETS): ARGS+=-run=none
$(CHECK_TEST_TARGETS): run-tests

run-tests: go.sum
ifneq (,$(shell which tparse 2>/dev/null))
$(GO) test -mod=readonly -json $(ARGS) -tags='$(TAGS)' $(TEST_PACKAGES) | tparse
else
$(GO) test -mod=readonly $(ARGS) -tags='$(TAGS)' $(TEST_PACKAGES)
endif

build-tests: go.sum
ifneq (,$(shell which tparse 2>/dev/null))
$(GO) test -mod=readonly -json $(ARGS) -tags='$(TAGS)' -run='ZYX_NOPE_NOPE_XYZ' $(TEST_PACKAGES) | tparse
else
$(GO) test -mod=readonly $(ARGS) -tags='$(TAGS)' -run='ZYX_NOPE_NOPE_XYZ' $(TEST_PACKAGES)
endif

test-cover:
export VERSION=$(VERSION); bash -x contrib/test_cover.sh

benchmark:
$(GO) test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION)

.PHONY: test test-all test-unit test-race test-cover benchmark run-tests build-tests $(TEST_TARGETS)
.PHONY: test test-all test-cover benchmark run-tests build-tests $(TEST_TARGETS)

##############################
# Test Network Targets
Expand Down
20 changes: 10 additions & 10 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,31 @@ 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"

"cosmossdk.io/log"
sdkmath "cosmossdk.io/math"
"cosmossdk.io/x/tx/signing"

storetypes "cosmossdk.io/store/types"
"cosmossdk.io/x/evidence"
evidencekeeper "cosmossdk.io/x/evidence/keeper"
evidencetypes "cosmossdk.io/x/evidence/types"
"cosmossdk.io/x/feegrant"
feegrantkeeper "cosmossdk.io/x/feegrant/keeper"
feegrantmodule "cosmossdk.io/x/feegrant/module"
"cosmossdk.io/x/tx/signing"
"cosmossdk.io/x/upgrade"
upgradekeeper "cosmossdk.io/x/upgrade/keeper"
upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/std"
"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"
Expand All @@ -47,11 +44,13 @@ import (
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/server/api"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/std"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
Expand Down Expand Up @@ -107,11 +106,12 @@ import (
"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"
"github.com/cosmos/gogoproto/proto"

"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"
ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"

icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
Expand Down Expand Up @@ -248,7 +248,7 @@ type App struct {

// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
BankKeeper bankkeeper.BaseKeeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
Expand Down
3 changes: 1 addition & 2 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"cosmossdk.io/log"
sdkmath "cosmossdk.io/math"
sdksim "cosmossdk.io/simapp"

dbm "github.com/cosmos/cosmos-db"
sdktypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down Expand Up @@ -159,7 +158,7 @@ func TestExportAppStateAndValidators(t *testing.T) {
exported, err := app.ExportAppStateAndValidators(false, nil, nil)
require.NoError(t, err, "ExportAppStateAndValidators")

var genState sdksim.GenesisState
var genState map[string]json.RawMessage
err = json.Unmarshal(exported.AppState, &genState)
require.NoError(t, err, "unmarshalling exported app state")

Expand Down
27 changes: 0 additions & 27 deletions app/params/amino.go

This file was deleted.

49 changes: 0 additions & 49 deletions app/params/proto.go

This file was deleted.

13 changes: 6 additions & 7 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"

"cosmossdk.io/log"
sdksim "cosmossdk.io/simapp"
"cosmossdk.io/store"
storetypes "cosmossdk.io/store/types"
evidencetypes "cosmossdk.io/x/evidence/types"
Expand Down Expand Up @@ -71,7 +70,7 @@ type StoreKeysPrefixes struct {
Prefixes [][]byte
}

// ProvAppStateFn wraps the sdksim.AppStateFn and sets the ICA GenesisState if isn't yet defined in the appState.
// ProvAppStateFn wraps the simtypes.AppStateFn and sets the ICA GenesisState if isn't yet defined in the appState.
func ProvAppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager, genesisState map[string]json.RawMessage) simtypes.AppStateFn {
return func(r *rand.Rand, accs []simtypes.Account, config simtypes.Config) (json.RawMessage, []simtypes.Account, string, time.Time) {
appState, simAccs, chainID, genesisTimestamp := simtestutil.AppStateFn(cdc, simManager, genesisState)(r, accs, config)
Expand Down Expand Up @@ -201,7 +200,7 @@ func TestSimple(t *testing.T) {
// /usr/local/go/bin/go test -benchmem -run=^$ github.com/provenance-io/provenance -bench ^BenchmarkFullAppSimulation$ -Commit=true -cpuprofile cpu.out
func TestAppImportExport(t *testing.T) {
// uncomment to run in ide without flags.
//sdksim.FlagEnabledValue = true
//simcli.FlagEnabledValue = true

config, db, dir, logger, skip, err := setupSimulation("leveldb-app-sim", "Simulation")
if skip {
Expand Down Expand Up @@ -257,7 +256,7 @@ func TestAppImportExport(t *testing.T) {

newApp := New(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, home, simcli.FlagPeriodValue, simtestutil.EmptyAppOptions{}, fauxMerkleModeOpt)

var genesisState sdksim.GenesisState
var genesisState map[string]json.RawMessage
err = json.Unmarshal(exported.AppState, &genesisState)
require.NoError(t, err)

Expand Down Expand Up @@ -402,9 +401,9 @@ func TestAppSimulationAfterImport(t *testing.T) {
// and doesn't depend on the application.
func TestAppStateDeterminism(t *testing.T) {
// uncomment these to run in ide without flags.
//sdksim.FlagEnabledValue = true
//sdksim.FlagBlockSizeValue = 100
//sdksim.FlagNumBlocksValue = 50
//simcli.FlagEnabledValue = true
//simcli.FlagBlockSizeValue = 100
//simcli.FlagNumBlocksValue = 50

if !simcli.FlagEnabledValue {
t.Skip("skipping application simulation")
Expand Down
Loading

0 comments on commit a614504

Please sign in to comment.