Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
test-all:
runs-on: ubuntu-latest
container:
image: rust:1.66.0
image: rust:1.70.0
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v1
Expand All @@ -35,7 +35,7 @@ jobs:
clippy:
runs-on: ubuntu-latest
container:
image: rust:1.66.0
image: rust:1.70.0
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v1
Expand Down
99 changes: 73 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ license = "MIT OR Apache-2.0"
publish = true

[features]
abi = ["borsh/unstable__schema", "schemars"]
abi = ["borsh/unstable__schema", "schemars-stable"]
abi-alpha = ["borsh/unstable__schema", "schemars-alpha"]
# This feature was introduced for legacy reasons for nearcore, and MUST be avoided
# https://github.com/near/nearcore/pull/4621#issuecomment-892099860
internal_unstable = []
default = []
schemars = []
schemars-stable = ["schemars", "dep:schemars-stable"]
schemars-alpha = ["schemars", "dep:schemars-alpha"]

[dependencies]
arbitrary = { version = "1", features = ["derive"] , optional = true }
borsh = { version = "1.0.0", features = ["rc"], optional = true }
serde = { version = "1.0.119", features = ["alloc", "derive", "rc"], optional = true }
schemars = { version = "0.8", optional = true }
schemars-stable = { version = "0.8.22", optional = true, package = "schemars" }
schemars-alpha = { version = "1.0.0-alpha.17", optional = true, package = "schemars" }

[dev-dependencies]
bolero = ">=0.8.0, <0.10.0"
Expand Down
2 changes: 2 additions & 0 deletions src/account_id.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::{borrow::Cow, fmt, ops::Deref, str::FromStr};

use crate::{AccountIdRef, ParseAccountError};
#[cfg(feature = "schemars")]
use crate::schemars_exports::schemars;

/// NEAR Account Identifier.
///
Expand Down
2 changes: 2 additions & 0 deletions src/account_id_ref.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::borrow::Cow;

use crate::{AccountId, ParseAccountError};
#[cfg(feature = "schemars")]
use crate::schemars_exports::schemars;

/// Account identifier. This is the human readable UTF-8 string which is used internally to index
/// accounts on the network and their respective state.
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

mod errors;

mod schemars_exports;
mod account_id;
mod account_id_ref;
#[cfg(feature = "borsh")]
Expand Down
5 changes: 5 additions & 0 deletions src/schemars_exports.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[cfg(all(feature = "schemars-alpha", not(feature = "schemars-stable")))]
pub use schemars_alpha as schemars;

#[cfg(feature = "schemars-stable")]
pub use schemars_stable as schemars;
Loading