From fb6941db9ac0f906f29f2a26be0a6497271c475f Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 12:42:41 +0300 Subject: [PATCH 01/11] chore: updated near-workspaces-rs --- examples/adder/Cargo.toml | 2 +- examples/callback-results/Cargo.toml | 2 +- examples/cross-contract-calls/Cargo.toml | 2 +- examples/factory-contract/Cargo.toml | 2 +- examples/fungible-token/Cargo.toml | 2 +- examples/lockable-fungible-token/Cargo.toml | 2 +- examples/non-fungible-token/Cargo.toml | 2 +- near-sdk/Cargo.toml | 6 +++--- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/adder/Cargo.toml b/examples/adder/Cargo.toml index bec5bafb9..89067b819 100644 --- a/examples/adder/Cargo.toml +++ b/examples/adder/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.11.1" +near-workspaces = "0.12" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-abi = "0.4.0" diff --git a/examples/callback-results/Cargo.toml b/examples/callback-results/Cargo.toml index 52fafda73..204eaad4a 100644 --- a/examples/callback-results/Cargo.toml +++ b/examples/callback-results/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.11.1" +near-workspaces = "0.12" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } diff --git a/examples/cross-contract-calls/Cargo.toml b/examples/cross-contract-calls/Cargo.toml index 118779daf..b02c26103 100644 --- a/examples/cross-contract-calls/Cargo.toml +++ b/examples/cross-contract-calls/Cargo.toml @@ -9,7 +9,7 @@ anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["default", "unit-testing"] } test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" cross-contract-high-level = { path = "./high-level" } cross-contract-low-level = { path = "./low-level" } diff --git a/examples/factory-contract/Cargo.toml b/examples/factory-contract/Cargo.toml index 7fca0329d..4ba91fe3d 100644 --- a/examples/factory-contract/Cargo.toml +++ b/examples/factory-contract/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } [profile.release] diff --git a/examples/fungible-token/Cargo.toml b/examples/fungible-token/Cargo.toml index b2a546724..f48f872be 100644 --- a/examples/fungible-token/Cargo.toml +++ b/examples/fungible-token/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" [profile.release] codegen-units = 1 diff --git a/examples/lockable-fungible-token/Cargo.toml b/examples/lockable-fungible-token/Cargo.toml index 01f9982e9..8a808e3bf 100644 --- a/examples/lockable-fungible-token/Cargo.toml +++ b/examples/lockable-fungible-token/Cargo.toml @@ -14,7 +14,7 @@ near-sdk = { path = "../../near-sdk", features = ["legacy"] } anyhow = "1.0" tokio = { version = "1.14", features = ["full"] } near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" [profile.release] codegen-units = 1 diff --git a/examples/non-fungible-token/Cargo.toml b/examples/non-fungible-token/Cargo.toml index dcdeee7d9..fe4d40a0a 100644 --- a/examples/non-fungible-token/Cargo.toml +++ b/examples/non-fungible-token/Cargo.toml @@ -9,7 +9,7 @@ anyhow = "1.0" near-contract-standards = { path = "../../near-contract-standards" } near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" [profile.release] codegen-units = 1 diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index b7edcceb9..0d51d20ea 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -31,8 +31,8 @@ bs58 = "0.5" once_cell = { version = "1.17", default-features = false } near-account-id = { version = "1.0.0", features = ["serde", "borsh"] } -near-gas = { version = "0.2.3", features = ["serde", "borsh"] } -near-token = { version = "0.2.1", features = ["serde", "borsh"] } +near-gas = { version = "0.3", features = ["serde", "borsh"] } +near-token = { version = "0.3", features = ["serde", "borsh"] } [target.'cfg(target_arch = "wasm32")'.dependencies] wee_alloc = { version = "0.4.5", default-features = false, optional = true } @@ -63,7 +63,7 @@ rand_chacha = "0.3.1" near-rng = "0.1.1" near-abi = { version = "0.4.0", features = ["__chunked-entries"] } symbolic-debuginfo = "12" -near-workspaces = { version = "0.11.1", features = ["unstable"] } +near-workspaces = { version = "0.12", features = ["unstable"] } anyhow = "1.0" tokio = { version = "1", features = ["full"] } strum = "0.25.0" From 61fa342cec07492f46a5fe35df0d1eb7024561fb Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 12:52:28 +0300 Subject: [PATCH 02/11] bumped up minimum rust version --- near-sdk/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index 0d51d20ea..25dfc4f11 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -3,6 +3,7 @@ name = "near-sdk" version.workspace = true authors = ["Near Inc "] edition = "2021" +rust-version = "1.78.0" license = "MIT OR Apache-2.0" readme = "README.md" categories = ["wasm"] From 9cb6cd75f0fc102593738a3de4bba34dcdbf36f6 Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 12:54:29 +0300 Subject: [PATCH 03/11] bumped up minimum rust version --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3ebafe3c7..55f805c12 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,11 +14,11 @@ jobs: matrix: platform: - os: ubuntu-latest - rs: 1.76.0 + rs: 1.78.0 - os: ubuntu-latest rs: stable - os: macos-latest - rs: 1.76.0 + rs: 1.78.0 - os: macos-latest rs: stable features: ['', '--features unstable,legacy,__abi-generate'] From 4ca3208a40448582b9af075da799a261f38db953 Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 12:55:05 +0300 Subject: [PATCH 04/11] removed from cargo toml --- near-sdk/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index 25dfc4f11..0d51d20ea 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -3,7 +3,6 @@ name = "near-sdk" version.workspace = true authors = ["Near Inc "] edition = "2021" -rust-version = "1.78.0" license = "MIT OR Apache-2.0" readme = "README.md" categories = ["wasm"] From 501776356ba2734871ef7cccb830ff4c7c3d5039 Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 13:11:43 +0300 Subject: [PATCH 05/11] fixed test output --- .../schema_derive_invalids.stderr | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/near-sdk/compilation_tests/schema_derive_invalids.stderr b/near-sdk/compilation_tests/schema_derive_invalids.stderr index 9894ab188..ff4a5743e 100644 --- a/near-sdk/compilation_tests/schema_derive_invalids.stderr +++ b/near-sdk/compilation_tests/schema_derive_invalids.stderr @@ -77,17 +77,20 @@ error[E0277]: the trait bound `Inner: JsonSchema` is not satisfied | ^^^^^ the trait `JsonSchema` is not implemented for `Inner` | = help: the following other types implement trait `JsonSchema`: - &'a T - &'a mut T - () - (T0, T1) - (T0, T1, T2) - (T0, T1, T2, T3) - (T0, T1, T2, T3, T4) - (T0, T1, T2, T3, T4, T5) + bool + char + isize + i8 + i16 + i32 + i64 + i128 and $N others note: required by a bound in `SchemaGenerator::subschema_for` --> $CARGO/schemars-0.8.21/src/gen.rs | | pub fn subschema_for(&mut self) -> Schema { | ^^^^^^^^^^ required by this bound in `SchemaGenerator::subschema_for` +┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ +note: If the actual output is the correct output you can bless it by rerunning + your test with the environment variable TRYBUILD=overwrite From 2c46d84e81128ecd53e70cdefbf52264bf43b039 Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 13:29:34 +0300 Subject: [PATCH 06/11] proper fix --- near-sdk/compilation_tests/schema_derive_invalids.stderr | 3 --- 1 file changed, 3 deletions(-) diff --git a/near-sdk/compilation_tests/schema_derive_invalids.stderr b/near-sdk/compilation_tests/schema_derive_invalids.stderr index ff4a5743e..52f705d4e 100644 --- a/near-sdk/compilation_tests/schema_derive_invalids.stderr +++ b/near-sdk/compilation_tests/schema_derive_invalids.stderr @@ -91,6 +91,3 @@ note: required by a bound in `SchemaGenerator::subschema_for` | | pub fn subschema_for(&mut self) -> Schema { | ^^^^^^^^^^ required by this bound in `SchemaGenerator::subschema_for` -┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ -note: If the actual output is the correct output you can bless it by rerunning - your test with the environment variable TRYBUILD=overwrite From c2c8b0be639a6a27f67407296f1ca9b2fc0c86ab Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 13:38:45 +0300 Subject: [PATCH 07/11] try 2 --- .github/workflows/test.yml | 4 ++-- .../schema_derive_invalids.stderr | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55f805c12..7690fad84 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,11 +14,11 @@ jobs: matrix: platform: - os: ubuntu-latest - rs: 1.78.0 + rs: 1.78 - os: ubuntu-latest rs: stable - os: macos-latest - rs: 1.78.0 + rs: 1.78 - os: macos-latest rs: stable features: ['', '--features unstable,legacy,__abi-generate'] diff --git a/near-sdk/compilation_tests/schema_derive_invalids.stderr b/near-sdk/compilation_tests/schema_derive_invalids.stderr index 52f705d4e..9894ab188 100644 --- a/near-sdk/compilation_tests/schema_derive_invalids.stderr +++ b/near-sdk/compilation_tests/schema_derive_invalids.stderr @@ -77,14 +77,14 @@ error[E0277]: the trait bound `Inner: JsonSchema` is not satisfied | ^^^^^ the trait `JsonSchema` is not implemented for `Inner` | = help: the following other types implement trait `JsonSchema`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + &'a T + &'a mut T + () + (T0, T1) + (T0, T1, T2) + (T0, T1, T2, T3) + (T0, T1, T2, T3, T4) + (T0, T1, T2, T3, T4, T5) and $N others note: required by a bound in `SchemaGenerator::subschema_for` --> $CARGO/schemars-0.8.21/src/gen.rs From 3272ae48f200258355dc205b30011308f03021c5 Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 14:35:30 +0300 Subject: [PATCH 08/11] i hope to fix test --- near-sdk/compilation_tests/all.rs | 5 +- .../schema_derive_invalids.stderr | 16 ++-- .../schema_derive_invalids_180.rs | 1 + .../schema_derive_invalids_180.stderr | 93 +++++++++++++++++++ 4 files changed, 106 insertions(+), 9 deletions(-) create mode 120000 near-sdk/compilation_tests/schema_derive_invalids_180.rs create mode 100644 near-sdk/compilation_tests/schema_derive_invalids_180.stderr diff --git a/near-sdk/compilation_tests/all.rs b/near-sdk/compilation_tests/all.rs index 611cc0734..7724de447 100644 --- a/near-sdk/compilation_tests/all.rs +++ b/near-sdk/compilation_tests/all.rs @@ -23,7 +23,10 @@ fn compilation_tests() { t.pass("compilation_tests/function_error.rs"); t.pass("compilation_tests/enum_near_bindgen.rs"); t.pass("compilation_tests/schema_derive.rs"); - if rustversion::cfg!(since(1.78)) && std::env::consts::OS == "linux" { + + if rustversion::cfg!(since(1.80)) { + t.compile_fail("compilation_tests/schema_derive_invalids_180.rs"); + } else if rustversion::cfg!(since(1.78)) && std::env::consts::OS == "linux" { // The compilation error output has slightly changed in 1.7x and between platforms, // so we snapshoted this single version t.compile_fail("compilation_tests/schema_derive_invalids.rs"); diff --git a/near-sdk/compilation_tests/schema_derive_invalids.stderr b/near-sdk/compilation_tests/schema_derive_invalids.stderr index 9894ab188..52f705d4e 100644 --- a/near-sdk/compilation_tests/schema_derive_invalids.stderr +++ b/near-sdk/compilation_tests/schema_derive_invalids.stderr @@ -77,14 +77,14 @@ error[E0277]: the trait bound `Inner: JsonSchema` is not satisfied | ^^^^^ the trait `JsonSchema` is not implemented for `Inner` | = help: the following other types implement trait `JsonSchema`: - &'a T - &'a mut T - () - (T0, T1) - (T0, T1, T2) - (T0, T1, T2, T3) - (T0, T1, T2, T3, T4) - (T0, T1, T2, T3, T4, T5) + bool + char + isize + i8 + i16 + i32 + i64 + i128 and $N others note: required by a bound in `SchemaGenerator::subschema_for` --> $CARGO/schemars-0.8.21/src/gen.rs diff --git a/near-sdk/compilation_tests/schema_derive_invalids_180.rs b/near-sdk/compilation_tests/schema_derive_invalids_180.rs new file mode 120000 index 000000000..6c8baafb2 --- /dev/null +++ b/near-sdk/compilation_tests/schema_derive_invalids_180.rs @@ -0,0 +1 @@ +schema_derive_invalids.rs \ No newline at end of file diff --git a/near-sdk/compilation_tests/schema_derive_invalids_180.stderr b/near-sdk/compilation_tests/schema_derive_invalids_180.stderr new file mode 100644 index 000000000..d147e0cf9 --- /dev/null +++ b/near-sdk/compilation_tests/schema_derive_invalids_180.stderr @@ -0,0 +1,93 @@ +error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified + --> compilation_tests/schema_derive_invalids_180.rs:9:1 + | +9 | / #[abi] +10 | | struct Nada; + | |____________^ + +error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified + --> compilation_tests/schema_derive_invalids_180.rs:13:1 + | +13 | / #[abi()] +14 | | struct Empty; + | |_____________^ + +error: Unknown field: `serde` + --> compilation_tests/schema_derive_invalids_180.rs:17:7 + | +17 | #[abi(serde)] + | ^^^^^ + +error: Unknown field: `serde` + --> compilation_tests/schema_derive_invalids_180.rs:21:13 + | +21 | #[abi(json, serde)] + | ^^^^^ + +error: Unknown field: `serde` + --> compilation_tests/schema_derive_invalids_180.rs:25:13 + | +25 | #[abi(json, serde, schemars)] + | ^^^^^ + +error: Unknown field: `schemars` + --> compilation_tests/schema_derive_invalids_180.rs:25:20 + | +25 | #[abi(json, serde, schemars)] + | ^^^^^^^^ + +error: Unknown field: `serde` + --> compilation_tests/schema_derive_invalids_180.rs:29:13 + | +29 | #[abi(json, serde = "?")] + | ^^^^^ + +error: `NearSchema` does not support derive for unions + --> compilation_tests/schema_derive_invalids_180.rs:33:1 + | +33 | / union Unsupporteed { +34 | | a: u8, +35 | | b: u16, +36 | | } + | |_^ + +error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified + --> compilation_tests/schema_derive_invalids_180.rs:39:1 + | +39 | / #[abi()] +40 | | union UnsupporteedWithoutArgs { +41 | | a: u8, +42 | | b: u16, +43 | | } + | |_^ + +error: `NearSchema` does not support derive for unions + --> compilation_tests/schema_derive_invalids_180.rs:47:1 + | +47 | / union UnsupporteedWithArgs { +48 | | a: u8, +49 | | b: u16, +50 | | } + | |_^ + +error[E0277]: the trait bound `Inner: JsonSchema` is not satisfied + --> compilation_tests/schema_derive_invalids_180.rs:6:14 + | +6 | struct Outer(Inner); + | ^^^^^ the trait `JsonSchema` is not implemented for `Inner` + | + = help: the following other types implement trait `JsonSchema`: + &'a T + &'a mut T + () + (T0, T1) + (T0, T1, T2) + (T0, T1, T2, T3) + (T0, T1, T2, T3, T4) + (T0, T1, T2, T3, T4, T5) + and $N others +note: required by a bound in `SchemaGenerator::subschema_for` + --> $CARGO/schemars-0.8.21/src/gen.rs + | + | pub fn subschema_for(&mut self) -> Schema { + | ^^^^^^^^^^ required by this bound in `SchemaGenerator::subschema_for` From 93c1b380cc240026ec8ecf34bbb9c04411dc47e7 Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 15:29:47 +0300 Subject: [PATCH 09/11] updated test to 1.80 only --- near-sdk/compilation_tests/all.rs | 8 +- .../schema_derive_invalids.stderr | 38 ++++---- .../schema_derive_invalids_180.rs | 1 - .../schema_derive_invalids_180.stderr | 93 ------------------- 4 files changed, 22 insertions(+), 118 deletions(-) delete mode 120000 near-sdk/compilation_tests/schema_derive_invalids_180.rs delete mode 100644 near-sdk/compilation_tests/schema_derive_invalids_180.stderr diff --git a/near-sdk/compilation_tests/all.rs b/near-sdk/compilation_tests/all.rs index 7724de447..31bff9458 100644 --- a/near-sdk/compilation_tests/all.rs +++ b/near-sdk/compilation_tests/all.rs @@ -24,12 +24,10 @@ fn compilation_tests() { t.pass("compilation_tests/enum_near_bindgen.rs"); t.pass("compilation_tests/schema_derive.rs"); - if rustversion::cfg!(since(1.80)) { - t.compile_fail("compilation_tests/schema_derive_invalids_180.rs"); - } else if rustversion::cfg!(since(1.78)) && std::env::consts::OS == "linux" { - // The compilation error output has slightly changed in 1.7x and between platforms, + if rustversion::cfg!(since(1.80)) && std::env::consts::OS == "linux" { + // The compilation error output has slightly changed in 1.7x and 1.8x and between platforms, // so we snapshoted this single version - t.compile_fail("compilation_tests/schema_derive_invalids.rs"); + t.compile_fail("compilation_tests/schema_derive_invalids_180.rs"); } t.compile_fail("compilation_tests/generic_function.rs"); t.compile_fail("compilation_tests/generic_const_function.rs"); diff --git a/near-sdk/compilation_tests/schema_derive_invalids.stderr b/near-sdk/compilation_tests/schema_derive_invalids.stderr index 52f705d4e..d147e0cf9 100644 --- a/near-sdk/compilation_tests/schema_derive_invalids.stderr +++ b/near-sdk/compilation_tests/schema_derive_invalids.stderr @@ -1,49 +1,49 @@ error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified - --> compilation_tests/schema_derive_invalids.rs:9:1 + --> compilation_tests/schema_derive_invalids_180.rs:9:1 | 9 | / #[abi] 10 | | struct Nada; | |____________^ error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified - --> compilation_tests/schema_derive_invalids.rs:13:1 + --> compilation_tests/schema_derive_invalids_180.rs:13:1 | 13 | / #[abi()] 14 | | struct Empty; | |_____________^ error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids.rs:17:7 + --> compilation_tests/schema_derive_invalids_180.rs:17:7 | 17 | #[abi(serde)] | ^^^^^ error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids.rs:21:13 + --> compilation_tests/schema_derive_invalids_180.rs:21:13 | 21 | #[abi(json, serde)] | ^^^^^ error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids.rs:25:13 + --> compilation_tests/schema_derive_invalids_180.rs:25:13 | 25 | #[abi(json, serde, schemars)] | ^^^^^ error: Unknown field: `schemars` - --> compilation_tests/schema_derive_invalids.rs:25:20 + --> compilation_tests/schema_derive_invalids_180.rs:25:20 | 25 | #[abi(json, serde, schemars)] | ^^^^^^^^ error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids.rs:29:13 + --> compilation_tests/schema_derive_invalids_180.rs:29:13 | 29 | #[abi(json, serde = "?")] | ^^^^^ error: `NearSchema` does not support derive for unions - --> compilation_tests/schema_derive_invalids.rs:33:1 + --> compilation_tests/schema_derive_invalids_180.rs:33:1 | 33 | / union Unsupporteed { 34 | | a: u8, @@ -52,7 +52,7 @@ error: `NearSchema` does not support derive for unions | |_^ error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified - --> compilation_tests/schema_derive_invalids.rs:39:1 + --> compilation_tests/schema_derive_invalids_180.rs:39:1 | 39 | / #[abi()] 40 | | union UnsupporteedWithoutArgs { @@ -62,7 +62,7 @@ error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specifi | |_^ error: `NearSchema` does not support derive for unions - --> compilation_tests/schema_derive_invalids.rs:47:1 + --> compilation_tests/schema_derive_invalids_180.rs:47:1 | 47 | / union UnsupporteedWithArgs { 48 | | a: u8, @@ -71,20 +71,20 @@ error: `NearSchema` does not support derive for unions | |_^ error[E0277]: the trait bound `Inner: JsonSchema` is not satisfied - --> compilation_tests/schema_derive_invalids.rs:6:14 + --> compilation_tests/schema_derive_invalids_180.rs:6:14 | 6 | struct Outer(Inner); | ^^^^^ the trait `JsonSchema` is not implemented for `Inner` | = help: the following other types implement trait `JsonSchema`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + &'a T + &'a mut T + () + (T0, T1) + (T0, T1, T2) + (T0, T1, T2, T3) + (T0, T1, T2, T3, T4) + (T0, T1, T2, T3, T4, T5) and $N others note: required by a bound in `SchemaGenerator::subschema_for` --> $CARGO/schemars-0.8.21/src/gen.rs diff --git a/near-sdk/compilation_tests/schema_derive_invalids_180.rs b/near-sdk/compilation_tests/schema_derive_invalids_180.rs deleted file mode 120000 index 6c8baafb2..000000000 --- a/near-sdk/compilation_tests/schema_derive_invalids_180.rs +++ /dev/null @@ -1 +0,0 @@ -schema_derive_invalids.rs \ No newline at end of file diff --git a/near-sdk/compilation_tests/schema_derive_invalids_180.stderr b/near-sdk/compilation_tests/schema_derive_invalids_180.stderr deleted file mode 100644 index d147e0cf9..000000000 --- a/near-sdk/compilation_tests/schema_derive_invalids_180.stderr +++ /dev/null @@ -1,93 +0,0 @@ -error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified - --> compilation_tests/schema_derive_invalids_180.rs:9:1 - | -9 | / #[abi] -10 | | struct Nada; - | |____________^ - -error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified - --> compilation_tests/schema_derive_invalids_180.rs:13:1 - | -13 | / #[abi()] -14 | | struct Empty; - | |_____________^ - -error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids_180.rs:17:7 - | -17 | #[abi(serde)] - | ^^^^^ - -error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids_180.rs:21:13 - | -21 | #[abi(json, serde)] - | ^^^^^ - -error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids_180.rs:25:13 - | -25 | #[abi(json, serde, schemars)] - | ^^^^^ - -error: Unknown field: `schemars` - --> compilation_tests/schema_derive_invalids_180.rs:25:20 - | -25 | #[abi(json, serde, schemars)] - | ^^^^^^^^ - -error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids_180.rs:29:13 - | -29 | #[abi(json, serde = "?")] - | ^^^^^ - -error: `NearSchema` does not support derive for unions - --> compilation_tests/schema_derive_invalids_180.rs:33:1 - | -33 | / union Unsupporteed { -34 | | a: u8, -35 | | b: u16, -36 | | } - | |_^ - -error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified - --> compilation_tests/schema_derive_invalids_180.rs:39:1 - | -39 | / #[abi()] -40 | | union UnsupporteedWithoutArgs { -41 | | a: u8, -42 | | b: u16, -43 | | } - | |_^ - -error: `NearSchema` does not support derive for unions - --> compilation_tests/schema_derive_invalids_180.rs:47:1 - | -47 | / union UnsupporteedWithArgs { -48 | | a: u8, -49 | | b: u16, -50 | | } - | |_^ - -error[E0277]: the trait bound `Inner: JsonSchema` is not satisfied - --> compilation_tests/schema_derive_invalids_180.rs:6:14 - | -6 | struct Outer(Inner); - | ^^^^^ the trait `JsonSchema` is not implemented for `Inner` - | - = help: the following other types implement trait `JsonSchema`: - &'a T - &'a mut T - () - (T0, T1) - (T0, T1, T2) - (T0, T1, T2, T3) - (T0, T1, T2, T3, T4) - (T0, T1, T2, T3, T4, T5) - and $N others -note: required by a bound in `SchemaGenerator::subschema_for` - --> $CARGO/schemars-0.8.21/src/gen.rs - | - | pub fn subschema_for(&mut self) -> Schema { - | ^^^^^^^^^^ required by this bound in `SchemaGenerator::subschema_for` From d7c981e1845c7f7b83e12b298f94a350191554d0 Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 15:30:49 +0300 Subject: [PATCH 10/11] updated test --- .../schema_derive_invalids.stderr | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/near-sdk/compilation_tests/schema_derive_invalids.stderr b/near-sdk/compilation_tests/schema_derive_invalids.stderr index d147e0cf9..9894ab188 100644 --- a/near-sdk/compilation_tests/schema_derive_invalids.stderr +++ b/near-sdk/compilation_tests/schema_derive_invalids.stderr @@ -1,49 +1,49 @@ error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified - --> compilation_tests/schema_derive_invalids_180.rs:9:1 + --> compilation_tests/schema_derive_invalids.rs:9:1 | 9 | / #[abi] 10 | | struct Nada; | |____________^ error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified - --> compilation_tests/schema_derive_invalids_180.rs:13:1 + --> compilation_tests/schema_derive_invalids.rs:13:1 | 13 | / #[abi()] 14 | | struct Empty; | |_____________^ error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids_180.rs:17:7 + --> compilation_tests/schema_derive_invalids.rs:17:7 | 17 | #[abi(serde)] | ^^^^^ error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids_180.rs:21:13 + --> compilation_tests/schema_derive_invalids.rs:21:13 | 21 | #[abi(json, serde)] | ^^^^^ error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids_180.rs:25:13 + --> compilation_tests/schema_derive_invalids.rs:25:13 | 25 | #[abi(json, serde, schemars)] | ^^^^^ error: Unknown field: `schemars` - --> compilation_tests/schema_derive_invalids_180.rs:25:20 + --> compilation_tests/schema_derive_invalids.rs:25:20 | 25 | #[abi(json, serde, schemars)] | ^^^^^^^^ error: Unknown field: `serde` - --> compilation_tests/schema_derive_invalids_180.rs:29:13 + --> compilation_tests/schema_derive_invalids.rs:29:13 | 29 | #[abi(json, serde = "?")] | ^^^^^ error: `NearSchema` does not support derive for unions - --> compilation_tests/schema_derive_invalids_180.rs:33:1 + --> compilation_tests/schema_derive_invalids.rs:33:1 | 33 | / union Unsupporteed { 34 | | a: u8, @@ -52,7 +52,7 @@ error: `NearSchema` does not support derive for unions | |_^ error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specified - --> compilation_tests/schema_derive_invalids_180.rs:39:1 + --> compilation_tests/schema_derive_invalids.rs:39:1 | 39 | / #[abi()] 40 | | union UnsupporteedWithoutArgs { @@ -62,7 +62,7 @@ error: At least one of `json` or `borsh` inside of `#[abi(...)]` must be specifi | |_^ error: `NearSchema` does not support derive for unions - --> compilation_tests/schema_derive_invalids_180.rs:47:1 + --> compilation_tests/schema_derive_invalids.rs:47:1 | 47 | / union UnsupporteedWithArgs { 48 | | a: u8, @@ -71,7 +71,7 @@ error: `NearSchema` does not support derive for unions | |_^ error[E0277]: the trait bound `Inner: JsonSchema` is not satisfied - --> compilation_tests/schema_derive_invalids_180.rs:6:14 + --> compilation_tests/schema_derive_invalids.rs:6:14 | 6 | struct Outer(Inner); | ^^^^^ the trait `JsonSchema` is not implemented for `Inner` From ab2133454b7f97de1a4ad4d320610a93e9a96d07 Mon Sep 17 00:00:00 2001 From: akorchyn Date: Fri, 16 Aug 2024 15:31:22 +0300 Subject: [PATCH 11/11] updated test --- near-sdk/compilation_tests/all.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/near-sdk/compilation_tests/all.rs b/near-sdk/compilation_tests/all.rs index 31bff9458..9a8007083 100644 --- a/near-sdk/compilation_tests/all.rs +++ b/near-sdk/compilation_tests/all.rs @@ -27,7 +27,7 @@ fn compilation_tests() { if rustversion::cfg!(since(1.80)) && std::env::consts::OS == "linux" { // The compilation error output has slightly changed in 1.7x and 1.8x and between platforms, // so we snapshoted this single version - t.compile_fail("compilation_tests/schema_derive_invalids_180.rs"); + t.compile_fail("compilation_tests/schema_derive_invalids.rs"); } t.compile_fail("compilation_tests/generic_function.rs"); t.compile_fail("compilation_tests/generic_const_function.rs");