diff --git a/x/wasm/keeper/contract_keeper.go b/x/wasm/keeper/contract_keeper.go index d9de71f66a..564adc5532 100644 --- a/x/wasm/keeper/contract_keeper.go +++ b/x/wasm/keeper/contract_keeper.go @@ -23,18 +23,6 @@ type decoratedKeeper interface { authZ AuthorizationPolicy, ) (sdk.AccAddress, []byte, error) - createAndInstantiate( - ctx sdk.Context, - creator, admin sdk.AccAddress, - wasmCode []byte, - instantiateAccess *types.AccessConfig, - initMsg []byte, - label string, - deposit sdk.Coins, - addressGenerator AddressGenerator, - authZ AuthorizationPolicy, - ) (sdk.AccAddress, []byte, error) - migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, msg []byte, authZ AuthorizationPolicy) ([]byte, error) setContractAdmin(ctx sdk.Context, contractAddress, caller, newAdmin sdk.AccAddress, authZ AuthorizationPolicy) error pinCode(ctx sdk.Context, codeID uint64) error @@ -140,15 +128,3 @@ func (p PermissionedKeeper) SetContractInfoExtension(ctx sdk.Context, contract s func (p PermissionedKeeper) SetAccessConfig(ctx sdk.Context, codeID uint64, caller sdk.AccAddress, newConfig types.AccessConfig) error { return p.nested.setAccessConfig(ctx, codeID, caller, newConfig, p.authZPolicy) } - -func (p PermissionedKeeper) CreateAndInstantiate( - ctx sdk.Context, - creator, admin sdk.AccAddress, - wasmCode []byte, - instantiateAccess *types.AccessConfig, - initMsg []byte, - label string, - deposit sdk.Coins, -) (sdk.AccAddress, []byte, error) { - return p.nested.createAndInstantiate(ctx, creator, admin, wasmCode, instantiateAccess, initMsg, label, deposit, p.nested.ClassicAddressGenerator(), p.authZPolicy) -} diff --git a/x/wasm/types/exported_keepers.go b/x/wasm/types/exported_keepers.go index 76fb5b510d..dcf97cb2cc 100644 --- a/x/wasm/types/exported_keepers.go +++ b/x/wasm/types/exported_keepers.go @@ -51,16 +51,6 @@ type ContractOpsKeeper interface { fixMsg bool, ) (sdk.AccAddress, []byte, error) - CreateAndInstantiate( - ctx sdk.Context, - creator, admin sdk.AccAddress, - wasmCode []byte, - instantiateAccess *AccessConfig, - initMsg []byte, - label string, - deposit sdk.Coins, - ) (sdk.AccAddress, []byte, error) - // Execute executes the contract instance Execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, msg []byte, coins sdk.Coins) ([]byte, error) diff --git a/x/wasm/types/proposal.go b/x/wasm/types/proposal.go index c6082c394a..bd4684dd49 100644 --- a/x/wasm/types/proposal.go +++ b/x/wasm/types/proposal.go @@ -73,6 +73,7 @@ func init() { // register new content types with the sdk govtypes.RegisterProposalType(string(ProposalTypePinCodes)) govtypes.RegisterProposalType(string(ProposalTypeUnpinCodes)) govtypes.RegisterProposalType(string(ProposalTypeUpdateInstantiateConfig)) + govtypes.RegisterProposalType(string(ProposalTypeStoreAndInstantiateContractProposal)) govtypes.RegisterProposalTypeCodec(&StoreCodeProposal{}, "wasm/StoreCodeProposal") govtypes.RegisterProposalTypeCodec(&InstantiateContractProposal{}, "wasm/InstantiateContractProposal") govtypes.RegisterProposalTypeCodec(&MigrateContractProposal{}, "wasm/MigrateContractProposal") @@ -265,7 +266,18 @@ func NewStoreAndInstantiateContractProposal( msg RawContractMessage, funds sdk.Coins, ) *StoreAndInstantiateContractProposal { - return &StoreAndInstantiateContractProposal{title, description, runAs, wasmBz, permission, unpinCode, admin, label, msg, funds} + return &StoreAndInstantiateContractProposal{ + Title: title, + Description: description, + RunAs: runAs, + WASMByteCode: wasmBz, + InstantiatePermission: permission, + UnpinCode: unpinCode, + Admin: admin, + Label: label, + Msg: msg, + Funds: funds, + } } // ProposalRoute returns the routing key of a parameter change proposal.