Move enabled gov types to app construction
This commit is contained in:
13
app/app.go
13
app/app.go
@@ -137,10 +137,9 @@ type WasmWrapper struct {
|
||||
}
|
||||
|
||||
// NewWasmApp returns a reference to an initialized WasmApp.
|
||||
func NewWasmApp(
|
||||
logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool,
|
||||
invCheckPeriod uint, skipUpgradeHeights map[int64]bool, baseAppOptions ...func(*bam.BaseApp),
|
||||
) *WasmApp {
|
||||
func NewWasmApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool,
|
||||
invCheckPeriod uint, enabledProposals []wasm.ProposalType, skipUpgradeHeights map[int64]bool,
|
||||
baseAppOptions ...func(*bam.BaseApp)) *WasmApp {
|
||||
|
||||
cdc := MakeCodec()
|
||||
|
||||
@@ -252,9 +251,9 @@ func NewWasmApp(
|
||||
supportedFeatures := "staking"
|
||||
app.wasmKeeper = wasm.NewKeeper(app.cdc, keys[wasm.StoreKey], app.subspaces[wasm.ModuleName], app.accountKeeper, app.bankKeeper, app.stakingKeeper, wasmRouter, wasmDir, wasmConfig, supportedFeatures, nil, nil)
|
||||
|
||||
// The gov proposal types can be individually enabled. As default all wasm gov types are supported here.
|
||||
if len(wasm.DefaultEnabledProposals) != 0 {
|
||||
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.wasmKeeper, wasm.DefaultEnabledProposals))
|
||||
// The gov proposal types can be individually enabled
|
||||
if len(enabledProposals) != 0 {
|
||||
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.wasmKeeper, enabledProposals))
|
||||
}
|
||||
|
||||
app.govKeeper = gov.NewKeeper(
|
||||
|
||||
@@ -17,12 +17,12 @@ import (
|
||||
|
||||
func TestWasmdExport(t *testing.T) {
|
||||
db := db.NewMemDB()
|
||||
gapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, map[int64]bool{})
|
||||
gapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, wasm.DefaultEnabledProposals, map[int64]bool{})
|
||||
err := setGenesis(gapp)
|
||||
require.NoError(t, err)
|
||||
|
||||
// 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, 0, map[int64]bool{})
|
||||
newGapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, wasm.DefaultEnabledProposals, map[int64]bool{})
|
||||
_, _, err = newGapp.ExportAppStateAndValidators(false, []string{})
|
||||
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
|
||||
}
|
||||
@@ -30,7 +30,7 @@ func TestWasmdExport(t *testing.T) {
|
||||
// ensure that black listed addresses are properly set in bank keeper
|
||||
func TestBlackListedAddrs(t *testing.T) {
|
||||
db := db.NewMemDB()
|
||||
gapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, map[int64]bool{})
|
||||
gapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, wasm.DefaultEnabledProposals, map[int64]bool{})
|
||||
|
||||
for acc := range maccPerms {
|
||||
require.True(t, gapp.bankKeeper.BlacklistedAddr(gapp.supplyKeeper.GetModuleAddress(acc)))
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
|
||||
wasmd "github.com/CosmWasm/wasmd/app"
|
||||
"github.com/CosmWasm/wasmd/x/wasm"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
@@ -31,7 +32,7 @@ const (
|
||||
// Setup initializes a new wasmd.WasmApp. A Nop logger is set in WasmApp.
|
||||
func Setup(isCheckTx bool) *wasmd.WasmApp {
|
||||
db := dbm.NewMemDB()
|
||||
app := wasmd.NewWasmApp(log.NewNopLogger(), db, nil, true, 0, nil)
|
||||
app := wasmd.NewWasmApp(log.NewNopLogger(), db, nil, true, 0, wasm.DefaultEnabledProposals, nil)
|
||||
// app := wasmd.NewWasmApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, 0)
|
||||
if !isCheckTx {
|
||||
// init chain must be called to stop deliverState from being nil
|
||||
@@ -57,7 +58,7 @@ func Setup(isCheckTx bool) *wasmd.WasmApp {
|
||||
// genesis accounts.
|
||||
func SetupWithGenesisAccounts(genAccs []authexported.GenesisAccount) *wasmd.WasmApp {
|
||||
db := dbm.NewMemDB()
|
||||
app := wasmd.NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, nil)
|
||||
app := wasmd.NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, wasm.DefaultEnabledProposals, nil)
|
||||
// app := wasmd.NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, 0)
|
||||
|
||||
// initialize the chain with the passed in genesis accounts
|
||||
|
||||
@@ -5,10 +5,10 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/x/simulation"
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
)
|
||||
|
||||
// Profile with:
|
||||
@@ -27,7 +27,7 @@ func BenchmarkFullAppSimulation(b *testing.B) {
|
||||
}
|
||||
}()
|
||||
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, interBlockCacheOpt())
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, wasm.DefaultEnabledProposals, map[int64]bool{}, interBlockCacheOpt())
|
||||
|
||||
// run randomized simulation
|
||||
_, simParams, simErr := simulation.SimulateFromSeed(
|
||||
@@ -66,7 +66,7 @@ func BenchmarkInvariants(b *testing.B) {
|
||||
}
|
||||
}()
|
||||
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, interBlockCacheOpt())
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, wasm.DefaultEnabledProposals, map[int64]bool{}, interBlockCacheOpt())
|
||||
|
||||
// run randomized simulation
|
||||
_, simParams, simErr := simulation.SimulateFromSeed(
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
wasm2 "github.com/CosmWasm/wasmd/x/wasm"
|
||||
"github.com/stretchr/testify/require"
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
@@ -62,7 +63,7 @@ func TestFullAppSimulation(t *testing.T) {
|
||||
require.NoError(t, os.RemoveAll(dir))
|
||||
}()
|
||||
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, wasm2.DefaultEnabledProposals, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
require.Equal(t, appName, app.Name())
|
||||
|
||||
// run randomized simulation
|
||||
@@ -94,7 +95,7 @@ func TestAppImportExport(t *testing.T) {
|
||||
require.NoError(t, os.RemoveAll(dir))
|
||||
}()
|
||||
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, wasm2.DefaultEnabledProposals, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
require.Equal(t, appName, app.Name())
|
||||
|
||||
// Run randomized simulation
|
||||
@@ -128,7 +129,7 @@ func TestAppImportExport(t *testing.T) {
|
||||
require.NoError(t, os.RemoveAll(newDir))
|
||||
}()
|
||||
|
||||
newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, wasm2.DefaultEnabledProposals, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
require.Equal(t, appName, newApp.Name())
|
||||
|
||||
var genesisState GenesisState
|
||||
@@ -180,7 +181,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
|
||||
require.NoError(t, os.RemoveAll(dir))
|
||||
}()
|
||||
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, wasm2.DefaultEnabledProposals, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
require.Equal(t, appName, app.Name())
|
||||
|
||||
// Run randomized simulation
|
||||
@@ -219,7 +220,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
|
||||
require.NoError(t, os.RemoveAll(newDir))
|
||||
}()
|
||||
|
||||
newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, wasm2.DefaultEnabledProposals, map[int64]bool{}, fauxMerkleModeOpt)
|
||||
require.Equal(t, appName, newApp.Name())
|
||||
|
||||
newApp.InitChain(abci.RequestInitChain{
|
||||
@@ -263,7 +264,7 @@ func TestAppStateDeterminism(t *testing.T) {
|
||||
|
||||
db := dbm.NewMemDB()
|
||||
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, interBlockCacheOpt())
|
||||
app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, wasm2.DefaultEnabledProposals, map[int64]bool{}, interBlockCacheOpt())
|
||||
|
||||
fmt.Printf(
|
||||
"running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n",
|
||||
|
||||
@@ -4,17 +4,8 @@ import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tendermint/tendermint/libs/cli"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
dbm "github.com/tendermint/tm-db"
|
||||
|
||||
"github.com/CosmWasm/wasmd/app"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm"
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/client/debug"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
@@ -24,6 +15,13 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tendermint/tendermint/libs/cli"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
dbm "github.com/tendermint/tm-db"
|
||||
)
|
||||
|
||||
const flagInvCheckPeriod = "inv-check-period"
|
||||
@@ -87,14 +85,13 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application
|
||||
skipUpgradeHeights[int64(h)] = true
|
||||
}
|
||||
|
||||
return app.NewWasmApp(
|
||||
logger, db, traceStore, true, invCheckPeriod, skipUpgradeHeights,
|
||||
return app.NewWasmApp(logger, db, traceStore, true, invCheckPeriod,
|
||||
wasm.DefaultEnabledProposals, skipUpgradeHeights,
|
||||
baseapp.SetPruning(store.NewPruningOptionsFromString(viper.GetString("pruning"))),
|
||||
baseapp.SetMinGasPrices(viper.GetString(server.FlagMinGasPrices)),
|
||||
baseapp.SetHaltHeight(viper.GetUint64(server.FlagHaltHeight)),
|
||||
baseapp.SetHaltTime(viper.GetUint64(server.FlagHaltTime)),
|
||||
baseapp.SetInterBlockCache(cache),
|
||||
)
|
||||
baseapp.SetInterBlockCache(cache))
|
||||
}
|
||||
|
||||
func exportAppStateAndTMValidators(
|
||||
@@ -102,7 +99,7 @@ func exportAppStateAndTMValidators(
|
||||
) (json.RawMessage, []tmtypes.GenesisValidator, error) {
|
||||
|
||||
if height != -1 {
|
||||
gapp := app.NewWasmApp(logger, db, traceStore, false, uint(1), nil)
|
||||
gapp := app.NewWasmApp(logger, db, traceStore, false, uint(1), wasm.DefaultEnabledProposals, nil)
|
||||
err := gapp.LoadHeight(height)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
@@ -110,6 +107,6 @@ func exportAppStateAndTMValidators(
|
||||
return gapp.ExportAppStateAndValidators(forZeroHeight, jailWhiteList)
|
||||
}
|
||||
|
||||
gapp := app.NewWasmApp(logger, db, traceStore, true, uint(1), nil)
|
||||
gapp := app.NewWasmApp(logger, db, traceStore, true, uint(1), wasm.DefaultEnabledProposals, nil)
|
||||
return gapp.ExportAppStateAndValidators(forZeroHeight, jailWhiteList)
|
||||
}
|
||||
|
||||
@@ -7,22 +7,20 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/CosmWasm/wasmd/app"
|
||||
"github.com/CosmWasm/wasmd/x/wasm"
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
"github.com/cosmos/cosmos-sdk/store"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
cpm "github.com/otiai10/copy"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
tmos "github.com/tendermint/tendermint/libs/os"
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
tmsm "github.com/tendermint/tendermint/state"
|
||||
tmstore "github.com/tendermint/tendermint/store"
|
||||
tm "github.com/tendermint/tendermint/types"
|
||||
|
||||
"github.com/CosmWasm/wasmd/app"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
"github.com/cosmos/cosmos-sdk/store"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
func replayCmd() *cobra.Command {
|
||||
@@ -94,9 +92,8 @@ func replayTxs(rootDir string) error {
|
||||
fmt.Fprintln(os.Stderr, "Creating application")
|
||||
gapp := app.NewWasmApp(
|
||||
// TODO: do we want to set skipUpgradeHieghts here?
|
||||
ctx.Logger, appDB, traceStoreWriter, true, uint(1), nil,
|
||||
baseapp.SetPruning(store.PruneEverything), // nothing
|
||||
)
|
||||
ctx.Logger, appDB, traceStoreWriter, true, uint(1), wasm.DefaultEnabledProposals, nil,
|
||||
baseapp.SetPruning(store.PruneEverything))
|
||||
|
||||
// Genesis
|
||||
var genDocPath = filepath.Join(configDir, "genesis.json")
|
||||
|
||||
@@ -50,6 +50,7 @@ import (
|
||||
dbm "github.com/tendermint/tm-db"
|
||||
|
||||
"github.com/CosmWasm/wasmd/app"
|
||||
"github.com/CosmWasm/wasmd/x/wasm"
|
||||
)
|
||||
|
||||
// TODO: Make InitializeTestLCD safe to call in multiple tests at the same time
|
||||
@@ -73,7 +74,7 @@ func InitializeLCD(nValidators int, initAddrs []sdk.AccAddress, minting bool, po
|
||||
logger = log.NewFilter(logger, log.AllowError())
|
||||
|
||||
db := dbm.NewMemDB()
|
||||
gapp := app.NewWasmApp(logger, db, nil, true, 0, nil, baseapp.SetPruning(store.PruneNothing))
|
||||
gapp := app.NewWasmApp(logger, db, nil, true, 0, wasm.DefaultEnabledProposals, nil, baseapp.SetPruning(store.PruneNothing))
|
||||
cdc = app.MakeCodec()
|
||||
|
||||
genDoc, valConsPubKeys, valOperAddrs, privVal, err := defaultGenesis(config, nValidators, initAddrs, minting)
|
||||
|
||||
@@ -91,6 +91,7 @@ var (
|
||||
)
|
||||
|
||||
type (
|
||||
ProposalType = types.ProposalType
|
||||
GenesisState = types.GenesisState
|
||||
Code = types.Code
|
||||
Contract = types.Contract
|
||||
|
||||
@@ -17,7 +17,11 @@ const ( // TODO: same as in handler
|
||||
)
|
||||
|
||||
// NewWasmProposalHandler creates a new governance Handler for wasm proposals
|
||||
func NewWasmProposalHandler(k Keeper, enabledTypes map[string]struct{}) govtypes.Handler {
|
||||
func NewWasmProposalHandler(k Keeper, enabledProposalTypes []types.ProposalType) govtypes.Handler {
|
||||
enabledTypes := make(map[string]struct{}, len(enabledProposalTypes))
|
||||
for i := range enabledProposalTypes {
|
||||
enabledTypes[string(enabledProposalTypes[i])] = struct{}{}
|
||||
}
|
||||
return func(ctx sdk.Context, content govtypes.Content) error {
|
||||
if content == nil {
|
||||
return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "content must not be empty")
|
||||
|
||||
@@ -11,29 +11,31 @@ import (
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
)
|
||||
|
||||
type ProposalType string
|
||||
|
||||
const (
|
||||
ProposalTypeStoreCode = "StoreCode"
|
||||
ProposalTypeStoreInstantiateContract = "InstantiateContract"
|
||||
ProposalTypeMigrateContract = "MigrateContract"
|
||||
ProposalTypeUpdateAdmin = "UpdateAdmin"
|
||||
ProposalTypeClearAdmin = "ClearAdmin"
|
||||
ProposalTypeStoreCode ProposalType = "StoreCode"
|
||||
ProposalTypeStoreInstantiateContract ProposalType = "InstantiateContract"
|
||||
ProposalTypeMigrateContract ProposalType = "MigrateContract"
|
||||
ProposalTypeUpdateAdmin ProposalType = "UpdateAdmin"
|
||||
ProposalTypeClearAdmin ProposalType = "ClearAdmin"
|
||||
)
|
||||
|
||||
// DefaultEnabledProposals contains all wasm gov types as keys.
|
||||
var DefaultEnabledProposals = map[string]struct{}{
|
||||
ProposalTypeStoreCode: {},
|
||||
ProposalTypeStoreInstantiateContract: {},
|
||||
ProposalTypeMigrateContract: {},
|
||||
ProposalTypeUpdateAdmin: {},
|
||||
ProposalTypeClearAdmin: {},
|
||||
var DefaultEnabledProposals = []ProposalType{
|
||||
ProposalTypeStoreCode,
|
||||
ProposalTypeStoreInstantiateContract,
|
||||
ProposalTypeMigrateContract,
|
||||
ProposalTypeUpdateAdmin,
|
||||
ProposalTypeClearAdmin,
|
||||
}
|
||||
|
||||
func init() { // register new content types with the sdk
|
||||
govtypes.RegisterProposalType(ProposalTypeStoreCode)
|
||||
govtypes.RegisterProposalType(ProposalTypeStoreInstantiateContract)
|
||||
govtypes.RegisterProposalType(ProposalTypeMigrateContract)
|
||||
govtypes.RegisterProposalType(ProposalTypeUpdateAdmin)
|
||||
govtypes.RegisterProposalType(ProposalTypeClearAdmin)
|
||||
govtypes.RegisterProposalType(string(ProposalTypeStoreCode))
|
||||
govtypes.RegisterProposalType(string(ProposalTypeStoreInstantiateContract))
|
||||
govtypes.RegisterProposalType(string(ProposalTypeMigrateContract))
|
||||
govtypes.RegisterProposalType(string(ProposalTypeUpdateAdmin))
|
||||
govtypes.RegisterProposalType(string(ProposalTypeClearAdmin))
|
||||
govtypes.RegisterProposalTypeCodec(StoreCodeProposal{}, "wasm/store-proposal")
|
||||
govtypes.RegisterProposalTypeCodec(InstantiateContractProposal{}, "wasm/instantiate-proposal")
|
||||
govtypes.RegisterProposalTypeCodec(MigrateContractProposal{}, "wasm/migrate-proposal")
|
||||
@@ -95,7 +97,7 @@ type StoreCodeProposal struct {
|
||||
}
|
||||
|
||||
// ProposalType returns the type
|
||||
func (p StoreCodeProposal) ProposalType() string { return ProposalTypeStoreCode }
|
||||
func (p StoreCodeProposal) ProposalType() string { return string(ProposalTypeStoreCode) }
|
||||
|
||||
// ValidateBasic validates the proposal
|
||||
func (p StoreCodeProposal) ValidateBasic() error {
|
||||
@@ -170,7 +172,7 @@ type InstantiateContractProposal struct {
|
||||
|
||||
// ProposalType returns the type
|
||||
func (p InstantiateContractProposal) ProposalType() string {
|
||||
return ProposalTypeStoreInstantiateContract
|
||||
return string(ProposalTypeStoreInstantiateContract)
|
||||
}
|
||||
|
||||
// ValidateBasic validates the proposal
|
||||
@@ -248,7 +250,7 @@ type MigrateContractProposal struct {
|
||||
}
|
||||
|
||||
// ProposalType returns the type
|
||||
func (p MigrateContractProposal) ProposalType() string { return ProposalTypeMigrateContract }
|
||||
func (p MigrateContractProposal) ProposalType() string { return string(ProposalTypeMigrateContract) }
|
||||
|
||||
// ValidateBasic validates the proposal
|
||||
func (p MigrateContractProposal) ValidateBasic() error {
|
||||
@@ -303,7 +305,7 @@ type UpdateAdminProposal struct {
|
||||
}
|
||||
|
||||
// ProposalType returns the type
|
||||
func (p UpdateAdminProposal) ProposalType() string { return ProposalTypeUpdateAdmin }
|
||||
func (p UpdateAdminProposal) ProposalType() string { return string(ProposalTypeUpdateAdmin) }
|
||||
|
||||
// ValidateBasic validates the proposal
|
||||
func (p UpdateAdminProposal) ValidateBasic() error {
|
||||
@@ -337,7 +339,7 @@ type ClearAdminProposal struct {
|
||||
}
|
||||
|
||||
// ProposalType returns the type
|
||||
func (p ClearAdminProposal) ProposalType() string { return ProposalTypeClearAdmin }
|
||||
func (p ClearAdminProposal) ProposalType() string { return string(ProposalTypeClearAdmin) }
|
||||
|
||||
// ValidateBasic validates the proposal
|
||||
func (p ClearAdminProposal) ValidateBasic() error {
|
||||
|
||||
Reference in New Issue
Block a user