Remove legacy gov proposal dependencies (#1587)

* Remove legacy gov proposal dependencies

* Fix comments

* Fix lint

* Update files

* Fix lint

* Fix lint
This commit is contained in:
pinosu
2023-09-07 15:13:19 +02:00
committed by GitHub
parent 0f82c95b6d
commit 09b50085cd
13 changed files with 168 additions and 162 deletions

View File

@@ -6,14 +6,12 @@ import (
dbm "github.com/cometbft/cometbft-db"
"github.com/cometbft/cometbft/libs/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)
var emptyWasmOpts []wasmkeeper.Option
@@ -28,7 +26,7 @@ func TestWasmdExport(t *testing.T) {
gapp.Commit()
// Making a new app object with the db, so that initchain hasn't been called
newGapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, wasmtypes.EnableAllProposals, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), emptyWasmOpts)
newGapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), emptyWasmOpts)
_, err := newGapp.ExportAppStateAndValidators(false, []string{}, nil)
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
}
@@ -54,34 +52,3 @@ func TestGetMaccPerms(t *testing.T) {
dup := GetMaccPerms()
require.Equal(t, maccPerms, dup, "duplicated module account permissions differed from actual module account permissions")
}
func TestGetEnabledProposals(t *testing.T) {
cases := map[string]struct {
proposalsEnabled string
specificEnabled string
expected []wasmtypes.ProposalType
}{
"all disabled": {
proposalsEnabled: "false",
expected: wasmtypes.DisableAllProposals,
},
"all enabled": {
proposalsEnabled: "true",
expected: wasmtypes.EnableAllProposals,
},
"some enabled": {
proposalsEnabled: "okay",
specificEnabled: "StoreCode,InstantiateContract",
expected: []wasmtypes.ProposalType{wasmtypes.ProposalTypeStoreCode, wasmtypes.ProposalTypeInstantiateContract},
},
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
ProposalsEnabled = tc.proposalsEnabled
EnableSpecificProposals = tc.specificEnabled
proposals := GetEnabledProposals()
assert.Equal(t, tc.expected, proposals)
})
}
}