diff --git a/ci-test.sh b/ci-test.sh index d64063b88..68d0320e5 100755 --- a/ci-test.sh +++ b/ci-test.sh @@ -11,7 +11,7 @@ else cargo generate-lockfile ### this is section for packages, refusing to work with 1.69 - cargo update -p clap@4.4.1 --precise 4.3.24 + cargo update -p clap@4.4.2 --precise 4.3.24 cargo update -p clap_lex@0.5.1 --precise 0.5.0 ### end of 1.69 threshold section diff --git a/examples/adder/Cargo.lock b/examples/adder/Cargo.lock index 6b9ab6ffb..99556f159 100644 --- a/examples/adder/Cargo.lock +++ b/examples/adder/Cargo.lock @@ -58,7 +58,6 @@ name = "adder" version = "0.1.0" dependencies = [ "anyhow", - "borsh 1.0.0-alpha.3", "near-abi", "near-sdk", "schemars", @@ -453,11 +452,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1acb549fd0db3b4150957daa838fa9bbd26c18f18b32f24c9678de4b8ca4f7" +checksum = "41898277107b0d3f027593697912977397eba6ac39a55bdd2eb02c1d5d5013b5" dependencies = [ - "borsh-derive 1.0.0-alpha.3", + "borsh-derive 1.0.0-alpha.4", "cfg_aliases", ] @@ -489,9 +488,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6d4b2eff15f3f87c5d0844180621f6eb0688e68820d76cf17149a02eef1c78" +checksum = "413cb435569fe499e89235f758304e0e7198016baa351d8f5827ea0f40526ce0" dependencies = [ "once_cell", "proc-macro-crate 1.3.1", @@ -1783,9 +1782,9 @@ dependencies = [ [[package]] name = "near-abi" version = "0.3.0" -source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#fb57a26524e30f8a18683415e1d9d549824091ca" +source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#f9430ffb61cbe2b1316b5200eb292b2a237b08d8" dependencies = [ - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "schemars", "semver", "serde", @@ -2136,7 +2135,7 @@ name = "near-sdk" version = "4.1.1" dependencies = [ "base64 0.13.1", - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "bs58", "near-abi", "near-crypto 0.17.0", diff --git a/examples/adder/Cargo.toml b/examples/adder/Cargo.toml index 6af77bc17..822d113c6 100644 --- a/examples/adder/Cargo.toml +++ b/examples/adder/Cargo.toml @@ -10,7 +10,6 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../near-sdk", features = ["unstable"] } serde = { version = "1", features = ["derive"] } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } schemars = "0.8" [dev-dependencies] diff --git a/examples/adder/src/lib.rs b/examples/adder/src/lib.rs index 74af3e3dc..314d58159 100644 --- a/examples/adder/src/lib.rs +++ b/examples/adder/src/lib.rs @@ -3,6 +3,7 @@ use near_sdk::serde::{Deserialize, Serialize}; use near_sdk::{near_bindgen, NearSchema}; #[derive(NearSchema, Serialize, Deserialize, BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] #[abi(json, borsh)] pub struct Pair(u32, u32); @@ -15,6 +16,7 @@ pub struct DoublePair { #[near_bindgen] #[derive(Default, BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct Adder {} #[near_bindgen] diff --git a/examples/callback-results/Cargo.lock b/examples/callback-results/Cargo.lock index f327d526f..a0ad97f4d 100644 --- a/examples/callback-results/Cargo.lock +++ b/examples/callback-results/Cargo.lock @@ -437,11 +437,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1acb549fd0db3b4150957daa838fa9bbd26c18f18b32f24c9678de4b8ca4f7" +checksum = "41898277107b0d3f027593697912977397eba6ac39a55bdd2eb02c1d5d5013b5" dependencies = [ - "borsh-derive 1.0.0-alpha.3", + "borsh-derive 1.0.0-alpha.4", "cfg_aliases", ] @@ -473,9 +473,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6d4b2eff15f3f87c5d0844180621f6eb0688e68820d76cf17149a02eef1c78" +checksum = "413cb435569fe499e89235f758304e0e7198016baa351d8f5827ea0f40526ce0" dependencies = [ "once_cell", "proc-macro-crate 1.3.1", @@ -1766,9 +1766,9 @@ dependencies = [ [[package]] name = "near-abi" version = "0.3.0" -source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#fb57a26524e30f8a18683415e1d9d549824091ca" +source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#f9430ffb61cbe2b1316b5200eb292b2a237b08d8" dependencies = [ - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "schemars", "semver", "serde", @@ -2119,7 +2119,7 @@ name = "near-sdk" version = "4.1.1" dependencies = [ "base64 0.13.1", - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "bs58", "near-abi", "near-crypto 0.17.0", diff --git a/examples/cross-contract-calls/Cargo.lock b/examples/cross-contract-calls/Cargo.lock index 92dd4be70..4cd840c68 100644 --- a/examples/cross-contract-calls/Cargo.lock +++ b/examples/cross-contract-calls/Cargo.lock @@ -443,11 +443,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1acb549fd0db3b4150957daa838fa9bbd26c18f18b32f24c9678de4b8ca4f7" +checksum = "41898277107b0d3f027593697912977397eba6ac39a55bdd2eb02c1d5d5013b5" dependencies = [ - "borsh-derive 1.0.0-alpha.3", + "borsh-derive 1.0.0-alpha.4", "cfg_aliases", ] @@ -479,9 +479,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6d4b2eff15f3f87c5d0844180621f6eb0688e68820d76cf17149a02eef1c78" +checksum = "413cb435569fe499e89235f758304e0e7198016baa351d8f5827ea0f40526ce0" dependencies = [ "once_cell", "proc-macro-crate 1.3.1", @@ -755,7 +755,6 @@ dependencies = [ name = "cross-contract-high-level" version = "1.1.0" dependencies = [ - "borsh 1.0.0-alpha.3", "near-sdk", ] @@ -763,7 +762,6 @@ dependencies = [ name = "cross-contract-low-level" version = "1.1.0" dependencies = [ - "borsh 1.0.0-alpha.3", "near-sdk", ] @@ -1792,9 +1790,9 @@ dependencies = [ [[package]] name = "near-abi" version = "0.3.0" -source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#fb57a26524e30f8a18683415e1d9d549824091ca" +source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#f9430ffb61cbe2b1316b5200eb292b2a237b08d8" dependencies = [ - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "schemars", "semver", "serde", @@ -2145,7 +2143,7 @@ name = "near-sdk" version = "4.1.1" dependencies = [ "base64 0.13.1", - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "bs58", "near-abi", "near-crypto 0.17.0", diff --git a/examples/cross-contract-calls/high-level/Cargo.toml b/examples/cross-contract-calls/high-level/Cargo.toml index 7a98e005e..0f188089a 100644 --- a/examples/cross-contract-calls/high-level/Cargo.toml +++ b/examples/cross-contract-calls/high-level/Cargo.toml @@ -9,4 +9,3 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../../near-sdk" } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } diff --git a/examples/cross-contract-calls/high-level/src/lib.rs b/examples/cross-contract-calls/high-level/src/lib.rs index 5dba44df3..275b9bd4f 100644 --- a/examples/cross-contract-calls/high-level/src/lib.rs +++ b/examples/cross-contract-calls/high-level/src/lib.rs @@ -4,6 +4,7 @@ use near_sdk::{log, near_bindgen, PromiseOrValue}; #[near_bindgen] #[derive(Default, BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct CrossContract {} #[near_bindgen] diff --git a/examples/cross-contract-calls/low-level/Cargo.toml b/examples/cross-contract-calls/low-level/Cargo.toml index 56dc7d6ff..0b86d16b2 100644 --- a/examples/cross-contract-calls/low-level/Cargo.toml +++ b/examples/cross-contract-calls/low-level/Cargo.toml @@ -9,4 +9,3 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../../near-sdk" } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } diff --git a/examples/cross-contract-calls/low-level/src/lib.rs b/examples/cross-contract-calls/low-level/src/lib.rs index 87747f804..873f7bc55 100644 --- a/examples/cross-contract-calls/low-level/src/lib.rs +++ b/examples/cross-contract-calls/low-level/src/lib.rs @@ -10,6 +10,7 @@ const FACTORIAL_MULT_CALL_GAS: Gas = Gas(10_000_000_000_000); #[near_bindgen] #[derive(Default, BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct CrossContract {} #[near_bindgen] diff --git a/examples/factory-contract/Cargo.lock b/examples/factory-contract/Cargo.lock index beb8ecb9d..dc48a894c 100644 --- a/examples/factory-contract/Cargo.lock +++ b/examples/factory-contract/Cargo.lock @@ -443,11 +443,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1acb549fd0db3b4150957daa838fa9bbd26c18f18b32f24c9678de4b8ca4f7" +checksum = "41898277107b0d3f027593697912977397eba6ac39a55bdd2eb02c1d5d5013b5" dependencies = [ - "borsh-derive 1.0.0-alpha.3", + "borsh-derive 1.0.0-alpha.4", "cfg_aliases", ] @@ -479,9 +479,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6d4b2eff15f3f87c5d0844180621f6eb0688e68820d76cf17149a02eef1c78" +checksum = "413cb435569fe499e89235f758304e0e7198016baa351d8f5827ea0f40526ce0" dependencies = [ "once_cell", "proc-macro-crate 1.3.1", @@ -1055,7 +1055,6 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" name = "factory-contract-high-level" version = "1.1.0" dependencies = [ - "borsh 1.0.0-alpha.3", "near-sdk", ] @@ -1063,7 +1062,6 @@ dependencies = [ name = "factory-contract-low-level" version = "1.1.0" dependencies = [ - "borsh 1.0.0-alpha.3", "near-sdk", ] @@ -1792,9 +1790,9 @@ dependencies = [ [[package]] name = "near-abi" version = "0.3.0" -source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#fb57a26524e30f8a18683415e1d9d549824091ca" +source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#f9430ffb61cbe2b1316b5200eb292b2a237b08d8" dependencies = [ - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "schemars", "semver", "serde", @@ -2145,7 +2143,7 @@ name = "near-sdk" version = "4.1.1" dependencies = [ "base64 0.13.1", - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "bs58", "near-abi", "near-crypto 0.17.0", diff --git a/examples/factory-contract/high-level/Cargo.toml b/examples/factory-contract/high-level/Cargo.toml index 6d83bcf65..ae04ffca5 100644 --- a/examples/factory-contract/high-level/Cargo.toml +++ b/examples/factory-contract/high-level/Cargo.toml @@ -9,4 +9,3 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../../near-sdk" } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } diff --git a/examples/factory-contract/high-level/src/lib.rs b/examples/factory-contract/high-level/src/lib.rs index f86c44ad0..3b44b1a01 100644 --- a/examples/factory-contract/high-level/src/lib.rs +++ b/examples/factory-contract/high-level/src/lib.rs @@ -4,6 +4,7 @@ use near_sdk::{env, ext_contract, json_types::U128, near_bindgen, AccountId, Pro #[near_bindgen] #[derive(Default, BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct FactoryContract {} // If the `ext_contract` name is not provided explicitly, the namespace for generated methods is diff --git a/examples/factory-contract/low-level/Cargo.toml b/examples/factory-contract/low-level/Cargo.toml index bc7f068aa..27a11bfb0 100644 --- a/examples/factory-contract/low-level/Cargo.toml +++ b/examples/factory-contract/low-level/Cargo.toml @@ -9,4 +9,3 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../../near-sdk" } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } diff --git a/examples/factory-contract/low-level/src/lib.rs b/examples/factory-contract/low-level/src/lib.rs index b8f502e4e..bdf0607cf 100644 --- a/examples/factory-contract/low-level/src/lib.rs +++ b/examples/factory-contract/low-level/src/lib.rs @@ -8,6 +8,7 @@ const SINGLE_CALL_GAS: Gas = Gas(20_000_000_000_000); #[near_bindgen] #[derive(Default, BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct FactoryContract {} #[near_bindgen] diff --git a/examples/fungible-token/Cargo.lock b/examples/fungible-token/Cargo.lock index dc7a2e2dd..e5a5f7298 100644 --- a/examples/fungible-token/Cargo.lock +++ b/examples/fungible-token/Cargo.lock @@ -443,11 +443,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1acb549fd0db3b4150957daa838fa9bbd26c18f18b32f24c9678de4b8ca4f7" +checksum = "41898277107b0d3f027593697912977397eba6ac39a55bdd2eb02c1d5d5013b5" dependencies = [ - "borsh-derive 1.0.0-alpha.3", + "borsh-derive 1.0.0-alpha.4", "cfg_aliases", ] @@ -479,9 +479,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6d4b2eff15f3f87c5d0844180621f6eb0688e68820d76cf17149a02eef1c78" +checksum = "413cb435569fe499e89235f758304e0e7198016baa351d8f5827ea0f40526ce0" dependencies = [ "once_cell", "proc-macro-crate 1.3.1", @@ -878,7 +878,6 @@ dependencies = [ name = "defi" version = "0.0.1" dependencies = [ - "borsh 1.0.0-alpha.3", "near-contract-standards", "near-sdk", "schemars", @@ -1173,7 +1172,6 @@ dependencies = [ name = "fungible-token" version = "1.1.0" dependencies = [ - "borsh 1.0.0-alpha.3", "near-contract-standards", "near-sdk", "schemars", @@ -1797,9 +1795,9 @@ dependencies = [ [[package]] name = "near-abi" version = "0.3.0" -source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#fb57a26524e30f8a18683415e1d9d549824091ca" +source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#f9430ffb61cbe2b1316b5200eb292b2a237b08d8" dependencies = [ - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "schemars", "semver", "serde", @@ -1860,7 +1858,6 @@ dependencies = [ name = "near-contract-standards" version = "4.1.1" dependencies = [ - "borsh 1.0.0-alpha.3", "near-sdk", "schemars", "serde", @@ -2161,7 +2158,7 @@ name = "near-sdk" version = "4.1.1" dependencies = [ "base64 0.13.1", - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "bs58", "near-abi", "near-crypto 0.17.0", diff --git a/examples/fungible-token/ft/Cargo.toml b/examples/fungible-token/ft/Cargo.toml index 7796ce772..0f7f98ec7 100644 --- a/examples/fungible-token/ft/Cargo.toml +++ b/examples/fungible-token/ft/Cargo.toml @@ -9,6 +9,5 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../../near-sdk" } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } near-contract-standards = { path = "../../../near-contract-standards" } schemars = "0.8" diff --git a/examples/fungible-token/ft/src/lib.rs b/examples/fungible-token/ft/src/lib.rs index 76acbd8a1..7166eeeaa 100644 --- a/examples/fungible-token/ft/src/lib.rs +++ b/examples/fungible-token/ft/src/lib.rs @@ -33,6 +33,7 @@ use near_sdk::{ #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +#[borsh(crate = "::near_sdk::borsh")] pub struct Contract { token: FungibleToken, metadata: LazyOption, @@ -41,6 +42,7 @@ pub struct Contract { const DATA_IMAGE_SVG_NEAR_ICON: &str = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 288 288'%3E%3Cg id='l' data-name='l'%3E%3Cpath d='M187.58,79.81l-30.1,44.69a3.2,3.2,0,0,0,4.75,4.2L191.86,103a1.2,1.2,0,0,1,2,.91v80.46a1.2,1.2,0,0,1-2.12.77L102.18,77.93A15.35,15.35,0,0,0,90.47,72.5H87.34A15.34,15.34,0,0,0,72,87.84V201.16A15.34,15.34,0,0,0,87.34,216.5h0a15.35,15.35,0,0,0,13.08-7.31l30.1-44.69a3.2,3.2,0,0,0-4.75-4.2L96.14,186a1.2,1.2,0,0,1-2-.91V104.61a1.2,1.2,0,0,1,2.12-.77l89.55,107.23a15.35,15.35,0,0,0,11.71,5.43h3.13A15.34,15.34,0,0,0,216,201.16V87.84A15.34,15.34,0,0,0,200.66,72.5h0A15.35,15.35,0,0,0,187.58,79.81Z'/%3E%3C/g%3E%3C/svg%3E"; #[derive(BorshSerialize, BorshStorageKey)] +#[borsh(crate = "::near_sdk::borsh")] enum StorageKey { FungibleToken, Metadata, diff --git a/examples/fungible-token/test-contract-defi/Cargo.toml b/examples/fungible-token/test-contract-defi/Cargo.toml index 6433d6769..f7aa87af0 100644 --- a/examples/fungible-token/test-contract-defi/Cargo.toml +++ b/examples/fungible-token/test-contract-defi/Cargo.toml @@ -9,6 +9,5 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../../near-sdk" } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } near-contract-standards = { path = "../../../near-contract-standards" } schemars = "0.8" diff --git a/examples/fungible-token/test-contract-defi/src/lib.rs b/examples/fungible-token/test-contract-defi/src/lib.rs index e222ff049..f4292384e 100644 --- a/examples/fungible-token/test-contract-defi/src/lib.rs +++ b/examples/fungible-token/test-contract-defi/src/lib.rs @@ -14,6 +14,7 @@ const GAS_FOR_FT_ON_TRANSFER: Gas = Gas(BASE_GAS + PROMISE_CALL); #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +#[borsh(crate = "::near_sdk::borsh")] pub struct DeFi { fungible_token_account_id: AccountId, } diff --git a/examples/lockable-fungible-token/Cargo.lock b/examples/lockable-fungible-token/Cargo.lock index e9eced37e..00e40284e 100644 --- a/examples/lockable-fungible-token/Cargo.lock +++ b/examples/lockable-fungible-token/Cargo.lock @@ -443,11 +443,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1acb549fd0db3b4150957daa838fa9bbd26c18f18b32f24c9678de4b8ca4f7" +checksum = "41898277107b0d3f027593697912977397eba6ac39a55bdd2eb02c1d5d5013b5" dependencies = [ - "borsh-derive 1.0.0-alpha.3", + "borsh-derive 1.0.0-alpha.4", "cfg_aliases", ] @@ -479,9 +479,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6d4b2eff15f3f87c5d0844180621f6eb0688e68820d76cf17149a02eef1c78" +checksum = "413cb435569fe499e89235f758304e0e7198016baa351d8f5827ea0f40526ce0" dependencies = [ "once_cell", "proc-macro-crate 1.3.1", @@ -1677,7 +1677,6 @@ name = "lockable-fungible-token" version = "0.1.0" dependencies = [ "anyhow", - "borsh 1.0.0-alpha.3", "near-primitives 0.17.0", "near-sdk", "near-units", @@ -1775,9 +1774,9 @@ dependencies = [ [[package]] name = "near-abi" version = "0.3.0" -source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#fb57a26524e30f8a18683415e1d9d549824091ca" +source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#f9430ffb61cbe2b1316b5200eb292b2a237b08d8" dependencies = [ - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "schemars", "semver", "serde", @@ -2128,7 +2127,7 @@ name = "near-sdk" version = "4.1.1" dependencies = [ "base64 0.13.1", - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "bs58", "near-abi", "near-crypto 0.17.0", diff --git a/examples/lockable-fungible-token/Cargo.toml b/examples/lockable-fungible-token/Cargo.toml index 5a64de572..029d153ea 100644 --- a/examples/lockable-fungible-token/Cargo.toml +++ b/examples/lockable-fungible-token/Cargo.toml @@ -9,7 +9,6 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../near-sdk" } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } [dev-dependencies] anyhow = "1.0" diff --git a/examples/lockable-fungible-token/src/lib.rs b/examples/lockable-fungible-token/src/lib.rs index 225b11843..db0951c13 100644 --- a/examples/lockable-fungible-token/src/lib.rs +++ b/examples/lockable-fungible-token/src/lib.rs @@ -5,6 +5,7 @@ use std::collections::HashMap; use std::str::FromStr; #[derive(Default, BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct Account { /// Current unlocked balance. pub balance: Balance, @@ -46,6 +47,7 @@ impl Account { #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +#[borsh(crate = "::near_sdk::borsh")] pub struct FunToken { /// AccountID -> Account details. pub accounts: UnorderedMap, diff --git a/examples/mission-control/Cargo.lock b/examples/mission-control/Cargo.lock index 7876e84d9..1c85f587f 100644 --- a/examples/mission-control/Cargo.lock +++ b/examples/mission-control/Cargo.lock @@ -282,11 +282,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1acb549fd0db3b4150957daa838fa9bbd26c18f18b32f24c9678de4b8ca4f7" +checksum = "41898277107b0d3f027593697912977397eba6ac39a55bdd2eb02c1d5d5013b5" dependencies = [ - "borsh-derive 1.0.0-alpha.3", + "borsh-derive 1.0.0-alpha.4", "cfg_aliases", ] @@ -318,9 +318,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6d4b2eff15f3f87c5d0844180621f6eb0688e68820d76cf17149a02eef1c78" +checksum = "413cb435569fe499e89235f758304e0e7198016baa351d8f5827ea0f40526ce0" dependencies = [ "once_cell", "proc-macro-crate 1.3.1", @@ -1268,7 +1268,6 @@ dependencies = [ name = "mission-control" version = "0.1.0" dependencies = [ - "borsh 1.0.0-alpha.3", "near-sdk", ] @@ -1281,9 +1280,9 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "near-abi" version = "0.3.0" -source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#fb57a26524e30f8a18683415e1d9d549824091ca" +source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#f9430ffb61cbe2b1316b5200eb292b2a237b08d8" dependencies = [ - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "schemars", "semver", "serde", @@ -1460,7 +1459,7 @@ name = "near-sdk" version = "4.1.1" dependencies = [ "base64 0.13.1", - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "bs58", "near-abi", "near-crypto", diff --git a/examples/mission-control/Cargo.toml b/examples/mission-control/Cargo.toml index 5126c5ddd..00d51fdac 100644 --- a/examples/mission-control/Cargo.toml +++ b/examples/mission-control/Cargo.toml @@ -9,7 +9,6 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../near-sdk" } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } [profile.release] codegen-units = 1 diff --git a/examples/mission-control/src/account.rs b/examples/mission-control/src/account.rs index 56888ac15..944059a94 100644 --- a/examples/mission-control/src/account.rs +++ b/examples/mission-control/src/account.rs @@ -19,10 +19,12 @@ use std::ops; BorshSerialize, )] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub struct Quantity(pub i32); #[derive(Clone, Serialize, Deserialize, BorshDeserialize, BorshSerialize)] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub struct Account(pub HashMap); pub enum Tranx { diff --git a/examples/mission-control/src/agent.rs b/examples/mission-control/src/agent.rs index e233277a7..780ba29a6 100644 --- a/examples/mission-control/src/agent.rs +++ b/examples/mission-control/src/agent.rs @@ -7,6 +7,7 @@ use std::collections::HashMap; #[derive(Clone, Serialize, Deserialize, BorshDeserialize, BorshSerialize)] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub struct Agent { pub account: Account, pub is_alive: bool, diff --git a/examples/mission-control/src/asset.rs b/examples/mission-control/src/asset.rs index 4e1df6a06..6dff85e79 100644 --- a/examples/mission-control/src/asset.rs +++ b/examples/mission-control/src/asset.rs @@ -5,6 +5,7 @@ use near_sdk::serde::{Deserialize, Serialize}; PartialEq, Eq, PartialOrd, + Ord, Hash, Clone, Copy, @@ -14,6 +15,7 @@ use near_sdk::serde::{Deserialize, Serialize}; BorshSerialize, )] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub enum Resource { Battery, RgbSensor, @@ -25,6 +27,7 @@ pub enum Resource { PartialEq, Eq, PartialOrd, + Ord, Hash, Clone, Copy, @@ -34,6 +37,7 @@ pub enum Resource { BorshSerialize, )] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub enum Reward { Score, Token, @@ -46,6 +50,7 @@ pub enum Reward { PartialEq, Eq, PartialOrd, + Ord, Hash, Clone, Copy, @@ -55,6 +60,7 @@ pub enum Reward { BorshSerialize, )] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub enum Asset { Resource(Resource), Reward(Reward), @@ -63,9 +69,10 @@ pub enum Asset { } #[derive( - PartialEq, Eq, Hash, Serialize, Deserialize, PartialOrd, BorshDeserialize, BorshSerialize, + PartialEq, Eq, Hash, Serialize, Deserialize, PartialOrd, Ord, BorshDeserialize, BorshSerialize, )] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub enum Exchange { MissionTimeWithResource, MissionTimeWithTrust, diff --git a/examples/mission-control/src/mission_control.rs b/examples/mission-control/src/mission_control.rs index b40293598..2df7d213f 100644 --- a/examples/mission-control/src/mission_control.rs +++ b/examples/mission-control/src/mission_control.rs @@ -11,6 +11,7 @@ use std::collections::HashMap; #[near_bindgen] #[derive(Serialize, Deserialize, BorshDeserialize, BorshSerialize)] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub struct MissionControl { account: Account, agents: HashMap, diff --git a/examples/mission-control/src/rate.rs b/examples/mission-control/src/rate.rs index c14f70ae5..a647a1129 100644 --- a/examples/mission-control/src/rate.rs +++ b/examples/mission-control/src/rate.rs @@ -6,6 +6,7 @@ use std::collections::HashMap; #[derive(PartialEq, Eq, Serialize, Deserialize, BorshDeserialize, BorshSerialize)] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub struct Rate { pub credit: HashMap, pub debit: HashMap, diff --git a/examples/status-message/Cargo.lock b/examples/status-message/Cargo.lock index 7543d4d70..826d9343f 100644 --- a/examples/status-message/Cargo.lock +++ b/examples/status-message/Cargo.lock @@ -282,11 +282,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1acb549fd0db3b4150957daa838fa9bbd26c18f18b32f24c9678de4b8ca4f7" +checksum = "41898277107b0d3f027593697912977397eba6ac39a55bdd2eb02c1d5d5013b5" dependencies = [ - "borsh-derive 1.0.0-alpha.3", + "borsh-derive 1.0.0-alpha.4", "cfg_aliases", ] @@ -318,9 +318,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.0.0-alpha.3" +version = "1.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6d4b2eff15f3f87c5d0844180621f6eb0688e68820d76cf17149a02eef1c78" +checksum = "413cb435569fe499e89235f758304e0e7198016baa351d8f5827ea0f40526ce0" dependencies = [ "once_cell", "proc-macro-crate 1.3.1", @@ -1273,9 +1273,9 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "near-abi" version = "0.3.0" -source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#fb57a26524e30f8a18683415e1d9d549824091ca" +source = "git+https://github.com/dj8yfo/near-abi-rs.git?branch=borsh_update#f9430ffb61cbe2b1316b5200eb292b2a237b08d8" dependencies = [ - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "schemars", "semver", "serde", @@ -1452,7 +1452,7 @@ name = "near-sdk" version = "4.1.1" dependencies = [ "base64 0.13.1", - "borsh 1.0.0-alpha.3", + "borsh 1.0.0-alpha.4", "bs58", "near-abi", "near-crypto", @@ -2317,7 +2317,6 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" name = "status-message" version = "0.1.0" dependencies = [ - "borsh 1.0.0-alpha.3", "near-sdk", ] diff --git a/examples/status-message/Cargo.toml b/examples/status-message/Cargo.toml index ac4f4f447..f3bb5745e 100644 --- a/examples/status-message/Cargo.toml +++ b/examples/status-message/Cargo.toml @@ -9,7 +9,6 @@ crate-type = ["cdylib"] [dependencies] near-sdk = { path = "../../near-sdk" } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } [profile.release] codegen-units = 1 diff --git a/examples/status-message/src/lib.rs b/examples/status-message/src/lib.rs index 9c097ef90..d3e303c75 100644 --- a/examples/status-message/src/lib.rs +++ b/examples/status-message/src/lib.rs @@ -3,10 +3,12 @@ use near_sdk::collections::LookupMap; use near_sdk::{env, log, near_bindgen, AccountId, BorshStorageKey}; #[derive(BorshSerialize, BorshStorageKey)] +#[borsh(crate = "::near_sdk::borsh")] struct RecordsKey; #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct StatusMessage { records: LookupMap, } diff --git a/near-contract-standards/Cargo.toml b/near-contract-standards/Cargo.toml index 1bdeee1fa..263deee55 100644 --- a/near-contract-standards/Cargo.toml +++ b/near-contract-standards/Cargo.toml @@ -14,7 +14,6 @@ NEAR smart contracts standard library. [dependencies] near-sdk = { path = "../near-sdk", version = "~4.1.1", default-features = false, features = ["legacy"] } -borsh = { version = "1.0.0-alpha.4", features = ["derive"] } serde = "1" serde_json = "1" schemars = "0.8" diff --git a/near-contract-standards/src/fungible_token/core.rs b/near-contract-standards/src/fungible_token/core.rs index 1790886fa..8ac763484 100644 --- a/near-contract-standards/src/fungible_token/core.rs +++ b/near-contract-standards/src/fungible_token/core.rs @@ -17,6 +17,7 @@ use near_sdk::PromiseOrValue; /// /// #[near_bindgen] /// #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +/// #[borsh(crate = "::near_sdk::borsh")] /// pub struct Contract { /// token: FungibleToken, /// metadata: LazyOption, diff --git a/near-contract-standards/src/fungible_token/core_impl.rs b/near-contract-standards/src/fungible_token/core_impl.rs index d61ee8e73..cae776c24 100644 --- a/near-contract-standards/src/fungible_token/core_impl.rs +++ b/near-contract-standards/src/fungible_token/core_impl.rs @@ -25,6 +25,7 @@ const ERR_TOTAL_SUPPLY_OVERFLOW: &str = "Total supply overflow"; /// /// For example usage, see examples/fungible-token/src/lib.rs. #[derive(BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct FungibleToken { /// AccountID -> Account balance. pub accounts: LookupMap, diff --git a/near-contract-standards/src/fungible_token/metadata.rs b/near-contract-standards/src/fungible_token/metadata.rs index 29a0ff498..4da6c1276 100644 --- a/near-contract-standards/src/fungible_token/metadata.rs +++ b/near-contract-standards/src/fungible_token/metadata.rs @@ -7,6 +7,7 @@ pub const FT_METADATA_SPEC: &str = "ft-1.0.0"; #[derive(BorshDeserialize, BorshSerialize, Clone, Deserialize, Serialize)] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] #[cfg_attr(feature = "abi", derive(schemars::JsonSchema))] pub struct FungibleTokenMetadata { pub spec: String, diff --git a/near-contract-standards/src/fungible_token/resolver.rs b/near-contract-standards/src/fungible_token/resolver.rs index fc3228274..e96854b5d 100644 --- a/near-contract-standards/src/fungible_token/resolver.rs +++ b/near-contract-standards/src/fungible_token/resolver.rs @@ -14,6 +14,7 @@ use near_sdk::{ext_contract, json_types::U128, AccountId}; /// /// #[near_bindgen] /// #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +/// #[borsh(crate = "::near_sdk::borsh")] /// pub struct Contract { /// token: FungibleToken, /// metadata: LazyOption, diff --git a/near-contract-standards/src/non_fungible_token/approval/mod.rs b/near-contract-standards/src/non_fungible_token/approval/mod.rs index e77f561b2..92f3c9e7f 100644 --- a/near-contract-standards/src/non_fungible_token/approval/mod.rs +++ b/near-contract-standards/src/non_fungible_token/approval/mod.rs @@ -28,6 +28,7 @@ use near_sdk::Promise; /// /// #[near_bindgen] /// #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +/// #[borsh(crate = "::near_sdk::borsh")] /// pub struct Contract { /// tokens: NonFungibleToken, ///} diff --git a/near-contract-standards/src/non_fungible_token/core/core_impl.rs b/near-contract-standards/src/non_fungible_token/core/core_impl.rs index 25fa8ef99..5f87d153a 100644 --- a/near-contract-standards/src/non_fungible_token/core/core_impl.rs +++ b/near-contract-standards/src/non_fungible_token/core/core_impl.rs @@ -28,6 +28,7 @@ const GAS_FOR_NFT_TRANSFER_CALL: Gas = Gas(25_000_000_000_000 + GAS_FOR_RESOLVE_ /// /// For example usage, see examples/non-fungible-token/src/lib.rs. #[derive(BorshDeserialize, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct NonFungibleToken { // owner of contract pub owner_id: AccountId, @@ -50,6 +51,7 @@ pub struct NonFungibleToken { } #[derive(BorshStorageKey, BorshSerialize)] +#[borsh(crate = "::near_sdk::borsh")] pub enum StorageKey { TokensPerOwner { account_hash: Vec }, } diff --git a/near-contract-standards/src/non_fungible_token/core/mod.rs b/near-contract-standards/src/non_fungible_token/core/mod.rs index 09254b8b6..53ecc5f30 100644 --- a/near-contract-standards/src/non_fungible_token/core/mod.rs +++ b/near-contract-standards/src/non_fungible_token/core/mod.rs @@ -29,6 +29,7 @@ use near_sdk::PromiseOrValue; /// /// #[near_bindgen] /// #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +/// #[borsh(crate = "::near_sdk::borsh")] /// pub struct Contract { /// tokens: NonFungibleToken, ///} diff --git a/near-contract-standards/src/non_fungible_token/core/resolver.rs b/near-contract-standards/src/non_fungible_token/core/resolver.rs index 812138918..ccd39da3a 100644 --- a/near-contract-standards/src/non_fungible_token/core/resolver.rs +++ b/near-contract-standards/src/non_fungible_token/core/resolver.rs @@ -14,6 +14,7 @@ use std::collections::HashMap; /// /// #[near_bindgen] /// #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +/// #[borsh(crate = "::near_sdk::borsh")] /// pub struct Contract { /// tokens: NonFungibleToken, ///} diff --git a/near-contract-standards/src/non_fungible_token/enumeration/mod.rs b/near-contract-standards/src/non_fungible_token/enumeration/mod.rs index c34360378..04a008299 100644 --- a/near-contract-standards/src/non_fungible_token/enumeration/mod.rs +++ b/near-contract-standards/src/non_fungible_token/enumeration/mod.rs @@ -17,6 +17,7 @@ use near_sdk::AccountId; /// /// #[near_bindgen] /// #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +/// #[borsh(crate = "::near_sdk::borsh")] /// pub struct Contract { /// tokens: NonFungibleToken, ///} diff --git a/near-contract-standards/src/non_fungible_token/metadata.rs b/near-contract-standards/src/non_fungible_token/metadata.rs index 610ce65c6..9a7e63a60 100644 --- a/near-contract-standards/src/non_fungible_token/metadata.rs +++ b/near-contract-standards/src/non_fungible_token/metadata.rs @@ -10,6 +10,7 @@ pub const NFT_METADATA_SPEC: &str = "nft-1.0.0"; #[derive(BorshDeserialize, BorshSerialize, Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "abi", derive(schemars::JsonSchema))] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub struct NFTContractMetadata { pub spec: String, // required, essentially a version like "nft-1.0.0" pub name: String, // required, ex. "Mosaics" @@ -26,6 +27,7 @@ pub struct NFTContractMetadata { )] #[cfg_attr(feature = "abi", derive(schemars::JsonSchema))] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] pub struct TokenMetadata { pub title: Option, // ex. "Arch Nemesis: Mail Carrier" or "Parcel #5055" pub description: Option, // free-form description diff --git a/near-contract-standards/src/storage_management/mod.rs b/near-contract-standards/src/storage_management/mod.rs index 168e2cb54..3e75a6198 100644 --- a/near-contract-standards/src/storage_management/mod.rs +++ b/near-contract-standards/src/storage_management/mod.rs @@ -5,6 +5,7 @@ use near_sdk::AccountId; #[derive(BorshDeserialize, BorshSerialize, Serialize, Deserialize)] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] #[cfg_attr(feature = "abi", derive(schemars::JsonSchema))] pub struct StorageBalance { pub total: U128, @@ -13,6 +14,7 @@ pub struct StorageBalance { #[derive(BorshDeserialize, BorshSerialize, Serialize, Deserialize)] #[serde(crate = "near_sdk::serde")] +#[borsh(crate = "::near_sdk::borsh")] #[cfg_attr(feature = "abi", derive(schemars::JsonSchema))] pub struct StorageBalanceBounds { pub min: U128, @@ -40,6 +42,7 @@ pub struct StorageBalanceBounds { /// /// #[near_bindgen] /// #[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)] +/// #[borsh(crate = "::near_sdk::borsh")] /// pub struct Contract { /// token: FungibleToken, /// metadata: LazyOption, diff --git a/near-contract-standards/src/upgrade/mod.rs b/near-contract-standards/src/upgrade/mod.rs index 234cbb0db..e9ec43914 100644 --- a/near-contract-standards/src/upgrade/mod.rs +++ b/near-contract-standards/src/upgrade/mod.rs @@ -26,6 +26,7 @@ pub trait Upgradable { } #[derive(BorshSerialize, BorshDeserialize)] +#[borsh(crate = "::near_sdk::borsh")] pub struct Upgrade { pub owner: AccountId, pub staging_duration: Duration, diff --git a/near-sdk/compilation_tests/bad_argument.rs b/near-sdk/compilation_tests/bad_argument.rs index bb57bf6c8..f50ad03ec 100644 --- a/near-sdk/compilation_tests/bad_argument.rs +++ b/near-sdk/compilation_tests/bad_argument.rs @@ -5,7 +5,7 @@ use borsh::{BorshDeserialize, BorshSerialize}; use std::collections::HashMap; use serde::{Serialize, Deserialize}; -#[derive(BorshSerialize, BorshDeserialize, Eq, PartialEq, Hash, PartialOrd, Serialize, Deserialize)] +#[derive(BorshSerialize, BorshDeserialize, Eq, PartialEq, Hash, PartialOrd, Ord, Serialize, Deserialize)] enum TypeA { Var1, Var2 diff --git a/near-sdk/compilation_tests/complex.rs b/near-sdk/compilation_tests/complex.rs index 2640e5cb1..6c649b771 100644 --- a/near-sdk/compilation_tests/complex.rs +++ b/near-sdk/compilation_tests/complex.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; #[derive( - BorshDeserialize, BorshSerialize, Eq, PartialEq, Hash, PartialOrd, Serialize, Deserialize, + BorshDeserialize, BorshSerialize, Eq, PartialEq, Hash, PartialOrd, Ord, Serialize, Deserialize, )] pub enum TypeA { Var1, diff --git a/near-sdk/compilation_tests/references.rs b/near-sdk/compilation_tests/references.rs index 8c73c9f9d..e1e424e1d 100644 --- a/near-sdk/compilation_tests/references.rs +++ b/near-sdk/compilation_tests/references.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; #[derive( - BorshDeserialize, BorshSerialize, Eq, PartialEq, Hash, PartialOrd, Serialize, Deserialize, + BorshDeserialize, BorshSerialize, Eq, PartialEq, Hash, PartialOrd, Ord, Serialize, Deserialize, )] pub enum TypeA { Var1, diff --git a/near-sdk/src/collections/lazy_option.rs b/near-sdk/src/collections/lazy_option.rs index 189e667dd..38cca6eee 100644 --- a/near-sdk/src/collections/lazy_option.rs +++ b/near-sdk/src/collections/lazy_option.rs @@ -5,7 +5,7 @@ //! `LazyOption` and it will not be deserialized until requested. use std::marker::PhantomData; -use borsh::{BorshDeserialize, BorshSerialize, to_vec}; +use borsh::{to_vec, BorshDeserialize, BorshSerialize}; use crate::env; use crate::IntoStorageKey; diff --git a/near-sdk/src/collections/lookup_map.rs b/near-sdk/src/collections/lookup_map.rs index 957f19bdb..8b6fab299 100644 --- a/near-sdk/src/collections/lookup_map.rs +++ b/near-sdk/src/collections/lookup_map.rs @@ -3,7 +3,7 @@ //! makes this map more efficient in the number of reads and writes. use std::marker::PhantomData; -use borsh::{BorshDeserialize, BorshSerialize, to_vec}; +use borsh::{to_vec, BorshDeserialize, BorshSerialize}; use crate::collections::append_slice; use crate::{env, IntoStorageKey}; diff --git a/near-sdk/src/collections/lookup_set.rs b/near-sdk/src/collections/lookup_set.rs index 071d4ced5..b1360a0ea 100644 --- a/near-sdk/src/collections/lookup_set.rs +++ b/near-sdk/src/collections/lookup_set.rs @@ -3,7 +3,7 @@ //! makes this implementation more efficient in the number of reads and writes. use std::marker::PhantomData; -use borsh::{BorshDeserialize, BorshSerialize, to_vec}; +use borsh::{to_vec, BorshDeserialize, BorshSerialize}; use crate::collections::append_slice; use crate::{env, IntoStorageKey}; diff --git a/near-sdk/src/collections/unordered_map/mod.rs b/near-sdk/src/collections/unordered_map/mod.rs index 40237aa3b..d9cccd2e9 100644 --- a/near-sdk/src/collections/unordered_map/mod.rs +++ b/near-sdk/src/collections/unordered_map/mod.rs @@ -6,7 +6,7 @@ pub use iter::Iter; use crate::collections::{append, append_slice, Vector}; use crate::{env, IntoStorageKey}; -use borsh::{BorshDeserialize, BorshSerialize, to_vec}; +use borsh::{to_vec, BorshDeserialize, BorshSerialize}; use std::mem::size_of; const ERR_INCONSISTENT_STATE: &str = "The collection is an inconsistent state. Did previous smart contract execution terminate unexpectedly?"; diff --git a/near-sdk/src/collections/unordered_set.rs b/near-sdk/src/collections/unordered_set.rs index 14f17f011..70438805d 100644 --- a/near-sdk/src/collections/unordered_set.rs +++ b/near-sdk/src/collections/unordered_set.rs @@ -2,7 +2,7 @@ //! hashed but are instead serialized. use crate::collections::{append, append_slice, Vector}; use crate::{env, IntoStorageKey}; -use borsh::{BorshDeserialize, BorshSerialize, to_vec}; +use borsh::{to_vec, BorshDeserialize, BorshSerialize}; use std::mem::size_of; const ERR_INCONSISTENT_STATE: &str = "The collection is an inconsistent state. Did previous smart contract execution terminate unexpectedly?"; diff --git a/near-sdk/src/collections/vector.rs b/near-sdk/src/collections/vector.rs index 515c6147b..1c8043149 100644 --- a/near-sdk/src/collections/vector.rs +++ b/near-sdk/src/collections/vector.rs @@ -4,7 +4,7 @@ use core::ops::Range; use std::iter::FusedIterator; use std::marker::PhantomData; -use borsh::{BorshDeserialize, BorshSerialize, to_vec}; +use borsh::{to_vec, BorshDeserialize, BorshSerialize}; use crate::collections::append_slice; use crate::{env, IntoStorageKey}; diff --git a/near-sdk/src/private/mod.rs b/near-sdk/src/private/mod.rs index 5d78359c0..e26ae14b9 100644 --- a/near-sdk/src/private/mod.rs +++ b/near-sdk/src/private/mod.rs @@ -13,7 +13,7 @@ mod metadata; pub use metadata::{Metadata, MethodMetadata}; use crate::IntoStorageKey; -use borsh::{BorshSerialize, to_vec}; +use borsh::{to_vec, BorshSerialize}; /// Converts a Borsh serializable object into a `Vec` that is used for a storage key. /// diff --git a/near-sdk/src/store/lazy/mod.rs b/near-sdk/src/store/lazy/mod.rs index 252965008..c437a4fbd 100644 --- a/near-sdk/src/store/lazy/mod.rs +++ b/near-sdk/src/store/lazy/mod.rs @@ -6,7 +6,7 @@ mod impls; -use borsh::{BorshDeserialize, BorshSerialize, to_vec}; +use borsh::{to_vec, BorshDeserialize, BorshSerialize}; use once_cell::unsync::OnceCell; use crate::env; diff --git a/near-sdk/src/store/unordered_map/mod.rs b/near-sdk/src/store/unordered_map/mod.rs index d5ea900a0..481a2ad4f 100644 --- a/near-sdk/src/store/unordered_map/mod.rs +++ b/near-sdk/src/store/unordered_map/mod.rs @@ -694,7 +694,7 @@ mod tests { use super::UnorderedMap; use crate::test_utils::test_env::setup_free; use arbitrary::{Arbitrary, Unstructured}; - use borsh::{BorshDeserialize, to_vec}; + use borsh::{to_vec, BorshDeserialize}; use rand::RngCore; use rand::SeedableRng; use std::collections::HashMap; diff --git a/near-sdk/src/store/unordered_set/mod.rs b/near-sdk/src/store/unordered_set/mod.rs index ae30a33c0..76d73c267 100644 --- a/near-sdk/src/store/unordered_set/mod.rs +++ b/near-sdk/src/store/unordered_set/mod.rs @@ -513,7 +513,7 @@ mod tests { use crate::store::UnorderedSet; use crate::test_utils::test_env::setup_free; use arbitrary::{Arbitrary, Unstructured}; - use borsh::{BorshDeserialize, to_vec}; + use borsh::{to_vec, BorshDeserialize}; use rand::RngCore; use rand::SeedableRng; use std::collections::HashSet; diff --git a/near-sdk/src/store/vec/mod.rs b/near-sdk/src/store/vec/mod.rs index c373f370b..34f30d523 100644 --- a/near-sdk/src/store/vec/mod.rs +++ b/near-sdk/src/store/vec/mod.rs @@ -543,7 +543,7 @@ where #[cfg(test)] mod tests { use arbitrary::{Arbitrary, Unstructured}; - use borsh::{BorshDeserialize, BorshSerialize, to_vec}; + use borsh::{to_vec, BorshDeserialize, BorshSerialize}; use rand::{Rng, RngCore, SeedableRng}; use super::Vector;