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

chore: put legacy collections under feature flag #923

Merged
merged 5 commits into from
Oct 19, 2022
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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: Swatinem/rust-cache@v1
- run: rustup target add wasm32-unknown-unknown
- name: Test
run: cargo test --all --features unstable
run: cargo test --all --features unstable,legacy
lint:
name: Clippy and fmt
runs-on: ubuntu-latest
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: Swatinem/rust-cache@v1
- name: Test Format
run: cargo fmt -- --check
- run: cargo clippy --features unstable --tests -- -Dclippy::all
- run: cargo clippy --features unstable,legacy --tests -- -Dclippy::all
windows:
name: Windows
runs-on: windows-latest
Expand All @@ -51,7 +51,7 @@ jobs:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
- run: cargo check -p near-sdk --features unstable
- run: cargo check -p near-sdk --features unstable,legacy
- run: cargo check -p near-contract-standards
audit:
name: Audit
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## [Unreleased]

### Changes
### Changed
- Added new `legacy` feature flag and put `near_sdk::collections` under it. `near_sdk::store` will be replacing them. [PR 923](https://github.com/near/near-sdk-rs/pull/923).
- Stabilize `store::LookupMap` and `store::UnorderedMap` collections. [PR 922](https://github.com/near/near-sdk-rs/pull/922).
- Stabilize `store::LookupSet` and `store::UnorderedSet` collections. [PR 924](https://github.com/near/near-sdk-rs/pull/924).

Expand Down
2 changes: 1 addition & 1 deletion near-contract-standards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ NEAR smart contracts standard library.
"""

[dependencies]
near-sdk = { path = "../near-sdk", version = "=4.1.0-pre.3", default-features = false }
near-sdk = { path = "../near-sdk", version = "=4.1.0-pre.3", default-features = false, features = ["legacy"] }
serde = "1"
serde_json = "1"
schemars = "0.8"
Expand Down
5 changes: 3 additions & 2 deletions near-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ arbitrary = { version = ">=1.0, <1.1.4", features = ["derive"] }
hex = { version = "0.4.3", features = ["serde"] }

[features]
default = ["wee_alloc", "unit-testing"]
default = ["wee_alloc", "unit-testing", "legacy"]
expensive-debug = []
unstable = []
legacy = []
abi = ["near-abi", "schemars"]
unit-testing = ["near-vm-logic", "near-primitives-core", "near-primitives", "near-crypto"]

__abi-embed = ["near-sdk-macros/__abi-embed"]
__abi-generate = ["abi", "near-sdk-macros/__abi-generate"]

[package.metadata.docs.rs]
features = ["unstable"]
features = ["unstable", "legacy"]
1 change: 1 addition & 0 deletions near-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub use near_sdk_macros::{

pub mod store;

#[cfg(feature = "legacy")]
pub mod collections;
mod environment;
pub use environment::env;
Expand Down