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: update near-sdk, near-abi, borsh version #109

Merged
merged 4 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
64 changes: 59 additions & 5 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion cargo-near/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ serde_json = "1.0"
sha2 = "0.10"
symbolic-debuginfo = "8.8"
schemars = "0.8"
near-abi = { version = "0.3.0", features = ["__chunked-entries"] }
near-abi = { version = "0.4.0", features = ["__chunked-entries"] }
libloading = "0.7.3"
zstd = "0.11"
atty = "0.2.14"
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ publish = false

[dependencies]
const_format = "0.2"
near-abi = "0.3.0"
near-abi = "0.4.0"

[dev-dependencies]
borsh = "0.9"
borsh = { version = "1.0.0", features = ["derive", "unstable__schema"]}
camino = "1.1.1"
cargo-near = { path = "../cargo-near" }
color-eyre = "0.6"
Expand Down
23 changes: 14 additions & 9 deletions integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
use const_format::formatcp;

pub const SDK_VERSION: &str = "4.1.0";
pub const SDK_GIT_REV: &str = "10b0dea3b1a214d789cc90314aa814a4181610ad";
/// published `near-sdk` version
pub const SDK_VERSION: &str = "4.1.1";
/// NOTE: this version is version of near-sdk in master branch from 5.x.x development cycle
pub const SDK_VERSION_MASTER: &str = "4.1.1";
pub const SDK_GIT_REV: &str = "15bfb0e6d54ff386478d137074027c2cb863df03";
pub const SDK_VERSION_TOML: &str = formatcp!(r#"version = "{SDK_VERSION}""#);
pub const SDK_GIT_VERSION_TOML_COMMA: &str = formatcp!(
r#"version = "{SDK_VERSION_MASTER}", git = "https://github.com/near/near-sdk-rs.git", rev = "{SDK_GIT_REV}""#
);
pub const SDK_GIT_VERSION_TOML_TABLE: &str = formatcp!(
r#"
version = "{SDK_VERSION}"
version = "{SDK_VERSION_MASTER}"
git = "https://github.com/near/near-sdk-rs.git"
rev = "{SDK_GIT_REV}"
"#
Expand All @@ -27,6 +33,7 @@ macro_rules! invoke_cargo_near {
cargo_vars.insert("sdk-version", $crate::SDK_VERSION);
cargo_vars.insert("sdk-git-rev", $crate::SDK_GIT_REV);
cargo_vars.insert("sdk-version-toml", $crate::SDK_VERSION_TOML);
cargo_vars.insert("sdk-git-version-toml-comma", $crate::SDK_GIT_VERSION_TOML_COMMA);
cargo_vars.insert("sdk-git-version-toml-table", $crate::SDK_GIT_VERSION_TOML_TABLE);
cargo_vars.insert("name", function_name!());
for (k, v) in cargo_vars {
Expand Down Expand Up @@ -109,15 +116,12 @@ macro_rules! generate_abi_fn_with {
$crate::generate_abi_with! {
$(Cargo: $cargo_path;)? $(Vars: $cargo_vars;)? $(Opts: $cli_opts;)?
Code:
// fixme! remove after borsh fixes trait qualification
// fixme! https://github.com/near/borsh-rs/issues/112
dj8yfo marked this conversation as resolved.
Show resolved Hide resolved
use near_sdk::borsh::BorshSchema;

use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::borsh::{BorshDeserialize, BorshSerialize};
use near_sdk::near_bindgen;

#[near_bindgen]
#[derive(Default, BorshDeserialize, BorshSerialize)]
#[borsh(crate = "near_sdk::borsh")]
pub struct Contract {}

#[near_bindgen]
Expand Down Expand Up @@ -208,11 +212,12 @@ macro_rules! build_fn_with {
$crate::build_with! {
$(Cargo: $cargo_path;)? $(Vars: $cargo_vars;)? $(Opts: $cli_opts;)?
Code:
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::borsh::{BorshDeserialize, BorshSerialize};
use near_sdk::{near_bindgen, NearSchema};

#[near_bindgen]
#[derive(Default, BorshDeserialize, BorshSerialize)]
#[borsh(crate = "near_sdk::borsh")]
pub struct Contract {}

#[near_bindgen]
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/templates/_Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
near-sdk = { features = ["unstable"], ::sdk-version-toml:: }
# NOTE: uncomment line 11 and comment 12, if it's desirable to switch to published `near-sdk` version
# near-sdk = { features = ["unstable"], ::sdk-version-toml:: }
near-sdk = { features = ["unstable"], ::sdk-git-version-toml-comma:: }
serde = { version = "1", features = ["derive"] }
schemars = "0.8"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
near-sdk = { default-features = false, version = "::sdk-version::" }
# NOTE: uncomment line 11 and comment 12, if it's desirable to switch to published `near-sdk` version
# near-sdk = { default-features = false, version = "::sdk-version::" }
dj8yfo marked this conversation as resolved.
Show resolved Hide resolved
near-sdk = { default-features = false, ::sdk-git-version-toml-comma:: }
serde = { version = "1", features = ["derive"] }
schemars = "0.8"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
near-sdk = { features = ["abi"], ::sdk-version-toml:: }
# NOTE: uncomment line 11 and comment 12, if it's desirable to switch to published `near-sdk` version
# near-sdk = { features = ["abi"], ::sdk-version-toml:: }
near-sdk = { features = ["abi"], ::sdk-git-version-toml-comma:: }
serde = { version = "1", features = ["derive"] }
schemars = "0.8"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
near-sdk = { features = ["abi", "unstable"], ::sdk-version-toml:: }
# NOTE: uncomment line 11 and comment 12, if it's desirable to switch to published `near-sdk` version
# near-sdk = { features = ["abi", "unstable"], ::sdk-version-toml:: }
near-sdk = { features = ["abi", "unstable"], ::sdk-git-version-toml-comma:: }
serde = { version = "1", features = ["derive"] }
schemars = "0.8"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
near-sdk = { default-features = false, features = ["abi"], ::sdk-version-toml:: }
# NOTE: uncomment line 11 and comment 12, if it's desirable to switch to published `near-sdk` version
# near-sdk = { default-features = false, features = ["abi"], ::sdk-version-toml:: }
near-sdk = { default-features = false, features = ["abi"], ::sdk-git-version-toml-comma:: }
serde = { version = "1", features = ["derive"] }
schemars = "0.8"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ serde = { version = "1", features = ["derive"] }
schemars = "0.8"

[target.'cfg(windows)'.dependencies]
near-sdk = { ::sdk-version-toml:: }
# NOTE: uncomment line 15 and comment 16, if it's desirable to switch to published `near-sdk` version
# near-sdk = { ::sdk-version-toml:: }
near-sdk = { ::sdk-git-version-toml-comma:: }

[target.'cfg(unix)'.dependencies]
near-sdk = { ::sdk-version-toml:: }
# NOTE: uncomment line 20 and comment 21, if it's desirable to switch to published `near-sdk` version
# near-sdk = { ::sdk-version-toml:: }
near-sdk = { ::sdk-git-version-toml-comma:: }

[workspace]
members = []
Expand Down
Loading
Loading