diff --git a/x/wasm/alias.go b/x/wasm/alias.go index e2d457bab4a..7910a78a018 100644 --- a/x/wasm/alias.go +++ b/x/wasm/alias.go @@ -20,8 +20,6 @@ const ( RouterKey = types.RouterKey MaxWasmSize = types.MaxWasmSize MaxLabelSize = types.MaxLabelSize - BuildTagRegexp = types.BuildTagRegexp - MaxBuildTagSize = types.MaxBuildTagSize WasmModuleEventType = types.WasmModuleEventType AttributeKeyContractAddr = types.AttributeKeyContractAddr ProposalTypeStoreCode = types.ProposalTypeStoreCode diff --git a/x/wasm/client/cli/genesis_msg.go b/x/wasm/client/cli/genesis_msg.go index 8ada1c5d2a0..88dcfdd9154 100644 --- a/x/wasm/client/cli/genesis_msg.go +++ b/x/wasm/client/cli/genesis_msg.go @@ -69,8 +69,6 @@ func GenesisStoreCodeCmd(defaultNodeHome string, genesisMutator GenesisMutator) }) }, } - cmd.Flags().String(flagSource, "", "A valid URI reference to the contract's source code, optional") - cmd.Flags().String(flagBuilder, "", "A valid docker tag for the build system, optional") cmd.Flags().String(flagRunAs, "", "The address that is stored as code creator") cmd.Flags().String(flagInstantiateByEverybody, "", "Everybody can instantiate a contract from the code, optional") cmd.Flags().String(flagInstantiateByAddress, "", "Only this address can instantiate a contract instance from the code, optional") @@ -289,8 +287,6 @@ func getAllCodes(state *types.GenesisState) ([]codeMeta, error) { Info: types.CodeInfo{ CodeHash: hash[:], Creator: msg.Sender, - Source: msg.Source, - Builder: msg.Builder, InstantiateConfig: accessConfig, }, }) diff --git a/x/wasm/client/cli/genesis_msg_test.go b/x/wasm/client/cli/genesis_msg_test.go index 61095e8c8d7..ea1a7987a40 100644 --- a/x/wasm/client/cli/genesis_msg_test.go +++ b/x/wasm/client/cli/genesis_msg_test.go @@ -55,7 +55,6 @@ func TestGenesisStoreCodeCmd(t *testing.T) { mutator: func(cmd *cobra.Command) { cmd.SetArgs([]string{anyValidWasmFile.Name()}) flagSet := cmd.Flags() - flagSet.Set("source", "https://foo.bar") flagSet.Set("run-as", keeper.RandomBech32AccountAddress(t)) }, }, @@ -80,18 +79,6 @@ func TestGenesisStoreCodeCmd(t *testing.T) { srcGenesis: minimalWasmGenesis, mutator: func(cmd *cobra.Command) { cmd.SetArgs([]string{anyValidWasmFile.Name()}) - flagSet := cmd.Flags() - flagSet.Set("source", "https://foo.bar") - }, - expError: true, - }, - "invalid msg data should fail": { - srcGenesis: minimalWasmGenesis, - mutator: func(cmd *cobra.Command) { - cmd.SetArgs([]string{anyValidWasmFile.Name()}) - flagSet := cmd.Flags() - flagSet.Set("source", "not an url") - flagSet.Set("run-as", keeper.RandomBech32AccountAddress(t)) }, expError: true, }, diff --git a/x/wasm/client/cli/gov_tx.go b/x/wasm/client/cli/gov_tx.go index 32fc19ef2d4..45d1f5a2ef9 100644 --- a/x/wasm/client/cli/gov_tx.go +++ b/x/wasm/client/cli/gov_tx.go @@ -57,8 +57,6 @@ func ProposalStoreCodeCmd() *cobra.Command { Description: proposalDescr, RunAs: runAs, WASMByteCode: src.WASMByteCode, - Source: src.Source, - Builder: src.Builder, InstantiatePermission: src.InstantiatePermission, } @@ -74,8 +72,6 @@ func ProposalStoreCodeCmd() *cobra.Command { }, } - cmd.Flags().String(flagSource, "", "A valid URI reference to the contract's source code, optional") - cmd.Flags().String(flagBuilder, "", "A valid docker tag for the build system, optional") cmd.Flags().String(flagRunAs, "", "The address that is stored as code creator") cmd.Flags().String(flagInstantiateByEverybody, "", "Everybody can instantiate a contract from the code, optional") cmd.Flags().String(flagInstantiateByAddress, "", "Only this address can instantiate a contract instance from the code, optional") diff --git a/x/wasm/client/cli/tx.go b/x/wasm/client/cli/tx.go index b7a26b029a3..6b3ee571e44 100644 --- a/x/wasm/client/cli/tx.go +++ b/x/wasm/client/cli/tx.go @@ -19,8 +19,6 @@ import ( const ( flagAmount = "amount" - flagSource = "source" - flagBuilder = "builder" flagLabel = "label" flagAdmin = "admin" flagRunAs = "run-as" @@ -69,8 +67,6 @@ func StoreCodeCmd() *cobra.Command { }, } - cmd.Flags().String(flagSource, "", "A valid URI reference to the contract's source code, optional") - cmd.Flags().String(flagBuilder, "", "A valid docker tag for the build system, optional") cmd.Flags().String(flagInstantiateByEverybody, "", "Everybody can instantiate a contract from the code, optional") cmd.Flags().String(flagInstantiateByAddress, "", "Only this address can instantiate a contract instance from the code, optional") flags.AddTxFlagsToCmd(cmd) @@ -122,21 +118,9 @@ func parseStoreCodeArgs(file string, sender sdk.AccAddress, flags *flag.FlagSet) } } - // build and sign the transaction, then broadcast to Tendermint - source, err := flags.GetString(flagSource) - if err != nil { - return types.MsgStoreCode{}, fmt.Errorf("source: %s", err) - } - builder, err := flags.GetString(flagBuilder) - if err != nil { - return types.MsgStoreCode{}, fmt.Errorf("builder: %s", err) - } - msg := types.MsgStoreCode{ Sender: sender.String(), WASMByteCode: wasm, - Source: source, - Builder: builder, InstantiatePermission: perm, } return msg, nil diff --git a/x/wasm/client/rest/gov.go b/x/wasm/client/rest/gov.go index 7a2e70abc5f..8e4e9cc6409 100644 --- a/x/wasm/client/rest/gov.go +++ b/x/wasm/client/rest/gov.go @@ -24,10 +24,6 @@ type StoreCodeProposalJsonReq struct { RunAs string `json:"run_as" yaml:"run_as"` // WASMByteCode can be raw or gzip compressed WASMByteCode []byte `json:"wasm_byte_code" yaml:"wasm_byte_code"` - // Source is a valid absolute HTTPS URI to the contract's source code, optional - Source string `json:"source" yaml:"source"` - // Builder is a valid docker image name with tag, optional - Builder string `json:"builder" yaml:"builder"` // InstantiatePermission to apply on contract creation, optional InstantiatePermission *types.AccessConfig `json:"instantiate_permission" yaml:"instantiate_permission"` } @@ -38,8 +34,6 @@ func (s StoreCodeProposalJsonReq) Content() govtypes.Content { Description: s.Description, RunAs: s.RunAs, WASMByteCode: s.WASMByteCode, - Source: s.Source, - Builder: s.Builder, InstantiatePermission: s.InstantiatePermission, } } diff --git a/x/wasm/genesis_test.go b/x/wasm/genesis_test.go index 4e8f5b9cc0c..0c82182bf7a 100644 --- a/x/wasm/genesis_test.go +++ b/x/wasm/genesis_test.go @@ -22,8 +22,6 @@ func TestInitGenesis(t *testing.T) { msg := MsgStoreCode{ Sender: creator.String(), WASMByteCode: testContract, - Source: "https://github.com/CosmWasm/wasmd/blob/master/x/wasm/testdata/hackatom.wasm", - Builder: "confio/cosmwasm-opt:0.7.0", } err := msg.ValidateBasic() require.NoError(t, err)