Skip to content

Commit

Permalink
All code compiles and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jul 28, 2021
1 parent c9360f6 commit 2387a48
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 47 deletions.
2 changes: 0 additions & 2 deletions x/wasm/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions x/wasm/client/cli/genesis_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
},
})
Expand Down
13 changes: 0 additions & 13 deletions x/wasm/client/cli/genesis_msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
},
},
Expand All @@ -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,
},
Expand Down
4 changes: 0 additions & 4 deletions x/wasm/client/cli/gov_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ func ProposalStoreCodeCmd() *cobra.Command {
Description: proposalDescr,
RunAs: runAs,
WASMByteCode: src.WASMByteCode,
Source: src.Source,
Builder: src.Builder,
InstantiatePermission: src.InstantiatePermission,
}

Expand All @@ -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")
Expand Down
16 changes: 0 additions & 16 deletions x/wasm/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (

const (
flagAmount = "amount"
flagSource = "source"
flagBuilder = "builder"
flagLabel = "label"
flagAdmin = "admin"
flagRunAs = "run-as"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions x/wasm/client/rest/gov.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand All @@ -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,
}
}
Expand Down
2 changes: 0 additions & 2 deletions x/wasm/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2387a48

Please sign in to comment.