Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into fifth-46
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Nov 7, 2022
2 parents b385d2d + a9ce273 commit d4a563f
Show file tree
Hide file tree
Showing 20 changed files with 842 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/proto-buf-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- uses: bufbuild/buf-setup-action@v1.8.0
- uses: bufbuild/buf-setup-action@v1.9.0

# lint checks
- uses: bufbuild/buf-lint-action@v1
Expand Down
10 changes: 10 additions & 0 deletions app/params/weights.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ const (
DefaultWeightCommunitySpendProposal int = 5
DefaultWeightTextProposal int = 5
DefaultWeightParamChangeProposal int = 5

DefaultWeightMsgStoreCode int = 50
DefaultWeightMsgInstantiateContract int = 100
DefaultWeightMsgExecuteContract int = 100
DefaultWeightMsgUpdateAdmin int = 25
DefaultWeightMsgClearAdmin int = 10
DefaultWeightMsgMigrateContract int = 50

DefaultWeightStoreCodeProposal int = 5
DefaultWeightInstantiateContractProposal int = 5
DefaultWeightUpdateAdminProposal int = 5
DefaultWeightExecuteContractProposal int = 5
DefaultWeightClearAdminProposal int = 5
)
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ require (
cosmossdk.io/math v1.0.0-beta.3
github.com/CosmWasm/wasmvm v1.1.1
github.com/cosmos/cosmos-proto v1.0.0-alpha8
github.com/cosmos/cosmos-sdk v0.46.3
github.com/cosmos/cosmos-sdk v0.46.4
github.com/cosmos/gogoproto v1.4.2
github.com/cosmos/iavl v0.19.3
github.com/cosmos/iavl v0.19.4
github.com/cosmos/ibc-go/v5 v5.0.1
github.com/cosmos/interchain-accounts v0.3.2
github.com/dvsekhvalnov/jose2go v1.5.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44=
github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU=
github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw=
github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I=
github.com/cosmos/cosmos-sdk v0.46.3 h1:2jdJYcSwh4AtFJKGoNGvmEy2mKDWtGaVZphGpvedljQ=
github.com/cosmos/cosmos-sdk v0.46.3/go.mod h1:AynIAjXwtS3T/ApdhNCz/7/KGMbZSUBbKRTcbukb2ic=
github.com/cosmos/cosmos-sdk v0.46.4 h1:I4CPfnz7lAPM7cEvvyTxL1h3M/ugbhTNr5ZRcnW8WsU=
github.com/cosmos/cosmos-sdk v0.46.4/go.mod h1:b5usG7aBEEvhaatYCdV6orFbDUsj4BG1V6UtKwNcJeQ=
github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k=
github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
Expand All @@ -246,8 +246,8 @@ github.com/cosmos/gogoproto v1.4.2 h1:UeGRcmFW41l0G0MiefWhkPEVEwvu78SZsHBvI78dAY
github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU=
github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y=
github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw=
github.com/cosmos/iavl v0.19.3 h1:cESO0OwTTxQm5rmyESKW+zESheDUYI7CcZDWWDwnuxg=
github.com/cosmos/iavl v0.19.3/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok=
github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
github.com/cosmos/ibc-go/v5 v5.0.1 h1:ZI5xCi6RDOL+hyu6Wx/w6JoAYFlOoK5hijsRTVWo+RA=
github.com/cosmos/ibc-go/v5 v5.0.1/go.mod h1:LX0DHLW3dfi/1e4BJzi8MGLWmQ4DSraPEgVjyo3VzAo=
github.com/cosmos/interchain-accounts v0.3.2 h1:7S5rSndahpjkzUvG00kKZrTZsEuVHuVC9a7p0qDVcF8=
Expand Down
5 changes: 5 additions & 0 deletions x/wasm/client/cli/genesis_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func GenesisStoreCodeCmd(defaultNodeHome string, genesisMutator GenesisMutator)
return nil
})
},
SilenceUsage: true,
}
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")
Expand Down Expand Up @@ -136,6 +137,7 @@ func GenesisInstantiateContractCmd(defaultNodeHome string, genesisMutator Genesi
return nil
})
},
SilenceUsage: true,
}
cmd.Flags().String(flagAmount, "", "Coins to send to the contract during instantiation")
cmd.Flags().String(flagLabel, "", "A human-readable name for this contract in lists")
Expand Down Expand Up @@ -189,6 +191,7 @@ func GenesisExecuteContractCmd(defaultNodeHome string, genesisMutator GenesisMut
return nil
})
},
SilenceUsage: true,
}
cmd.Flags().String(flagAmount, "", "Coins to send to the contract along with command")
cmd.Flags().String(flagRunAs, "", "The address that pays the funds.")
Expand Down Expand Up @@ -217,6 +220,7 @@ func GenesisListCodesCmd(defaultNodeHome string, genReader GenesisReader) *cobra
}
return printJSONOutput(cmd, all)
},
SilenceUsage: true,
}
cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory")
flags.AddQueryFlagsToCmd(cmd)
Expand All @@ -239,6 +243,7 @@ func GenesisListContractsCmd(defaultNodeHome string, genReader GenesisReader) *c
all := GetAllContracts(state)
return printJSONOutput(cmd, all)
},
SilenceUsage: true,
}
cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory")
flags.AddQueryFlagsToCmd(cmd)
Expand Down
10 changes: 10 additions & 0 deletions x/wasm/client/cli/gov_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func ProposalStoreCodeCmd() *cobra.Command {

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}

cmd.Flags().String(flagRunAs, "", "The address that is stored as code creator")
Expand Down Expand Up @@ -159,6 +160,7 @@ func ProposalInstantiateContractCmd() *cobra.Command {

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}
cmd.Flags().String(flagAmount, "", "Coins to send to the contract during instantiation")
cmd.Flags().String(flagLabel, "", "A human-readable name for this contract in lists")
Expand Down Expand Up @@ -227,6 +229,7 @@ func ProposalMigrateContractCmd() *cobra.Command {

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}

// proposal flags
Expand Down Expand Up @@ -304,6 +307,7 @@ func ProposalExecuteContractCmd() *cobra.Command {

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}
cmd.Flags().String(flagRunAs, "", "The address that is passed as sender to the contract on proposal execution")
cmd.Flags().String(flagAmount, "", "Coins to send to the contract during instantiation")
Expand Down Expand Up @@ -366,6 +370,7 @@ func ProposalSudoContractCmd() *cobra.Command {

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}

// proposal flagsExecute
Expand Down Expand Up @@ -428,6 +433,7 @@ func ProposalUpdateContractAdminCmd() *cobra.Command {

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}
// proposal flags
cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") //nolint:staticcheck
Expand Down Expand Up @@ -483,6 +489,7 @@ func ProposalClearContractAdminCmd() *cobra.Command {

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}
// proposal flags
cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") //nolint:staticcheck
Expand Down Expand Up @@ -542,6 +549,7 @@ func ProposalPinCodesCmd() *cobra.Command {

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}
// proposal flags
cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") //nolint:staticcheck
Expand Down Expand Up @@ -613,6 +621,7 @@ func ProposalUnpinCodesCmd() *cobra.Command {

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}
// proposal flags
cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") //nolint:staticcheck
Expand Down Expand Up @@ -731,6 +740,7 @@ $ %s tx gov submit-proposal update-instantiate-config 1:nobody 2:everybody 3:%s1

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}
// proposal flags
cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") //nolint:staticcheck
Expand Down
3 changes: 3 additions & 0 deletions x/wasm/client/cli/new_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func MigrateContractCmd() *cobra.Command {
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
},
SilenceUsage: true,
}
flags.AddTxFlagsToCmd(cmd)
return cmd
Expand Down Expand Up @@ -79,6 +80,7 @@ func UpdateContractAdminCmd() *cobra.Command {
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
},
SilenceUsage: true,
}
flags.AddTxFlagsToCmd(cmd)
return cmd
Expand Down Expand Up @@ -115,6 +117,7 @@ func ClearContractAdminCmd() *cobra.Command {
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
},
SilenceUsage: true,
}
flags.AddTxFlagsToCmd(cmd)
return cmd
Expand Down
18 changes: 16 additions & 2 deletions x/wasm/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func GetQueryCmd() *cobra.Command {
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
SilenceUsage: true,
}
queryCmd.AddCommand(
GetCmdListCode(),
Expand Down Expand Up @@ -137,6 +138,7 @@ func GetCmdListCode() *cobra.Command {
}
return clientCtx.PrintProto(res)
},
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
flags.AddPaginationFlagsToCmd(cmd, "list codes")
Expand Down Expand Up @@ -182,6 +184,7 @@ func GetCmdListContractByCode() *cobra.Command {
}
return clientCtx.PrintProto(res)
},
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
flags.AddPaginationFlagsToCmd(cmd, "list contracts by code")
Expand Down Expand Up @@ -224,6 +227,7 @@ func GetCmdQueryCode() *cobra.Command {
fmt.Printf("Downloading wasm code to %s\n", args[1])
return os.WriteFile(args[1], res.Data, 0o600)
},
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
Expand Down Expand Up @@ -263,6 +267,7 @@ func GetCmdQueryCodeInfo() *cobra.Command {

return clientCtx.PrintProto(res.CodeInfoResponse)
},
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
Expand Down Expand Up @@ -298,6 +303,7 @@ func GetCmdGetContractInfo() *cobra.Command {
}
return clientCtx.PrintProto(res)
},
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
Expand All @@ -312,6 +318,7 @@ func GetCmdGetContractState() *cobra.Command {
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
SilenceUsage: true,
}
cmd.AddCommand(
GetCmdGetContractStateAll(),
Expand Down Expand Up @@ -355,6 +362,7 @@ func GetCmdGetContractStateAll() *cobra.Command {
}
return clientCtx.PrintProto(res)
},
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
flags.AddPaginationFlagsToCmd(cmd, "contract state")
Expand Down Expand Up @@ -396,6 +404,7 @@ func GetCmdGetContractStateRaw() *cobra.Command {
}
return clientCtx.PrintProto(res)
},
SilenceUsage: true,
}
decoder.RegisterFlags(cmd.PersistentFlags(), "key argument")
flags.AddQueryFlagsToCmd(cmd)
Expand Down Expand Up @@ -444,6 +453,7 @@ func GetCmdGetContractStateSmart() *cobra.Command {
}
return clientCtx.PrintProto(res)
},
SilenceUsage: true,
}
decoder.RegisterFlags(cmd.PersistentFlags(), "query argument")
flags.AddQueryFlagsToCmd(cmd)
Expand Down Expand Up @@ -487,6 +497,7 @@ func GetCmdGetContractHistory() *cobra.Command {

return clientCtx.PrintProto(res)
},
SilenceUsage: true,
}

flags.AddQueryFlagsToCmd(cmd)
Expand All @@ -499,7 +510,7 @@ func GetCmdListPinnedCode() *cobra.Command {
cmd := &cobra.Command{
Use: "pinned",
Short: "List all pinned code ids",
Long: "\t\tLong: List all pinned code ids,\n",
Long: "List all pinned code ids",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
Expand All @@ -523,6 +534,7 @@ func GetCmdListPinnedCode() *cobra.Command {
}
return clientCtx.PrintProto(res)
},
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
flags.AddPaginationFlagsToCmd(cmd, "list codes")
Expand All @@ -534,7 +546,7 @@ func GetCmdListContractsByCreator() *cobra.Command {
cmd := &cobra.Command{
Use: "list-contracts-by-creator [creator]",
Short: "List all contracts by creator",
Long: "\t\tLong: List all contracts by creator,\n",
Long: "List all contracts by creator",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
Expand Down Expand Up @@ -563,6 +575,7 @@ func GetCmdListContractsByCreator() *cobra.Command {
}
return clientCtx.PrintProto(res)
},
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
Expand Down Expand Up @@ -650,6 +663,7 @@ func GetCmdQueryParams() *cobra.Command {

return clientCtx.PrintProto(&res.Params)
},
SilenceUsage: true,
}

flags.AddQueryFlagsToCmd(cmd)
Expand Down
9 changes: 7 additions & 2 deletions x/wasm/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func GetTxCmd() *cobra.Command {
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
SilenceUsage: true,
}
txCmd.AddCommand(
StoreCodeCmd(),
Expand Down Expand Up @@ -76,6 +77,7 @@ func StoreCodeCmd() *cobra.Command {
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
},
SilenceUsage: true,
}

cmd.Flags().String(flagInstantiateByEverybody, "", "Everybody can instantiate a contract from the code, optional")
Expand Down Expand Up @@ -183,7 +185,7 @@ func InstantiateContractCmd() *cobra.Command {
Long: fmt.Sprintf(`Creates a new instance of an uploaded wasm code with the given 'constructor' message.
Each contract instance has a unique address assigned.
Example:
$ %s wasmd tx wasm instantiate 1 '{"foo":"bar"}' --admin="$(%s keys show mykey -a)" \
$ %s tx wasm instantiate 1 '{"foo":"bar"}' --admin="$(%s keys show mykey -a)" \
--from mykey --amount="100ustake" --label "local0.1.0"
`, version.AppName, version.AppName),
Aliases: []string{"start", "init", "inst", "i"},
Expand All @@ -202,6 +204,7 @@ $ %s wasmd tx wasm instantiate 1 '{"foo":"bar"}' --admin="$(%s keys show mykey -
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}

cmd.Flags().String(flagAmount, "", "Coins to send to the contract during instantiation")
Expand All @@ -224,7 +227,7 @@ Each contract instance has a unique address assigned. They are assigned automati
for special use cases, the given 'salt' argument and '--fix-msg' parameters can be used to generate a custom address.
Predictable address example (also see '%s query wasm build-address -h'):
$ %s wasmd tx wasm instantiate2 1 '{"foo":"bar"}' $(echo -n "testing" | xxd -ps) --admin="$(%s keys show mykey -a)" \
$ %s tx wasm instantiate2 1 '{"foo":"bar"}' $(echo -n "testing" | xxd -ps) --admin="$(%s keys show mykey -a)" \
--from mykey --amount="100ustake" --label "local0.1.0" \
--fix-msg
`, version.AppName, version.AppName, version.AppName),
Expand Down Expand Up @@ -262,6 +265,7 @@ $ %s wasmd tx wasm instantiate2 1 '{"foo":"bar"}' $(echo -n "testing" | xxd -ps)
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
SilenceUsage: true,
}

cmd.Flags().String(flagAmount, "", "Coins to send to the contract during instantiation")
Expand Down Expand Up @@ -347,6 +351,7 @@ func ExecuteContractCmd() *cobra.Command {
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
},
SilenceUsage: true,
}

cmd.Flags().String(flagAmount, "", "Coins to send to the contract along with command")
Expand Down
Loading

0 comments on commit d4a563f

Please sign in to comment.