From 2424dd7935942ae3cd9ad94668ff4ab73c646d6e Mon Sep 17 00:00:00 2001 From: rashad Date: Wed, 20 Sep 2023 13:13:55 -0400 Subject: [PATCH] chore: remove alloc references (#1367) Co-authored-by: Rashad Alston --- docs/src/designing-a-schema/types.md | 4 +- docs/src/indexing-fuel-types/blocks.md | 1 - docs/src/indexing-fuel-types/receipts.md | 14 +-- docs/src/indexing-fuel-types/transactions.md | 2 - .../fuel-explorer/fuel-explorer/src/lib.rs | 1 - .../hello-indexer-native/src/main.rs | 1 - examples/hello-world/hello-indexer/src/lib.rs | 1 - packages/fuel-indexer-macros/src/native.rs | 2 + packages/fuel-indexer-macros/src/wasm.rs | 2 + packages/fuel-indexer-plugin/src/wasm.rs | 1 - packages/fuel-indexer-schema/src/join.rs | 2 - packages/fuel-indexer-schema/src/lib.rs | 2 - .../indexers/fuel-indexer-test/src/lib.rs | 2 - .../simple-wasm/simple-wasm/src/lib.rs | 1 - packages/fuel-indexer-tests/tests/service.rs | 1 - ...fail_if_abi_contains_reserved_fuel_type.rs | 1 - ...l_if_arg_not_passed_to_handler_function.rs | 1 - ...attribute_abi_arg_includes_invalid_type.rs | 1 - ...ibute_abi_arg_includes_invalid_type.stderr | 96 +++++++++---------- ...ttribute_manifest_schema_arg_is_invalid.rs | 1 - ...bute_manifest_schema_arg_is_invalid.stderr | 18 ++-- .../fail_if_ident_not_defined_in_abi.rs | 1 - .../fail_if_ident_not_defined_in_abi.stderr | 2 +- .../fail_if_indexer_module_is_empty.rs | 1 - ...on_function_patterns_included_in_module.rs | 1 - ...unction_patterns_included_in_module.stderr | 2 +- ...f_unsupported_type_used_in_handler_args.rs | 1 - ...supported_type_used_in_handler_args.stderr | 2 +- .../pass_if_indexer_is_valid_multi_type.rs | 1 - .../pass_if_indexer_is_valid_single_type.rs | 1 - .../pass_if_unsupported_types_are_used.rs | 1 - plugins/forc-index/src/defaults.rs | 6 +- 32 files changed, 70 insertions(+), 104 deletions(-) diff --git a/docs/src/designing-a-schema/types.md b/docs/src/designing-a-schema/types.md index 11ed5561c..91c11371e 100644 --- a/docs/src/designing-a-schema/types.md +++ b/docs/src/designing-a-schema/types.md @@ -15,7 +15,6 @@ type Account @entity { This `Account` object type from the GraphQL schema, might be used in an indexer module like so: ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -44,7 +43,6 @@ enum SignatureLabel { This `SignatureLabel` object type from the GraphQL schema, might be used in an indexer module like so: ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -108,10 +106,10 @@ type Transaction @entity { This `Transaction` union type from the GraphQL schema, might be used in an indexer module like so: ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] + mod indexer_mod { fn handle_event(event: Event) { let bytecode_length = 1024; diff --git a/docs/src/indexing-fuel-types/blocks.md b/docs/src/indexing-fuel-types/blocks.md index df89e8f23..bca9c442a 100644 --- a/docs/src/indexing-fuel-types/blocks.md +++ b/docs/src/indexing-fuel-types/blocks.md @@ -19,7 +19,6 @@ pub struct BlockData { ## Usage ```rust,ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] diff --git a/docs/src/indexing-fuel-types/receipts.md b/docs/src/indexing-fuel-types/receipts.md index a000df9dd..0e68fd3cb 100644 --- a/docs/src/indexing-fuel-types/receipts.md +++ b/docs/src/indexing-fuel-types/receipts.md @@ -34,6 +34,9 @@ pub struct Burn { ``` ```rust, ignore +use fuel_indexer_utils::prelude::*; + +#[indexer(manifest = "indexer.manifest.yaml")] mod indexer_mod { fn handle_burn_receipt(block_data: BlockData) { let height = block_data.header.height; @@ -68,7 +71,6 @@ pub struct Call { ``` ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -103,7 +105,6 @@ pub struct Log { ``` ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -143,7 +144,6 @@ pub struct LogData { > Note: the example below will run both when the type `MyEvent` is logged as well as when `MyEvent` is returned from a function. ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -173,7 +173,6 @@ pub struct MessageOut { ``` ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -200,7 +199,6 @@ pub struct Mint { ``` ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -234,7 +232,6 @@ pub struct Panic { ``` ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -272,7 +269,6 @@ pub struct Return { You can handle functions that produce a `Return` receipt type by adding a parameter with the type `Return`. ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -340,7 +336,6 @@ pub struct Revert { | FailedAssert | 4 | ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -373,7 +368,6 @@ pub struct ScriptResult { ``` ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -411,7 +405,6 @@ pub struct Transfer { ``` ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -449,7 +442,6 @@ pub struct TransferOut { ``` ```rust, ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] diff --git a/docs/src/indexing-fuel-types/transactions.md b/docs/src/indexing-fuel-types/transactions.md index 435ab54c5..83b507fd7 100644 --- a/docs/src/indexing-fuel-types/transactions.md +++ b/docs/src/indexing-fuel-types/transactions.md @@ -19,7 +19,6 @@ pub struct TransactionData { ### Usage ```rust,ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] @@ -68,7 +67,6 @@ pub enum TransactionStatus { ### Usage ```rust,ignore -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "indexer.manifest.yaml")] diff --git a/examples/fuel-explorer/fuel-explorer/src/lib.rs b/examples/fuel-explorer/fuel-explorer/src/lib.rs index fff8a515a..6066b37dd 100644 --- a/examples/fuel-explorer/fuel-explorer/src/lib.rs +++ b/examples/fuel-explorer/fuel-explorer/src/lib.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; // TODO: We use a lot of manual type conversion below due to https://github.com/FuelLabs/fuel-indexer/issues/286 diff --git a/examples/hello-world-native/hello-indexer-native/src/main.rs b/examples/hello-world-native/hello-indexer-native/src/main.rs index 9b1d4d9d7..0fc0e7e13 100644 --- a/examples/hello-world-native/hello-indexer-native/src/main.rs +++ b/examples/hello-world-native/hello-indexer-native/src/main.rs @@ -20,7 +20,6 @@ //! ```bash //! cargo run -p hello-world-data --bin hello-world-data //! ``` -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer( diff --git a/examples/hello-world/hello-indexer/src/lib.rs b/examples/hello-world/hello-indexer/src/lib.rs index f6a77c2c6..c7719d0d0 100644 --- a/examples/hello-world/hello-indexer/src/lib.rs +++ b/examples/hello-world/hello-indexer/src/lib.rs @@ -26,7 +26,6 @@ //! cargo run -p hello-world-data --bin hello-world-data //! ``` -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "examples/hello-world/hello-indexer/hello_indexer.manifest.yaml")] diff --git a/packages/fuel-indexer-macros/src/native.rs b/packages/fuel-indexer-macros/src/native.rs index 544dd066c..4cded672d 100644 --- a/packages/fuel-indexer-macros/src/native.rs +++ b/packages/fuel-indexer-macros/src/native.rs @@ -33,6 +33,8 @@ pub fn handler_block_native( /// indexer module, not within the scope of the entire lib module. fn native_prelude() -> proc_macro2::TokenStream { quote! { + extern crate alloc; + type B256 = [u8; 32]; static mut db: Option>> = None; diff --git a/packages/fuel-indexer-macros/src/wasm.rs b/packages/fuel-indexer-macros/src/wasm.rs index 95838c13b..fd4bcdea0 100644 --- a/packages/fuel-indexer-macros/src/wasm.rs +++ b/packages/fuel-indexer-macros/src/wasm.rs @@ -36,6 +36,8 @@ pub fn handler_block_wasm( /// indexer module, not within the scope of the entire lib module. fn wasm_prelude() -> proc_macro2::TokenStream { quote! { + extern crate alloc; + use alloc::{format, vec, vec::Vec}; use std::str::FromStr; diff --git a/packages/fuel-indexer-plugin/src/wasm.rs b/packages/fuel-indexer-plugin/src/wasm.rs index e8af8578e..b49b34093 100644 --- a/packages/fuel-indexer-plugin/src/wasm.rs +++ b/packages/fuel-indexer-plugin/src/wasm.rs @@ -1,5 +1,4 @@ extern crate alloc; - use alloc::vec::Vec; use fuel_indexer_lib::{ graphql::MAX_FOREIGN_KEY_LIST_FIELDS, diff --git a/packages/fuel-indexer-schema/src/join.rs b/packages/fuel-indexer-schema/src/join.rs index 167cd0daa..98cc20661 100644 --- a/packages/fuel-indexer-schema/src/join.rs +++ b/packages/fuel-indexer-schema/src/join.rs @@ -2,8 +2,6 @@ use crate::FtColumn; use fuel_indexer_lib::join_table_typedefs_name; use serde::{Deserialize, Serialize}; -extern crate alloc; - /// Details for the many-to-many relationship. /// /// This is essentially the same as `fuel_indexer_lib::graphql::parser::JoinTableRelation`, just diff --git a/packages/fuel-indexer-schema/src/lib.rs b/packages/fuel-indexer-schema/src/lib.rs index 29f0e9152..d47b6ef78 100644 --- a/packages/fuel-indexer-schema/src/lib.rs +++ b/packages/fuel-indexer-schema/src/lib.rs @@ -5,8 +5,6 @@ // TODO: Deny `clippy::unused_crate_dependencies` when including feature-flagged dependency `itertools` -extern crate alloc; - use fuel_indexer_lib::MAX_ARRAY_LENGTH; use fuel_indexer_types::{fuel::*, scalar::*, Identity}; use serde::{Deserialize, Serialize}; diff --git a/packages/fuel-indexer-tests/indexers/fuel-indexer-test/src/lib.rs b/packages/fuel-indexer-tests/indexers/fuel-indexer-test/src/lib.rs index a86761c60..c8f9c04f3 100644 --- a/packages/fuel-indexer-tests/indexers/fuel-indexer-test/src/lib.rs +++ b/packages/fuel-indexer-tests/indexers/fuel-indexer-test/src/lib.rs @@ -1,5 +1,3 @@ -extern crate alloc; - use fuel_indexer_utils::prelude::*; #[indexer( diff --git a/packages/fuel-indexer-tests/indexers/simple-wasm/simple-wasm/src/lib.rs b/packages/fuel-indexer-tests/indexers/simple-wasm/simple-wasm/src/lib.rs index 678e972ef..9b51c375a 100644 --- a/packages/fuel-indexer-tests/indexers/simple-wasm/simple-wasm/src/lib.rs +++ b/packages/fuel-indexer-tests/indexers/simple-wasm/simple-wasm/src/lib.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "packages/fuel-indexer-tests/indexers/simple-wasm/simple_wasm.yaml")] diff --git a/packages/fuel-indexer-tests/tests/service.rs b/packages/fuel-indexer-tests/tests/service.rs index 814dba91b..8d1e6ed00 100644 --- a/packages/fuel-indexer-tests/tests/service.rs +++ b/packages/fuel-indexer-tests/tests/service.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer::prelude::fuel::{BlockData, Consensus, Header}; use fuel_indexer::{Executor, IndexerConfig, WasmIndexExecutor}; use fuel_indexer_lib::WasmIndexerError; diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_abi_contains_reserved_fuel_type.rs b/packages/fuel-indexer-tests/trybuild/fail_if_abi_contains_reserved_fuel_type.rs index 651fe3004..324f399e1 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_abi_contains_reserved_fuel_type.rs +++ b/packages/fuel-indexer-tests/trybuild/fail_if_abi_contains_reserved_fuel_type.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "packages/fuel-indexer-tests/trybuild/invalid_abi_type_simple_wasm.yaml")] diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_arg_not_passed_to_handler_function.rs b/packages/fuel-indexer-tests/trybuild/fail_if_arg_not_passed_to_handler_function.rs index 211cf47f4..52f30834b 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_arg_not_passed_to_handler_function.rs +++ b/packages/fuel-indexer-tests/trybuild/fail_if_arg_not_passed_to_handler_function.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[no_mangle] diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs index e05167111..1dce61ae7 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs +++ b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::indexer; #[no_mangle] 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 bbdbd6f64..867601ed3 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 @@ -1,4 +1,4 @@ -error: Type with ident 'Ident { ident: "BadType", span: #0 bytes(225..232) }' not defined in the ABI. +error: Type with ident 'Ident { ident: "BadType", span: #0 bytes(205..212) }' not defined in the ABI. --> trybuild/fail_if_attribute_abi_arg_includes_invalid_type.rs | | #[indexer(manifest = "packages/fuel-indexer-tests/trybuild/simple_wasm.yaml")] @@ -26,13 +26,13 @@ error[E0412]: cannot find type `BlockData` in this scope | help: consider importing one of these items | -2 + use fuel_indexer::prelude::fuel::BlockData; +1 + use fuel_indexer::prelude::fuel::BlockData; | -2 + use fuel_indexer_plugin::prelude::BlockData; +1 + use fuel_indexer_plugin::prelude::BlockData; | -2 + use fuel_indexer_types::fuel::BlockData; +1 + use fuel_indexer_types::fuel::BlockData; | -2 + use fuel_indexer_utils::plugin::prelude::BlockData; +1 + use fuel_indexer_utils::plugin::prelude::BlockData; | error[E0422]: cannot find struct, variant or union type `BlockData` in this scope @@ -43,13 +43,13 @@ error[E0422]: cannot find struct, variant or union type `BlockData` in this scop | help: consider importing one of these items | -2 + use fuel_indexer::prelude::fuel::BlockData; +1 + use fuel_indexer::prelude::fuel::BlockData; | -2 + use fuel_indexer_plugin::prelude::BlockData; +1 + use fuel_indexer_plugin::prelude::BlockData; | -2 + use fuel_indexer_types::fuel::BlockData; +1 + use fuel_indexer_types::fuel::BlockData; | -2 + use fuel_indexer_utils::plugin::prelude::BlockData; +1 + use fuel_indexer_utils::plugin::prelude::BlockData; | error[E0433]: failed to resolve: use of undeclared crate or module `fuel` @@ -60,17 +60,17 @@ error[E0433]: failed to resolve: use of undeclared crate or module `fuel` | help: there is a crate or module with a similar name | -33 | header: fuels::Header { +32 | header: fuels::Header { | ~~~~~ help: consider importing one of these items | -2 + use fuel_indexer::prelude::fuel; +1 + use fuel_indexer::prelude::fuel; | -2 + use fuel_indexer_plugin::prelude::fuel; +1 + use fuel_indexer_plugin::prelude::fuel; | -2 + use fuel_indexer_types::fuel; +1 + use fuel_indexer_types::fuel; | -2 + use fuel_indexer_utils::plugin::prelude::fuel; +1 + use fuel_indexer_utils::plugin::prelude::fuel; | error[E0433]: failed to resolve: use of undeclared crate or module `fuel` @@ -81,17 +81,17 @@ error[E0433]: failed to resolve: use of undeclared crate or module `fuel` | help: there is a crate or module with a similar name | -45 | transactions: vec![fuels::TransactionData { +44 | transactions: vec![fuels::TransactionData { | ~~~~~ help: consider importing one of these items | -2 + use fuel_indexer::prelude::fuel; +1 + use fuel_indexer::prelude::fuel; | -2 + use fuel_indexer_plugin::prelude::fuel; +1 + use fuel_indexer_plugin::prelude::fuel; | -2 + use fuel_indexer_types::fuel; +1 + use fuel_indexer_types::fuel; | -2 + use fuel_indexer_utils::plugin::prelude::fuel; +1 + use fuel_indexer_utils::plugin::prelude::fuel; | error[E0433]: failed to resolve: use of undeclared crate or module `fuel` @@ -102,23 +102,23 @@ error[E0433]: failed to resolve: use of undeclared crate or module `fuel` | help: there is a crate or module with a similar name | -46 | status: fuels::TransactionStatus::default(), +45 | status: fuels::TransactionStatus::default(), | ~~~~~ help: consider importing one of these items | -2 + use fuel_indexer::prelude::fuel::TransactionStatus; +1 + use fuel_indexer::prelude::fuel::TransactionStatus; | -2 + use fuel_indexer_plugin::prelude::fuel::TransactionStatus; +1 + use fuel_indexer_plugin::prelude::fuel::TransactionStatus; | -2 + use fuel_indexer_types::fuel::TransactionStatus; +1 + use fuel_indexer_types::fuel::TransactionStatus; | -2 + use fuel_indexer_utils::plugin::prelude::fuel::TransactionStatus; +1 + 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(), -46 + status: TransactionStatus::default(), +45 - status: fuel::TransactionStatus::default(), +45 + status: TransactionStatus::default(), | error[E0433]: failed to resolve: use of undeclared crate or module `fuel` @@ -129,23 +129,23 @@ error[E0433]: failed to resolve: use of undeclared crate or module `fuel` | help: there is a crate or module with a similar name | -49 | fuels::Receipt::Call { +48 | fuels::Receipt::Call { | ~~~~~ help: consider importing one of these items | -2 + use fuel_indexer::prelude::fuel::Receipt; +1 + use fuel_indexer::prelude::fuel::Receipt; | -2 + use fuel_indexer_plugin::prelude::fuel::Receipt; +1 + use fuel_indexer_plugin::prelude::fuel::Receipt; | -2 + use fuel_indexer_types::fuel::Receipt; +1 + use fuel_indexer_types::fuel::Receipt; | -2 + use fuel_indexer_utils::plugin::prelude::fuel::Receipt; +1 + use fuel_indexer_utils::plugin::prelude::fuel::Receipt; | and 2 other candidates help: if you import `Receipt`, refer to it directly | -49 - fuel::Receipt::Call { -49 + Receipt::Call { +48 - fuel::Receipt::Call { +48 + Receipt::Call { | error[E0433]: failed to resolve: use of undeclared crate or module `fuel` @@ -156,23 +156,23 @@ error[E0433]: failed to resolve: use of undeclared crate or module `fuel` | help: there is a crate or module with a similar name | -60 | fuels::Receipt::ReturnData { +59 | fuels::Receipt::ReturnData { | ~~~~~ help: consider importing one of these items | -2 + use fuel_indexer::prelude::fuel::Receipt; +1 + use fuel_indexer::prelude::fuel::Receipt; | -2 + use fuel_indexer_plugin::prelude::fuel::Receipt; +1 + use fuel_indexer_plugin::prelude::fuel::Receipt; | -2 + use fuel_indexer_types::fuel::Receipt; +1 + use fuel_indexer_types::fuel::Receipt; | -2 + use fuel_indexer_utils::plugin::prelude::fuel::Receipt; +1 + use fuel_indexer_utils::plugin::prelude::fuel::Receipt; | and 2 other candidates help: if you import `Receipt`, refer to it directly | -60 - fuel::Receipt::ReturnData { -60 + Receipt::ReturnData { +59 - fuel::Receipt::ReturnData { +59 + Receipt::ReturnData { | error[E0433]: failed to resolve: use of undeclared type `Transaction` @@ -183,13 +183,13 @@ error[E0433]: failed to resolve: use of undeclared type `Transaction` | help: consider importing one of these items | -2 + use fuel_indexer::prelude::fuel::Transaction; +1 + use fuel_indexer::prelude::fuel::Transaction; | -2 + use fuel_indexer_plugin::prelude::fuel::Transaction; +1 + use fuel_indexer_plugin::prelude::fuel::Transaction; | -2 + use fuel_indexer_types::fuel::Transaction; +1 + use fuel_indexer_types::fuel::Transaction; | -2 + use fuel_indexer_utils::plugin::prelude::fuel::Transaction; +1 + use fuel_indexer_utils::plugin::prelude::fuel::Transaction; | and 3 other candidates @@ -201,13 +201,13 @@ error[E0425]: cannot find function `serialize` in this scope | help: consider importing one of these items | -2 + use chrono::naive::serde::ts_microseconds::serialize; +1 + use chrono::naive::serde::ts_microseconds::serialize; | -2 + use chrono::naive::serde::ts_microseconds_option::serialize; +1 + use chrono::naive::serde::ts_microseconds_option::serialize; | -2 + use chrono::naive::serde::ts_milliseconds::serialize; +1 + use chrono::naive::serde::ts_milliseconds::serialize; | -2 + use chrono::naive::serde::ts_milliseconds_option::serialize; +1 + use chrono::naive::serde::ts_milliseconds_option::serialize; | and 16 other candidates diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_manifest_schema_arg_is_invalid.rs b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_manifest_schema_arg_is_invalid.rs index c9215559d..e96ae6d69 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_manifest_schema_arg_is_invalid.rs +++ b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_manifest_schema_arg_is_invalid.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[no_mangle] diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_manifest_schema_arg_is_invalid.stderr b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_manifest_schema_arg_is_invalid.stderr index c9e426f67..0cf8a8d04 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_attribute_manifest_schema_arg_is_invalid.stderr +++ b/packages/fuel-indexer-tests/trybuild/fail_if_attribute_manifest_schema_arg_is_invalid.stderr @@ -26,13 +26,13 @@ error[E0433]: failed to resolve: use of undeclared type `Consensus` | help: consider importing one of these items | -2 + use crate::fuel::Consensus; +1 + use crate::fuel::Consensus; | -2 + use fuel_indexer::prelude::fuel::Consensus; +1 + use fuel_indexer::prelude::fuel::Consensus; | -2 + use fuel_indexer_plugin::prelude::fuel::Consensus; +1 + use fuel_indexer_plugin::prelude::fuel::Consensus; | -2 + use fuel_indexer_types::fuel::Consensus; +1 + use fuel_indexer_types::fuel::Consensus; | and 1 other candidate @@ -44,13 +44,13 @@ error[E0433]: failed to resolve: use of undeclared type `Transaction` | help: consider importing one of these items | -2 + use crate::fuel::Transaction; +1 + use crate::fuel::Transaction; | -2 + use fuel_indexer::prelude::fuel::Transaction; +1 + use fuel_indexer::prelude::fuel::Transaction; | -2 + use fuel_indexer_plugin::prelude::fuel::Transaction; +1 + use fuel_indexer_plugin::prelude::fuel::Transaction; | -2 + use fuel_indexer_types::fuel::Transaction; +1 + use fuel_indexer_types::fuel::Transaction; | and 4 other candidates @@ -80,7 +80,7 @@ error[E0308]: mismatched types found struct `Vec<_>` help: try wrapping the expression in `Some` | -65 | data: Some(bytes), +64 | data: Some(bytes), | +++++ + error[E0063]: missing field `producer` in initializer of `fuel_indexer_utils::prelude::BlockData` diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_ident_not_defined_in_abi.rs b/packages/fuel-indexer-tests/trybuild/fail_if_ident_not_defined_in_abi.rs index 2e0ccd8f2..c09da16c5 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_ident_not_defined_in_abi.rs +++ b/packages/fuel-indexer-tests/trybuild/fail_if_ident_not_defined_in_abi.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "packages/fuel-indexer-tests/trybuild/simple_wasm.yaml")] diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_ident_not_defined_in_abi.stderr b/packages/fuel-indexer-tests/trybuild/fail_if_ident_not_defined_in_abi.stderr index c68514063..c4f8e8abc 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_ident_not_defined_in_abi.stderr +++ b/packages/fuel-indexer-tests/trybuild/fail_if_ident_not_defined_in_abi.stderr @@ -1,4 +1,4 @@ -error: Type with ident 'Ident { ident: "ThisIsNotDefinedInTheABI", span: #0 bytes(177..201) }' not defined in the ABI. +error: Type with ident 'Ident { ident: "ThisIsNotDefinedInTheABI", span: #0 bytes(157..181) }' not defined in the ABI. --> trybuild/fail_if_ident_not_defined_in_abi.rs | | #[indexer(manifest = "packages/fuel-indexer-tests/trybuild/simple_wasm.yaml")] diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_indexer_module_is_empty.rs b/packages/fuel-indexer-tests/trybuild/fail_if_indexer_module_is_empty.rs index 404f326dd..f024c3d23 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_indexer_module_is_empty.rs +++ b/packages/fuel-indexer-tests/trybuild/fail_if_indexer_module_is_empty.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[no_mangle] diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_non_function_patterns_included_in_module.rs b/packages/fuel-indexer-tests/trybuild/fail_if_non_function_patterns_included_in_module.rs index 22b7f745d..a8609762b 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_non_function_patterns_included_in_module.rs +++ b/packages/fuel-indexer-tests/trybuild/fail_if_non_function_patterns_included_in_module.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "packages/fuel-indexer-tests/trybuild/simple_wasm.yaml")] diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_non_function_patterns_included_in_module.stderr b/packages/fuel-indexer-tests/trybuild/fail_if_non_function_patterns_included_in_module.stderr index c11ec9e15..bda560adb 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_non_function_patterns_included_in_module.stderr +++ b/packages/fuel-indexer-tests/trybuild/fail_if_non_function_patterns_included_in_module.stderr @@ -1,4 +1,4 @@ -error: Unsupported item in indexer module 'Item::Mod { attrs: [], vis: Visibility::Inherited, unsafety: None, mod_token: Mod, ident: Ident { ident: "some_disallowed_module", span: #0 bytes(159..181) }, content: Some((Brace, [])), semi: None }'. +error: Unsupported item in indexer module 'Item::Mod { attrs: [], vis: Visibility::Inherited, unsafety: None, mod_token: Mod, ident: Ident { ident: "some_disallowed_module", span: #0 bytes(139..161) }, content: Some((Brace, [])), semi: None }'. --> trybuild/fail_if_non_function_patterns_included_in_module.rs | | #[indexer(manifest = "packages/fuel-indexer-tests/trybuild/simple_wasm.yaml")] diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_unsupported_type_used_in_handler_args.rs b/packages/fuel-indexer-tests/trybuild/fail_if_unsupported_type_used_in_handler_args.rs index d97caf827..1c29e307c 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_unsupported_type_used_in_handler_args.rs +++ b/packages/fuel-indexer-tests/trybuild/fail_if_unsupported_type_used_in_handler_args.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "packages/fuel-indexer-tests/trybuild/simple_wasm.yaml")] diff --git a/packages/fuel-indexer-tests/trybuild/fail_if_unsupported_type_used_in_handler_args.stderr b/packages/fuel-indexer-tests/trybuild/fail_if_unsupported_type_used_in_handler_args.stderr index 96515ff14..87a2b3d3a 100644 --- a/packages/fuel-indexer-tests/trybuild/fail_if_unsupported_type_used_in_handler_args.stderr +++ b/packages/fuel-indexer-tests/trybuild/fail_if_unsupported_type_used_in_handler_args.stderr @@ -1,4 +1,4 @@ -error: Type with ident 'Ident { ident: "Vec", span: #0 bytes(177..180) }' is not currently supported. +error: Type with ident 'Ident { ident: "Vec", span: #0 bytes(157..160) }' is not currently supported. --> trybuild/fail_if_unsupported_type_used_in_handler_args.rs | | #[indexer(manifest = "packages/fuel-indexer-tests/trybuild/simple_wasm.yaml")] diff --git a/packages/fuel-indexer-tests/trybuild/pass_if_indexer_is_valid_multi_type.rs b/packages/fuel-indexer-tests/trybuild/pass_if_indexer_is_valid_multi_type.rs index 7a6196747..49fcc6f6d 100644 --- a/packages/fuel-indexer-tests/trybuild/pass_if_indexer_is_valid_multi_type.rs +++ b/packages/fuel-indexer-tests/trybuild/pass_if_indexer_is_valid_multi_type.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[no_mangle] diff --git a/packages/fuel-indexer-tests/trybuild/pass_if_indexer_is_valid_single_type.rs b/packages/fuel-indexer-tests/trybuild/pass_if_indexer_is_valid_single_type.rs index c097f1e24..d9ce24181 100644 --- a/packages/fuel-indexer-tests/trybuild/pass_if_indexer_is_valid_single_type.rs +++ b/packages/fuel-indexer-tests/trybuild/pass_if_indexer_is_valid_single_type.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[no_mangle] diff --git a/packages/fuel-indexer-tests/trybuild/pass_if_unsupported_types_are_used.rs b/packages/fuel-indexer-tests/trybuild/pass_if_unsupported_types_are_used.rs index bcc01f01b..44a6a037d 100644 --- a/packages/fuel-indexer-tests/trybuild/pass_if_unsupported_types_are_used.rs +++ b/packages/fuel-indexer-tests/trybuild/pass_if_unsupported_types_are_used.rs @@ -1,4 +1,3 @@ -extern crate alloc; use fuel_indexer_utils::prelude::*; #[no_mangle] diff --git a/plugins/forc-index/src/defaults.rs b/plugins/forc-index/src/defaults.rs index 0a3f058c6..dc89f364f 100644 --- a/plugins/forc-index/src/defaults.rs +++ b/plugins/forc-index/src/defaults.rs @@ -148,8 +148,7 @@ pub fn default_indexer_lib( let manifest_path = manifest_path.display(); format!( - r#"extern crate alloc; -use fuel_indexer_utils::prelude::*; + r#"use fuel_indexer_utils::prelude::*; #[indexer(manifest = "{manifest_path}")] pub mod {indexer_name}_index_mod {{ @@ -186,8 +185,7 @@ pub fn default_indexer_binary( let manifest_path = manifest_path.display(); format!( - r#"extern crate alloc; -use fuel_indexer_utils::prelude::*; + r#"use fuel_indexer_utils::prelude::*; #[indexer(manifest = "{manifest_path}")] pub mod {indexer_name}_index_mod {{