Skip to content

Create cosmwasm-core crate #2054

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

Merged
merged 42 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a221e22
Move types to `cosmwasm-core`
aumetra Mar 13, 2024
08f8601
Fix `no_std` compile issues
aumetra Mar 13, 2024
4647230
Add CI jobs
aumetra Mar 13, 2024
735cf9a
Format README
aumetra Mar 13, 2024
81dfd8f
Move `serde` module back to `cosmwasm-std`
aumetra Mar 13, 2024
e491faf
Remove `alloc` imports
aumetra Mar 13, 2024
257ab45
Add cargo config to `cosmwasm-core`
aumetra Mar 13, 2024
1aa7db8
Update contract schemas
aumetra Mar 13, 2024
2e7b45c
Add `no_std` checks
aumetra Mar 13, 2024
ed8800c
Remove `forward_ref` dependency
aumetra Mar 14, 2024
aa73eb0
Fix CI config for WASM target
aumetra Mar 14, 2024
557fefc
Move `HexBinary`
aumetra Mar 14, 2024
b3629e4
Move addresses
aumetra Mar 14, 2024
44aba65
Update lockfiles
aumetra Mar 14, 2024
de6e0ce
Fix imports
aumetra Mar 14, 2024
c50ce96
Move encoding logic into public functions
aumetra Mar 14, 2024
d66a3d4
Add some documentation
aumetra Mar 14, 2024
c214ef3
Add tests to the encoding module
aumetra Mar 14, 2024
eaf21f6
Test coverage of core error
aumetra Mar 14, 2024
e92179c
Only export needed types via __internal module
aumetra Mar 14, 2024
3d36e18
Make it obvious macro is internal only and reexport via `__internal`
aumetra Mar 14, 2024
67836e6
Tests for core error conversion
aumetra Mar 14, 2024
314cf01
Run coverage reports with all features
aumetra Mar 14, 2024
ec62172
Address review
aumetra Mar 14, 2024
115e178
Make `cosmwasm-crypto` compatible with `no_std`
aumetra Mar 14, 2024
a6b07e9
Fix CI fails
aumetra Mar 14, 2024
0f8503d
Actually fix CI failures
aumetra Mar 14, 2024
fbdebe6
Add `extern crate` declaration to the top of the crates
aumetra Mar 15, 2024
f2bbfff
Move full `StdError` to `cosmwasm-core`
aumetra Mar 15, 2024
b75be76
Mark core as 'Internal only' in the README
aumetra Mar 15, 2024
dee1f5b
Mark `std` feature in `cosmwasm-std` as deprecated
aumetra Mar 15, 2024
9ab33ba
Fix reexports
aumetra Mar 15, 2024
5b9f755
Fix CI failures
aumetra Apr 4, 2024
247f1d6
Update packages/core/src/__internal.rs
aumetra Apr 4, 2024
92d4417
Remove core reexport
aumetra Apr 4, 2024
c7dc6b2
Import only during tests
aumetra Apr 4, 2024
5c770c0
Remove leftover `.map_err`
aumetra Apr 4, 2024
50bb1b3
Adjust result type
aumetra Apr 5, 2024
e79e51b
Remove `testing` feature from core
aumetra Apr 5, 2024
db219f6
Fix CI
aumetra Apr 5, 2024
ab6b92f
Use `thiserror`, regenerate lockfiles
aumetra Apr 5, 2024
026040e
Adjust version of `cosmwasm-core`
aumetra Apr 5, 2024
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
75 changes: 74 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ workflows:
- arm64
- package_crypto
- package_check
- package_core
- package_schema
- package_schema_derive
- package_std
Expand Down Expand Up @@ -171,6 +172,10 @@ jobs:
name: "contracts/staking: integration-test"
working_directory: ~/project/contracts/staking
command: cargo wasm --locked && cargo integration-test --locked
- run:
name: "packages/core: test"
working_directory: ~/project/packages/core
command: cargo test --all-features --locked
- run:
name: "packages/crypto: test"
working_directory: ~/project/packages/crypto
Expand Down Expand Up @@ -285,6 +290,62 @@ jobs:
- target/debug/deps
key: cargocache-v2-package_check-rust:1.73-{{ checksum "Cargo.lock" }}

package_core:
docker:
- image: rust:1.73
environment:
# Limit the number of parallel jobs to avoid OOM crashes during doc testing
RUST_TEST_THREADS: 8
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
- restore_cache:
keys:
- cargocache-v2-package_core-rust:1.73-{{ checksum "Cargo.lock" }}
- run:
name: Add thumbv7em-none-eabi target
command: rustup target add thumbv7em-none-eabi && rustup target list --installed
- run:
name: Add wasm32 target
command: rustup target add wasm32-unknown-unknown && rustup target list --installed
- run:
name: Build library for native target (no features)
working_directory: ~/project/packages/core
command: cargo build --locked --no-default-features
- run:
name: Build library for wasm target (no features)
working_directory: ~/project/packages/core
command: cargo wasm --locked --no-default-features
- run:
name: Build library for no_std target (no features)
working_directory: ~/project/packages/core
command: cargo no-std --locked --no-default-features
- run:
name: Run unit tests (no features)
working_directory: ~/project/packages/core
command: cargo test --locked --no-default-features
- run:
name: Build library for native target (all features)
working_directory: ~/project/packages/core
command: cargo build --locked --features std
- run:
name: Build library for wasm target (all features)
working_directory: ~/project/packages/core
command: cargo wasm --locked --features std
- run:
name: Run unit tests (all features)
working_directory: ~/project/packages/core
command: cargo test --locked --features std
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: cargocache-v2-package_core-rust:1.73-{{ checksum "Cargo.lock" }}

package_schema:
docker:
- image: rust:1.73
Expand Down Expand Up @@ -925,6 +986,14 @@ jobs:
name: Clippy linting on schema-derive
working_directory: ~/project/packages/schema-derive
command: cargo clippy --all-targets --tests -- -D warnings
- run:
name: Clippy linting on core (no feature flags)
working_directory: ~/project/packages/core
command: cargo clippy --all-targets -- -D warnings
- run:
name: Clippy linting on core (all feature flags)
working_directory: ~/project/packages/core
command: cargo clippy --all-features --all-targets -- -D warnings
- run:
name: Clippy linting on std (no feature flags)
working_directory: ~/project/packages/std
Expand Down Expand Up @@ -997,8 +1066,9 @@ jobs:
name: Run tests with coverage
command: |
mkdir -p reports
cargo test
cargo test --all-features

grcov . -s packages/core --binary-path ./target/debug -t lcov -o ./reports/core.info
grcov . -s packages/crypto --binary-path ./target/debug -t lcov -o ./reports/crypto.info
grcov . -s packages/derive --binary-path ./target/debug -t lcov -o ./reports/derive.info
grcov . -s packages/schema --binary-path ./target/debug -t lcov -o ./reports/schema.info
Expand All @@ -1007,6 +1077,9 @@ jobs:
environment:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "cosmwasm-%p-%m.profraw"
- codecov/upload:
file: reports/core.info
flags: cosmwasm-core
- codecov/upload:
file: reports/crypto.info
flags: cosmwasm-crypto
Expand Down
Loading