Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Bump wasmd and cosmos-sdk version #368

Merged
merged 6 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ FROM golang:1.19-alpine3.16 AS go-builder
WORKDIR /src

# CosmWasm: see https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.2.1/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.2.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.2.4/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.2.4/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a

# hadolint ignore=DL4006
RUN set -eux \
&& apk add --no-cache ca-certificates=20220614-r0 build-base=0.5-r3 git=2.36.6-r0 linux-headers=5.16.7-r1 \
&& sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 86bc5fdc0f01201481c36e17cd3dfed6e9650d22e1c5c8983a5b78c231789ee0 \
&& sha256sum /lib/libwasmvm_muslc.x86_64.a | grep a00700aa19f5bfe0f46290ddf69bf51eb03a6dfcd88b905e1081af2e42dbbafc \
&& sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 682a54082e131eaff9beec80ba3e5908113916fcb8ddf7c668cb2d97cb94c13c \
&& sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ce3d892377d2523cf563e01120cb1436f9343f80be952c93f66aa94f5737b661 \
&& cp "/lib/libwasmvm_muslc.$(uname -m).a" /lib/libwasmvm_muslc.a

COPY . /src/
Expand Down
22 changes: 9 additions & 13 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
"github.com/CosmWasm/wasmd/x/wasm"
wasmclient "github.com/CosmWasm/wasmd/x/wasm/client"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
dbm "github.com/cometbft/cometbft-db"
Expand Down Expand Up @@ -140,16 +139,6 @@ const (
Name = "okp4d"
)

func getGovProposalHandlers() []govclient.ProposalHandler {
return append(wasmclient.ProposalHandlers,
paramsclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler,
ibcclientclient.UpgradeProposalHandler,
)
}

var (
// DefaultNodeHome default home directories for the application daemon.
DefaultNodeHome string
Expand All @@ -166,7 +155,13 @@ var (
staking.AppModuleBasic{},
mint.AppModuleBasic{},
distr.AppModuleBasic{},
gov.NewAppModuleBasic(getGovProposalHandlers()),
gov.NewAppModuleBasic([]govclient.ProposalHandler{
paramsclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler,
ibcclientclient.UpgradeProposalHandler,
}),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
Expand Down Expand Up @@ -570,14 +565,15 @@ func New(

// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1"
availableCapabilities := strings.Join(okp4wasm.AllCapabilities(), ",")
app.WasmKeeper = wasm.NewKeeper(
appCodec,
keys[wasm.StoreKey],
app.AccountKeeper,
app.BankKeeper,
app.StakingKeeper,
distrkeeper.NewQuerier(app.DistrKeeper),
app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
scopedWasmKeeper,
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v5/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func CreateUpgradeHandler(
// case minttypes.ModuleName:
// keyTable = minttypes.ParamKeyTable()
case distrtypes.ModuleName:
keyTable = distrtypes.ParamKeyTable() //nolint:staticcheck
keyTable = distrtypes.ParamKeyTable()
case slashingtypes.ModuleName:
keyTable = slashingtypes.ParamKeyTable() //nolint:staticcheck
case govtypes.ModuleName:
Expand Down
14 changes: 14 additions & 0 deletions app/wasm/capabilities.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package wasm

// AllCapabilities returns all capabilities available with the current wasmvm
// See https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md
// This functionality is going to be moved upstream: https://github.com/CosmWasm/wasmvm/issues/425
func AllCapabilities() []string {
return []string{
"iterator",
"staking",
"stargate",
"cosmwasm_1_1",
"cosmwasm_1_2",
}
}
12 changes: 0 additions & 12 deletions docs/command/okp4d_tx_gov_submit-legacy-proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,7 @@ okp4d tx gov submit-legacy-proposal [flags]

* [okp4d tx gov](okp4d_tx_gov.md) - Governance transactions subcommands
* [okp4d tx gov submit-legacy-proposal cancel-software-upgrade](okp4d_tx_gov_submit-legacy-proposal_cancel-software-upgrade.md) - Cancel the current software upgrade proposal
* [okp4d tx gov submit-legacy-proposal clear-contract-admin](okp4d_tx_gov_submit-legacy-proposal_clear-contract-admin.md) - Submit a clear admin for a contract to prevent further migrations proposal
* [okp4d tx gov submit-legacy-proposal execute-contract](okp4d_tx_gov_submit-legacy-proposal_execute-contract.md) - Submit a execute wasm contract proposal (run by any address)
* [okp4d tx gov submit-legacy-proposal ibc-upgrade](okp4d_tx_gov_submit-legacy-proposal_ibc-upgrade.md) - Submit an IBC upgrade proposal
* [okp4d tx gov submit-legacy-proposal instantiate-contract](okp4d_tx_gov_submit-legacy-proposal_instantiate-contract.md) - Submit an instantiate wasm contract proposal
* [okp4d tx gov submit-legacy-proposal instantiate-contract-2](okp4d_tx_gov_submit-legacy-proposal_instantiate-contract-2.md) - Submit an instantiate wasm contract proposal with predictable address
* [okp4d tx gov submit-legacy-proposal migrate-contract](okp4d_tx_gov_submit-legacy-proposal_migrate-contract.md) - Submit a migrate wasm contract to a new code version proposal
* [okp4d tx gov submit-legacy-proposal param-change](okp4d_tx_gov_submit-legacy-proposal_param-change.md) - Submit a parameter change proposal
* [okp4d tx gov submit-legacy-proposal pin-codes](okp4d_tx_gov_submit-legacy-proposal_pin-codes.md) - Submit a pin code proposal for pinning a code to cache
* [okp4d tx gov submit-legacy-proposal set-contract-admin](okp4d_tx_gov_submit-legacy-proposal_set-contract-admin.md) - Submit a new admin for a contract proposal
* [okp4d tx gov submit-legacy-proposal software-upgrade](okp4d_tx_gov_submit-legacy-proposal_software-upgrade.md) - Submit a software upgrade proposal
* [okp4d tx gov submit-legacy-proposal store-instantiate](okp4d_tx_gov_submit-legacy-proposal_store-instantiate.md) - Submit and instantiate a wasm contract proposal
* [okp4d tx gov submit-legacy-proposal sudo-contract](okp4d_tx_gov_submit-legacy-proposal_sudo-contract.md) - Submit a sudo wasm contract proposal (to call privileged commands)
* [okp4d tx gov submit-legacy-proposal unpin-codes](okp4d_tx_gov_submit-legacy-proposal_unpin-codes.md) - Submit a unpin code proposal for unpinning a code to cache
* [okp4d tx gov submit-legacy-proposal update-client](okp4d_tx_gov_submit-legacy-proposal_update-client.md) - Submit an update IBC client proposal
* [okp4d tx gov submit-legacy-proposal update-instantiate-config](okp4d_tx_gov_submit-legacy-proposal_update-instantiate-config.md) - Submit an update instantiate config proposal.
* [okp4d tx gov submit-legacy-proposal wasm-store](okp4d_tx_gov_submit-legacy-proposal_wasm-store.md) - Submit a wasm binary proposal
1 change: 1 addition & 0 deletions docs/command/okp4d_tx_wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ okp4d tx wasm [flags]
* [okp4d tx wasm migrate](okp4d_tx_wasm_migrate.md) - Migrate a wasm contract to a new code version
* [okp4d tx wasm set-contract-admin](okp4d_tx_wasm_set-contract-admin.md) - Set new admin for a contract
* [okp4d tx wasm store](okp4d_tx_wasm_store.md) - Upload a wasm binary
* [okp4d tx wasm submit-proposal](okp4d_tx_wasm_submit-proposal.md) - Submit a wasm proposal.
* [okp4d tx wasm update-instantiate-config](okp4d_tx_wasm_update-instantiate-config.md) - Update instantiate config for a codeID
31 changes: 31 additions & 0 deletions docs/command/okp4d_tx_wasm_submit-proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## okp4d tx wasm submit-proposal

Submit a wasm proposal.

### Options

```
-h, --help help for submit-proposal
```

### Options inherited from parent commands

```
--chain-id string The network chain ID (default "okp4d")
```

### SEE ALSO

* [okp4d tx wasm](okp4d_tx_wasm.md) - Wasm transaction subcommands
* [okp4d tx wasm submit-proposal clear-contract-admin](okp4d_tx_wasm_submit-proposal_clear-contract-admin.md) - Submit a clear admin for a contract to prevent further migrations proposal
* [okp4d tx wasm submit-proposal execute-contract](okp4d_tx_wasm_submit-proposal_execute-contract.md) - Submit a execute wasm contract proposal (run by any address)
* [okp4d tx wasm submit-proposal instantiate-contract](okp4d_tx_wasm_submit-proposal_instantiate-contract.md) - Submit an instantiate wasm contract proposal
* [okp4d tx wasm submit-proposal instantiate-contract-2](okp4d_tx_wasm_submit-proposal_instantiate-contract-2.md) - Submit an instantiate wasm contract proposal with predictable address
* [okp4d tx wasm submit-proposal migrate-contract](okp4d_tx_wasm_submit-proposal_migrate-contract.md) - Submit a migrate wasm contract to a new code version proposal
* [okp4d tx wasm submit-proposal pin-codes](okp4d_tx_wasm_submit-proposal_pin-codes.md) - Submit a pin code proposal for pinning a code to cache
* [okp4d tx wasm submit-proposal set-contract-admin](okp4d_tx_wasm_submit-proposal_set-contract-admin.md) - Submit a new admin for a contract proposal
* [okp4d tx wasm submit-proposal store-instantiate](okp4d_tx_wasm_submit-proposal_store-instantiate.md) - Submit and instantiate a wasm contract proposal
* [okp4d tx wasm submit-proposal sudo-contract](okp4d_tx_wasm_submit-proposal_sudo-contract.md) - Submit a sudo wasm contract proposal (to call privileged commands)
* [okp4d tx wasm submit-proposal unpin-codes](okp4d_tx_wasm_submit-proposal_unpin-codes.md) - Submit a unpin code proposal for unpinning a code to cache
* [okp4d tx wasm submit-proposal update-instantiate-config](okp4d_tx_wasm_submit-proposal_update-instantiate-config.md) - Submit an update instantiate config proposal.
* [okp4d tx wasm submit-proposal wasm-store](okp4d_tx_wasm_submit-proposal_wasm-store.md) - Submit a wasm binary proposal
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
## okp4d tx gov submit-legacy-proposal clear-contract-admin
## okp4d tx wasm submit-proposal clear-contract-admin

Submit a clear admin for a contract to prevent further migrations proposal

```
okp4d tx gov submit-legacy-proposal clear-contract-admin [contract_addr_bech32] [flags]
okp4d tx wasm submit-proposal clear-contract-admin [contract_addr_bech32] --title [text] --summary [text] --authority [address] [flags]
```

### Options

```
-a, --account-number uint The account number of the signing account (offline mode only)
--authority string The address of the governance account. Default is the sdk gov module account (default "okp410d07y265gmmuvt4z0w9aw880jnsr700jh7kd2g")
--aux Generate aux signer data instead of sending a tx
-b, --broadcast-mode string Transaction broadcasting mode (sync|async) (default "sync")
--chain-id string The network chain ID (default "okp4d")
--deposit string Deposit of proposal
--description string Description of proposal
--dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
--fee-granter string Fee granter grants fees for the transaction
--fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer
Expand All @@ -34,6 +34,7 @@ okp4d tx gov submit-legacy-proposal clear-contract-admin [contract_addr_bech32]
-o, --output string Output format (text|json) (default "json")
-s, --sequence uint The sequence number of the signing account (offline mode only)
--sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature
--summary string Summary of proposal
--timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height
--tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator
--title string Title of proposal
Expand All @@ -42,4 +43,4 @@ okp4d tx gov submit-legacy-proposal clear-contract-admin [contract_addr_bech32]

### SEE ALSO

* [okp4d tx gov submit-legacy-proposal](okp4d_tx_gov_submit-legacy-proposal.md) - Submit a legacy proposal along with an initial deposit
* [okp4d tx wasm submit-proposal](okp4d_tx_wasm_submit-proposal.md) - Submit a wasm proposal.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
## okp4d tx gov submit-legacy-proposal execute-contract
## okp4d tx wasm submit-proposal execute-contract

Submit a execute wasm contract proposal (run by any address)

```
okp4d tx gov submit-legacy-proposal execute-contract [contract_addr_bech32] [json_encoded_migration_args] [flags]
okp4d tx wasm submit-proposal execute-contract [contract_addr_bech32] [json_encoded_migration_args] --title [text] --summary [text] --authority [address] [flags]
```

### Options

```
-a, --account-number uint The account number of the signing account (offline mode only)
--amount string Coins to send to the contract during instantiation
--authority string The address of the governance account. Default is the sdk gov module account (default "okp410d07y265gmmuvt4z0w9aw880jnsr700jh7kd2g")
--aux Generate aux signer data instead of sending a tx
-b, --broadcast-mode string Transaction broadcasting mode (sync|async) (default "sync")
--chain-id string The network chain ID (default "okp4d")
--deposit string Deposit of proposal
--description string Description of proposal
--dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
--fee-granter string Fee granter grants fees for the transaction
--fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer
Expand All @@ -33,9 +33,9 @@ okp4d tx gov submit-legacy-proposal execute-contract [contract_addr_bech32] [jso
--note string Note to add a description to the transaction (previously --memo)
--offline Offline mode (does not allow any online functionality)
-o, --output string Output format (text|json) (default "json")
--run-as string The address that is passed as sender to the contract on proposal execution
-s, --sequence uint The sequence number of the signing account (offline mode only)
--sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature
--summary string Summary of proposal
--timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height
--tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator
--title string Title of proposal
Expand All @@ -44,4 +44,4 @@ okp4d tx gov submit-legacy-proposal execute-contract [contract_addr_bech32] [jso

### SEE ALSO

* [okp4d tx gov submit-legacy-proposal](okp4d_tx_gov_submit-legacy-proposal.md) - Submit a legacy proposal along with an initial deposit
* [okp4d tx wasm submit-proposal](okp4d_tx_wasm_submit-proposal.md) - Submit a wasm proposal.
Loading