Skip to content

Commit

Permalink
Merge pull request #1933 from CosmWasm/1927-make-instantiate-optional
Browse files Browse the repository at this point in the history
Make instantiate optional
  • Loading branch information
chipshort authored Nov 13, 2023
2 parents cf25c49 + 374b2ea commit 88762e8
Show file tree
Hide file tree
Showing 18 changed files with 2,220 additions and 42 deletions.
30 changes: 29 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ workflows:
- contract_burner
- contract_crypto_verify
- contract_cyberpunk
- contract_empty
# - contract_floaty # This contract needs nightly Rust to compile
- contract_hackatom
- contract_ibc_reflect
- contract_ibc_reflect_send
# - contract_floaty # This contract needs nightly Rust to compile
- contract_queue
- contract_reflect
- contract_staking
Expand Down Expand Up @@ -754,6 +755,33 @@ jobs:
- target/wasm32-unknown-unknown/release/deps
key: cargocache-v2-contract_virus-rust:1.70.0-{{ checksum "Cargo.lock" }}

contract_empty:
docker:
- image: rust:1.70.0
environment:
RUST_BACKTRACE: 1
working_directory: ~/cosmwasm/contracts/empty
steps:
- checkout:
path: ~/cosmwasm
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-v2-contract_empty-rust:1.70.0-{{ checksum "Cargo.lock" }}
- check_contract
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
- target/wasm32-unknown-unknown/release/.fingerprint
- target/wasm32-unknown-unknown/release/build
- target/wasm32-unknown-unknown/release/deps
key: cargocache-v2-contract_empty-rust:1.70.0-{{ checksum "Cargo.lock" }}

fmt:
docker:
- image: rust:1.70.0
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ and this project adheres to
`Addr` type for `ContractInfoResponse::{creator, admin}`. ([#1883])
- cosmwasm-std: Change `DistributionQuerier::new` to take `IntoIterator` instead
of `HashMap`. ([#1941])
- cosmwasm-vm: Make `instantiate` entrypoint optional. ([#1933])

[#1874]: https://github.com/CosmWasm/cosmwasm/pull/1874
[#1876]: https://github.com/CosmWasm/cosmwasm/pull/1876
Expand All @@ -54,6 +55,7 @@ and this project adheres to
[#1884]: https://github.com/CosmWasm/cosmwasm/pull/1884
[#1898]: https://github.com/CosmWasm/cosmwasm/pull/1898
[#1902]: https://github.com/CosmWasm/cosmwasm/pull/1902
[#1933]: https://github.com/CosmWasm/cosmwasm/pull/1933
[#1939]: https://github.com/CosmWasm/cosmwasm/pull/1939
[#1940]: https://github.com/CosmWasm/cosmwasm/pull/1940
[#1941]: https://github.com/CosmWasm/cosmwasm/pull/1941
Expand Down
7 changes: 7 additions & 0 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Introducing the development contracts in the order they were created.
that hackatom has.
10. **virus** is a contract that reproduces itself and does nothing useful
beyond that, showing how to use instantiate2 from a contract.
11. **empty** is an empty contract that does nothing. It is used to test that we
can store contracts with no entry points.

## Optimized builds

Expand Down Expand Up @@ -99,6 +101,11 @@ docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_virus",target=/code/contracts/virus/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.13 ./contracts/virus

docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_empty",target=/code/contracts/empty/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.13 ./contracts/empty
```

## Entry points
Expand Down
6 changes: 6 additions & 0 deletions contracts/empty/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown"
wasm-debug = "build --lib --target wasm32-unknown-unknown"
unit-test = "test --lib"
integration-test = "test --test integration"
schema = "run --bin schema"
Loading

0 comments on commit 88762e8

Please sign in to comment.