diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41bec4d30..11fa910a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,11 +52,11 @@ jobs: - name: Set env vars id: set-env run: > - echo "IS_MASTER=${{ env.IS_MASTER }}" >> $GITHUB_OUTPUT + echo "IS_MASTER=${{ env.IS_MASTER }}" >> $GITHUB_OUTPUT - echo "IS_DEVELOP=${{ env.IS_DEVELOP }}" >> $GITHUB_OUTPUT + echo "IS_DEVELOP=${{ env.IS_DEVELOP }}" >> $GITHUB_OUTPUT - echo "IS_RELEASE=${{ env.IS_RELEASE }}" >> $GITHUB_OUTPUT + echo "IS_RELEASE=${{ env.IS_RELEASE }}" >> $GITHUB_OUTPUT if [[ ${{ env.IS_MASTER }} == 'true' || ${{ env.IS_DEVELOP }} == 'true' || ${{ env.IS_RELEASE }} == 'true' || ${{ env.BRANCH_NAME }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "IS_RELEASE_OR_MASTER_OR_DEVELOP_OR_SEMVER=true" >> $GITHUB_OUTPUT @@ -266,8 +266,12 @@ jobs: - name: Run E2E and integration tests run: cargo test --locked --all-targets --features postgres -p fuel-indexer-tests -- --test-threads=1 + - name: Run trybuild tests + run: cargo test --locked --all-targets --features trybuild -p + fuel-indexer-tests build-default-indexer: - if: needs.set-env-vars.outputs.IS_RELEASE_OR_MASTER_OR_DEVELOP_OR_SEMVER != 'true' + # if: needs.set-env-vars.outputs.IS_RELEASE_OR_MASTER_OR_DEVELOP_OR_SEMVER != 'true' + if: false needs: - cargo-toml-fmt-check - set-env-vars @@ -318,8 +322,9 @@ jobs: cd .. rm -rfv indexer-test build-and-test-examples: - if: needs.set-env-vars.outputs.IS_RELEASE_OR_MASTER_OR_DEVELOP_OR_SEMVER != - 'true' + # if: needs.set-env-vars.outputs.IS_RELEASE_OR_MASTER_OR_DEVELOP_OR_SEMVER != + # 'true' + if: false needs: - cargo-toml-fmt-check - set-env-vars diff --git a/Cargo.lock b/Cargo.lock index 9ffaf741b..1314ea850 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3377,22 +3377,17 @@ dependencies = [ "fuel-abi-types 0.3.0", "fuel-indexer-database-types", "fuel-indexer-lib", - "fuel-indexer-plugin", "fuel-indexer-schema", "fuel-indexer-types", - "fuel-indexer-utils", "fuels", "fuels-code-gen", - "fuels-macros", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "serde", "serde_json", "sha2 0.10.7", "syn 2.0.28", - "trybuild", ] [[package]] @@ -3483,12 +3478,14 @@ dependencies = [ "fuel-indexer-database", "fuel-indexer-graphql", "fuel-indexer-lib", + "fuel-indexer-plugin", "fuel-indexer-postgres", "fuel-indexer-schema", "fuel-indexer-types", "fuel-indexer-utils", "fuel-tx 0.35.3", "fuels", + "fuels-macros", "futures", "hex", "hyper", @@ -3504,6 +3501,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber 0.2.25", + "trybuild", "url", "wasmer", "wasmer-middlewares", @@ -7795,9 +7793,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "trybuild" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84e0202ea606ba5ebee8507ab2bfbe89b98551ed9b8f0be198109275cff284b" +checksum = "6df60d81823ed9c520ee897489573da4b1d79ffbe006b8134f46de1a1aa03555" dependencies = [ "basic-toml", "glob", diff --git a/docs/README.md b/docs/README.md index 511d8267a..c09a8d220 100644 --- a/docs/README.md +++ b/docs/README.md @@ -191,7 +191,7 @@ Fuel indexer tests are currently broken out by a database feature flag. In order Further, the indexer uses end-to-end (E2E) tests. In order to trigger these end-to-end tests, you'll want to use the `e2e` features flag: `--features e2e`. -> All end-to-end tests also require the use of a database feature. For example, to run the end-to-end tests with a Posgres backend, use `--features e2e,postgres`. +> All end-to-end tests also require the use of a database feature. For example, to run the end-to-end tests with a Posgres backend, use `--features postgres`. ### Default tests @@ -202,7 +202,7 @@ cargo test --locked --workspace --all-targets ### End-to-end tests ```bash -cargo test --locked --workspace --all-targets --features e2e,postgres +cargo test --locked --workspace --all-targets --features postgres ``` ### `trybuild` tests @@ -210,7 +210,7 @@ cargo test --locked --workspace --all-targets --features e2e,postgres For tests related to the meta-programming used in the Fuel indexer, we use `trybuild`. ```bash -RUSTFLAGS='-D warnings' cargo test -p fuel-indexer-macros --locked +RUSTFLAGS='-D warnings' cargo test -p fuel-indexer-tests --features trybuild --locked ``` ## Contributing diff --git a/docs/src/for-contributors/index.md b/docs/src/for-contributors/index.md index 717f24967..12cbfa4bb 100644 --- a/docs/src/for-contributors/index.md +++ b/docs/src/for-contributors/index.md @@ -81,7 +81,7 @@ Fuel indexer tests are currently broken out by a database feature flag. In order Further, the indexer uses end-to-end (E2E) tests. In order to trigger these end-to-end tests, you'll want to use the `e2e` features flag: `--features e2e`. -> All end-to-end tests also require the use of a database feature. For example, to run the end-to-end tests with a Posgres backend, use `--features e2e,postgres`. +> All end-to-end tests also require the use of a database feature. For example, to run the end-to-end tests with a Posgres backend, use `--features postgres`. ### Default tests @@ -92,7 +92,7 @@ cargo test --locked --workspace --all-targets ### End-to-end tests ```bash -cargo test --locked --workspace --all-targets --features e2e,postgres +cargo test --locked --workspace --all-targets --features postgres ``` ### `trybuild` tests diff --git a/packages/fuel-indexer-macros/Cargo.toml b/packages/fuel-indexer-macros/Cargo.toml index 00db6fb4c..6a193bc45 100644 --- a/packages/fuel-indexer-macros/Cargo.toml +++ b/packages/fuel-indexer-macros/Cargo.toml @@ -30,12 +30,5 @@ serde_json = { workspace = true } sha2 = "0.10" syn = { version = "2.0", features = ["full"] } -[dev-dependencies] -fuel-indexer-plugin = { workspace = true } -fuel-indexer-utils = { workspace = true } -fuels-macros = { version = "0.46", default-features = false } -serde = { workspace = true } -trybuild = "1.0" - [features] default = ["fuel-indexer-schema/db-models"] diff --git a/packages/fuel-indexer-macros/src/lib.rs b/packages/fuel-indexer-macros/src/lib.rs index 1e59b70d9..d541725bb 100644 --- a/packages/fuel-indexer-macros/src/lib.rs +++ b/packages/fuel-indexer-macros/src/lib.rs @@ -18,30 +18,3 @@ use proc_macro::TokenStream; pub fn indexer(attrs: TokenStream, item: TokenStream) -> TokenStream { process_indexer_module(attrs, item) } - -#[cfg(test)] -mod tests { - #[test] - fn test_success_and_failure_macros() { - let t = trybuild::TestCases::new(); - let manifest_dir = env!("CARGO_MANIFEST_DIR"); - std::env::set_var("COMPILE_TEST_PREFIX", manifest_dir); - - let macro_data_root = std::path::Path::new(manifest_dir) - .join("..") - .join("fuel-indexer-tests") - .join("trybuild"); - - t.compile_fail(macro_data_root.join("fail_if_attribute_args_include_self.rs")); - t.compile_fail(macro_data_root.join("fail_if_attribute_args_not_included.rs")); - t.pass(macro_data_root.join("pass_if_indexer_is_valid_single_type.rs")); - t.pass(macro_data_root.join("pass_if_indexer_is_valid_multi_type.rs")); - t.compile_fail( - macro_data_root.join("fail_if_attribute_schema_arg_is_invalid.rs"), - ); - t.compile_fail( - macro_data_root.join("fail_if_attribute_abi_arg_includes_invalid_type.rs"), - ); - t.compile_fail(macro_data_root.join("fail_if_indexer_module_is_empty.rs")); - } -} diff --git a/packages/fuel-indexer-tests/Cargo.toml b/packages/fuel-indexer-tests/Cargo.toml index 70982d14f..8882ab81d 100644 --- a/packages/fuel-indexer-tests/Cargo.toml +++ b/packages/fuel-indexer-tests/Cargo.toml @@ -32,12 +32,14 @@ fuel-indexer-api-server = { workspace = true } fuel-indexer-database = { workspace = true } fuel-indexer-graphql = { workspace = true } fuel-indexer-lib = { workspace = true } +fuel-indexer-plugin = { workspace = true } fuel-indexer-postgres = { workspace = true, features = ["metrics"] } fuel-indexer-schema = { workspace = true, default-features = true } fuel-indexer-types = { workspace = true } fuel-indexer-utils = { workspace = true } fuel-tx = { workspace = true } fuels = { features = ["fuel-core-lib", "std"], version = "0.46" } +fuels-macros = { version = "0.46", default-features = false } futures = "0.3" hex = "0.4" hyper = { version = "0.14", features = ["client", "http2", "http1", "runtime" ] } @@ -53,6 +55,7 @@ thiserror = { workspace = true } tokio = { features = ["macros", "rt-multi-thread"], workspace = true } tracing = { workspace = true } tracing-subscriber = { version = "0.2", features = ["env-filter"] } +trybuild = "1.0" url = "2.3" wasmer = "4" wasmer-middlewares = "4" @@ -61,3 +64,8 @@ wasmer-types = "4" [features] default = ["postgres"] postgres = [] + +# Including trybuild tests with other integration tests causes $CARGO_MANIFEST_DIR to be switched from +# the workspace root level to the test crate level. This in turn causes the `abigen!` macro's path to be +# incorrect - thus the tests won't compile. +trybuild = [] diff --git a/packages/fuel-indexer-tests/indexers/simple-wasm/simple_wasm.wasm b/packages/fuel-indexer-tests/indexers/simple-wasm/simple_wasm.wasm index 89df19c54..c6b8b21db 100644 Binary files a/packages/fuel-indexer-tests/indexers/simple-wasm/simple_wasm.wasm and b/packages/fuel-indexer-tests/indexers/simple-wasm/simple_wasm.wasm differ diff --git a/packages/fuel-indexer-tests/src/lib.rs b/packages/fuel-indexer-tests/src/lib.rs index 1f5131fa2..c28eebf8e 100644 --- a/packages/fuel-indexer-tests/src/lib.rs +++ b/packages/fuel-indexer-tests/src/lib.rs @@ -1,3 +1,4 @@ +#[cfg(not(feature = "trybuild"))] pub mod fixtures; pub const WORKSPACE_ROOT: &str = env!("CARGO_MANIFEST_DIR"); diff --git a/packages/fuel-indexer-tests/tests/lib.rs b/packages/fuel-indexer-tests/tests/lib.rs index 3deaeffd0..9bc415e95 100644 --- a/packages/fuel-indexer-tests/tests/lib.rs +++ b/packages/fuel-indexer-tests/tests/lib.rs @@ -1,10 +1,14 @@ -#[cfg(feature = "postgres")] +#[cfg(all(feature = "postgres", not(feature = "trybuild")))] mod graphql_server; -#[cfg(feature = "postgres")] +#[cfg(all(feature = "postgres", not(feature = "trybuild")))] mod indexing; +#[cfg(not(feature = "trybuild"))] mod service; -#[cfg(feature = "postgres")] +#[cfg(all(feature = "postgres", not(feature = "trybuild")))] mod web_server; + +#[cfg(feature = "trybuild")] +mod trybuild; diff --git a/packages/fuel-indexer-tests/tests/trybuild.rs b/packages/fuel-indexer-tests/tests/trybuild.rs new file mode 100644 index 000000000..357d930fe --- /dev/null +++ b/packages/fuel-indexer-tests/tests/trybuild.rs @@ -0,0 +1,23 @@ +#[cfg(feature = "trybuild")] +#[test] +fn test_success_and_failure_macros() { + let t = trybuild::TestCases::new(); + let manifest_dir = env!("CARGO_MANIFEST_DIR"); + + std::env::set_var("COMPILE_TEST_PREFIX", manifest_dir); + + let macro_data_root = std::path::Path::new(manifest_dir) + .join("..") + .join("fuel-indexer-tests") + .join("trybuild"); + + t.compile_fail(macro_data_root.join("fail_if_attribute_args_include_self.rs")); + t.compile_fail(macro_data_root.join("fail_if_attribute_args_not_included.rs")); + t.pass(macro_data_root.join("pass_if_indexer_is_valid_single_type.rs")); + t.pass(macro_data_root.join("pass_if_indexer_is_valid_multi_type.rs")); + t.compile_fail(macro_data_root.join("fail_if_attribute_schema_arg_is_invalid.rs")); + t.compile_fail( + macro_data_root.join("fail_if_attribute_abi_arg_includes_invalid_type.rs"), + ); + t.compile_fail(macro_data_root.join("fail_if_indexer_module_is_empty.rs")); +} diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.stderr b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.stderr index 6b581bdb1..5360f4052 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.stderr +++ b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.stderr @@ -25,6 +25,8 @@ error[E0412]: cannot find type `BlockData` in this scope | ^^^^^^^^^ not found in this scope | help: consider importing one of these items + | +2 + use fuel_indexer::prelude::fuel::BlockData; | 2 + use fuel_indexer_plugin::prelude::BlockData; | @@ -40,6 +42,8 @@ error[E0422]: cannot find struct, variant or union type `BlockData` in this scop | ^^^^^^^^^ not found in this scope | help: consider importing one of these items + | +2 + use fuel_indexer::prelude::fuel::BlockData; | 2 + use fuel_indexer_plugin::prelude::BlockData; | @@ -49,23 +53,26 @@ help: consider importing one of these items | error[E0433]: failed to resolve: use of undeclared crate or module `fuel` - --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs - | - | status: fuel::TransactionStatus::default(), - | ^^^^ use of undeclared crate or module `fuel` - | + --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs + | + | status: fuel::TransactionStatus::default(), + | ^^^^ use of undeclared crate or module `fuel` + | help: there is a crate or module with a similar name | 46 | status: fuels::TransactionStatus::default(), | ~~~~~ help: consider importing one of these items | +2 + use fuel_indexer::prelude::fuel::TransactionStatus; + | 2 + use fuel_indexer_plugin::prelude::fuel::TransactionStatus; | 2 + use fuel_indexer_types::fuel::TransactionStatus; | 2 + use fuel_indexer_utils::plugin::prelude::fuel::TransactionStatus; | + and 1 other candidate help: if you import `TransactionStatus`, refer to it directly | 46 - status: fuel::TransactionStatus::default(), @@ -73,25 +80,26 @@ help: if you import `TransactionStatus`, refer to it directly | error[E0433]: failed to resolve: use of undeclared crate or module `fuel` - --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs - | - | fuel::Receipt::Call { - | ^^^^ use of undeclared crate or module `fuel` - | + --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs + | + | fuel::Receipt::Call { + | ^^^^ use of undeclared crate or module `fuel` + | help: there is a crate or module with a similar name | 49 | fuels::Receipt::Call { | ~~~~~ help: consider importing one of these items | +2 + use fuel_indexer::prelude::fuel::Receipt; + | 2 + use fuel_indexer_plugin::prelude::fuel::Receipt; | 2 + use fuel_indexer_types::fuel::Receipt; | 2 + use fuel_indexer_utils::plugin::prelude::fuel::Receipt; | -2 + use fuels::tx::Receipt; - | + and 2 other candidates help: if you import `Receipt`, refer to it directly | 49 - fuel::Receipt::Call { @@ -99,25 +107,26 @@ help: if you import `Receipt`, refer to it directly | error[E0433]: failed to resolve: use of undeclared crate or module `fuel` - --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs - | - | fuel::Receipt::ReturnData { - | ^^^^ use of undeclared crate or module `fuel` - | + --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs + | + | fuel::Receipt::ReturnData { + | ^^^^ use of undeclared crate or module `fuel` + | help: there is a crate or module with a similar name | 60 | fuels::Receipt::ReturnData { | ~~~~~ help: consider importing one of these items | +2 + use fuel_indexer::prelude::fuel::Receipt; + | 2 + use fuel_indexer_plugin::prelude::fuel::Receipt; | 2 + use fuel_indexer_types::fuel::Receipt; | 2 + use fuel_indexer_utils::plugin::prelude::fuel::Receipt; | -2 + use fuels::tx::Receipt; - | + and 2 other candidates help: if you import `Receipt`, refer to it directly | 60 - fuel::Receipt::ReturnData { @@ -131,6 +140,8 @@ error[E0433]: failed to resolve: use of undeclared type `Transaction` | ^^^^^^^^^^^ use of undeclared type `Transaction` | help: consider importing one of these items + | +2 + use fuel_indexer::prelude::fuel::Transaction; | 2 + use fuel_indexer_plugin::prelude::fuel::Transaction; | @@ -138,8 +149,7 @@ help: consider importing one of these items | 2 + use fuel_indexer_utils::plugin::prelude::fuel::Transaction; | -2 + use fuels::prelude::Transaction; - | + and 3 other candidates error[E0425]: cannot find function `serialize` in this scope --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs @@ -148,13 +158,16 @@ error[E0425]: cannot find function `serialize` in this scope | ^^^^^^^^^ not found in this scope | help: consider importing one of these items + | +2 + use chrono::naive::serde::ts_microseconds::serialize; | -2 + use fuel_indexer_lib::utils::serialize; +2 + use chrono::naive::serde::ts_microseconds_option::serialize; | -2 + use fuel_indexer_plugin::serialize; +2 + use chrono::naive::serde::ts_milliseconds::serialize; | -2 + use fuel_indexer_utils::plugin::serialize; +2 + use chrono::naive::serde::ts_milliseconds_option::serialize; | + and 16 other candidates error[E0425]: cannot find function `handle_events` in this scope --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs @@ -163,22 +176,22 @@ error[E0425]: cannot find function `handle_events` in this scope | ^^^^^^^^^^^^^ not found in this scope error[E0433]: failed to resolve: use of undeclared crate or module `fuel` - --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs - | - | header: fuel::Header { - | ^^^^ use of undeclared crate or module `fuel` - | + --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs + | + | header: fuel::Header { + | ^^^^ use of undeclared crate or module `fuel` + | help: there is a crate or module with a similar name | 33 | header: fuels::Header { | ~~~~~ error[E0433]: failed to resolve: use of undeclared crate or module `fuel` - --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs - | - | transactions: vec![fuel::TransactionData { - | ^^^^ use of undeclared crate or module `fuel` - | + --> ../fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs + | + | transactions: vec![fuel::TransactionData { + | ^^^^ use of undeclared crate or module `fuel` + | help: there is a crate or module with a similar name | 45 | transactions: vec![fuels::TransactionData { diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_schema_arg_is_invalid.stderr b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_schema_arg_is_invalid.stderr index e1d25bb04..e625e7a8a 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_schema_arg_is_invalid.stderr +++ b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_schema_arg_is_invalid.stderr @@ -25,15 +25,16 @@ error[E0433]: failed to resolve: use of undeclared type `Consensus` | ^^^^^^^^^ use of undeclared type `Consensus` | help: consider importing one of these items - | + | 2 + use crate::fuel::Consensus; | +2 + use fuel_indexer::prelude::fuel::Consensus; + | 2 + use fuel_indexer_plugin::prelude::fuel::Consensus; | 2 + use fuel_indexer_types::fuel::Consensus; | -2 + use fuel_indexer_utils::plugin::prelude::fuel::Consensus; - | + and 1 other candidate error[E0433]: failed to resolve: use of undeclared type `Transaction` --> ../fuel-indexer-tests/trybuild/fail_if_attribute_schema_arg_is_invalid.rs @@ -42,41 +43,41 @@ error[E0433]: failed to resolve: use of undeclared type `Transaction` | ^^^^^^^^^^^ use of undeclared type `Transaction` | help: consider importing one of these items - | + | 2 + use crate::fuel::Transaction; | +2 + use fuel_indexer::prelude::fuel::Transaction; + | 2 + use fuel_indexer_plugin::prelude::fuel::Transaction; | 2 + use fuel_indexer_types::fuel::Transaction; | -2 + use fuel_indexer_utils::plugin::prelude::fuel::Transaction; - | - and 1 other candidate + and 4 other candidates -error[E0560]: struct `Header` has no field named `output_messages_count` +error[E0560]: struct `fuel_indexer_utils::prelude::fuel::Header` has no field named `output_messages_count` --> ../fuel-indexer-tests/trybuild/fail_if_attribute_schema_arg_is_invalid.rs | | output_messages_count: 1, - | ^^^^^^^^^^^^^^^^^^^^^ `Header` does not have this field + | ^^^^^^^^^^^^^^^^^^^^^ `fuel_indexer_utils::prelude::fuel::Header` does not have this field | = note: available fields are: `id`, `da_height`, `transactions_count`, `message_receipt_count`, `transactions_root` ... and 5 others -error[E0560]: struct `Header` has no field named `output_messages_root` +error[E0560]: struct `fuel_indexer_utils::prelude::fuel::Header` has no field named `output_messages_root` --> ../fuel-indexer-tests/trybuild/fail_if_attribute_schema_arg_is_invalid.rs | | output_messages_root: [0u8; 32].into(), - | ^^^^^^^^^^^^^^^^^^^^ `Header` does not have this field + | ^^^^^^^^^^^^^^^^^^^^ `fuel_indexer_utils::prelude::fuel::Header` does not have this field | = note: available fields are: `id`, `da_height`, `transactions_count`, `message_receipt_count`, `transactions_root` ... and 5 others error[E0308]: mismatched types - --> ../fuel-indexer-tests/trybuild/fail_if_attribute_schema_arg_is_invalid.rs - | - | data: bytes, - | ^^^^^ expected `Option>`, found `Vec` - | - = note: expected enum `std::option::Option>` - found struct `Vec<_>` + --> ../fuel-indexer-tests/trybuild/fail_if_attribute_schema_arg_is_invalid.rs + | + | data: bytes, + | ^^^^^ expected `Option>`, found `Vec` + | + = note: expected enum `std::option::Option>` + found struct `Vec<_>` help: try wrapping the expression in `Some` | 65 | data: Some(bytes),