From aa2f34880c63ef9d784f27127851634908d736d8 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Thu, 27 Apr 2023 15:31:00 +0200 Subject: [PATCH 1/2] core: bump borsh version and other deps --- .github/workflows/test.yml | 2 +- README.md | 2 +- workspaces/Cargo.toml | 16 ++++++++-------- workspaces/src/types/mod.rs | 6 ++---- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c5305a63..572e3139 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: strategy: matrix: platform: [ubuntu-latest, macos-latest] - toolchain: [stable, 1.60.0] + toolchain: [stable, 1.68.0] runs-on: ${{ matrix.platform }} steps: diff --git a/README.md b/README.md index 3f5fa3ea..06b51f84 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ## Requirements -- Rust v1.60.0 and up +- Rust v1.68.0 and up - MacOS (x86 and M1) or Linux (x86) for sandbox tests. ### WASM compilation not supported diff --git a/workspaces/Cargo.toml b/workspaces/Cargo.toml index aaefcb30..0dcb6f07 100644 --- a/workspaces/Cargo.toml +++ b/workspaces/Cargo.toml @@ -13,9 +13,9 @@ Library for automating workflows and testing NEAR smart contracts. async-trait = "0.1" async-process = "1.3" base64 = "0.13" -borsh = "0.9" +borsh = "0.10" bs58 = "0.4" -cargo_metadata = { version = "0.14.2", optional = true } +cargo_metadata = { version = "0.15.4", optional = true } chrono = "0.4.19" fs2 = "0.4" hex = "0.4.2" @@ -24,7 +24,7 @@ rand = "0.8.4" reqwest = { version = "0.11", features = ["json"] } serde = "1.0" serde_json = "1.0" -json-patch = "0.2" +json-patch = "1.0" tempfile = "3.3" thiserror = "1.0" tokio = { version = "1", features = ["full"] } @@ -32,11 +32,11 @@ tokio-retry = "0.3" tracing = "0.1" url = { version = "2.2.2", features = ["serde"] } -near-account-id = "0.15.0" -near-crypto = "0.15.0" -near-primitives = "0.15.0" -near-jsonrpc-primitives = "0.15.0" -near-jsonrpc-client = { version = "0.4.1", features = ["sandbox"] } +near-account-id = "0.16" +near-crypto = "0.16" +near-primitives = "0.16" +near-jsonrpc-primitives = "0.16" +near-jsonrpc-client = { version = "0.5", features = ["sandbox"] } near-sandbox-utils = "0.6.2" [build-dependencies] diff --git a/workspaces/src/types/mod.rs b/workspaces/src/types/mod.rs index a04224f7..701b5426 100644 --- a/workspaces/src/types/mod.rs +++ b/workspaces/src/types/mod.rs @@ -13,8 +13,6 @@ use std::str::FromStr; use borsh::{BorshDeserialize, BorshSerialize}; pub use near_account_id::AccountId; -use near_primitives::logging::pretty_hash; -use near_primitives::serialize::to_base58; use serde::{Deserialize, Serialize}; use crate::error::{Error, ErrorKind}; @@ -286,13 +284,13 @@ impl TryFrom> for CryptoHash { impl Debug for CryptoHash { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", pretty_hash(&self.to_string())) + write!(f, "{}", self) } } impl Display for CryptoHash { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - Display::fmt(&to_base58(self.0), f) + Display::fmt(&bs58::encode(self.0).into_string(), f) } } From c4b7a253f7f16d4d3e9c5b2dfb99bd8e23b20aeb Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 24 May 2023 10:02:41 +0200 Subject: [PATCH 2/2] core: bump borsh version in other crates --- examples/Cargo.toml | 2 +- examples/src/ref_finance.rs | 2 +- workspaces/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 9603e95b..7c495e13 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dev-dependencies] anyhow = "1.0" -borsh = "0.9" +borsh = "0.10" maplit = "1.0" near-units = "0.2.0" serde = "1.0" diff --git a/examples/src/ref_finance.rs b/examples/src/ref_finance.rs index 458e068b..9f723b72 100644 --- a/examples/src/ref_finance.rs +++ b/examples/src/ref_finance.rs @@ -197,7 +197,7 @@ async fn create_custom_ft( .await?; // Initialize our FT contract with owner metadata and total supply available - // to be traded and transfered into other contracts such as Ref-Finance + // to be traded and transferred into other contracts such as Ref-Finance ft.call("new_default_meta") .args_json(json!({ "owner_id": owner.id(), diff --git a/workspaces/Cargo.toml b/workspaces/Cargo.toml index 0dcb6f07..4351032b 100644 --- a/workspaces/Cargo.toml +++ b/workspaces/Cargo.toml @@ -47,7 +47,7 @@ libc = "0.2" [dev-dependencies] anyhow = "1.0" -borsh = "0.9" +borsh = "0.10" futures = "0.3" near-units = "0.2.0" near-sdk = "4.0.0"