From b9421dbba69180b87256db630ad1cae09a8a1c58 Mon Sep 17 00:00:00 2001 From: Ahmed Sagdati <37515857+segfault-magnet@users.noreply.github.com> Date: Tue, 14 May 2024 22:56:41 +0200 Subject: [PATCH] refactor: move e2e tests into separate crate (#1374) A different crate forces `e2e` tests to only use what was exported through `fuels`. Part of an ongoing effort to stabilize the sdk --------- Co-authored-by: Ahmed Sagdati Co-authored-by: hal3e --- .github/workflows/ci.yml | 38 ++---- .gitignore | 18 +-- Cargo.toml | 5 +- ci_checks.sh | 20 +-- docs/src/calling-contracts/call-params.md | 4 +- docs/src/calling-contracts/logs.md | 6 +- docs/src/calling-contracts/low-level-calls.md | 4 +- docs/src/calling-contracts/other-contracts.md | 4 +- .../src/calling-contracts/variable-outputs.md | 2 +- docs/src/cookbook/deposit-and-withdraw.md | 2 +- docs/src/custom-transactions/custom-calls.md | 2 +- .../transaction-builders.md | 2 +- docs/src/deploying/configurable-constants.md | 4 +- docs/src/getting-started.md | 2 +- docs/src/predicates/index.md | 6 +- docs/src/predicates/send-spend-predicate.md | 2 +- docs/src/running-scripts.md | 16 +-- docs/src/testing/chains.md | 4 +- .../testing/the-setup-program-test-macro.md | 4 +- docs/src/types/B512.md | 2 +- docs/src/types/bits256.md | 2 +- docs/src/types/bytes.md | 2 +- docs/src/types/conversion.md | 4 +- docs/src/types/custom_types.md | 4 +- docs/src/types/evm_address.md | 2 +- docs/src/types/string.md | 2 +- docs/src/types/vectors.md | 4 +- docs/src/wallets/signing.md | 2 +- e2e/Cargo.toml | 32 +++++ e2e/Forc.toml | 114 ++++++++++++++++++ .../sharing_types/contract_a/Forc.toml | 0 .../sharing_types/contract_a/src/main.sw | 0 .../sharing_types/contract_b/Forc.toml | 0 .../sharing_types/contract_b/src/main.sw | 0 .../sharing_types/shared_lib/Forc.toml | 0 .../sharing_types/shared_lib/src/lib.sw | 0 .../sway}/bindings/simple_contract/Forc.toml | 0 .../bindings/simple_contract/src/main.sw | 0 .../sway}/bindings/type_paths/Forc.toml | 0 .../bindings/type_paths/src/another_lib.sw | 0 .../type_paths/src/contract_a_types.sw | 0 .../sway}/bindings/type_paths/src/main.sw | 0 .../sway}/contracts/asserts/Forc.toml | 0 .../sway}/contracts/asserts/src/main.sw | 0 .../contracts/auth_testing_abi/Forc.toml | 0 .../contracts/auth_testing_abi/src/main.sw | 0 .../contracts/auth_testing_contract/Forc.toml | 0 .../auth_testing_contract/src/main.sw | 0 .../sway}/contracts/block_timestamp/Forc.toml | 0 .../contracts/block_timestamp/src/main.sw | 0 .../sway}/contracts/configurables/Forc.toml | 0 .../sway}/contracts/configurables/src/main.sw | 0 .../sway}/contracts/contract_test/Forc.toml | 0 .../sway}/contracts/contract_test/src/main.sw | 0 .../contracts/large_return_data/Forc.toml | 0 .../contracts/large_return_data/src/main.sw | 0 .../sway}/contracts/lib_contract/Forc.toml | 0 .../sway}/contracts/lib_contract/src/main.sw | 0 .../contracts/lib_contract_abi/Forc.toml | 0 .../contracts/lib_contract_abi/src/main.sw | 0 .../contracts/lib_contract_caller/Forc.toml | 0 .../contracts/lib_contract_caller/src/main.sw | 0 .../sway}/contracts/library_test/Forc.toml | 0 .../sway}/contracts/library_test/src/main.sw | 0 .../sway}/contracts/liquidity_pool/Forc.toml | 0 .../contracts/liquidity_pool/src/main.sw | 0 .../contracts/low_level_caller/Forc.toml | 0 .../contracts/low_level_caller/src/main.sw | 0 .../sway}/contracts/msg_methods/Forc.toml | 0 .../sway}/contracts/msg_methods/src/main.sw | 0 .../contracts/multiple_read_calls/Forc.toml | 0 .../contracts/multiple_read_calls/src/main.sw | 0 .../contracts/needs_custom_decoder/Forc.toml | 0 .../needs_custom_decoder/src/main.sw | 0 .../contracts/payable_annotation/Forc.toml | 0 .../contracts/payable_annotation/src/main.sw | 0 .../sway}/contracts/require/Forc.toml | 0 .../sway}/contracts/require/src/main.sw | 0 .../revert_transaction_error/Forc.toml | 0 .../revert_transaction_error/src/main.sw | 0 .../sway}/contracts/storage/Forc.toml | 0 .../sway}/contracts/storage/src/main.sw | 0 .../sway}/contracts/token_ops/Forc.toml | 0 .../sway}/contracts/token_ops/src/main.sw | 0 .../transaction_block_height/Forc.toml | 0 .../transaction_block_height/src/main.sw | 0 .../sway}/logs/contract_logs/Forc.toml | 0 .../sway}/logs/contract_logs/src/main.sw | 0 .../sway}/logs/contract_logs_abi/Forc.toml | 0 .../sway}/logs/contract_logs_abi/src/main.sw | 0 .../contract_with_contract_logs/Forc.toml | 0 .../contract_with_contract_logs/src/main.sw | 0 .../sway}/logs/script_heap_logs/Forc.toml | 0 .../sway}/logs/script_heap_logs/src/main.sw | 0 .../sway}/logs/script_logs/Forc.toml | 0 .../sway}/logs/script_logs/src/main.sw | 0 .../Forc.toml | 0 .../src/main.sw | 0 .../logs/script_with_contract_logs/Forc.toml | 0 .../script_with_contract_logs/src/main.sw | 0 .../predicates/basic_predicate/Forc.toml | 0 .../predicates/basic_predicate/src/main.sw | 0 .../predicate_configurables/Forc.toml | 0 .../predicate_configurables/src/main.sw | 0 .../predicates/predicate_witnesses/Forc.toml | 0 .../predicate_witnesses/src/main.sw | 0 .../sway}/predicates/signatures/Forc.toml | 0 .../sway}/predicates/signatures/src/main.sw | 0 .../sway}/predicates/swap/Forc.toml | 0 .../sway}/predicates/swap/src/main.sw | 0 .../sway}/scripts/arguments/Forc.toml | 0 .../sway}/scripts/arguments/src/main.sw | 0 .../sway}/scripts/basic_script/Forc.toml | 0 .../sway}/scripts/basic_script/src/main.sw | 0 .../scripts/require_from_contract/Forc.toml | 0 .../scripts/require_from_contract/src/main.sw | 0 e2e/sway/scripts/reverting/Forc.toml | 5 + e2e/sway/scripts/reverting/src/main.sw | 5 + .../sway}/scripts/script_array/Forc.toml | 0 .../sway}/scripts/script_array/src/main.sw | 0 .../sway}/scripts/script_asserts/Forc.toml | 0 .../sway}/scripts/script_asserts/src/main.sw | 0 .../scripts/script_configurables/Forc.toml | 0 .../scripts/script_configurables/src/main.sw | 0 .../sway}/scripts/script_enum/Forc.toml | 0 .../sway}/scripts/script_enum/src/main.sw | 0 .../script_needs_custom_decoder/Forc.toml | 0 .../script_needs_custom_decoder/src/main.sw | 0 .../sway}/scripts/script_require/Forc.toml | 0 .../sway}/scripts/script_require/src/main.sw | 0 .../sway}/scripts/script_struct/Forc.toml | 0 .../sway}/scripts/script_struct/src/main.sw | 0 .../sway}/scripts/transfer_script/Forc.toml | 0 .../sway}/scripts/transfer_script/src/main.sw | 0 .../sway}/types/contracts/b256/Forc.toml | 0 .../sway}/types/contracts/b256/src/main.sw | 0 .../sway}/types/contracts/b512/Forc.toml | 0 .../sway}/types/contracts/b512/src/main.sw | 0 .../sway}/types/contracts/bytes/Forc.toml | 0 .../sway}/types/contracts/bytes/src/main.sw | 0 .../contracts/call_empty_return/Forc.toml | 0 .../contracts/call_empty_return/src/main.sw | 0 .../complex_types_contract/Forc.toml | 0 .../complex_types_contract/src/main.sw | 0 .../contracts/contract_output_test/Forc.toml | 0 .../contract_output_test/src/main.sw | 0 .../types/contracts/empty_arguments/Forc.toml | 0 .../contracts/empty_arguments/src/main.sw | 0 .../types/contracts/enum_as_input/Forc.toml | 0 .../types/contracts/enum_as_input/src/main.sw | 0 .../types/contracts/enum_encoding/Forc.toml | 0 .../types/contracts/enum_encoding/src/main.sw | 0 .../contracts/enum_inside_struct/Forc.toml | 0 .../contracts/enum_inside_struct/src/main.sw | 0 .../types/contracts/evm_address/Forc.toml | 0 .../types/contracts/evm_address/src/main.sw | 0 .../sway}/types/contracts/generics/Forc.toml | 0 .../types/contracts/generics/src/main.sw | 0 .../contracts/heap_type_in_enums/Forc.toml | 0 .../contracts/heap_type_in_enums/src/main.sw | 0 .../types/contracts/heap_types/Forc.toml | 0 .../types/contracts/heap_types/src/main.sw | 0 .../sway}/types/contracts/identity/Forc.toml | 0 .../types/contracts/identity/src/main.sw | 0 .../types/contracts/native_types/Forc.toml | 0 .../types/contracts/native_types/src/main.sw | 0 .../types/contracts/nested_structs/Forc.toml | 0 .../contracts/nested_structs/src/main.sw | 0 .../sway}/types/contracts/options/Forc.toml | 0 .../sway}/types/contracts/options/src/main.sw | 0 .../sway}/types/contracts/raw_slice/Forc.toml | 0 .../types/contracts/raw_slice/src/main.sw | 0 .../sway}/types/contracts/results/Forc.toml | 0 .../sway}/types/contracts/results/src/main.sw | 0 .../types/contracts/std_lib_string/Forc.toml | 0 .../contracts/std_lib_string/src/main.sw | 0 .../types/contracts/str_in_array/Forc.toml | 0 .../types/contracts/str_in_array/src/main.sw | 0 .../types/contracts/string_slice/Forc.toml | 0 .../types/contracts/string_slice/src/main.sw | 0 .../sway}/types/contracts/tuples/Forc.toml | 0 .../sway}/types/contracts/tuples/src/main.sw | 0 .../types/contracts/two_structs/Forc.toml | 0 .../types/contracts/two_structs/src/main.sw | 0 .../contracts/type_inside_enum/Forc.toml | 0 .../contracts/type_inside_enum/src/main.sw | 0 .../sway}/types/contracts/u128/Forc.toml | 0 .../sway}/types/contracts/u128/src/main.sw | 0 .../sway}/types/contracts/u256/Forc.toml | 0 .../sway}/types/contracts/u256/src/main.sw | 0 .../types/contracts/vector_output/Forc.toml | 0 .../types/contracts/vector_output/src/main.sw | 0 .../sway}/types/contracts/vectors/Forc.toml | 0 .../contracts/vectors/src/data_structures.sw | 0 .../types/contracts/vectors/src/eq_impls.sw | 0 .../sway}/types/contracts/vectors/src/main.sw | 0 .../types/contracts/vectors/src/utils.sw | 0 .../sway}/types/predicates/address/Forc.toml | 0 .../types/predicates/address/src/main.sw | 0 .../sway}/types/predicates/enums/Forc.toml | 0 .../sway}/types/predicates/enums/src/main.sw | 0 .../types/predicates/predicate_b256/Forc.toml | 0 .../predicates/predicate_b256/src/main.sw | 0 .../predicates/predicate_bytes/Forc.toml | 0 .../predicates/predicate_bytes/src/main.sw | 0 .../predicates/predicate_bytes_hash/Forc.toml | 0 .../predicate_bytes_hash/src/main.sw | 0 .../predicates/predicate_generics/Forc.toml | 0 .../predicates/predicate_generics/src/main.sw | 0 .../predicates/predicate_raw_slice/Forc.toml | 0 .../predicate_raw_slice/src/main.sw | 0 .../predicate_std_lib_string/Forc.toml | 0 .../predicate_std_lib_string/src/main.sw | 0 .../predicates/predicate_tuples/Forc.toml | 0 .../predicates/predicate_tuples/src/main.sw | 0 .../types/predicates/predicate_u128/Forc.toml | 0 .../predicates/predicate_u128/src/main.sw | 0 .../types/predicates/predicate_u256/Forc.toml | 0 .../predicates/predicate_u256/src/main.sw | 0 .../predicates/predicate_vector/Forc.toml | 0 .../predicates/predicate_vector/src/main.sw | 0 .../predicates/predicate_vectors/Forc.toml | 0 .../predicates/predicate_vectors/src/main.sw | 0 .../sway}/types/predicates/structs/Forc.toml | 0 .../types/predicates/structs/src/main.sw | 0 .../sway}/types/predicates/u64/Forc.toml | 0 .../sway}/types/predicates/u64/src/main.sw | 0 .../types/scripts/options_results/Forc.toml | 0 .../types/scripts/options_results/src/main.sw | 0 .../sway}/types/scripts/script_b256/Forc.toml | 0 .../types/scripts/script_b256/src/main.sw | 0 .../types/scripts/script_bytes/Forc.toml | 0 .../types/scripts/script_bytes/src/main.sw | 0 .../types/scripts/script_generics/Forc.toml | 0 .../types/scripts/script_generics/src/main.sw | 0 .../types/scripts/script_heap_types/Forc.toml | 0 .../scripts/script_heap_types/src/main.sw | 0 .../types/scripts/script_raw_slice/Forc.toml | 0 .../scripts/script_raw_slice/src/main.sw | 0 .../scripts/script_std_lib_string/Forc.toml | 0 .../scripts/script_std_lib_string/src/main.sw | 0 .../types/scripts/script_tuples/Forc.toml | 0 .../types/scripts/script_tuples/src/main.sw | 0 .../sway}/types/scripts/script_u128/Forc.toml | 0 .../types/scripts/script_u128/src/main.sw | 0 .../sway}/types/scripts/script_u256/Forc.toml | 0 .../types/scripts/script_u256/src/main.sw | 0 .../types/scripts/script_vectors/Forc.toml | 0 .../script_vectors/src/data_structures.sw | 0 .../scripts/script_vectors/src/eq_impls.sw | 0 .../types/scripts/script_vectors/src/main.sw | 0 .../types/scripts/script_vectors/src/utils.sw | 0 {packages/fuels => e2e}/tests/bindings.rs | 8 +- .../fuels => e2e}/tests/configurables.rs | 25 ++-- {packages/fuels => e2e}/tests/contracts.rs | 104 ++++++++-------- {packages/fuels => e2e}/tests/from_token.rs | 0 {packages/fuels => e2e}/tests/imports.rs | 0 {packages/fuels => e2e}/tests/logs.rs | 95 +++++++-------- {packages/fuels => e2e}/tests/predicates.rs | 103 ++++++++-------- {packages/fuels => e2e}/tests/providers.rs | 41 +++---- {packages/fuels => e2e}/tests/scripts.rs | 28 ++--- {packages/fuels => e2e}/tests/storage.rs | 12 +- .../fuels => e2e}/tests/types_contracts.rs | 84 ++++++------- .../fuels => e2e}/tests/types_predicates.rs | 68 ++++++----- .../fuels => e2e}/tests/types_scripts.rs | 22 ++-- {packages/fuels => e2e}/tests/wallets.rs | 8 +- examples/contracts/src/lib.rs | 69 +++++------ examples/cookbook/src/lib.rs | 7 +- examples/debugging/src/lib.rs | 5 +- examples/macros/src/lib.rs | 20 ++- examples/predicates/src/lib.rs | 13 +- examples/wallets/src/lib.rs | 2 +- packages/fuels-accounts/Cargo.toml | 1 + packages/fuels-accounts/src/predicate.rs | 8 +- .../abigen/bindings/script.rs | 2 +- packages/fuels-core/Cargo.toml | 3 +- packages/fuels-core/src/types/errors.rs | 8 +- packages/fuels-programs/src/contract.rs | 8 +- .../src/fuel_bin_service.rs | 12 +- packages/fuels/Cargo.toml | 15 --- packages/fuels/Forc.toml | 113 ----------------- packages/fuels/src/lib.rs | 9 -- .../.cargo/config.toml | 0 .../wasm-tests => wasm-tests}/Cargo.toml | 8 +- .../wasm-tests => wasm-tests}/src/lib.rs | 0 285 files changed, 616 insertions(+), 610 deletions(-) create mode 100644 e2e/Cargo.toml create mode 100644 e2e/Forc.toml rename {packages/fuels/tests => e2e/sway}/bindings/sharing_types/contract_a/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/bindings/sharing_types/contract_a/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/bindings/sharing_types/contract_b/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/bindings/sharing_types/contract_b/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/bindings/sharing_types/shared_lib/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/bindings/sharing_types/shared_lib/src/lib.sw (100%) rename {packages/fuels/tests => e2e/sway}/bindings/simple_contract/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/bindings/simple_contract/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/bindings/type_paths/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/bindings/type_paths/src/another_lib.sw (100%) rename {packages/fuels/tests => e2e/sway}/bindings/type_paths/src/contract_a_types.sw (100%) rename {packages/fuels/tests => e2e/sway}/bindings/type_paths/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/asserts/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/asserts/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/auth_testing_abi/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/auth_testing_abi/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/auth_testing_contract/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/auth_testing_contract/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/block_timestamp/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/block_timestamp/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/configurables/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/configurables/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/contract_test/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/contract_test/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/large_return_data/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/large_return_data/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/lib_contract/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/lib_contract/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/lib_contract_abi/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/lib_contract_abi/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/lib_contract_caller/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/lib_contract_caller/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/library_test/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/library_test/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/liquidity_pool/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/liquidity_pool/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/low_level_caller/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/low_level_caller/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/msg_methods/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/msg_methods/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/multiple_read_calls/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/multiple_read_calls/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/needs_custom_decoder/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/needs_custom_decoder/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/payable_annotation/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/payable_annotation/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/require/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/require/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/revert_transaction_error/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/revert_transaction_error/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/storage/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/storage/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/token_ops/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/token_ops/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/contracts/transaction_block_height/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/contracts/transaction_block_height/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/logs/contract_logs/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/logs/contract_logs/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/logs/contract_logs_abi/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/logs/contract_logs_abi/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/logs/contract_with_contract_logs/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/logs/contract_with_contract_logs/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/logs/script_heap_logs/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/logs/script_heap_logs/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/logs/script_logs/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/logs/script_logs/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/logs/script_needs_custom_decoder_logging/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/logs/script_needs_custom_decoder_logging/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/logs/script_with_contract_logs/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/logs/script_with_contract_logs/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/predicates/basic_predicate/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/predicates/basic_predicate/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/predicates/predicate_configurables/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/predicates/predicate_configurables/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/predicates/predicate_witnesses/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/predicates/predicate_witnesses/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/predicates/signatures/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/predicates/signatures/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/predicates/swap/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/predicates/swap/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/arguments/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/arguments/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/basic_script/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/basic_script/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/require_from_contract/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/require_from_contract/src/main.sw (100%) create mode 100644 e2e/sway/scripts/reverting/Forc.toml create mode 100644 e2e/sway/scripts/reverting/src/main.sw rename {packages/fuels/tests => e2e/sway}/scripts/script_array/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_array/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_asserts/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_asserts/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_configurables/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_configurables/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_enum/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_enum/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_needs_custom_decoder/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_needs_custom_decoder/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_require/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_require/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_struct/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/script_struct/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/scripts/transfer_script/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/scripts/transfer_script/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/b256/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/b256/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/b512/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/b512/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/bytes/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/bytes/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/call_empty_return/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/call_empty_return/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/complex_types_contract/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/complex_types_contract/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/contract_output_test/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/contract_output_test/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/empty_arguments/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/empty_arguments/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/enum_as_input/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/enum_as_input/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/enum_encoding/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/enum_encoding/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/enum_inside_struct/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/enum_inside_struct/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/evm_address/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/evm_address/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/generics/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/generics/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/heap_type_in_enums/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/heap_type_in_enums/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/heap_types/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/heap_types/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/identity/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/identity/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/native_types/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/native_types/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/nested_structs/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/nested_structs/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/options/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/options/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/raw_slice/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/raw_slice/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/results/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/results/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/std_lib_string/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/std_lib_string/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/str_in_array/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/str_in_array/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/string_slice/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/string_slice/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/tuples/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/tuples/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/two_structs/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/two_structs/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/type_inside_enum/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/type_inside_enum/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/u128/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/u128/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/u256/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/u256/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/vector_output/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/vector_output/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/vectors/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/vectors/src/data_structures.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/vectors/src/eq_impls.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/vectors/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/contracts/vectors/src/utils.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/address/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/address/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/enums/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/enums/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_b256/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_b256/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_bytes/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_bytes/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_bytes_hash/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_bytes_hash/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_generics/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_generics/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_raw_slice/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_raw_slice/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_std_lib_string/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_std_lib_string/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_tuples/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_tuples/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_u128/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_u128/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_u256/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_u256/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_vector/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_vector/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_vectors/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/predicate_vectors/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/structs/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/structs/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/u64/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/predicates/u64/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/options_results/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/options_results/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_b256/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_b256/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_bytes/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_bytes/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_generics/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_generics/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_heap_types/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_heap_types/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_raw_slice/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_raw_slice/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_std_lib_string/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_std_lib_string/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_tuples/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_tuples/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_u128/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_u128/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_u256/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_u256/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_vectors/Forc.toml (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_vectors/src/data_structures.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_vectors/src/eq_impls.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_vectors/src/main.sw (100%) rename {packages/fuels/tests => e2e/sway}/types/scripts/script_vectors/src/utils.sw (100%) rename {packages/fuels => e2e}/tests/bindings.rs (95%) rename {packages/fuels => e2e}/tests/configurables.rs (86%) rename {packages/fuels => e2e}/tests/contracts.rs (93%) rename {packages/fuels => e2e}/tests/from_token.rs (100%) rename {packages/fuels => e2e}/tests/imports.rs (100%) rename {packages/fuels => e2e}/tests/logs.rs (93%) rename {packages/fuels => e2e}/tests/predicates.rs (88%) rename {packages/fuels => e2e}/tests/providers.rs (94%) rename {packages/fuels => e2e}/tests/scripts.rs (90%) rename {packages/fuels => e2e}/tests/storage.rs (85%) rename {packages/fuels => e2e}/tests/types_contracts.rs (94%) rename {packages/fuels => e2e}/tests/types_predicates.rs (76%) rename {packages/fuels => e2e}/tests/types_scripts.rs (91%) rename {packages/fuels => e2e}/tests/wallets.rs (99%) delete mode 100644 packages/fuels/Forc.toml rename {packages/wasm-tests => wasm-tests}/.cargo/config.toml (100%) rename {packages/wasm-tests => wasm-tests}/Cargo.toml (51%) rename {packages/wasm-tests => wasm-tests}/src/lib.rs (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bfba9bb62..0a03a0cdc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,45 +59,28 @@ jobs: fi - name: Check format of Sway test projects - run: forc fmt --check - working-directory: packages/fuels + run: forc fmt --check --path e2e - name: Build Sway test projects - run: forc build --release --terse --error-on-warnings - working-directory: packages/fuels + run: forc build --release --terse --error-on-warnings --path e2e - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: retention-days: 2 name: sway-examples - # cache only the sway build artifacts, skip all src files path: | - packages/fuels/tests - !packages/fuels/tests/*.rs - !packages/fuels/tests/**/*.rs - !packages/fuels/tests/**/*.sw - !packages/fuels/tests/**/Forc.toml - !packages/fuels/tests/**/Forc.lock - !packages/fuels/tests/.gitignore + e2e/sway/**/out/* # TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked. - name: Build Sway test projects w type paths - run: forc build --release --terse --error-on-warnings --json-abi-with-callpaths - working-directory: packages/fuels + run: forc build --release --terse --error-on-warnings --json-abi-with-callpaths --path e2e - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: retention-days: 2 name: sway-examples-w-type-paths - # cache only the sway build artifacts, skip all src files path: | - packages/fuels/tests - !packages/fuels/tests/*.rs - !packages/fuels/tests/**/*.rs - !packages/fuels/tests/**/*.sw - !packages/fuels/tests/**/Forc.toml - !packages/fuels/tests/**/Forc.lock - !packages/fuels/tests/.gitignore + e2e/sway/**/out/* get-workspace-members: runs-on: ubuntu-latest @@ -217,10 +200,11 @@ jobs: - name: Download sway example artifacts if: ${{ matrix.download_sway_artifacts }} - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ matrix.download_sway_artifacts }} - path: packages/fuels/tests/ + # Needed because `upload-artifact` will remove 'e2e/sway' because it is shared between all matched files + path: e2e/sway/ - name: Install nextest if: ${{ matrix.cargo_command == 'nextest' }} @@ -249,7 +233,7 @@ jobs: run: | rustup target add wasm32-unknown-unknown curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - cd packages/wasm-tests + cd wasm-tests wasm-pack test --node - name: Check for invalid documentation anchors diff --git a/.gitignore b/.gitignore index 75d9a30a7d..f54a1239f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Generated by Cargo # will have compiled files and executables -/target/ +target/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html @@ -12,17 +12,9 @@ Cargo.lock # Don't add the generated MDBook artifacts docs/book/ -# Don't add lock files in the fuels tests directory. -packages/fuels/tests/**/**/Forc.lock +# Don't add Forc lock files +**/Forc.lock # Don't add out/ files from test Sway projects. -packages/fuels/tests/**/**/out/ - -# Don't add target/ files from test Sway projects. -packages/fuels/tests/**/**/target/ - -# Don't add .gitignore files from test Sway projects. -packages/fuels/tests/**/**/.gitignore - -# Don't add lock files in the fuels directory. -packages/fuels/Forc.lock +e2e/sway/**/out/ +e2e/sway/**/.gitignore diff --git a/Cargo.toml b/Cargo.toml index ace307541b..0cb70f40f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ # https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html#details resolver = "2" members = [ + "e2e", "examples/codec", "examples/contracts", "examples/cookbook", @@ -23,9 +24,9 @@ members = [ "packages/fuels-macros", "packages/fuels-programs", "packages/fuels-test-helpers", - "packages/wasm-tests", "scripts/check-docs", "scripts/versions-replacer", + "wasm-tests", ] [workspace.package] @@ -92,7 +93,7 @@ fuel-types = { version = "0.49.0" } fuel-vm = { version = "0.49.0" } # Workspace projects -fuels = { version = "0.61.0", path = "./packages/fuels" } +fuels = { version = "0.61.0", path = "./packages/fuels", default-features = false } fuels-accounts = { version = "0.61.0", path = "./packages/fuels-accounts", default-features = false } fuels-code-gen = { version = "0.61.0", path = "./packages/fuels-code-gen", default-features = false } fuels-core = { version = "0.61.0", path = "./packages/fuels-core", default-features = false } diff --git a/ci_checks.sh b/ci_checks.sh index cdea15e6df..faaf36815f 100755 --- a/ci_checks.sh +++ b/ci_checks.sh @@ -8,13 +8,13 @@ # Note, if you need a custom branch, you can replace `--tag {RELEASE}` with the `--branch {BRANCH_NAME}`. cargo fmt --all -- --check && -forc fmt --check --path packages/fuels && -forc build --release --terse --path packages/fuels && -forc build --release --terse --json-abi-with-callpaths --path packages/fuels && -cargo clippy --all-targets && -cargo clippy --all-targets --all-features && -cargo test --all-targets --all-features && -cargo test --all-targets --all-features --workspace && -cargo test --all-targets --workspace && -cargo run --bin check-docs && -$(cargo doc |& grep -A 6 "warning: unresolved link to") + forc fmt --check && + forc build --release --terse && + cargo clippy --all-targets && + forc build --release --terse --json-abi-with-callpaths && + cargo clippy --all-targets --all-features && + cargo test --all-targets --all-features && + cargo test --all-targets --all-features --workspace && + cargo test --all-targets --workspace && + cargo run --bin check-docs && + $(cargo doc |& grep -A 6 "warning: unresolved link to") diff --git a/docs/src/calling-contracts/call-params.md b/docs/src/calling-contracts/call-params.md index bea40fcb03..ca18043d69 100644 --- a/docs/src/calling-contracts/call-params.md +++ b/docs/src/calling-contracts/call-params.md @@ -15,7 +15,7 @@ You can use these to forward coins to a contract. You can configure these parame For instance, suppose the following contract that uses Sway's `msg_amount()` to return the amount sent in that transaction. ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts/contract_test/src/main.sw:msg_amount}} +{{#include ../../../e2e/sway/contracts/contract_test/src/main.sw:msg_amount}} ``` Then, in Rust, after setting up and deploying the above contract, you can configure the amount being sent in the transaction like this: @@ -31,7 +31,7 @@ Then, in Rust, after setting up and deploying the above contract, you can config In the following example, we try to forward an amount of `100` of the base asset to `non_payable`. As its name suggests, `non_payable` isn't annotated with `#[payable]` in the contract code. Passing `CallParameters` with an amount other than `0` leads to an error: ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts.rs:non_payable_params}} +{{#include ../../../e2e/tests/contracts.rs:non_payable_params}} ``` > **Note:** forwarding gas to a contract call is always possible, regardless of the contract method being non-payable. diff --git a/docs/src/calling-contracts/logs.md b/docs/src/calling-contracts/logs.md index 3d13b22d1c..8c74671914 100644 --- a/docs/src/calling-contracts/logs.md +++ b/docs/src/calling-contracts/logs.md @@ -5,19 +5,19 @@ Whenever you log a value within a contract method, the resulting log entry is ad Consider the following contract method: ```rust,ignore -{{#include ../../../packages/fuels/tests/logs/contract_logs/src/main.sw:produce_logs}} +{{#include ../../../e2e/sway/logs/contract_logs/src/main.sw:produce_logs}} ``` You can access the logged values in Rust by calling `decode_logs_with_type::` from a `FuelCallResponse`, where `T` is the type of the logged variables you want to retrieve. The result will be a `Vec`: ```rust,ignore -{{#include ../../../packages/fuels/tests/logs.rs:produce_logs}} +{{#include ../../../e2e/tests/logs.rs:produce_logs}} ``` You can use the `decode_logs()` function to retrieve a `LogResult` struct containing a `results` field that is a vector of `Result` values representing the success or failure of decoding each log. ```rust, ignore -{{#include ../../../packages/fuels/tests/logs.rs:decode_logs}} +{{#include ../../../e2e/tests/logs.rs:decode_logs}} ``` Due to possible performance hits, it is not recommended to use `decode_logs()` outside of a debugging scenario. diff --git a/docs/src/calling-contracts/low-level-calls.md b/docs/src/calling-contracts/low-level-calls.md index 40843a0c7d..f3fb2a31bd 100644 --- a/docs/src/calling-contracts/low-level-calls.md +++ b/docs/src/calling-contracts/low-level-calls.md @@ -12,7 +12,7 @@ Your caller contract should call `std::low_level_call::call_with_function_select - `std::low_level_call::CallParams` ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts/low_level_caller/src/main.sw:low_level_call_contract}} +{{#include ../../../e2e/sway/contracts/low_level_caller/src/main.sw:low_level_call_contract}} ``` On the SDK side, you can construct an encoded function selector using `fuels::core::encode_fn_selector`, and encoded calldata using the `fuels::core::calldata!` macro. @@ -20,7 +20,7 @@ On the SDK side, you can construct an encoded function selector using `fuels::co E.g. to call the following function on the target contract: ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts/contract_test/src/main.sw:low_level_call}} +{{#include ../../../e2e/sway/contracts/contract_test/src/main.sw:low_level_call}} ``` you would construct the function selector and the calldata as such, and provide them to the caller contract (like the one above): diff --git a/docs/src/calling-contracts/other-contracts.md b/docs/src/calling-contracts/other-contracts.md index 0df2b1b6b9..f7a02cad96 100644 --- a/docs/src/calling-contracts/other-contracts.md +++ b/docs/src/calling-contracts/other-contracts.md @@ -5,11 +5,11 @@ If your contract method is calling other contracts you will have to add the appr `with_contracts(&[&contract_instance, ...])` requires contract instances that were created using the `abigen` macro. When setting the external contracts with this method, logs and require revert errors originating from the external contract can be propagated and decoded by the calling contract. ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts.rs:external_contract}} +{{#include ../../../e2e/tests/contracts.rs:external_contract}} ``` If however, you do not need do decode logs or you do not have a contract instance that was generated using the `abigen` macro you can use `with_contract_ids(&[&contract_id, ...])` and provide the required contract ids. ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts.rs:external_contract_ids}} +{{#include ../../../e2e/tests/contracts.rs:external_contract_ids}} ``` diff --git a/docs/src/calling-contracts/variable-outputs.md b/docs/src/calling-contracts/variable-outputs.md index cbd46720e2..76f962a664 100644 --- a/docs/src/calling-contracts/variable-outputs.md +++ b/docs/src/calling-contracts/variable-outputs.md @@ -8,7 +8,7 @@ Sometimes, the contract you call might transfer funds to a specific address, dep Let's say you deployed a contract with the following method: ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts/token_ops/src/main.sw:variable_outputs}} +{{#include ../../../e2e/sway/contracts/token_ops/src/main.sw:variable_outputs}} ``` When calling `transfer_coins_to_output` with the SDK, you can specify the number of variable outputs by chaining `append_variable_outputs(amount)` to your call. Like this: diff --git a/docs/src/cookbook/deposit-and-withdraw.md b/docs/src/cookbook/deposit-and-withdraw.md index fc84e48b17..3a084a84e8 100644 --- a/docs/src/cookbook/deposit-and-withdraw.md +++ b/docs/src/cookbook/deposit-and-withdraw.md @@ -3,7 +3,7 @@ Consider the following contract: ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts/liquidity_pool/src/main.sw}} +{{#include ../../../e2e/sway/contracts/liquidity_pool/src/main.sw}} ``` As its name suggests, it represents a simplified example of a liquidity pool contract. The method `deposit()` expects you to supply an arbitrary amount of the `BASE_TOKEN`. As a result, it mints double the amount of the liquidity asset to the calling address. Analogously, if you call `withdraw()` supplying it with the liquidity asset, it will transfer half that amount of the `BASE_TOKEN` back to the calling address except for deducting it from the contract balance instead of minting it. diff --git a/docs/src/custom-transactions/custom-calls.md b/docs/src/custom-transactions/custom-calls.md index f8917b8a28..b1727582c7 100644 --- a/docs/src/custom-transactions/custom-calls.md +++ b/docs/src/custom-transactions/custom-calls.md @@ -11,5 +11,5 @@ When preparing a contract call via `ContractCallHandler` or a script call via `S ## Custom script call ```rust,ignore -{{#include ../../../packages/fuels/tests/scripts.rs:script_call_tb}} +{{#include ../../../e2e/tests/scripts.rs:script_call_tb}} ``` diff --git a/docs/src/custom-transactions/transaction-builders.md b/docs/src/custom-transactions/transaction-builders.md index de8eaffbaf..ee3fa223f2 100644 --- a/docs/src/custom-transactions/transaction-builders.md +++ b/docs/src/custom-transactions/transaction-builders.md @@ -91,7 +91,7 @@ Finally, we verify the transaction succeeded and that the cold storage indeed ho If you need to build the transaction without signatures, which is useful when estimating transaction costs or simulations, you can use the `build_without_signatures(&provider)` method and later sign the built transaction. ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts.rs:tb_build_without_signatures}} +{{#include ../../../e2e/tests/contracts.rs:tb_build_without_signatures}} ``` > **Note** In contrast to adding signers to a transaction builder, when signing a built transaction, you must ensure that the order of signatures matches the order of signed inputs. Multiple signed inputs with the same owner will have the same witness index. diff --git a/docs/src/deploying/configurable-constants.md b/docs/src/deploying/configurable-constants.md index f247d8b136..3067aeac26 100644 --- a/docs/src/deploying/configurable-constants.md +++ b/docs/src/deploying/configurable-constants.md @@ -3,11 +3,11 @@ In Sway, you can define `configurable` constants which can be changed during the contract deployment in the SDK. Here is an example how the constants are defined. ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts/configurables/src/main.sw}} +{{#include ../../../e2e/sway/contracts/configurables/src/main.sw}} ``` Each of the configurable constants will get a dedicated `with` method in the SDK. For example, the constant `STR_4` will get the `with_STR_4` method which accepts the same type as defined in the contract code. Below is an example where we chain several `with` methods and deploy the contract with the new constants. ```rust,ignore -{{#include ../../../packages/fuels/tests/configurables.rs:contract_configurables}} +{{#include ../../../e2e/tests/configurables.rs:contract_configurables}} ``` diff --git a/docs/src/getting-started.md b/docs/src/getting-started.md index 3a686958a1..5aa320e84c 100644 --- a/docs/src/getting-started.md +++ b/docs/src/getting-started.md @@ -95,7 +95,7 @@ use fuels::prelude::*; ## The Fuel Rust SDK source code -Another way to experience the SDK is to look at the source code. The `packages/fuels/tests/` folder is full of integration tests that go through almost all aspects of the SDK. +Another way to experience the SDK is to look at the source code. The `e2e/tests/` folder is full of integration tests that go through almost all aspects of the SDK. > **Note** Before running the tests, we need to build all the Sway test projects. The file `packages/fuels/Forc.toml` contains a `[workspace], which members are the paths to all integration tests. > To build these tests, run the following command: diff --git a/docs/src/predicates/index.md b/docs/src/predicates/index.md index 0d84784b40..d1b9023963 100644 --- a/docs/src/predicates/index.md +++ b/docs/src/predicates/index.md @@ -7,7 +7,7 @@ Predicates, in Sway, are programs that return a Boolean value and do not have an Let's consider the following predicate example: ```rust,ignore -{{#include ../../../packages/fuels/tests/predicates/basic_predicate/src/main.sw}} +{{#include ../../../e2e/sway/predicates/basic_predicate/src/main.sw}} ``` We will look at a complete example of using the SDK to send and receive funds from a predicate. @@ -46,10 +46,10 @@ Then we can transfer assets owned by the predicate via the [Account](../accounts Same as contracts and scripts, you can define configurable constants in `predicates`, which can be changed during the predicate execution. Here is an example of how the constants are defined. ```rust,ignore -{{#include ../../../packages/fuels/tests/predicates/predicate_configurables/src/main.sw:predicate_configurables}} +{{#include ../../../e2e/sway/predicates/predicate_configurables/src/main.sw:predicate_configurables}} ``` Each configurable constant will get a dedicated `with` method in the SDK. For example, the constant `U8` will get the `with_U8` method which accepts the same type defined in sway. Below is an example where we chain several `with` methods and update the predicate with the new constants. ```rust,ignore -{{#include ../../../packages/fuels/tests/predicates.rs:predicate_configurables}} +{{#include ../../../e2e/tests/predicates.rs:predicate_configurables}} diff --git a/docs/src/predicates/send-spend-predicate.md b/docs/src/predicates/send-spend-predicate.md index 72f11d383f..91a9722265 100644 --- a/docs/src/predicates/send-spend-predicate.md +++ b/docs/src/predicates/send-spend-predicate.md @@ -3,7 +3,7 @@ This is a more involved example where the predicate accepts three signatures and matches them to three predefined public keys. The `ec_recover_address` function is used to recover the public key from the signatures. If two of the three extracted public keys match the predefined public keys, the funds can be spent. Note that the signature order has to match the order of the predefined public keys. ```rust,ignore -{{#include ../../../packages/fuels/tests/predicates/signatures/src/main.sw}} +{{#include ../../../e2e/sway/predicates/signatures/src/main.sw}} ``` Let's use the SDK to interact with the predicate. First, let's create three wallets with specific keys. Their hashed public keys are already hard-coded in the predicate. Then we create the receiver wallet, which we will use to spend the predicate funds. diff --git a/docs/src/running-scripts.md b/docs/src/running-scripts.md index 29a3b15ba3..210109a5e7 100644 --- a/docs/src/running-scripts.md +++ b/docs/src/running-scripts.md @@ -3,13 +3,13 @@ You can run a script using its JSON-ABI and the path to its binary file. You can run the scripts with arguments. For this, you have to use the `abigen!` macro seen [previously](./abigen/the-abigen-macro.md). ````rust,ignore -{{#include ../../packages/fuels/tests/scripts.rs:script_with_arguments}} +{{#include ../../e2e/tests/scripts.rs:script_with_arguments}} ```` Furthermore, if you need to separate submission from value retrieval for any reason, you can do so as follows: ```rust,ignore -{{#include ../../packages/fuels/tests/scripts.rs:submit_response_script}} +{{#include ../../e2e/tests/scripts.rs:submit_response_script}} ``` ## Running scripts with transaction policies @@ -17,7 +17,7 @@ Furthermore, if you need to separate submission from value retrieval for any rea The method for passing transaction policies is the same as [with contracts](./calling-contracts/tx-policies.md). As a reminder, the workflow would look like this: ```rust,ignore -{{#include ../../packages/fuels/tests/scripts.rs:script_with_tx_policies}} +{{#include ../../e2e/tests/scripts.rs:script_with_tx_policies}} ``` ## Logs @@ -25,7 +25,7 @@ The method for passing transaction policies is the same as [with contracts](./ca Script calls provide the same logging functions, `decode_logs()` and `decode_logs_with_type()`, as contract calls. As a reminder, the workflow looks like this: ```rust,ignore -{{#include ../../packages/fuels/tests/logs.rs:script_logs}} +{{#include ../../e2e/tests/logs.rs:script_logs}} ``` ## Calling contracts from scripts @@ -35,13 +35,13 @@ Scripts use the same interfaces for setting external contracts as [contract meth Below is an example that uses `with_contracts(&[&contract_instance, ...])`. ```rust,ignore -{{#include ../../packages/fuels/tests/logs.rs:external_contract}} +{{#include ../../e2e/tests/logs.rs:external_contract}} ``` And this is an example that uses `with_contract_ids(&[&contract_id, ...])`. ```rust,ignore -{{#include ../../packages/fuels/tests/logs.rs:external_contract_ids}} +{{#include ../../e2e/tests/logs.rs:external_contract_ids}} ``` ## Configurable constants @@ -49,10 +49,10 @@ And this is an example that uses `with_contract_ids(&[&contract_id, ...])`. Same as contracts, you can define `configurable` constants in `scripts` which can be changed during the script execution. Here is an example how the constants are defined. ```rust,ignore -{{#include ../../packages/fuels/tests/scripts/script_configurables/src/main.sw}} +{{#include ../../e2e/sway/scripts/script_configurables/src/main.sw}} ``` Each configurable constant will get a dedicated `with` method in the SDK. For example, the constant `STR_4` will get the `with_STR_4` method which accepts the same type defined in sway. Below is an example where we chain several `with` methods and execute the script with the new constants. ```rust,ignore -{{#include ../../packages/fuels/tests/configurables.rs:script_configurables}} +{{#include ../../e2e/tests/configurables.rs:script_configurables}} diff --git a/docs/src/testing/chains.md b/docs/src/testing/chains.md index 04a6a062b7..336dc520ec 100644 --- a/docs/src/testing/chains.md +++ b/docs/src/testing/chains.md @@ -5,11 +5,11 @@ You can use `produce_blocks` to help achieve an arbitrary block height; this is > **Note**: For the `produce_blocks` API to work, it is imperative to have `manual_blocks_enabled = true` in the config for the running node. See example below. ````rust,ignore -{{#include ../../../packages/fuels/tests/providers.rs:use_produce_blocks_to_increase_block_height}} +{{#include ../../../e2e/tests/providers.rs:use_produce_blocks_to_increase_block_height}} ```` You can also set a custom block time as the second, optional argument. Here is an example: ````rust,ignore -{{#include ../../../packages/fuels/tests/providers.rs:use_produce_blocks_custom_time}} +{{#include ../../../e2e/tests/providers.rs:use_produce_blocks_custom_time}} ```` diff --git a/docs/src/testing/the-setup-program-test-macro.md b/docs/src/testing/the-setup-program-test-macro.md index b7a252b3b4..72d71fbf68 100644 --- a/docs/src/testing/the-setup-program-test-macro.md +++ b/docs/src/testing/the-setup-program-test-macro.md @@ -84,7 +84,7 @@ The setup code that you have seen in previous sections gets reduced to: > **Note** The same contract can be deployed several times as the macro deploys the contracts with salt. You can also deploy different contracts to the same provider by referencing the same wallet in the `Deploy` command. ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts.rs:contract_setup_macro_multi}} +{{#include ../../../e2e/tests/contracts.rs:contract_setup_macro_multi}} ``` In this example, three contracts are deployed on the same provider using the `wallet` generated by the `Wallets` command. The second and third macros use the same contract but have different IDs because of the deployment with salt. Both of them can call the first contract by using their ID. @@ -92,5 +92,5 @@ In this example, three contracts are deployed on the same provider using the `wa In addition, you can manually create the `wallet` variable and then use it inside the macro. This is useful if you want to create custom wallets or providers but still want to use the macro to reduce boilerplate code. Below is an example of this approach. ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts.rs:contract_setup_macro_manual_wallet}} +{{#include ../../../e2e/tests/contracts.rs:contract_setup_macro_manual_wallet}} ``` diff --git a/docs/src/types/B512.md b/docs/src/types/B512.md index 8d53d5b436..fa4c801a51 100644 --- a/docs/src/types/B512.md +++ b/docs/src/types/B512.md @@ -9,5 +9,5 @@ In the Rust SDK, the `B512` definition matches the Sway standard library type wi Here's an example: ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:b512_example}} +{{#include ../../../e2e/tests/types_contracts.rs:b512_example}} ``` diff --git a/docs/src/types/bits256.md b/docs/src/types/bits256.md index 0a860e460e..be001b0e3b 100644 --- a/docs/src/types/bits256.md +++ b/docs/src/types/bits256.md @@ -5,7 +5,7 @@ In Fuel, a type called `b256` represents hashes and holds a 256-bit value. The R Here's an example: ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:256_arg}} +{{#include ../../../e2e/tests/types_contracts.rs:256_arg}} ``` If you have a hexadecimal value as a string and wish to convert it to `Bits256`, you may do so with `from_hex_str`: diff --git a/docs/src/types/bytes.md b/docs/src/types/bytes.md index 0b02e0efef..96fc2e9a54 100644 --- a/docs/src/types/bytes.md +++ b/docs/src/types/bytes.md @@ -3,7 +3,7 @@ In Fuel, a type called `Bytes` represents a collection of tightly-packed bytes. The Rust SDK represents `Bytes` as `Bytes(Vec)`. Here's an example of using `Bytes` in a contract call: ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:bytes_arg}} +{{#include ../../../e2e/tests/types_contracts.rs:bytes_arg}} ``` If you have a hexadecimal value as a string and wish to convert it to `Bytes`, you may do so with `from_hex_str`: diff --git a/docs/src/types/conversion.md b/docs/src/types/conversion.md index f11a7b8706..1fe84ec0b4 100644 --- a/docs/src/types/conversion.md +++ b/docs/src/types/conversion.md @@ -80,7 +80,7 @@ Convert a hex string to a `ContractId`: Convert a contract instance to a `ContractId`: ```rust,ignore -{{#include ../../../packages/fuels/tests/logs.rs:instance_to_contract_id}} +{{#include ../../../e2e/tests/logs.rs:instance_to_contract_id}} ``` ## Convert to `Identity` @@ -202,7 +202,7 @@ Convert a string to `Bytes`: Convert two hex strings to `B512`: ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:b512_example}} +{{#include ../../../e2e/tests/types_contracts.rs:b512_example}} ``` ## Convert to `EvmAddress` diff --git a/docs/src/types/custom_types.md b/docs/src/types/custom_types.md index c151db9f0c..c6c4b05560 100644 --- a/docs/src/types/custom_types.md +++ b/docs/src/types/custom_types.md @@ -17,7 +17,7 @@ struct CounterConfig { After using the `abigen!` macro, `CounterConfig` will be accessible in your Rust file! Here's an example: ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:struct_generation}} +{{#include ../../../e2e/tests/types_contracts.rs:struct_generation}} ``` You can freely use your custom types (structs or enums) within this scope. That also means passing custom types to functions and receiving custom types from function calls. @@ -57,7 +57,7 @@ impl MyContract for Contract { Your Rust code would look like this: ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:generic}} +{{#include ../../../e2e/tests/types_contracts.rs:generic}} ``` ### Unused generic type parameters diff --git a/docs/src/types/evm_address.md b/docs/src/types/evm_address.md index 4c4a1de43c..03e31559f1 100644 --- a/docs/src/types/evm_address.md +++ b/docs/src/types/evm_address.md @@ -9,7 +9,7 @@ In the Rust SDK, Ethereum Virtual Machine (EVM) addresses can be represented wit Here's an example: ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:evm_address_arg}} +{{#include ../../../e2e/tests/types_contracts.rs:evm_address_arg}} ``` > **Note:** when creating an `EvmAddress` from `Bits256`, the first 12 bytes will be cleared because an EVM address is only 20 bytes long. diff --git a/docs/src/types/string.md b/docs/src/types/string.md index 4e44dd59d5..2c73d460b0 100644 --- a/docs/src/types/string.md +++ b/docs/src/types/string.md @@ -17,5 +17,5 @@ To make working with `SizedAsciiString`s easier, you can use `try_into()` to con If your contract's method takes and returns, for instance, a Sway's `str[23]`. When using the SDK, this method will take and return a `SizedAsciiString<23>`, and you can pass a string to it like this: ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:contract_takes_string}} +{{#include ../../../e2e/tests/types_contracts.rs:contract_takes_string}} ``` diff --git a/docs/src/types/vectors.md b/docs/src/types/vectors.md index 498c1d974f..fb909f5216 100644 --- a/docs/src/types/vectors.md +++ b/docs/src/types/vectors.md @@ -5,7 +5,7 @@ You can pass a Rust `std::vec::Vec` into your contract method transparently. The following code calls a Sway contract method which accepts a `Vec>`. ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:passing_in_vec}} +{{#include ../../../e2e/tests/types_contracts.rs:passing_in_vec}} ``` You can use a vector just like you would use any other type -- e.g. a `[Vec; 2]` or a `SomeStruct>` etc. @@ -15,7 +15,7 @@ You can use a vector just like you would use any other type -- e.g. a `[Vec Returning vectors from contract methods is supported transparently, with the caveat that you cannot have them nested inside another type. This limitation is temporary. ```rust,ignore -{{#include ../../../packages/fuels/tests/types_contracts.rs:returning_vec}} +{{#include ../../../e2e/tests/types_contracts.rs:returning_vec}} ``` > **Note: you can still interact with contracts containing methods that return vectors nested inside another type, just not interact with the methods themselves** diff --git a/docs/src/wallets/signing.md b/docs/src/wallets/signing.md index 33f54fcfdd..4225e86612 100644 --- a/docs/src/wallets/signing.md +++ b/docs/src/wallets/signing.md @@ -23,5 +23,5 @@ Below is a full example of how to create a transaction builder and add signers t If you have a built transaction and want to add a signature, you can use the `sign_with` method. ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts.rs:tx_sign_with}} +{{#include ../../../e2e/tests/contracts.rs:tx_sign_with}} ``` diff --git a/e2e/Cargo.toml b/e2e/Cargo.toml new file mode 100644 index 0000000000..8a2d180fe2 --- /dev/null +++ b/e2e/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "e2e" +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +readme = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +rust-version = { workspace = true } +version = { workspace = true } +publish = false + +[dev-dependencies] +# used in test assertions +chrono = { workspace = true } +# TODO: [issue](https://github.com/FuelLabs/fuels-rs/issues/1375) needs to be removed, `ScriptTransaction` and `CreateTransaction` in `fuels` use `fuel_tx::Input` but don't reexport or convert it into a `fuels` owned type +fuel-tx = { workspace = true } +fuels = { workspace = true } +# TODO: [issue](https://github.com/FuelLabs/fuels-rs/issues/1376) because setup-program-test uses it but `fuels` did not reexport `rand` +rand = { workspace = true } +# used in test assertions +tai64 = { workspace = true } +tempfile = { workspace = true } +tokio = { workspace = true, features = ["test-util"] } + +[features] +default = ["fuels/default", "coin-cache"] +fuel-core-lib = ["fuels/fuel-core-lib"] +rocksdb = ["fuels/rocksdb"] +coin-cache = ["fuels/coin-cache"] +# TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked. +test-type-paths = [] diff --git a/e2e/Forc.toml b/e2e/Forc.toml new file mode 100644 index 0000000000..e6b21223f1 --- /dev/null +++ b/e2e/Forc.toml @@ -0,0 +1,114 @@ +[workspace] +members = [ + 'sway/bindings/sharing_types/contract_a', + 'sway/bindings/sharing_types/contract_b', + 'sway/bindings/sharing_types/shared_lib', + 'sway/bindings/simple_contract', + 'sway/bindings/type_paths', + 'sway/contracts/asserts', + 'sway/contracts/auth_testing_abi', + 'sway/contracts/auth_testing_contract', + 'sway/contracts/block_timestamp', + 'sway/contracts/configurables', + 'sway/contracts/contract_test', + 'sway/contracts/large_return_data', + 'sway/contracts/lib_contract', + 'sway/contracts/lib_contract_abi', + 'sway/contracts/lib_contract_caller', + 'sway/contracts/library_test', + 'sway/contracts/liquidity_pool', + 'sway/contracts/low_level_caller', + 'sway/contracts/msg_methods', + 'sway/contracts/multiple_read_calls', + 'sway/contracts/needs_custom_decoder', + 'sway/contracts/payable_annotation', + 'sway/contracts/require', + 'sway/contracts/revert_transaction_error', + 'sway/contracts/storage', + 'sway/contracts/token_ops', + 'sway/contracts/transaction_block_height', + 'sway/logs/contract_logs', + 'sway/logs/contract_logs_abi', + 'sway/logs/contract_with_contract_logs', + 'sway/logs/script_heap_logs', + 'sway/logs/script_logs', + 'sway/logs/script_needs_custom_decoder_logging', + 'sway/logs/script_with_contract_logs', + 'sway/predicates/basic_predicate', + 'sway/predicates/predicate_configurables', + 'sway/predicates/predicate_witnesses', + 'sway/predicates/signatures', + 'sway/predicates/swap', + 'sway/scripts/arguments', + 'sway/scripts/basic_script', + 'sway/scripts/require_from_contract', + 'sway/scripts/reverting', + 'sway/scripts/script_array', + 'sway/scripts/script_asserts', + 'sway/scripts/script_configurables', + 'sway/scripts/script_enum', + 'sway/scripts/script_needs_custom_decoder', + 'sway/scripts/script_require', + 'sway/scripts/script_struct', + 'sway/scripts/transfer_script', + 'sway/types/contracts/b256', + 'sway/types/contracts/b512', + 'sway/types/contracts/bytes', + 'sway/types/contracts/call_empty_return', + 'sway/types/contracts/complex_types_contract', + 'sway/types/contracts/empty_arguments', + 'sway/types/contracts/enum_as_input', + 'sway/types/contracts/enum_encoding', + 'sway/types/contracts/enum_inside_struct', + 'sway/types/contracts/evm_address', + 'sway/types/contracts/generics', + 'sway/types/contracts/heap_type_in_enums', + 'sway/types/contracts/heap_types', + 'sway/types/contracts/identity', + 'sway/types/contracts/native_types', + 'sway/types/contracts/nested_structs', + 'sway/types/contracts/options', + 'sway/types/contracts/raw_slice', + 'sway/types/contracts/results', + 'sway/types/contracts/std_lib_string', + 'sway/types/contracts/str_in_array', + 'sway/types/contracts/string_slice', + 'sway/types/contracts/tuples', + 'sway/types/contracts/two_structs', + 'sway/types/contracts/type_inside_enum', + 'sway/types/contracts/u128', + 'sway/types/contracts/u256', + 'sway/types/contracts/vector_output', + 'sway/types/contracts/vectors', + 'sway/types/predicates/address', + 'sway/types/predicates/enums', + 'sway/types/predicates/predicate_b256', + 'sway/types/predicates/predicate_bytes', + 'sway/types/predicates/predicate_bytes_hash', + 'sway/types/predicates/predicate_generics', + 'sway/types/predicates/predicate_raw_slice', + 'sway/types/predicates/predicate_std_lib_string', + 'sway/types/predicates/predicate_tuples', + 'sway/types/predicates/predicate_u128', + 'sway/types/predicates/predicate_u256', + 'sway/types/predicates/predicate_vector', + 'sway/types/predicates/predicate_vectors', + 'sway/types/predicates/structs', + 'sway/types/predicates/u64', + 'sway/types/scripts/options_results', + 'sway/types/scripts/script_b256', + 'sway/types/scripts/script_bytes', + 'sway/types/scripts/script_generics', + 'sway/types/scripts/script_heap_types', + #TODO: Decide what to do with this test project once + # https://github.com/FuelLabs/sway/issues/5727 is resolved + # 'sway/types/scripts/script_raw_slice', + 'sway/types/scripts/script_std_lib_string', + 'sway/types/scripts/script_tuples', + 'sway/types/scripts/script_u128', + 'sway/types/scripts/script_u256', + 'sway/types/scripts/script_vectors', +] + +[patch.'https://github.com/fuellabs/sway'] +std = { git = "https://github.com/fuellabs/sway", branch = "xunilrj/new-encoding-configurables" } diff --git a/packages/fuels/tests/bindings/sharing_types/contract_a/Forc.toml b/e2e/sway/bindings/sharing_types/contract_a/Forc.toml similarity index 100% rename from packages/fuels/tests/bindings/sharing_types/contract_a/Forc.toml rename to e2e/sway/bindings/sharing_types/contract_a/Forc.toml diff --git a/packages/fuels/tests/bindings/sharing_types/contract_a/src/main.sw b/e2e/sway/bindings/sharing_types/contract_a/src/main.sw similarity index 100% rename from packages/fuels/tests/bindings/sharing_types/contract_a/src/main.sw rename to e2e/sway/bindings/sharing_types/contract_a/src/main.sw diff --git a/packages/fuels/tests/bindings/sharing_types/contract_b/Forc.toml b/e2e/sway/bindings/sharing_types/contract_b/Forc.toml similarity index 100% rename from packages/fuels/tests/bindings/sharing_types/contract_b/Forc.toml rename to e2e/sway/bindings/sharing_types/contract_b/Forc.toml diff --git a/packages/fuels/tests/bindings/sharing_types/contract_b/src/main.sw b/e2e/sway/bindings/sharing_types/contract_b/src/main.sw similarity index 100% rename from packages/fuels/tests/bindings/sharing_types/contract_b/src/main.sw rename to e2e/sway/bindings/sharing_types/contract_b/src/main.sw diff --git a/packages/fuels/tests/bindings/sharing_types/shared_lib/Forc.toml b/e2e/sway/bindings/sharing_types/shared_lib/Forc.toml similarity index 100% rename from packages/fuels/tests/bindings/sharing_types/shared_lib/Forc.toml rename to e2e/sway/bindings/sharing_types/shared_lib/Forc.toml diff --git a/packages/fuels/tests/bindings/sharing_types/shared_lib/src/lib.sw b/e2e/sway/bindings/sharing_types/shared_lib/src/lib.sw similarity index 100% rename from packages/fuels/tests/bindings/sharing_types/shared_lib/src/lib.sw rename to e2e/sway/bindings/sharing_types/shared_lib/src/lib.sw diff --git a/packages/fuels/tests/bindings/simple_contract/Forc.toml b/e2e/sway/bindings/simple_contract/Forc.toml similarity index 100% rename from packages/fuels/tests/bindings/simple_contract/Forc.toml rename to e2e/sway/bindings/simple_contract/Forc.toml diff --git a/packages/fuels/tests/bindings/simple_contract/src/main.sw b/e2e/sway/bindings/simple_contract/src/main.sw similarity index 100% rename from packages/fuels/tests/bindings/simple_contract/src/main.sw rename to e2e/sway/bindings/simple_contract/src/main.sw diff --git a/packages/fuels/tests/bindings/type_paths/Forc.toml b/e2e/sway/bindings/type_paths/Forc.toml similarity index 100% rename from packages/fuels/tests/bindings/type_paths/Forc.toml rename to e2e/sway/bindings/type_paths/Forc.toml diff --git a/packages/fuels/tests/bindings/type_paths/src/another_lib.sw b/e2e/sway/bindings/type_paths/src/another_lib.sw similarity index 100% rename from packages/fuels/tests/bindings/type_paths/src/another_lib.sw rename to e2e/sway/bindings/type_paths/src/another_lib.sw diff --git a/packages/fuels/tests/bindings/type_paths/src/contract_a_types.sw b/e2e/sway/bindings/type_paths/src/contract_a_types.sw similarity index 100% rename from packages/fuels/tests/bindings/type_paths/src/contract_a_types.sw rename to e2e/sway/bindings/type_paths/src/contract_a_types.sw diff --git a/packages/fuels/tests/bindings/type_paths/src/main.sw b/e2e/sway/bindings/type_paths/src/main.sw similarity index 100% rename from packages/fuels/tests/bindings/type_paths/src/main.sw rename to e2e/sway/bindings/type_paths/src/main.sw diff --git a/packages/fuels/tests/contracts/asserts/Forc.toml b/e2e/sway/contracts/asserts/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/asserts/Forc.toml rename to e2e/sway/contracts/asserts/Forc.toml diff --git a/packages/fuels/tests/contracts/asserts/src/main.sw b/e2e/sway/contracts/asserts/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/asserts/src/main.sw rename to e2e/sway/contracts/asserts/src/main.sw diff --git a/packages/fuels/tests/contracts/auth_testing_abi/Forc.toml b/e2e/sway/contracts/auth_testing_abi/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/auth_testing_abi/Forc.toml rename to e2e/sway/contracts/auth_testing_abi/Forc.toml diff --git a/packages/fuels/tests/contracts/auth_testing_abi/src/main.sw b/e2e/sway/contracts/auth_testing_abi/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/auth_testing_abi/src/main.sw rename to e2e/sway/contracts/auth_testing_abi/src/main.sw diff --git a/packages/fuels/tests/contracts/auth_testing_contract/Forc.toml b/e2e/sway/contracts/auth_testing_contract/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/auth_testing_contract/Forc.toml rename to e2e/sway/contracts/auth_testing_contract/Forc.toml diff --git a/packages/fuels/tests/contracts/auth_testing_contract/src/main.sw b/e2e/sway/contracts/auth_testing_contract/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/auth_testing_contract/src/main.sw rename to e2e/sway/contracts/auth_testing_contract/src/main.sw diff --git a/packages/fuels/tests/contracts/block_timestamp/Forc.toml b/e2e/sway/contracts/block_timestamp/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/block_timestamp/Forc.toml rename to e2e/sway/contracts/block_timestamp/Forc.toml diff --git a/packages/fuels/tests/contracts/block_timestamp/src/main.sw b/e2e/sway/contracts/block_timestamp/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/block_timestamp/src/main.sw rename to e2e/sway/contracts/block_timestamp/src/main.sw diff --git a/packages/fuels/tests/contracts/configurables/Forc.toml b/e2e/sway/contracts/configurables/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/configurables/Forc.toml rename to e2e/sway/contracts/configurables/Forc.toml diff --git a/packages/fuels/tests/contracts/configurables/src/main.sw b/e2e/sway/contracts/configurables/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/configurables/src/main.sw rename to e2e/sway/contracts/configurables/src/main.sw diff --git a/packages/fuels/tests/contracts/contract_test/Forc.toml b/e2e/sway/contracts/contract_test/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/contract_test/Forc.toml rename to e2e/sway/contracts/contract_test/Forc.toml diff --git a/packages/fuels/tests/contracts/contract_test/src/main.sw b/e2e/sway/contracts/contract_test/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/contract_test/src/main.sw rename to e2e/sway/contracts/contract_test/src/main.sw diff --git a/packages/fuels/tests/contracts/large_return_data/Forc.toml b/e2e/sway/contracts/large_return_data/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/large_return_data/Forc.toml rename to e2e/sway/contracts/large_return_data/Forc.toml diff --git a/packages/fuels/tests/contracts/large_return_data/src/main.sw b/e2e/sway/contracts/large_return_data/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/large_return_data/src/main.sw rename to e2e/sway/contracts/large_return_data/src/main.sw diff --git a/packages/fuels/tests/contracts/lib_contract/Forc.toml b/e2e/sway/contracts/lib_contract/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/lib_contract/Forc.toml rename to e2e/sway/contracts/lib_contract/Forc.toml diff --git a/packages/fuels/tests/contracts/lib_contract/src/main.sw b/e2e/sway/contracts/lib_contract/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/lib_contract/src/main.sw rename to e2e/sway/contracts/lib_contract/src/main.sw diff --git a/packages/fuels/tests/contracts/lib_contract_abi/Forc.toml b/e2e/sway/contracts/lib_contract_abi/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/lib_contract_abi/Forc.toml rename to e2e/sway/contracts/lib_contract_abi/Forc.toml diff --git a/packages/fuels/tests/contracts/lib_contract_abi/src/main.sw b/e2e/sway/contracts/lib_contract_abi/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/lib_contract_abi/src/main.sw rename to e2e/sway/contracts/lib_contract_abi/src/main.sw diff --git a/packages/fuels/tests/contracts/lib_contract_caller/Forc.toml b/e2e/sway/contracts/lib_contract_caller/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/lib_contract_caller/Forc.toml rename to e2e/sway/contracts/lib_contract_caller/Forc.toml diff --git a/packages/fuels/tests/contracts/lib_contract_caller/src/main.sw b/e2e/sway/contracts/lib_contract_caller/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/lib_contract_caller/src/main.sw rename to e2e/sway/contracts/lib_contract_caller/src/main.sw diff --git a/packages/fuels/tests/contracts/library_test/Forc.toml b/e2e/sway/contracts/library_test/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/library_test/Forc.toml rename to e2e/sway/contracts/library_test/Forc.toml diff --git a/packages/fuels/tests/contracts/library_test/src/main.sw b/e2e/sway/contracts/library_test/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/library_test/src/main.sw rename to e2e/sway/contracts/library_test/src/main.sw diff --git a/packages/fuels/tests/contracts/liquidity_pool/Forc.toml b/e2e/sway/contracts/liquidity_pool/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/liquidity_pool/Forc.toml rename to e2e/sway/contracts/liquidity_pool/Forc.toml diff --git a/packages/fuels/tests/contracts/liquidity_pool/src/main.sw b/e2e/sway/contracts/liquidity_pool/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/liquidity_pool/src/main.sw rename to e2e/sway/contracts/liquidity_pool/src/main.sw diff --git a/packages/fuels/tests/contracts/low_level_caller/Forc.toml b/e2e/sway/contracts/low_level_caller/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/low_level_caller/Forc.toml rename to e2e/sway/contracts/low_level_caller/Forc.toml diff --git a/packages/fuels/tests/contracts/low_level_caller/src/main.sw b/e2e/sway/contracts/low_level_caller/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/low_level_caller/src/main.sw rename to e2e/sway/contracts/low_level_caller/src/main.sw diff --git a/packages/fuels/tests/contracts/msg_methods/Forc.toml b/e2e/sway/contracts/msg_methods/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/msg_methods/Forc.toml rename to e2e/sway/contracts/msg_methods/Forc.toml diff --git a/packages/fuels/tests/contracts/msg_methods/src/main.sw b/e2e/sway/contracts/msg_methods/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/msg_methods/src/main.sw rename to e2e/sway/contracts/msg_methods/src/main.sw diff --git a/packages/fuels/tests/contracts/multiple_read_calls/Forc.toml b/e2e/sway/contracts/multiple_read_calls/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/multiple_read_calls/Forc.toml rename to e2e/sway/contracts/multiple_read_calls/Forc.toml diff --git a/packages/fuels/tests/contracts/multiple_read_calls/src/main.sw b/e2e/sway/contracts/multiple_read_calls/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/multiple_read_calls/src/main.sw rename to e2e/sway/contracts/multiple_read_calls/src/main.sw diff --git a/packages/fuels/tests/contracts/needs_custom_decoder/Forc.toml b/e2e/sway/contracts/needs_custom_decoder/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/needs_custom_decoder/Forc.toml rename to e2e/sway/contracts/needs_custom_decoder/Forc.toml diff --git a/packages/fuels/tests/contracts/needs_custom_decoder/src/main.sw b/e2e/sway/contracts/needs_custom_decoder/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/needs_custom_decoder/src/main.sw rename to e2e/sway/contracts/needs_custom_decoder/src/main.sw diff --git a/packages/fuels/tests/contracts/payable_annotation/Forc.toml b/e2e/sway/contracts/payable_annotation/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/payable_annotation/Forc.toml rename to e2e/sway/contracts/payable_annotation/Forc.toml diff --git a/packages/fuels/tests/contracts/payable_annotation/src/main.sw b/e2e/sway/contracts/payable_annotation/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/payable_annotation/src/main.sw rename to e2e/sway/contracts/payable_annotation/src/main.sw diff --git a/packages/fuels/tests/contracts/require/Forc.toml b/e2e/sway/contracts/require/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/require/Forc.toml rename to e2e/sway/contracts/require/Forc.toml diff --git a/packages/fuels/tests/contracts/require/src/main.sw b/e2e/sway/contracts/require/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/require/src/main.sw rename to e2e/sway/contracts/require/src/main.sw diff --git a/packages/fuels/tests/contracts/revert_transaction_error/Forc.toml b/e2e/sway/contracts/revert_transaction_error/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/revert_transaction_error/Forc.toml rename to e2e/sway/contracts/revert_transaction_error/Forc.toml diff --git a/packages/fuels/tests/contracts/revert_transaction_error/src/main.sw b/e2e/sway/contracts/revert_transaction_error/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/revert_transaction_error/src/main.sw rename to e2e/sway/contracts/revert_transaction_error/src/main.sw diff --git a/packages/fuels/tests/contracts/storage/Forc.toml b/e2e/sway/contracts/storage/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/storage/Forc.toml rename to e2e/sway/contracts/storage/Forc.toml diff --git a/packages/fuels/tests/contracts/storage/src/main.sw b/e2e/sway/contracts/storage/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/storage/src/main.sw rename to e2e/sway/contracts/storage/src/main.sw diff --git a/packages/fuels/tests/contracts/token_ops/Forc.toml b/e2e/sway/contracts/token_ops/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/token_ops/Forc.toml rename to e2e/sway/contracts/token_ops/Forc.toml diff --git a/packages/fuels/tests/contracts/token_ops/src/main.sw b/e2e/sway/contracts/token_ops/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/token_ops/src/main.sw rename to e2e/sway/contracts/token_ops/src/main.sw diff --git a/packages/fuels/tests/contracts/transaction_block_height/Forc.toml b/e2e/sway/contracts/transaction_block_height/Forc.toml similarity index 100% rename from packages/fuels/tests/contracts/transaction_block_height/Forc.toml rename to e2e/sway/contracts/transaction_block_height/Forc.toml diff --git a/packages/fuels/tests/contracts/transaction_block_height/src/main.sw b/e2e/sway/contracts/transaction_block_height/src/main.sw similarity index 100% rename from packages/fuels/tests/contracts/transaction_block_height/src/main.sw rename to e2e/sway/contracts/transaction_block_height/src/main.sw diff --git a/packages/fuels/tests/logs/contract_logs/Forc.toml b/e2e/sway/logs/contract_logs/Forc.toml similarity index 100% rename from packages/fuels/tests/logs/contract_logs/Forc.toml rename to e2e/sway/logs/contract_logs/Forc.toml diff --git a/packages/fuels/tests/logs/contract_logs/src/main.sw b/e2e/sway/logs/contract_logs/src/main.sw similarity index 100% rename from packages/fuels/tests/logs/contract_logs/src/main.sw rename to e2e/sway/logs/contract_logs/src/main.sw diff --git a/packages/fuels/tests/logs/contract_logs_abi/Forc.toml b/e2e/sway/logs/contract_logs_abi/Forc.toml similarity index 100% rename from packages/fuels/tests/logs/contract_logs_abi/Forc.toml rename to e2e/sway/logs/contract_logs_abi/Forc.toml diff --git a/packages/fuels/tests/logs/contract_logs_abi/src/main.sw b/e2e/sway/logs/contract_logs_abi/src/main.sw similarity index 100% rename from packages/fuels/tests/logs/contract_logs_abi/src/main.sw rename to e2e/sway/logs/contract_logs_abi/src/main.sw diff --git a/packages/fuels/tests/logs/contract_with_contract_logs/Forc.toml b/e2e/sway/logs/contract_with_contract_logs/Forc.toml similarity index 100% rename from packages/fuels/tests/logs/contract_with_contract_logs/Forc.toml rename to e2e/sway/logs/contract_with_contract_logs/Forc.toml diff --git a/packages/fuels/tests/logs/contract_with_contract_logs/src/main.sw b/e2e/sway/logs/contract_with_contract_logs/src/main.sw similarity index 100% rename from packages/fuels/tests/logs/contract_with_contract_logs/src/main.sw rename to e2e/sway/logs/contract_with_contract_logs/src/main.sw diff --git a/packages/fuels/tests/logs/script_heap_logs/Forc.toml b/e2e/sway/logs/script_heap_logs/Forc.toml similarity index 100% rename from packages/fuels/tests/logs/script_heap_logs/Forc.toml rename to e2e/sway/logs/script_heap_logs/Forc.toml diff --git a/packages/fuels/tests/logs/script_heap_logs/src/main.sw b/e2e/sway/logs/script_heap_logs/src/main.sw similarity index 100% rename from packages/fuels/tests/logs/script_heap_logs/src/main.sw rename to e2e/sway/logs/script_heap_logs/src/main.sw diff --git a/packages/fuels/tests/logs/script_logs/Forc.toml b/e2e/sway/logs/script_logs/Forc.toml similarity index 100% rename from packages/fuels/tests/logs/script_logs/Forc.toml rename to e2e/sway/logs/script_logs/Forc.toml diff --git a/packages/fuels/tests/logs/script_logs/src/main.sw b/e2e/sway/logs/script_logs/src/main.sw similarity index 100% rename from packages/fuels/tests/logs/script_logs/src/main.sw rename to e2e/sway/logs/script_logs/src/main.sw diff --git a/packages/fuels/tests/logs/script_needs_custom_decoder_logging/Forc.toml b/e2e/sway/logs/script_needs_custom_decoder_logging/Forc.toml similarity index 100% rename from packages/fuels/tests/logs/script_needs_custom_decoder_logging/Forc.toml rename to e2e/sway/logs/script_needs_custom_decoder_logging/Forc.toml diff --git a/packages/fuels/tests/logs/script_needs_custom_decoder_logging/src/main.sw b/e2e/sway/logs/script_needs_custom_decoder_logging/src/main.sw similarity index 100% rename from packages/fuels/tests/logs/script_needs_custom_decoder_logging/src/main.sw rename to e2e/sway/logs/script_needs_custom_decoder_logging/src/main.sw diff --git a/packages/fuels/tests/logs/script_with_contract_logs/Forc.toml b/e2e/sway/logs/script_with_contract_logs/Forc.toml similarity index 100% rename from packages/fuels/tests/logs/script_with_contract_logs/Forc.toml rename to e2e/sway/logs/script_with_contract_logs/Forc.toml diff --git a/packages/fuels/tests/logs/script_with_contract_logs/src/main.sw b/e2e/sway/logs/script_with_contract_logs/src/main.sw similarity index 100% rename from packages/fuels/tests/logs/script_with_contract_logs/src/main.sw rename to e2e/sway/logs/script_with_contract_logs/src/main.sw diff --git a/packages/fuels/tests/predicates/basic_predicate/Forc.toml b/e2e/sway/predicates/basic_predicate/Forc.toml similarity index 100% rename from packages/fuels/tests/predicates/basic_predicate/Forc.toml rename to e2e/sway/predicates/basic_predicate/Forc.toml diff --git a/packages/fuels/tests/predicates/basic_predicate/src/main.sw b/e2e/sway/predicates/basic_predicate/src/main.sw similarity index 100% rename from packages/fuels/tests/predicates/basic_predicate/src/main.sw rename to e2e/sway/predicates/basic_predicate/src/main.sw diff --git a/packages/fuels/tests/predicates/predicate_configurables/Forc.toml b/e2e/sway/predicates/predicate_configurables/Forc.toml similarity index 100% rename from packages/fuels/tests/predicates/predicate_configurables/Forc.toml rename to e2e/sway/predicates/predicate_configurables/Forc.toml diff --git a/packages/fuels/tests/predicates/predicate_configurables/src/main.sw b/e2e/sway/predicates/predicate_configurables/src/main.sw similarity index 100% rename from packages/fuels/tests/predicates/predicate_configurables/src/main.sw rename to e2e/sway/predicates/predicate_configurables/src/main.sw diff --git a/packages/fuels/tests/predicates/predicate_witnesses/Forc.toml b/e2e/sway/predicates/predicate_witnesses/Forc.toml similarity index 100% rename from packages/fuels/tests/predicates/predicate_witnesses/Forc.toml rename to e2e/sway/predicates/predicate_witnesses/Forc.toml diff --git a/packages/fuels/tests/predicates/predicate_witnesses/src/main.sw b/e2e/sway/predicates/predicate_witnesses/src/main.sw similarity index 100% rename from packages/fuels/tests/predicates/predicate_witnesses/src/main.sw rename to e2e/sway/predicates/predicate_witnesses/src/main.sw diff --git a/packages/fuels/tests/predicates/signatures/Forc.toml b/e2e/sway/predicates/signatures/Forc.toml similarity index 100% rename from packages/fuels/tests/predicates/signatures/Forc.toml rename to e2e/sway/predicates/signatures/Forc.toml diff --git a/packages/fuels/tests/predicates/signatures/src/main.sw b/e2e/sway/predicates/signatures/src/main.sw similarity index 100% rename from packages/fuels/tests/predicates/signatures/src/main.sw rename to e2e/sway/predicates/signatures/src/main.sw diff --git a/packages/fuels/tests/predicates/swap/Forc.toml b/e2e/sway/predicates/swap/Forc.toml similarity index 100% rename from packages/fuels/tests/predicates/swap/Forc.toml rename to e2e/sway/predicates/swap/Forc.toml diff --git a/packages/fuels/tests/predicates/swap/src/main.sw b/e2e/sway/predicates/swap/src/main.sw similarity index 100% rename from packages/fuels/tests/predicates/swap/src/main.sw rename to e2e/sway/predicates/swap/src/main.sw diff --git a/packages/fuels/tests/scripts/arguments/Forc.toml b/e2e/sway/scripts/arguments/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/arguments/Forc.toml rename to e2e/sway/scripts/arguments/Forc.toml diff --git a/packages/fuels/tests/scripts/arguments/src/main.sw b/e2e/sway/scripts/arguments/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/arguments/src/main.sw rename to e2e/sway/scripts/arguments/src/main.sw diff --git a/packages/fuels/tests/scripts/basic_script/Forc.toml b/e2e/sway/scripts/basic_script/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/basic_script/Forc.toml rename to e2e/sway/scripts/basic_script/Forc.toml diff --git a/packages/fuels/tests/scripts/basic_script/src/main.sw b/e2e/sway/scripts/basic_script/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/basic_script/src/main.sw rename to e2e/sway/scripts/basic_script/src/main.sw diff --git a/packages/fuels/tests/scripts/require_from_contract/Forc.toml b/e2e/sway/scripts/require_from_contract/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/require_from_contract/Forc.toml rename to e2e/sway/scripts/require_from_contract/Forc.toml diff --git a/packages/fuels/tests/scripts/require_from_contract/src/main.sw b/e2e/sway/scripts/require_from_contract/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/require_from_contract/src/main.sw rename to e2e/sway/scripts/require_from_contract/src/main.sw diff --git a/e2e/sway/scripts/reverting/Forc.toml b/e2e/sway/scripts/reverting/Forc.toml new file mode 100644 index 0000000000..5500daf4b3 --- /dev/null +++ b/e2e/sway/scripts/reverting/Forc.toml @@ -0,0 +1,5 @@ +[project] +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" +name = "reverting" diff --git a/e2e/sway/scripts/reverting/src/main.sw b/e2e/sway/scripts/reverting/src/main.sw new file mode 100644 index 0000000000..b26952d90c --- /dev/null +++ b/e2e/sway/scripts/reverting/src/main.sw @@ -0,0 +1,5 @@ +script; + +fn main() { + assert(false) +} diff --git a/packages/fuels/tests/scripts/script_array/Forc.toml b/e2e/sway/scripts/script_array/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/script_array/Forc.toml rename to e2e/sway/scripts/script_array/Forc.toml diff --git a/packages/fuels/tests/scripts/script_array/src/main.sw b/e2e/sway/scripts/script_array/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/script_array/src/main.sw rename to e2e/sway/scripts/script_array/src/main.sw diff --git a/packages/fuels/tests/scripts/script_asserts/Forc.toml b/e2e/sway/scripts/script_asserts/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/script_asserts/Forc.toml rename to e2e/sway/scripts/script_asserts/Forc.toml diff --git a/packages/fuels/tests/scripts/script_asserts/src/main.sw b/e2e/sway/scripts/script_asserts/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/script_asserts/src/main.sw rename to e2e/sway/scripts/script_asserts/src/main.sw diff --git a/packages/fuels/tests/scripts/script_configurables/Forc.toml b/e2e/sway/scripts/script_configurables/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/script_configurables/Forc.toml rename to e2e/sway/scripts/script_configurables/Forc.toml diff --git a/packages/fuels/tests/scripts/script_configurables/src/main.sw b/e2e/sway/scripts/script_configurables/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/script_configurables/src/main.sw rename to e2e/sway/scripts/script_configurables/src/main.sw diff --git a/packages/fuels/tests/scripts/script_enum/Forc.toml b/e2e/sway/scripts/script_enum/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/script_enum/Forc.toml rename to e2e/sway/scripts/script_enum/Forc.toml diff --git a/packages/fuels/tests/scripts/script_enum/src/main.sw b/e2e/sway/scripts/script_enum/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/script_enum/src/main.sw rename to e2e/sway/scripts/script_enum/src/main.sw diff --git a/packages/fuels/tests/scripts/script_needs_custom_decoder/Forc.toml b/e2e/sway/scripts/script_needs_custom_decoder/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/script_needs_custom_decoder/Forc.toml rename to e2e/sway/scripts/script_needs_custom_decoder/Forc.toml diff --git a/packages/fuels/tests/scripts/script_needs_custom_decoder/src/main.sw b/e2e/sway/scripts/script_needs_custom_decoder/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/script_needs_custom_decoder/src/main.sw rename to e2e/sway/scripts/script_needs_custom_decoder/src/main.sw diff --git a/packages/fuels/tests/scripts/script_require/Forc.toml b/e2e/sway/scripts/script_require/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/script_require/Forc.toml rename to e2e/sway/scripts/script_require/Forc.toml diff --git a/packages/fuels/tests/scripts/script_require/src/main.sw b/e2e/sway/scripts/script_require/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/script_require/src/main.sw rename to e2e/sway/scripts/script_require/src/main.sw diff --git a/packages/fuels/tests/scripts/script_struct/Forc.toml b/e2e/sway/scripts/script_struct/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/script_struct/Forc.toml rename to e2e/sway/scripts/script_struct/Forc.toml diff --git a/packages/fuels/tests/scripts/script_struct/src/main.sw b/e2e/sway/scripts/script_struct/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/script_struct/src/main.sw rename to e2e/sway/scripts/script_struct/src/main.sw diff --git a/packages/fuels/tests/scripts/transfer_script/Forc.toml b/e2e/sway/scripts/transfer_script/Forc.toml similarity index 100% rename from packages/fuels/tests/scripts/transfer_script/Forc.toml rename to e2e/sway/scripts/transfer_script/Forc.toml diff --git a/packages/fuels/tests/scripts/transfer_script/src/main.sw b/e2e/sway/scripts/transfer_script/src/main.sw similarity index 100% rename from packages/fuels/tests/scripts/transfer_script/src/main.sw rename to e2e/sway/scripts/transfer_script/src/main.sw diff --git a/packages/fuels/tests/types/contracts/b256/Forc.toml b/e2e/sway/types/contracts/b256/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/b256/Forc.toml rename to e2e/sway/types/contracts/b256/Forc.toml diff --git a/packages/fuels/tests/types/contracts/b256/src/main.sw b/e2e/sway/types/contracts/b256/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/b256/src/main.sw rename to e2e/sway/types/contracts/b256/src/main.sw diff --git a/packages/fuels/tests/types/contracts/b512/Forc.toml b/e2e/sway/types/contracts/b512/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/b512/Forc.toml rename to e2e/sway/types/contracts/b512/Forc.toml diff --git a/packages/fuels/tests/types/contracts/b512/src/main.sw b/e2e/sway/types/contracts/b512/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/b512/src/main.sw rename to e2e/sway/types/contracts/b512/src/main.sw diff --git a/packages/fuels/tests/types/contracts/bytes/Forc.toml b/e2e/sway/types/contracts/bytes/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/bytes/Forc.toml rename to e2e/sway/types/contracts/bytes/Forc.toml diff --git a/packages/fuels/tests/types/contracts/bytes/src/main.sw b/e2e/sway/types/contracts/bytes/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/bytes/src/main.sw rename to e2e/sway/types/contracts/bytes/src/main.sw diff --git a/packages/fuels/tests/types/contracts/call_empty_return/Forc.toml b/e2e/sway/types/contracts/call_empty_return/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/call_empty_return/Forc.toml rename to e2e/sway/types/contracts/call_empty_return/Forc.toml diff --git a/packages/fuels/tests/types/contracts/call_empty_return/src/main.sw b/e2e/sway/types/contracts/call_empty_return/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/call_empty_return/src/main.sw rename to e2e/sway/types/contracts/call_empty_return/src/main.sw diff --git a/packages/fuels/tests/types/contracts/complex_types_contract/Forc.toml b/e2e/sway/types/contracts/complex_types_contract/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/complex_types_contract/Forc.toml rename to e2e/sway/types/contracts/complex_types_contract/Forc.toml diff --git a/packages/fuels/tests/types/contracts/complex_types_contract/src/main.sw b/e2e/sway/types/contracts/complex_types_contract/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/complex_types_contract/src/main.sw rename to e2e/sway/types/contracts/complex_types_contract/src/main.sw diff --git a/packages/fuels/tests/types/contracts/contract_output_test/Forc.toml b/e2e/sway/types/contracts/contract_output_test/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/contract_output_test/Forc.toml rename to e2e/sway/types/contracts/contract_output_test/Forc.toml diff --git a/packages/fuels/tests/types/contracts/contract_output_test/src/main.sw b/e2e/sway/types/contracts/contract_output_test/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/contract_output_test/src/main.sw rename to e2e/sway/types/contracts/contract_output_test/src/main.sw diff --git a/packages/fuels/tests/types/contracts/empty_arguments/Forc.toml b/e2e/sway/types/contracts/empty_arguments/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/empty_arguments/Forc.toml rename to e2e/sway/types/contracts/empty_arguments/Forc.toml diff --git a/packages/fuels/tests/types/contracts/empty_arguments/src/main.sw b/e2e/sway/types/contracts/empty_arguments/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/empty_arguments/src/main.sw rename to e2e/sway/types/contracts/empty_arguments/src/main.sw diff --git a/packages/fuels/tests/types/contracts/enum_as_input/Forc.toml b/e2e/sway/types/contracts/enum_as_input/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/enum_as_input/Forc.toml rename to e2e/sway/types/contracts/enum_as_input/Forc.toml diff --git a/packages/fuels/tests/types/contracts/enum_as_input/src/main.sw b/e2e/sway/types/contracts/enum_as_input/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/enum_as_input/src/main.sw rename to e2e/sway/types/contracts/enum_as_input/src/main.sw diff --git a/packages/fuels/tests/types/contracts/enum_encoding/Forc.toml b/e2e/sway/types/contracts/enum_encoding/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/enum_encoding/Forc.toml rename to e2e/sway/types/contracts/enum_encoding/Forc.toml diff --git a/packages/fuels/tests/types/contracts/enum_encoding/src/main.sw b/e2e/sway/types/contracts/enum_encoding/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/enum_encoding/src/main.sw rename to e2e/sway/types/contracts/enum_encoding/src/main.sw diff --git a/packages/fuels/tests/types/contracts/enum_inside_struct/Forc.toml b/e2e/sway/types/contracts/enum_inside_struct/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/enum_inside_struct/Forc.toml rename to e2e/sway/types/contracts/enum_inside_struct/Forc.toml diff --git a/packages/fuels/tests/types/contracts/enum_inside_struct/src/main.sw b/e2e/sway/types/contracts/enum_inside_struct/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/enum_inside_struct/src/main.sw rename to e2e/sway/types/contracts/enum_inside_struct/src/main.sw diff --git a/packages/fuels/tests/types/contracts/evm_address/Forc.toml b/e2e/sway/types/contracts/evm_address/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/evm_address/Forc.toml rename to e2e/sway/types/contracts/evm_address/Forc.toml diff --git a/packages/fuels/tests/types/contracts/evm_address/src/main.sw b/e2e/sway/types/contracts/evm_address/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/evm_address/src/main.sw rename to e2e/sway/types/contracts/evm_address/src/main.sw diff --git a/packages/fuels/tests/types/contracts/generics/Forc.toml b/e2e/sway/types/contracts/generics/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/generics/Forc.toml rename to e2e/sway/types/contracts/generics/Forc.toml diff --git a/packages/fuels/tests/types/contracts/generics/src/main.sw b/e2e/sway/types/contracts/generics/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/generics/src/main.sw rename to e2e/sway/types/contracts/generics/src/main.sw diff --git a/packages/fuels/tests/types/contracts/heap_type_in_enums/Forc.toml b/e2e/sway/types/contracts/heap_type_in_enums/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/heap_type_in_enums/Forc.toml rename to e2e/sway/types/contracts/heap_type_in_enums/Forc.toml diff --git a/packages/fuels/tests/types/contracts/heap_type_in_enums/src/main.sw b/e2e/sway/types/contracts/heap_type_in_enums/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/heap_type_in_enums/src/main.sw rename to e2e/sway/types/contracts/heap_type_in_enums/src/main.sw diff --git a/packages/fuels/tests/types/contracts/heap_types/Forc.toml b/e2e/sway/types/contracts/heap_types/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/heap_types/Forc.toml rename to e2e/sway/types/contracts/heap_types/Forc.toml diff --git a/packages/fuels/tests/types/contracts/heap_types/src/main.sw b/e2e/sway/types/contracts/heap_types/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/heap_types/src/main.sw rename to e2e/sway/types/contracts/heap_types/src/main.sw diff --git a/packages/fuels/tests/types/contracts/identity/Forc.toml b/e2e/sway/types/contracts/identity/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/identity/Forc.toml rename to e2e/sway/types/contracts/identity/Forc.toml diff --git a/packages/fuels/tests/types/contracts/identity/src/main.sw b/e2e/sway/types/contracts/identity/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/identity/src/main.sw rename to e2e/sway/types/contracts/identity/src/main.sw diff --git a/packages/fuels/tests/types/contracts/native_types/Forc.toml b/e2e/sway/types/contracts/native_types/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/native_types/Forc.toml rename to e2e/sway/types/contracts/native_types/Forc.toml diff --git a/packages/fuels/tests/types/contracts/native_types/src/main.sw b/e2e/sway/types/contracts/native_types/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/native_types/src/main.sw rename to e2e/sway/types/contracts/native_types/src/main.sw diff --git a/packages/fuels/tests/types/contracts/nested_structs/Forc.toml b/e2e/sway/types/contracts/nested_structs/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/nested_structs/Forc.toml rename to e2e/sway/types/contracts/nested_structs/Forc.toml diff --git a/packages/fuels/tests/types/contracts/nested_structs/src/main.sw b/e2e/sway/types/contracts/nested_structs/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/nested_structs/src/main.sw rename to e2e/sway/types/contracts/nested_structs/src/main.sw diff --git a/packages/fuels/tests/types/contracts/options/Forc.toml b/e2e/sway/types/contracts/options/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/options/Forc.toml rename to e2e/sway/types/contracts/options/Forc.toml diff --git a/packages/fuels/tests/types/contracts/options/src/main.sw b/e2e/sway/types/contracts/options/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/options/src/main.sw rename to e2e/sway/types/contracts/options/src/main.sw diff --git a/packages/fuels/tests/types/contracts/raw_slice/Forc.toml b/e2e/sway/types/contracts/raw_slice/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/raw_slice/Forc.toml rename to e2e/sway/types/contracts/raw_slice/Forc.toml diff --git a/packages/fuels/tests/types/contracts/raw_slice/src/main.sw b/e2e/sway/types/contracts/raw_slice/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/raw_slice/src/main.sw rename to e2e/sway/types/contracts/raw_slice/src/main.sw diff --git a/packages/fuels/tests/types/contracts/results/Forc.toml b/e2e/sway/types/contracts/results/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/results/Forc.toml rename to e2e/sway/types/contracts/results/Forc.toml diff --git a/packages/fuels/tests/types/contracts/results/src/main.sw b/e2e/sway/types/contracts/results/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/results/src/main.sw rename to e2e/sway/types/contracts/results/src/main.sw diff --git a/packages/fuels/tests/types/contracts/std_lib_string/Forc.toml b/e2e/sway/types/contracts/std_lib_string/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/std_lib_string/Forc.toml rename to e2e/sway/types/contracts/std_lib_string/Forc.toml diff --git a/packages/fuels/tests/types/contracts/std_lib_string/src/main.sw b/e2e/sway/types/contracts/std_lib_string/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/std_lib_string/src/main.sw rename to e2e/sway/types/contracts/std_lib_string/src/main.sw diff --git a/packages/fuels/tests/types/contracts/str_in_array/Forc.toml b/e2e/sway/types/contracts/str_in_array/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/str_in_array/Forc.toml rename to e2e/sway/types/contracts/str_in_array/Forc.toml diff --git a/packages/fuels/tests/types/contracts/str_in_array/src/main.sw b/e2e/sway/types/contracts/str_in_array/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/str_in_array/src/main.sw rename to e2e/sway/types/contracts/str_in_array/src/main.sw diff --git a/packages/fuels/tests/types/contracts/string_slice/Forc.toml b/e2e/sway/types/contracts/string_slice/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/string_slice/Forc.toml rename to e2e/sway/types/contracts/string_slice/Forc.toml diff --git a/packages/fuels/tests/types/contracts/string_slice/src/main.sw b/e2e/sway/types/contracts/string_slice/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/string_slice/src/main.sw rename to e2e/sway/types/contracts/string_slice/src/main.sw diff --git a/packages/fuels/tests/types/contracts/tuples/Forc.toml b/e2e/sway/types/contracts/tuples/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/tuples/Forc.toml rename to e2e/sway/types/contracts/tuples/Forc.toml diff --git a/packages/fuels/tests/types/contracts/tuples/src/main.sw b/e2e/sway/types/contracts/tuples/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/tuples/src/main.sw rename to e2e/sway/types/contracts/tuples/src/main.sw diff --git a/packages/fuels/tests/types/contracts/two_structs/Forc.toml b/e2e/sway/types/contracts/two_structs/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/two_structs/Forc.toml rename to e2e/sway/types/contracts/two_structs/Forc.toml diff --git a/packages/fuels/tests/types/contracts/two_structs/src/main.sw b/e2e/sway/types/contracts/two_structs/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/two_structs/src/main.sw rename to e2e/sway/types/contracts/two_structs/src/main.sw diff --git a/packages/fuels/tests/types/contracts/type_inside_enum/Forc.toml b/e2e/sway/types/contracts/type_inside_enum/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/type_inside_enum/Forc.toml rename to e2e/sway/types/contracts/type_inside_enum/Forc.toml diff --git a/packages/fuels/tests/types/contracts/type_inside_enum/src/main.sw b/e2e/sway/types/contracts/type_inside_enum/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/type_inside_enum/src/main.sw rename to e2e/sway/types/contracts/type_inside_enum/src/main.sw diff --git a/packages/fuels/tests/types/contracts/u128/Forc.toml b/e2e/sway/types/contracts/u128/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/u128/Forc.toml rename to e2e/sway/types/contracts/u128/Forc.toml diff --git a/packages/fuels/tests/types/contracts/u128/src/main.sw b/e2e/sway/types/contracts/u128/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/u128/src/main.sw rename to e2e/sway/types/contracts/u128/src/main.sw diff --git a/packages/fuels/tests/types/contracts/u256/Forc.toml b/e2e/sway/types/contracts/u256/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/u256/Forc.toml rename to e2e/sway/types/contracts/u256/Forc.toml diff --git a/packages/fuels/tests/types/contracts/u256/src/main.sw b/e2e/sway/types/contracts/u256/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/u256/src/main.sw rename to e2e/sway/types/contracts/u256/src/main.sw diff --git a/packages/fuels/tests/types/contracts/vector_output/Forc.toml b/e2e/sway/types/contracts/vector_output/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/vector_output/Forc.toml rename to e2e/sway/types/contracts/vector_output/Forc.toml diff --git a/packages/fuels/tests/types/contracts/vector_output/src/main.sw b/e2e/sway/types/contracts/vector_output/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/vector_output/src/main.sw rename to e2e/sway/types/contracts/vector_output/src/main.sw diff --git a/packages/fuels/tests/types/contracts/vectors/Forc.toml b/e2e/sway/types/contracts/vectors/Forc.toml similarity index 100% rename from packages/fuels/tests/types/contracts/vectors/Forc.toml rename to e2e/sway/types/contracts/vectors/Forc.toml diff --git a/packages/fuels/tests/types/contracts/vectors/src/data_structures.sw b/e2e/sway/types/contracts/vectors/src/data_structures.sw similarity index 100% rename from packages/fuels/tests/types/contracts/vectors/src/data_structures.sw rename to e2e/sway/types/contracts/vectors/src/data_structures.sw diff --git a/packages/fuels/tests/types/contracts/vectors/src/eq_impls.sw b/e2e/sway/types/contracts/vectors/src/eq_impls.sw similarity index 100% rename from packages/fuels/tests/types/contracts/vectors/src/eq_impls.sw rename to e2e/sway/types/contracts/vectors/src/eq_impls.sw diff --git a/packages/fuels/tests/types/contracts/vectors/src/main.sw b/e2e/sway/types/contracts/vectors/src/main.sw similarity index 100% rename from packages/fuels/tests/types/contracts/vectors/src/main.sw rename to e2e/sway/types/contracts/vectors/src/main.sw diff --git a/packages/fuels/tests/types/contracts/vectors/src/utils.sw b/e2e/sway/types/contracts/vectors/src/utils.sw similarity index 100% rename from packages/fuels/tests/types/contracts/vectors/src/utils.sw rename to e2e/sway/types/contracts/vectors/src/utils.sw diff --git a/packages/fuels/tests/types/predicates/address/Forc.toml b/e2e/sway/types/predicates/address/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/address/Forc.toml rename to e2e/sway/types/predicates/address/Forc.toml diff --git a/packages/fuels/tests/types/predicates/address/src/main.sw b/e2e/sway/types/predicates/address/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/address/src/main.sw rename to e2e/sway/types/predicates/address/src/main.sw diff --git a/packages/fuels/tests/types/predicates/enums/Forc.toml b/e2e/sway/types/predicates/enums/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/enums/Forc.toml rename to e2e/sway/types/predicates/enums/Forc.toml diff --git a/packages/fuels/tests/types/predicates/enums/src/main.sw b/e2e/sway/types/predicates/enums/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/enums/src/main.sw rename to e2e/sway/types/predicates/enums/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_b256/Forc.toml b/e2e/sway/types/predicates/predicate_b256/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_b256/Forc.toml rename to e2e/sway/types/predicates/predicate_b256/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_b256/src/main.sw b/e2e/sway/types/predicates/predicate_b256/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_b256/src/main.sw rename to e2e/sway/types/predicates/predicate_b256/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_bytes/Forc.toml b/e2e/sway/types/predicates/predicate_bytes/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_bytes/Forc.toml rename to e2e/sway/types/predicates/predicate_bytes/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_bytes/src/main.sw b/e2e/sway/types/predicates/predicate_bytes/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_bytes/src/main.sw rename to e2e/sway/types/predicates/predicate_bytes/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_bytes_hash/Forc.toml b/e2e/sway/types/predicates/predicate_bytes_hash/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_bytes_hash/Forc.toml rename to e2e/sway/types/predicates/predicate_bytes_hash/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_bytes_hash/src/main.sw b/e2e/sway/types/predicates/predicate_bytes_hash/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_bytes_hash/src/main.sw rename to e2e/sway/types/predicates/predicate_bytes_hash/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_generics/Forc.toml b/e2e/sway/types/predicates/predicate_generics/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_generics/Forc.toml rename to e2e/sway/types/predicates/predicate_generics/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_generics/src/main.sw b/e2e/sway/types/predicates/predicate_generics/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_generics/src/main.sw rename to e2e/sway/types/predicates/predicate_generics/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_raw_slice/Forc.toml b/e2e/sway/types/predicates/predicate_raw_slice/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_raw_slice/Forc.toml rename to e2e/sway/types/predicates/predicate_raw_slice/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_raw_slice/src/main.sw b/e2e/sway/types/predicates/predicate_raw_slice/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_raw_slice/src/main.sw rename to e2e/sway/types/predicates/predicate_raw_slice/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_std_lib_string/Forc.toml b/e2e/sway/types/predicates/predicate_std_lib_string/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_std_lib_string/Forc.toml rename to e2e/sway/types/predicates/predicate_std_lib_string/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_std_lib_string/src/main.sw b/e2e/sway/types/predicates/predicate_std_lib_string/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_std_lib_string/src/main.sw rename to e2e/sway/types/predicates/predicate_std_lib_string/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_tuples/Forc.toml b/e2e/sway/types/predicates/predicate_tuples/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_tuples/Forc.toml rename to e2e/sway/types/predicates/predicate_tuples/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_tuples/src/main.sw b/e2e/sway/types/predicates/predicate_tuples/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_tuples/src/main.sw rename to e2e/sway/types/predicates/predicate_tuples/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_u128/Forc.toml b/e2e/sway/types/predicates/predicate_u128/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_u128/Forc.toml rename to e2e/sway/types/predicates/predicate_u128/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_u128/src/main.sw b/e2e/sway/types/predicates/predicate_u128/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_u128/src/main.sw rename to e2e/sway/types/predicates/predicate_u128/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_u256/Forc.toml b/e2e/sway/types/predicates/predicate_u256/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_u256/Forc.toml rename to e2e/sway/types/predicates/predicate_u256/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_u256/src/main.sw b/e2e/sway/types/predicates/predicate_u256/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_u256/src/main.sw rename to e2e/sway/types/predicates/predicate_u256/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_vector/Forc.toml b/e2e/sway/types/predicates/predicate_vector/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_vector/Forc.toml rename to e2e/sway/types/predicates/predicate_vector/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_vector/src/main.sw b/e2e/sway/types/predicates/predicate_vector/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_vector/src/main.sw rename to e2e/sway/types/predicates/predicate_vector/src/main.sw diff --git a/packages/fuels/tests/types/predicates/predicate_vectors/Forc.toml b/e2e/sway/types/predicates/predicate_vectors/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_vectors/Forc.toml rename to e2e/sway/types/predicates/predicate_vectors/Forc.toml diff --git a/packages/fuels/tests/types/predicates/predicate_vectors/src/main.sw b/e2e/sway/types/predicates/predicate_vectors/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/predicate_vectors/src/main.sw rename to e2e/sway/types/predicates/predicate_vectors/src/main.sw diff --git a/packages/fuels/tests/types/predicates/structs/Forc.toml b/e2e/sway/types/predicates/structs/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/structs/Forc.toml rename to e2e/sway/types/predicates/structs/Forc.toml diff --git a/packages/fuels/tests/types/predicates/structs/src/main.sw b/e2e/sway/types/predicates/structs/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/structs/src/main.sw rename to e2e/sway/types/predicates/structs/src/main.sw diff --git a/packages/fuels/tests/types/predicates/u64/Forc.toml b/e2e/sway/types/predicates/u64/Forc.toml similarity index 100% rename from packages/fuels/tests/types/predicates/u64/Forc.toml rename to e2e/sway/types/predicates/u64/Forc.toml diff --git a/packages/fuels/tests/types/predicates/u64/src/main.sw b/e2e/sway/types/predicates/u64/src/main.sw similarity index 100% rename from packages/fuels/tests/types/predicates/u64/src/main.sw rename to e2e/sway/types/predicates/u64/src/main.sw diff --git a/packages/fuels/tests/types/scripts/options_results/Forc.toml b/e2e/sway/types/scripts/options_results/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/options_results/Forc.toml rename to e2e/sway/types/scripts/options_results/Forc.toml diff --git a/packages/fuels/tests/types/scripts/options_results/src/main.sw b/e2e/sway/types/scripts/options_results/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/options_results/src/main.sw rename to e2e/sway/types/scripts/options_results/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_b256/Forc.toml b/e2e/sway/types/scripts/script_b256/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_b256/Forc.toml rename to e2e/sway/types/scripts/script_b256/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_b256/src/main.sw b/e2e/sway/types/scripts/script_b256/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_b256/src/main.sw rename to e2e/sway/types/scripts/script_b256/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_bytes/Forc.toml b/e2e/sway/types/scripts/script_bytes/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_bytes/Forc.toml rename to e2e/sway/types/scripts/script_bytes/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_bytes/src/main.sw b/e2e/sway/types/scripts/script_bytes/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_bytes/src/main.sw rename to e2e/sway/types/scripts/script_bytes/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_generics/Forc.toml b/e2e/sway/types/scripts/script_generics/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_generics/Forc.toml rename to e2e/sway/types/scripts/script_generics/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_generics/src/main.sw b/e2e/sway/types/scripts/script_generics/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_generics/src/main.sw rename to e2e/sway/types/scripts/script_generics/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_heap_types/Forc.toml b/e2e/sway/types/scripts/script_heap_types/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_heap_types/Forc.toml rename to e2e/sway/types/scripts/script_heap_types/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_heap_types/src/main.sw b/e2e/sway/types/scripts/script_heap_types/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_heap_types/src/main.sw rename to e2e/sway/types/scripts/script_heap_types/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_raw_slice/Forc.toml b/e2e/sway/types/scripts/script_raw_slice/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_raw_slice/Forc.toml rename to e2e/sway/types/scripts/script_raw_slice/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_raw_slice/src/main.sw b/e2e/sway/types/scripts/script_raw_slice/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_raw_slice/src/main.sw rename to e2e/sway/types/scripts/script_raw_slice/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_std_lib_string/Forc.toml b/e2e/sway/types/scripts/script_std_lib_string/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_std_lib_string/Forc.toml rename to e2e/sway/types/scripts/script_std_lib_string/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_std_lib_string/src/main.sw b/e2e/sway/types/scripts/script_std_lib_string/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_std_lib_string/src/main.sw rename to e2e/sway/types/scripts/script_std_lib_string/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_tuples/Forc.toml b/e2e/sway/types/scripts/script_tuples/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_tuples/Forc.toml rename to e2e/sway/types/scripts/script_tuples/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_tuples/src/main.sw b/e2e/sway/types/scripts/script_tuples/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_tuples/src/main.sw rename to e2e/sway/types/scripts/script_tuples/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_u128/Forc.toml b/e2e/sway/types/scripts/script_u128/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_u128/Forc.toml rename to e2e/sway/types/scripts/script_u128/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_u128/src/main.sw b/e2e/sway/types/scripts/script_u128/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_u128/src/main.sw rename to e2e/sway/types/scripts/script_u128/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_u256/Forc.toml b/e2e/sway/types/scripts/script_u256/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_u256/Forc.toml rename to e2e/sway/types/scripts/script_u256/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_u256/src/main.sw b/e2e/sway/types/scripts/script_u256/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_u256/src/main.sw rename to e2e/sway/types/scripts/script_u256/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_vectors/Forc.toml b/e2e/sway/types/scripts/script_vectors/Forc.toml similarity index 100% rename from packages/fuels/tests/types/scripts/script_vectors/Forc.toml rename to e2e/sway/types/scripts/script_vectors/Forc.toml diff --git a/packages/fuels/tests/types/scripts/script_vectors/src/data_structures.sw b/e2e/sway/types/scripts/script_vectors/src/data_structures.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_vectors/src/data_structures.sw rename to e2e/sway/types/scripts/script_vectors/src/data_structures.sw diff --git a/packages/fuels/tests/types/scripts/script_vectors/src/eq_impls.sw b/e2e/sway/types/scripts/script_vectors/src/eq_impls.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_vectors/src/eq_impls.sw rename to e2e/sway/types/scripts/script_vectors/src/eq_impls.sw diff --git a/packages/fuels/tests/types/scripts/script_vectors/src/main.sw b/e2e/sway/types/scripts/script_vectors/src/main.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_vectors/src/main.sw rename to e2e/sway/types/scripts/script_vectors/src/main.sw diff --git a/packages/fuels/tests/types/scripts/script_vectors/src/utils.sw b/e2e/sway/types/scripts/script_vectors/src/utils.sw similarity index 100% rename from packages/fuels/tests/types/scripts/script_vectors/src/utils.sw rename to e2e/sway/types/scripts/script_vectors/src/utils.sw diff --git a/packages/fuels/tests/bindings.rs b/e2e/tests/bindings.rs similarity index 95% rename from packages/fuels/tests/bindings.rs rename to e2e/tests/bindings.rs index 3533fefa48..a3e013bca9 100644 --- a/packages/fuels/tests/bindings.rs +++ b/e2e/tests/bindings.rs @@ -13,7 +13,7 @@ async fn compile_bindings_from_contract_file() { Wallets("wallet"), Abigen(Contract( name = "SimpleContract", - project = "packages/fuels/tests/bindings/simple_contract" + project = "e2e/sway/bindings/simple_contract" )), Deploy( name = "simple_contract_instance", @@ -91,11 +91,11 @@ async fn shared_types() -> Result<()> { Abigen( Contract( name = "ContractA", - project = "packages/fuels/tests/bindings/sharing_types/contract_a" + project = "e2e/sway/bindings/sharing_types/contract_a" ), Contract( name = "ContractB", - project = "packages/fuels/tests/bindings/sharing_types/contract_b" + project = "e2e/sway/bindings/sharing_types/contract_b" ), ), Deploy( @@ -208,7 +208,7 @@ async fn type_paths_respected() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "ContractA", - project = "packages/fuels/tests/bindings/type_paths" + project = "e2e/sway/bindings/type_paths" )), Deploy( name = "contract_a_instance", diff --git a/packages/fuels/tests/configurables.rs b/e2e/tests/configurables.rs similarity index 86% rename from packages/fuels/tests/configurables.rs rename to e2e/tests/configurables.rs index b329979fd5..fa3b1affc4 100644 --- a/packages/fuels/tests/configurables.rs +++ b/e2e/tests/configurables.rs @@ -1,20 +1,20 @@ use fuels::{ + core::codec::EncoderConfig, prelude::*, types::{Bits256, SizedAsciiString, U256}, }; -use fuels_core::codec::EncoderConfig; #[tokio::test] async fn contract_default_configurables() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/configurables/out/release/configurables-abi.json" + abi = "e2e/sway/contracts/configurables/out/release/configurables-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; let contract_id = Contract::load_from( - "tests/contracts/configurables/out/release/configurables.bin", + "sway/contracts/configurables/out/release/configurables.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -57,7 +57,7 @@ async fn script_default_configurables() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/scripts/script_configurables" + project = "e2e/sway/scripts/script_configurables" )), LoadScript( name = "script_instance", @@ -96,7 +96,7 @@ async fn contract_configurables() -> Result<()> { // ANCHOR: contract_configurables abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/configurables/out/release/configurables-abi.json" + abi = "e2e/sway/contracts/configurables/out/release/configurables-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; @@ -123,7 +123,7 @@ async fn contract_configurables() -> Result<()> { .with_ENUM(new_enum.clone())?; let contract_id = Contract::load_from( - "tests/contracts/configurables/out/release/configurables.bin", + "sway/contracts/configurables/out/release/configurables.bin", LoadConfiguration::default().with_configurables(configurables), )? .deploy(&wallet, TxPolicies::default()) @@ -161,11 +161,13 @@ async fn contract_configurables() -> Result<()> { #[tokio::test] async fn script_configurables() -> Result<()> { // ANCHOR: script_configurables - abigen!(Script(name="MyScript", abi="packages/fuels/tests/scripts/script_configurables/out/release/script_configurables-abi.json")); + abigen!(Script( + name = "MyScript", + abi = "e2e/sway/scripts/script_configurables/out/release/script_configurables-abi.json" + )); let wallet = launch_provider_and_get_wallet().await?; - let bin_path = - "../fuels/tests/scripts/script_configurables/out/release/script_configurables.bin"; + let bin_path = "sway/scripts/script_configurables/out/release/script_configurables.bin"; let instance = MyScript::new(wallet, bin_path); let str_4: SizedAsciiString<4> = "FUEL".try_into()?; @@ -221,7 +223,10 @@ async fn script_configurables() -> Result<()> { #[tokio::test] async fn configurable_encoder_config_is_applied() { - abigen!(Script(name="MyScript", abi="packages/fuels/tests/scripts/script_configurables/out/release/script_configurables-abi.json")); + abigen!(Script( + name = "MyScript", + abi = "e2e/sway/scripts/script_configurables/out/release/script_configurables-abi.json" + )); let new_struct = StructWithGeneric { field_1: 16u8, diff --git a/packages/fuels/tests/contracts.rs b/e2e/tests/contracts.rs similarity index 93% rename from packages/fuels/tests/contracts.rs rename to e2e/tests/contracts.rs index 602bff4266..ec78407fc5 100644 --- a/packages/fuels/tests/contracts.rs +++ b/e2e/tests/contracts.rs @@ -1,7 +1,7 @@ -use fuel_tx::ContractParameters; use fuels::{ core::codec::{calldata, encode_fn_selector, DecoderConfig, EncoderConfig}, prelude::*, + tx::ContractParameters, types::{errors::transaction::Reason, Bits256, Identity}, }; @@ -11,7 +11,7 @@ async fn test_multiple_args() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -43,11 +43,11 @@ async fn test_contract_calling_contract() -> Result<()> { Abigen( Contract( name = "LibContract", - project = "packages/fuels/tests/contracts/lib_contract" + project = "e2e/sway/contracts/lib_contract" ), Contract( name = "LibContractCaller", - project = "packages/fuels/tests/contracts/lib_contract_caller" + project = "e2e/sway/contracts/lib_contract_caller" ), ), Deploy( @@ -114,7 +114,7 @@ async fn test_reverting_transaction() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "RevertContract", - project = "packages/fuels/tests/contracts/revert_transaction_error" + project = "e2e/sway/contracts/revert_transaction_error" )), Deploy( name = "contract_instance", @@ -143,7 +143,7 @@ async fn test_multiple_read_calls() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "MultiReadContract", - project = "packages/fuels/tests/contracts/multiple_read_calls" + project = "e2e/sway/contracts/multiple_read_calls" )), Deploy( name = "contract_instance", @@ -174,7 +174,7 @@ async fn test_multi_call_beginner() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -207,7 +207,7 @@ async fn test_multi_call_pro() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -262,7 +262,7 @@ async fn test_contract_call_fee_estimation() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -299,7 +299,7 @@ async fn contract_call_has_same_estimated_and_used_gas() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -334,7 +334,7 @@ async fn mult_call_has_same_estimated_and_used_gas() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -372,7 +372,7 @@ async fn contract_method_call_respects_maturity() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "BlockHeightContract", - project = "packages/fuels/tests/contracts/transaction_block_height" + project = "e2e/sway/contracts/transaction_block_height" )), Deploy( name = "contract_instance", @@ -407,7 +407,7 @@ async fn test_auth_msg_sender_from_sdk() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "AuthContract", - project = "packages/fuels/tests/contracts/auth_testing_contract" + project = "e2e/sway/contracts/auth_testing_contract" )), Deploy( name = "contract_instance", @@ -433,7 +433,7 @@ async fn test_large_return_data() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/large_return_data" + project = "e2e/sway/contracts/large_return_data" )), Deploy( name = "contract_instance", @@ -490,7 +490,7 @@ async fn can_handle_function_called_new() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -513,11 +513,11 @@ async fn test_contract_setup_macro_deploy_with_salt() -> Result<()> { Abigen( Contract( name = "LibContract", - project = "packages/fuels/tests/contracts/lib_contract" + project = "e2e/sway/contracts/lib_contract" ), Contract( name = "LibContractCaller", - project = "packages/fuels/tests/contracts/lib_contract_caller" + project = "e2e/sway/contracts/lib_contract_caller" ), ), Deploy( @@ -574,7 +574,7 @@ async fn test_wallet_getter() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -601,7 +601,7 @@ async fn test_connect_wallet() -> Result<()> { setup_program_test!( Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -655,7 +655,7 @@ async fn setup_output_variable_estimation_test() -> Result<( let wallets = launch_custom_provider_and_get_wallets(wallet_config, None, None).await?; let contract_id = Contract::load_from( - "tests/contracts/token_ops/out/release/token_ops.bin", + "sway/contracts/token_ops/out/release/token_ops.bin", LoadConfiguration::default(), )? .deploy(&wallets[0], TxPolicies::default()) @@ -676,7 +676,7 @@ async fn setup_output_variable_estimation_test() -> Result<( async fn test_output_variable_estimation() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/token_ops/out/release/token_ops-abi.json" + abi = "e2e/sway/contracts/token_ops/out/release/token_ops-abi.json" )); let (wallets, addresses, mint_asset_id, contract_id) = @@ -734,7 +734,7 @@ async fn test_output_variable_estimation() -> Result<()> { async fn test_output_variable_estimation_default_attempts() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/token_ops/out/release/token_ops-abi.json" + abi = "e2e/sway/contracts/token_ops/out/release/token_ops-abi.json" )); let (wallets, addresses, mint_asset_id, contract_id) = @@ -763,7 +763,7 @@ async fn test_output_variable_estimation_default_attempts() -> Result<()> { async fn test_output_variable_estimation_multicall() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/token_ops/out/release/token_ops-abi.json" + abi = "e2e/sway/contracts/token_ops/out/release/token_ops-abi.json" )); let (wallets, addresses, mint_asset_id, contract_id) = @@ -821,7 +821,7 @@ async fn test_contract_instance_get_balances() -> Result<()> { setup_program_test!( Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -865,7 +865,7 @@ async fn contract_call_futures_implement_send() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -892,11 +892,11 @@ async fn test_contract_set_estimation() -> Result<()> { Abigen( Contract( name = "LibContract", - project = "packages/fuels/tests/contracts/lib_contract" + project = "e2e/sway/contracts/lib_contract" ), Contract( name = "LibContractCaller", - project = "packages/fuels/tests/contracts/lib_contract_caller" + project = "e2e/sway/contracts/lib_contract_caller" ), ), Deploy( @@ -948,15 +948,15 @@ async fn test_output_variable_contract_id_estimation_multicall() -> Result<()> { Abigen( Contract( name = "LibContract", - project = "packages/fuels/tests/contracts/lib_contract" + project = "e2e/sway/contracts/lib_contract" ), Contract( name = "LibContractCaller", - project = "packages/fuels/tests/contracts/lib_contract_caller" + project = "e2e/sway/contracts/lib_contract_caller" ), Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" ), ), Deploy( @@ -1040,7 +1040,7 @@ async fn test_contract_call_with_non_default_max_input() -> Result<()> { setup_program_test!( Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -1090,7 +1090,7 @@ async fn test_add_custom_assets() -> Result<()> { setup_program_test!( Abigen(Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -1127,7 +1127,7 @@ async fn test_add_custom_assets() -> Result<()> { #[tokio::test] async fn contract_load_error_messages() { { - let binary_path = "tests/contracts/contract_test/out/release/no_file_on_path.bin"; + let binary_path = "sway/contracts/contract_test/out/release/no_file_on_path.bin"; let expected_error = format!("io: file \"{binary_path}\" does not exist"); let error = Contract::load_from(binary_path, LoadConfiguration::default()) @@ -1136,7 +1136,7 @@ async fn contract_load_error_messages() { assert_eq!(error.to_string(), expected_error); } { - let binary_path = "tests/contracts/contract_test/out/release/contract_test-abi.json"; + let binary_path = "sway/contracts/contract_test/out/release/contract_test-abi.json"; let expected_error = format!("expected \"{binary_path}\" to have '.bin' extension"); let error = Contract::load_from(binary_path, LoadConfiguration::default()) @@ -1152,7 +1152,7 @@ async fn test_payable_annotation() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/payable_annotation" + project = "e2e/sway/contracts/payable_annotation" )), Deploy( name = "contract_instance", @@ -1201,7 +1201,7 @@ async fn multi_call_from_calls_with_different_account_types() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let wallet = WalletUnlocked::new_random(None); @@ -1233,11 +1233,11 @@ async fn low_level_call() -> Result<()> { Abigen( Contract( name = "MyCallerContract", - project = "packages/fuels/tests/contracts/low_level_caller" + project = "e2e/sway/contracts/low_level_caller" ), Contract( name = "MyTargetContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" ), ), Deploy( @@ -1445,7 +1445,7 @@ async fn can_configure_decoding_of_contract_return() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/needs_custom_decoder" + project = "e2e/sway/contracts/needs_custom_decoder" ),), Deploy( contract = "MyContract", @@ -1506,7 +1506,7 @@ async fn test_contract_submit_and_response() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -1548,11 +1548,11 @@ async fn test_heap_type_multicall() -> Result<()> { Abigen( Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" ), Contract( name = "VectorOutputContract", - project = "packages/fuels/tests/types/contracts/vector_output" + project = "e2e/sway/types/contracts/vector_output" ) ), Deploy( @@ -1597,14 +1597,14 @@ async fn heap_types_correctly_offset_in_create_transactions_w_storage_slots() -> Wallets("wallet"), Abigen(Predicate( name = "MyPredicate", - project = "packages/fuels/tests/types/predicates/predicate_vector" + project = "e2e/sway/types/predicates/predicate_vector" ),), ); let provider = wallet.try_provider()?.clone(); let data = MyPredicateEncoder::default().encode_data(18, 24, vec![2, 4, 42])?; let predicate = Predicate::load_from( - "tests/types/predicates/predicate_vector/out/release/predicate_vector.bin", + "sway/types/predicates/predicate_vector/out/release/predicate_vector.bin", )? .with_data(data) .with_provider(provider); @@ -1622,7 +1622,7 @@ async fn heap_types_correctly_offset_in_create_transactions_w_storage_slots() -> // the offsets were setup correctly since the predicate uses heap types in its arguments. // Storage slots were loaded automatically by default Contract::load_from( - "tests/contracts/storage/out/release/storage.bin", + "sway/contracts/storage/out/release/storage.bin", LoadConfiguration::default(), )? .deploy(&predicate, TxPolicies::default()) @@ -1638,11 +1638,11 @@ async fn test_arguments_with_gas_forwarded() -> Result<()> { Abigen( Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" ), Contract( name = "VectorOutputContract", - project = "packages/fuels/tests/types/contracts/vectors" + project = "e2e/sway/types/contracts/vectors" ) ), Deploy( @@ -1701,7 +1701,7 @@ async fn contract_custom_call_build_without_signatures() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -1744,12 +1744,12 @@ async fn contract_encoder_config_is_applied() -> Result<()> { setup_program_test!( Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Wallets("wallet") ); let contract_id = Contract::load_from( - "tests/contracts/contract_test/out/release/contract_test.bin", + "sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -1805,7 +1805,7 @@ async fn test_reentrant_calls() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "LibContractCaller", - project = "packages/fuels/tests/contracts/lib_contract_caller" + project = "e2e/sway/contracts/lib_contract_caller" ),), Deploy( name = "contract_caller_instance", @@ -1846,7 +1846,7 @@ async fn msg_sender_gas_estimation_issue() { setup_program_test!( Abigen(Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/msg_methods" + project = "e2e/sway/contracts/msg_methods" )), Deploy( contract = "MyContract", diff --git a/packages/fuels/tests/from_token.rs b/e2e/tests/from_token.rs similarity index 100% rename from packages/fuels/tests/from_token.rs rename to e2e/tests/from_token.rs diff --git a/packages/fuels/tests/imports.rs b/e2e/tests/imports.rs similarity index 100% rename from packages/fuels/tests/imports.rs rename to e2e/tests/imports.rs diff --git a/packages/fuels/tests/logs.rs b/e2e/tests/logs.rs similarity index 93% rename from packages/fuels/tests/logs.rs rename to e2e/tests/logs.rs index 801e93e60b..6d5f06d711 100644 --- a/packages/fuels/tests/logs.rs +++ b/e2e/tests/logs.rs @@ -1,7 +1,7 @@ use fuels::{ core::codec::DecoderConfig, prelude::*, - types::{errors::transaction::Reason, Bits256, SizedAsciiString}, + types::{errors::transaction::Reason, AsciiString, Bits256, SizedAsciiString}, }; #[tokio::test] @@ -10,7 +10,7 @@ async fn test_parse_logged_variables() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "LogContract", - project = "packages/fuels/tests/logs/contract_logs" + project = "e2e/sway/logs/contract_logs" )), Deploy( name = "contract_instance", @@ -48,7 +48,7 @@ async fn test_parse_logs_values() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "LogContract", - project = "packages/fuels/tests/logs/contract_logs" + project = "e2e/sway/logs/contract_logs" )), Deploy( name = "contract_instance", @@ -82,7 +82,7 @@ async fn test_parse_logs_custom_types() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "LogContract", - project = "packages/fuels/tests/logs/contract_logs" + project = "e2e/sway/logs/contract_logs" )), Deploy( name = "contract_instance", @@ -122,7 +122,7 @@ async fn test_parse_logs_generic_types() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "LogContract", - project = "packages/fuels/tests/logs/contract_logs" + project = "e2e/sway/logs/contract_logs" )), Deploy( name = "contract_instance", @@ -174,7 +174,7 @@ async fn test_decode_logs() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "LogContract", - project = "packages/fuels/tests/logs/contract_logs" + project = "e2e/sway/logs/contract_logs" )), Deploy( name = "contract_instance", @@ -228,7 +228,7 @@ async fn test_decode_logs_with_no_logs() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -255,7 +255,7 @@ async fn test_multi_call_log_single_contract() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "LogContract", - project = "packages/fuels/tests/logs/contract_logs" + project = "e2e/sway/logs/contract_logs" )), Deploy( name = "contract_instance", @@ -305,7 +305,7 @@ async fn test_multi_call_log_multiple_contracts() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "LogContract", - project = "packages/fuels/tests/logs/contract_logs" + project = "e2e/sway/logs/contract_logs" )), Deploy( name = "contract_instance", @@ -357,13 +357,10 @@ async fn test_multi_call_contract_with_contract_logs() -> Result<()> { setup_program_test!( Wallets("wallet"), Abigen( - Contract( - name = "MyContract", - project = "packages/fuels/tests/logs/contract_logs" - ), + Contract(name = "MyContract", project = "e2e/sway/logs/contract_logs"), Contract( name = "ContractCaller", - project = "packages/fuels/tests/logs/contract_with_contract_logs" + project = "e2e/sway/logs/contract_with_contract_logs" ) ), Deploy( @@ -379,7 +376,7 @@ async fn test_multi_call_contract_with_contract_logs() -> Result<()> { ); let contract_id = Contract::load_from( - "../../packages/fuels/tests/logs/contract_logs/out/release/contract_logs.bin", + "./sway/logs/contract_logs/out/release/contract_logs.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -437,7 +434,7 @@ async fn test_require_log() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "RequireContract", - project = "packages/fuels/tests/contracts/require" + project = "e2e/sway/contracts/require" )), Deploy( name = "contract_instance", @@ -484,7 +481,7 @@ async fn test_multi_call_require_log_single_contract() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "RequireContract", - project = "packages/fuels/tests/contracts/require" + project = "e2e/sway/contracts/require" )), Deploy( name = "contract_instance", @@ -555,7 +552,7 @@ async fn test_multi_call_require_log_multi_contract() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "RequireContract", - project = "packages/fuels/tests/contracts/require" + project = "e2e/sway/contracts/require" )), Deploy( name = "contract_instance", @@ -632,11 +629,11 @@ async fn test_script_decode_logs() -> Result<()> { // ANCHOR: script_logs abigen!(Script( name = "log_script", - abi = "packages/fuels/tests/logs/script_logs/out/release/script_logs-abi.json" + abi = "e2e/sway/logs/script_logs/out/release/script_logs-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; - let bin_path = "../fuels/tests/logs/script_logs/out/release/script_logs.bin"; + let bin_path = "sway/logs/script_logs/out/release/script_logs.bin"; let instance = log_script::new(wallet.clone(), bin_path); let response = instance.main().call().await?; @@ -699,13 +696,10 @@ async fn test_contract_with_contract_logs() -> Result<()> { setup_program_test!( Wallets("wallet"), Abigen( - Contract( - name = "MyContract", - project = "packages/fuels/tests/logs/contract_logs", - ), + Contract(name = "MyContract", project = "e2e/sway/logs/contract_logs",), Contract( name = "ContractCaller", - project = "packages/fuels/tests/logs/contract_with_contract_logs", + project = "e2e/sway/logs/contract_with_contract_logs", ) ), Deploy( @@ -716,7 +710,7 @@ async fn test_contract_with_contract_logs() -> Result<()> { ); let contract_id = Contract::load_from( - "../../packages/fuels/tests/logs/contract_logs/out/release/contract_logs.bin", + "./sway/logs/contract_logs/out/release/contract_logs.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -750,13 +744,10 @@ async fn test_script_logs_with_contract_logs() -> Result<()> { setup_program_test!( Wallets("wallet"), Abigen( - Contract( - name = "MyContract", - project = "packages/fuels/tests/logs/contract_logs", - ), + Contract(name = "MyContract", project = "e2e/sway/logs/contract_logs",), Script( name = "LogScript", - project = "packages/fuels/tests/logs/script_with_contract_logs" + project = "e2e/sway/logs/script_with_contract_logs" ) ), Deploy( @@ -830,7 +821,7 @@ async fn test_script_decode_logs_with_type() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "LogScript", - project = "packages/fuels/tests/logs/script_logs" + project = "e2e/sway/logs/script_logs" )), LoadScript( name = "script_instance", @@ -907,7 +898,7 @@ async fn test_script_require_log() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "LogScript", - project = "packages/fuels/tests/scripts/script_require" + project = "e2e/sway/scripts/script_require" )), LoadScript( name = "script_instance", @@ -957,11 +948,11 @@ async fn test_contract_require_from_contract() -> Result<()> { Abigen( Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/lib_contract", + project = "e2e/sway/contracts/lib_contract", ), Contract( name = "ContractCaller", - project = "packages/fuels/tests/contracts/lib_contract_caller", + project = "e2e/sway/contracts/lib_contract_caller", ) ), Deploy( @@ -972,7 +963,7 @@ async fn test_contract_require_from_contract() -> Result<()> { ); let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/lib_contract/out/release/lib_contract.bin", + "./sway/contracts/lib_contract/out/release/lib_contract.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -1000,15 +991,15 @@ async fn test_multi_call_contract_require_from_contract() -> Result<()> { Abigen( Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/lib_contract", + project = "e2e/sway/contracts/lib_contract", ), Contract( name = "ContractLogs", - project = "packages/fuels/tests/logs/contract_logs", + project = "e2e/sway/logs/contract_logs", ), Contract( name = "ContractCaller", - project = "packages/fuels/tests/contracts/lib_contract_caller", + project = "e2e/sway/contracts/lib_contract_caller", ) ), Deploy( @@ -1024,7 +1015,7 @@ async fn test_multi_call_contract_require_from_contract() -> Result<()> { ); let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/lib_contract/out/release/lib_contract.bin", + "./sway/contracts/lib_contract/out/release/lib_contract.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -1062,11 +1053,11 @@ async fn test_script_require_from_contract() -> Result<()> { Abigen( Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/lib_contract", + project = "e2e/sway/contracts/lib_contract", ), Script( name = "LogScript", - project = "packages/fuels/tests/scripts/require_from_contract" + project = "e2e/sway/scripts/require_from_contract" ) ), Deploy( @@ -1104,7 +1095,7 @@ async fn test_contract_asserts_log() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "LogContract", - project = "packages/fuels/tests/contracts/asserts" + project = "e2e/sway/contracts/asserts" )), Deploy( name = "contract_instance", @@ -1197,7 +1188,7 @@ async fn test_script_asserts_log() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "LogScript", - project = "packages/fuels/tests/scripts/script_asserts" + project = "e2e/sway/scripts/script_asserts" )), LoadScript( name = "script_instance", @@ -1296,7 +1287,7 @@ async fn contract_token_ops_error_messages() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/token_ops" + project = "e2e/sway/contracts/token_ops" )), Deploy( name = "contract_instance", @@ -1336,7 +1327,7 @@ async fn test_log_results() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "MyContract", - project = "packages/fuels/tests/logs/contract_logs" + project = "e2e/sway/logs/contract_logs" ),), Deploy( contract = "MyContract", @@ -1374,7 +1365,7 @@ async fn can_configure_decoder_for_contract_log_decoding() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/needs_custom_decoder" + project = "e2e/sway/contracts/needs_custom_decoder" ),), Deploy( contract = "MyContract", @@ -1464,7 +1455,7 @@ async fn can_configure_decoder_for_script_log_decoding() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "LogScript", - project = "packages/fuels/tests/logs/script_needs_custom_decoder_logging" + project = "e2e/sway/logs/script_needs_custom_decoder_logging" )), LoadScript( name = "script_instance", @@ -1514,13 +1505,11 @@ async fn can_configure_decoder_for_script_log_decoding() -> Result<()> { #[tokio::test] async fn contract_heap_log() -> Result<()> { - use fuels_core::types::AsciiString; - setup_program_test!( Wallets("wallet"), Abigen(Contract( name = "MyContract", - project = "packages/fuels/tests/logs/contract_logs" + project = "e2e/sway/logs/contract_logs" ),), Deploy( contract = "MyContract", @@ -1572,13 +1561,11 @@ async fn contract_heap_log() -> Result<()> { #[tokio::test] async fn script_heap_log() -> Result<()> { - use fuels_core::types::AsciiString; - setup_program_test!( Wallets("wallet"), Abigen(Script( name = "LogScript", - project = "packages/fuels/tests/logs/script_heap_logs" + project = "e2e/sway/logs/script_heap_logs" )), LoadScript( name = "script_instance", diff --git a/packages/fuels/tests/predicates.rs b/e2e/tests/predicates.rs similarity index 88% rename from packages/fuels/tests/predicates.rs rename to e2e/tests/predicates.rs index c3fac47f3c..480cc91c80 100644 --- a/packages/fuels/tests/predicates.rs +++ b/e2e/tests/predicates.rs @@ -117,7 +117,7 @@ async fn transfer_coins_and_messages_to_predicate() -> Result<()> { wallet.set_provider(provider.clone()); let predicate = - Predicate::load_from("tests/predicates/basic_predicate/out/release/basic_predicate.bin")? + Predicate::load_from("sway/predicates/basic_predicate/out/release/basic_predicate.bin")? .with_provider(provider.clone()); wallet @@ -138,14 +138,13 @@ async fn transfer_coins_and_messages_to_predicate() -> Result<()> { async fn spend_predicate_coins_messages_basic() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = - "packages/fuels/tests/predicates/basic_predicate/out/release/basic_predicate-abi.json" + abi = "e2e/sway/predicates/basic_predicate/out/release/basic_predicate-abi.json" )); let predicate_data = MyPredicateEncoder::default().encode_data(4097, 4097)?; let mut predicate: Predicate = - Predicate::load_from("tests/predicates/basic_predicate/out/release/basic_predicate.bin")? + Predicate::load_from("sway/predicates/basic_predicate/out/release/basic_predicate.bin")? .with_data(predicate_data); let num_coins = 4; @@ -185,18 +184,18 @@ async fn pay_with_predicate() -> Result<()> { abigen!( Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" ), Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/u64/out/release/u64-abi.json" + abi = "e2e/sway/types/predicates/u64/out/release/u64-abi.json" ) ); let predicate_data = MyPredicateEncoder::default().encode_data(32768)?; let mut predicate: Predicate = - Predicate::load_from("tests/types/predicates/u64/out/release/u64.bin")? + Predicate::load_from("sway/types/predicates/u64/out/release/u64.bin")? .with_data(predicate_data); let num_coins = 4; @@ -208,7 +207,7 @@ async fn pay_with_predicate() -> Result<()> { predicate.set_provider(provider.clone()); let contract_id = Contract::load_from( - "tests/contracts/contract_test/out/release/contract_test.bin", + "sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&predicate, TxPolicies::default()) @@ -248,19 +247,19 @@ async fn pay_with_predicate_vector_data() -> Result<()> { abigen!( Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" ), Predicate( - name = "MyPredicate", - abi = - "packages/fuels/tests/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" + name = "MyPredicate", + abi = + "e2e/sway/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" ) ); let predicate_data = MyPredicateEncoder::default().encode_data(12, 30, vec![2, 4, 42])?; let mut predicate: Predicate = Predicate::load_from( - "tests/types/predicates/predicate_vector/out/release/predicate_vector.bin", + "sway/types/predicates/predicate_vector/out/release/predicate_vector.bin", )? .with_data(predicate_data); @@ -273,7 +272,7 @@ async fn pay_with_predicate_vector_data() -> Result<()> { predicate.set_provider(provider.clone()); let contract_id = Contract::load_from( - "tests/contracts/contract_test/out/release/contract_test.bin", + "sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&predicate, TxPolicies::default()) @@ -312,14 +311,13 @@ async fn pay_with_predicate_vector_data() -> Result<()> { async fn predicate_contract_transfer() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = - "packages/fuels/tests/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" + abi = "e2e/sway/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" )); let predicate_data = MyPredicateEncoder::default().encode_data(2, 40, vec![2, 4, 42])?; let mut predicate: Predicate = Predicate::load_from( - "tests/types/predicates/predicate_vector/out/release/predicate_vector.bin", + "sway/types/predicates/predicate_vector/out/release/predicate_vector.bin", )? .with_data(predicate_data); @@ -332,7 +330,7 @@ async fn predicate_contract_transfer() -> Result<()> { predicate.set_provider(provider.clone()); let contract_id = Contract::load_from( - "tests/contracts/contract_test/out/release/contract_test.bin", + "sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&predicate, TxPolicies::default()) @@ -369,14 +367,13 @@ async fn predicate_transfer_to_base_layer() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = - "packages/fuels/tests/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" + abi = "e2e/sway/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" )); let predicate_data = MyPredicateEncoder::default().encode_data(22, 20, vec![2, 4, 42])?; let mut predicate: Predicate = Predicate::load_from( - "tests/types/predicates/predicate_vector/out/release/predicate_vector.bin", + "sway/types/predicates/predicate_vector/out/release/predicate_vector.bin", )? .with_data(predicate_data); @@ -416,14 +413,13 @@ async fn predicate_transfer_to_base_layer() -> Result<()> { async fn predicate_transfer_with_signed_resources() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = - "packages/fuels/tests/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" + abi = "e2e/sway/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" )); let predicate_data = MyPredicateEncoder::default().encode_data(2, 40, vec![2, 4, 42])?; let mut predicate: Predicate = Predicate::load_from( - "tests/types/predicates/predicate_vector/out/release/predicate_vector.bin", + "sway/types/predicates/predicate_vector/out/release/predicate_vector.bin", )? .with_data(predicate_data); @@ -496,19 +492,19 @@ async fn contract_tx_and_call_params_with_predicate() -> Result<()> { abigen!( Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" ), Predicate( - name = "MyPredicate", - abi = - "packages/fuels/tests/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" + name = "MyPredicate", + abi = + "e2e/sway/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" ) ); let predicate_data = MyPredicateEncoder::default().encode_data(22, 20, vec![2, 4, 42])?; let mut predicate: Predicate = Predicate::load_from( - "tests/types/predicates/predicate_vector/out/release/predicate_vector.bin", + "sway/types/predicates/predicate_vector/out/release/predicate_vector.bin", )? .with_data(predicate_data); @@ -521,7 +517,7 @@ async fn contract_tx_and_call_params_with_predicate() -> Result<()> { predicate.set_provider(provider.clone()); let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "./sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&predicate, TxPolicies::default()) @@ -571,19 +567,19 @@ async fn diff_asset_predicate_payment() -> Result<()> { abigen!( Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" ), Predicate( - name = "MyPredicate", - abi = - "packages/fuels/tests/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" + name = "MyPredicate", + abi = + "e2e/sway/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" ) ); let predicate_data = MyPredicateEncoder::default().encode_data(28, 14, vec![2, 4, 42])?; let mut predicate: Predicate = Predicate::load_from( - "tests/types/predicates/predicate_vector/out/release/predicate_vector.bin", + "sway/types/predicates/predicate_vector/out/release/predicate_vector.bin", )? .with_data(predicate_data); @@ -596,7 +592,7 @@ async fn diff_asset_predicate_payment() -> Result<()> { predicate.set_provider(provider.clone()); let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "./sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&predicate, TxPolicies::default()) @@ -621,7 +617,7 @@ async fn diff_asset_predicate_payment() -> Result<()> { async fn predicate_default_configurables() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/predicates/predicate_configurables/out/release/predicate_configurables-abi.json" + abi = "e2e/sway/predicates/predicate_configurables/out/release/predicate_configurables-abi.json" )); let new_struct = StructWithGeneric { @@ -634,7 +630,7 @@ async fn predicate_default_configurables() -> Result<()> { MyPredicateEncoder::default().encode_data(true, 8, new_struct, new_enum)?; let mut predicate: Predicate = Predicate::load_from( - "tests/predicates/predicate_configurables/out/release/predicate_configurables.bin", + "sway/predicates/predicate_configurables/out/release/predicate_configurables.bin", )? .with_data(predicate_data); @@ -675,7 +671,7 @@ async fn predicate_configurables() -> Result<()> { // ANCHOR: predicate_configurables abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/predicates/predicate_configurables/out/release/predicate_configurables-abi.json" + abi = "e2e/sway/predicates/predicate_configurables/out/release/predicate_configurables-abi.json" )); let new_struct = StructWithGeneric { @@ -693,7 +689,7 @@ async fn predicate_configurables() -> Result<()> { MyPredicateEncoder::default().encode_data(true, 8u8, new_struct, new_enum)?; let mut predicate: Predicate = Predicate::load_from( - "tests/predicates/predicate_configurables/out/release/predicate_configurables.bin", + "sway/predicates/predicate_configurables/out/release/predicate_configurables.bin", )? .with_data(predicate_data) .with_configurables(configurables); @@ -735,14 +731,13 @@ async fn predicate_configurables() -> Result<()> { async fn predicate_adjust_fee_persists_message_w_data() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = - "packages/fuels/tests/predicates/basic_predicate/out/release/basic_predicate-abi.json" + abi = "e2e/sway/predicates/basic_predicate/out/release/basic_predicate-abi.json" )); let predicate_data = MyPredicateEncoder::default().encode_data(4097, 4097)?; let mut predicate: Predicate = - Predicate::load_from("tests/predicates/basic_predicate/out/release/basic_predicate.bin")? + Predicate::load_from("sway/predicates/basic_predicate/out/release/basic_predicate.bin")? .with_data(predicate_data); let amount = 1000; @@ -775,14 +770,13 @@ async fn predicate_adjust_fee_persists_message_w_data() -> Result<()> { async fn predicate_transfer_non_base_asset() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = - "packages/fuels/tests/predicates/basic_predicate/out/release/basic_predicate-abi.json" + abi = "e2e/sway/predicates/basic_predicate/out/release/basic_predicate-abi.json" )); let predicate_data = MyPredicateEncoder::default().encode_data(32, 32)?; let mut predicate: Predicate = - Predicate::load_from("tests/predicates/basic_predicate/out/release/basic_predicate.bin")? + Predicate::load_from("sway/predicates/basic_predicate/out/release/basic_predicate.bin")? .with_data(predicate_data); let mut wallet = WalletUnlocked::new_random(None); @@ -838,13 +832,13 @@ async fn predicate_transfer_non_base_asset() -> Result<()> { async fn predicate_can_access_manually_added_witnesses() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/predicates/predicate_witnesses/out/release/predicate_witnesses-abi.json" + abi = "e2e/sway/predicates/predicate_witnesses/out/release/predicate_witnesses-abi.json" )); let predicate_data = MyPredicateEncoder::default().encode_data(0, 1)?; let mut predicate: Predicate = Predicate::load_from( - "tests/predicates/predicate_witnesses/out/release/predicate_witnesses.bin", + "sway/predicates/predicate_witnesses/out/release/predicate_witnesses.bin", )? .with_data(predicate_data); @@ -904,13 +898,13 @@ async fn predicate_can_access_manually_added_witnesses() -> Result<()> { async fn tx_id_not_changed_after_adding_witnesses() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/predicates/predicate_witnesses/out/release/predicate_witnesses-abi.json" + abi = "e2e/sway/predicates/predicate_witnesses/out/release/predicate_witnesses-abi.json" )); let predicate_data = MyPredicateEncoder::default().encode_data(0, 1)?; let mut predicate: Predicate = Predicate::load_from( - "tests/predicates/predicate_witnesses/out/release/predicate_witnesses.bin", + "sway/predicates/predicate_witnesses/out/release/predicate_witnesses.bin", )? .with_data(predicate_data); @@ -958,8 +952,7 @@ async fn tx_id_not_changed_after_adding_witnesses() -> Result<()> { async fn predicate_encoder_config_is_applied() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = - "packages/fuels/tests/predicates/basic_predicate/out/release/basic_predicate-abi.json" + abi = "e2e/sway/predicates/basic_predicate/out/release/basic_predicate-abi.json" )); { let _encoding_ok = MyPredicateEncoder::default() @@ -1014,11 +1007,9 @@ async fn predicate_validation() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = - "packages/fuels/tests/predicates/basic_predicate/out/release/basic_predicate-abi.json" + abi = "e2e/sway/predicates/basic_predicate/out/release/basic_predicate-abi.json" )); - let code_path = - "../../packages/fuels/tests/predicates/basic_predicate/out/release/basic_predicate.bin"; + let code_path = "./sway/predicates/basic_predicate/out/release/basic_predicate.bin"; // the predicate evaluates to true if the two arguments are equal let correct_predicate_data = MyPredicateEncoder::default().encode_data(4096, 4096)?; diff --git a/packages/fuels/tests/providers.rs b/e2e/tests/providers.rs similarity index 94% rename from packages/fuels/tests/providers.rs rename to e2e/tests/providers.rs index 1fa744b230..695dddcc95 100644 --- a/packages/fuels/tests/providers.rs +++ b/e2e/tests/providers.rs @@ -1,7 +1,6 @@ use std::ops::Add; use chrono::{DateTime, Duration, TimeZone, Utc}; -use fuel_core::chain_config::StateConfig; use fuels::{ accounts::Account, client::{PageDirection, PaginationRequest}, @@ -22,7 +21,7 @@ use fuels::{ async fn test_provider_launch_and_connect() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let mut wallet = WalletUnlocked::new_random(None); @@ -37,7 +36,7 @@ async fn test_provider_launch_and_connect() -> Result<()> { wallet.set_provider(provider.clone()); let contract_id = Contract::load_from( - "tests/contracts/contract_test/out/release/contract_test.bin", + "sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -68,7 +67,7 @@ async fn test_provider_launch_and_connect() -> Result<()> { async fn test_network_error() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let mut wallet = WalletUnlocked::new_random(None); @@ -85,7 +84,7 @@ async fn test_network_error() -> Result<()> { service.stop().await.unwrap(); let response = Contract::load_from( - "tests/contracts/contract_test/out/release/contract_test.bin", + "sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -127,7 +126,7 @@ async fn test_input_message() -> Result<()> { setup_program_test!( Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -172,11 +171,11 @@ async fn test_input_message_pays_fee() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let contract_id = Contract::load_from( - "tests/contracts/contract_test/out/release/contract_test.bin", + "sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -279,7 +278,7 @@ async fn can_retrieve_latest_block_time() -> Result<()> { #[tokio::test] async fn contract_deployment_respects_maturity() -> Result<()> { - abigen!(Contract(name="MyContract", abi="packages/fuels/tests/contracts/transaction_block_height/out/release/transaction_block_height-abi.json")); + abigen!(Contract(name="MyContract", abi="e2e/sway/contracts/transaction_block_height/out/release/transaction_block_height-abi.json")); let wallets = launch_custom_provider_and_get_wallets(WalletsConfig::default(), None, None).await?; @@ -288,7 +287,7 @@ async fn contract_deployment_respects_maturity() -> Result<()> { let deploy_w_maturity = |maturity| { Contract::load_from( - "tests/contracts/transaction_block_height/out/release/transaction_block_height.bin", + "sway/contracts/transaction_block_height/out/release/transaction_block_height.bin", LoadConfiguration::default(), ) .map(|loaded_contract| { @@ -319,7 +318,7 @@ async fn test_gas_forwarded_defaults_to_tx_limit() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -357,7 +356,7 @@ async fn test_amount_and_asset_forwarding() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TokenContract", - project = "packages/fuels/tests/contracts/token_ops" + project = "e2e/sway/contracts/token_ops" )), Deploy( name = "contract_instance", @@ -468,7 +467,7 @@ async fn test_gas_errors() -> Result<()> { setup_program_test!( Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -520,7 +519,7 @@ async fn test_call_param_gas_errors() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -562,7 +561,7 @@ async fn test_get_gas_used() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -709,7 +708,7 @@ async fn test_sway_timestamp() -> Result<()> { setup_program_test!( Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/block_timestamp" + project = "e2e/sway/contracts/block_timestamp" )), Deploy( name = "contract_instance", @@ -766,8 +765,6 @@ async fn create_transfer( #[cfg(feature = "coin-cache")] #[tokio::test] async fn test_caching() -> Result<()> { - use fuels_core::types::tx_status::TxStatus; - let amount = 1000; let num_coins = 10; let mut wallets = launch_custom_provider_and_get_wallets( @@ -806,7 +803,7 @@ async fn test_caching() -> Result<()> { #[cfg(feature = "coin-cache")] async fn create_revert_tx(wallet: &WalletUnlocked) -> Result { - use fuel_core_types::fuel_asm::Opcode; + let script = std::fs::read("sway/scripts/reverting/out/release/reverting.bin")?; let amount = 1; let asset_id = AssetId::zeroed(); @@ -814,7 +811,7 @@ async fn create_revert_tx(wallet: &WalletUnlocked) -> Result let outputs = wallet.get_asset_outputs_for_amount(&Bech32Address::default(), asset_id, amount); let mut tb = ScriptTransactionBuilder::prepare_transfer(inputs, outputs, TxPolicies::default()) - .with_script(vec![Opcode::RVRT.into()]); + .with_script(script); tb.add_signer(wallet.clone())?; wallet.adjust_for_fee(&mut tb, amount).await?; @@ -825,8 +822,6 @@ async fn create_revert_tx(wallet: &WalletUnlocked) -> Result #[cfg(feature = "coin-cache")] #[tokio::test] async fn test_cache_invalidation_on_await() -> Result<()> { - use fuels_core::types::tx_status::TxStatus; - let block_time = 1u32; let provider_config = NodeConfig { block_production: Trigger::Interval { @@ -870,7 +865,7 @@ async fn can_fetch_mint_transactions() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", diff --git a/packages/fuels/tests/scripts.rs b/e2e/tests/scripts.rs similarity index 90% rename from packages/fuels/tests/scripts.rs rename to e2e/tests/scripts.rs index 728e26f368..56b5971637 100644 --- a/packages/fuels/tests/scripts.rs +++ b/e2e/tests/scripts.rs @@ -1,8 +1,8 @@ use fuels::{ core::codec::{DecoderConfig, EncoderConfig}, prelude::*, + types::Identity, }; -use fuels_core::types::Identity; #[tokio::test] async fn main_function_arguments() -> Result<()> { @@ -10,10 +10,10 @@ async fn main_function_arguments() -> Result<()> { // The abigen is used for the same purpose as with contracts (Rust bindings) abigen!(Script( name = "MyScript", - abi = "packages/fuels/tests/scripts/arguments/out/release/arguments-abi.json" + abi = "e2e/sway/scripts/arguments/out/release/arguments-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; - let bin_path = "../fuels/tests/scripts/arguments/out/release/arguments.bin"; + let bin_path = "sway/scripts/arguments/out/release/arguments.bin"; let script_instance = MyScript::new(wallet, bin_path); let bim = Bimbam { val: 90 }; @@ -36,7 +36,7 @@ async fn script_call_has_same_estimated_and_used_gas() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/scripts/basic_script" + project = "e2e/sway/scripts/basic_script" )), LoadScript( name = "script_instance", @@ -69,7 +69,7 @@ async fn test_basic_script_with_tx_policies() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "bimbam_script", - project = "packages/fuels/tests/scripts/basic_script" + project = "e2e/sway/scripts/basic_script" )), LoadScript( name = "script_instance", @@ -102,7 +102,7 @@ async fn test_output_variable_estimation() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "transfer_script", - project = "packages/fuels/tests/scripts/transfer_script" + project = "e2e/sway/scripts/transfer_script" )), LoadScript( name = "script_instance", @@ -142,7 +142,7 @@ async fn test_script_struct() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/scripts/script_struct" + project = "e2e/sway/scripts/script_struct" )), LoadScript( name = "script_instance", @@ -167,7 +167,7 @@ async fn test_script_enum() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/scripts/script_enum" + project = "e2e/sway/scripts/script_enum" )), LoadScript( name = "script_instance", @@ -189,7 +189,7 @@ async fn test_script_array() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/scripts/script_array" + project = "e2e/sway/scripts/script_array" )), LoadScript( name = "script_instance", @@ -211,7 +211,7 @@ async fn can_configure_decoder_on_script_call() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/scripts/script_needs_custom_decoder" + project = "e2e/sway/scripts/script_needs_custom_decoder" )), LoadScript( name = "script_instance", @@ -258,7 +258,7 @@ async fn test_script_submit_and_response() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/scripts/script_struct" + project = "e2e/sway/scripts/script_struct" )), LoadScript( name = "script_instance", @@ -287,7 +287,7 @@ async fn test_script_transaction_builder() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/scripts/basic_script" + project = "e2e/sway/scripts/basic_script" )), LoadScript( name = "script_instance", @@ -324,10 +324,10 @@ async fn test_script_transaction_builder() -> Result<()> { async fn script_encoder_config_is_applied() { abigen!(Script( name = "MyScript", - abi = "packages/fuels/tests/scripts/basic_script/out/release/basic_script-abi.json" + abi = "e2e/sway/scripts/basic_script/out/release/basic_script-abi.json" )); let wallet = launch_provider_and_get_wallet().await.expect(""); - let bin_path = "../fuels/tests/scripts/basic_script/out/release/basic_script.bin"; + let bin_path = "sway/scripts/basic_script/out/release/basic_script.bin"; let script_instance_without_encoder_config = MyScript::new(wallet.clone(), bin_path); { diff --git a/packages/fuels/tests/storage.rs b/e2e/tests/storage.rs similarity index 85% rename from packages/fuels/tests/storage.rs rename to e2e/tests/storage.rs index 6d7719a623..290ebdd0bb 100644 --- a/packages/fuels/tests/storage.rs +++ b/e2e/tests/storage.rs @@ -10,7 +10,7 @@ use fuels::{ async fn test_storage_initialization() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/storage/out/release/storage-abi.json" + abi = "e2e/sway/contracts/storage/out/release/storage-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; @@ -22,7 +22,7 @@ async fn test_storage_initialization() -> Result<()> { let storage_configuration = StorageConfiguration::default().add_slot_overrides(storage_vec); let contract_id = Contract::load_from( - "tests/contracts/storage/out/release/storage.bin", + "sway/contracts/storage/out/release/storage.bin", LoadConfiguration::default().with_storage_configuration(storage_configuration), )? .deploy(&wallet, TxPolicies::default()) @@ -45,13 +45,13 @@ async fn test_storage_initialization() -> Result<()> { async fn test_init_storage_automatically() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/storage/out/release/storage-abi.json" + abi = "e2e/sway/contracts/storage/out/release/storage-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; let contract_id = Contract::load_from( - "tests/contracts/storage/out/release/storage.bin", + "sway/contracts/storage/out/release/storage.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -85,7 +85,7 @@ async fn test_init_storage_automatically() -> Result<()> { #[tokio::test] async fn storage_load_error_messages() { { - let json_path = "tests/contracts/storage/out/release/no_file_on_path.json"; + let json_path = "sway/contracts/storage/out/release/no_file_on_path.json"; let expected_error = format!("io: file \"{json_path}\" does not exist"); let error = StorageConfiguration::default() @@ -95,7 +95,7 @@ async fn storage_load_error_messages() { assert_eq!(error.to_string(), expected_error); } { - let json_path = "tests/contracts/storage/out/release/storage.bin"; + let json_path = "sway/contracts/storage/out/release/storage.bin"; let expected_error = format!("expected \"{json_path}\" to have '.json' extension"); let error = StorageConfiguration::default() diff --git a/packages/fuels/tests/types_contracts.rs b/e2e/tests/types_contracts.rs similarity index 94% rename from packages/fuels/tests/types_contracts.rs rename to e2e/tests/types_contracts.rs index b975a8a403..32dac786ff 100644 --- a/packages/fuels/tests/types_contracts.rs +++ b/e2e/tests/types_contracts.rs @@ -17,7 +17,7 @@ async fn test_methods_typeless_argument() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/empty_arguments" + project = "e2e/sway/types/contracts/empty_arguments" )), Deploy( name = "contract_instance", @@ -43,7 +43,7 @@ async fn call_with_empty_return() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/types/contracts/call_empty_return" + project = "e2e/sway/types/contracts/call_empty_return" )), Deploy( name = "contract_instance", @@ -62,7 +62,7 @@ async fn call_with_structs() -> Result<()> { // The generated bindings can be accessed through `MyContract`. // ANCHOR: struct_generation abigen!(Contract(name="MyContract", - abi="packages/fuels/tests/types/contracts/complex_types_contract/out/release/complex_types_contract-abi.json")); + abi="e2e/sway/types/contracts/complex_types_contract/out/release/complex_types_contract-abi.json")); // Here we can use `CounterConfig`, a struct originally // defined in the contract. @@ -75,7 +75,7 @@ async fn call_with_structs() -> Result<()> { let wallet = launch_provider_and_get_wallet().await?; let contract_id = Contract::load_from( - "tests/types/contracts/complex_types_contract/out/release/complex_types_contract.bin", + "sway/types/contracts/complex_types_contract/out/release/complex_types_contract.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -103,7 +103,7 @@ async fn abigen_different_structs_same_arg_name() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/two_structs" + project = "e2e/sway/types/contracts/two_structs" )), Deploy( name = "contract_instance", @@ -132,7 +132,7 @@ async fn nested_structs() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/nested_structs" + project = "e2e/sway/types/contracts/nested_structs" )), Deploy( name = "contract_instance", @@ -189,7 +189,7 @@ async fn calls_with_empty_struct() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/complex_types_contract" + project = "e2e/sway/types/contracts/complex_types_contract" )), Deploy( name = "contract_instance", @@ -220,7 +220,7 @@ async fn calls_with_empty_struct() -> Result<()> { async fn can_use_try_into_to_construct_struct_from_bytes() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/types/contracts/enum_inside_struct/out/release\ + abi = "e2e/sway/types/contracts/enum_inside_struct/out/release\ /enum_inside_struct-abi.json" )); let cocktail_in_bytes: Vec = vec![ @@ -252,7 +252,7 @@ async fn test_tuples() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/tuples" + project = "e2e/sway/types/contracts/tuples" )), Deploy( name = "contract_instance", @@ -326,7 +326,7 @@ async fn test_evm_address() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/evm_address" + project = "e2e/sway/types/contracts/evm_address" )), Deploy( name = "contract_instance", @@ -393,7 +393,7 @@ async fn test_array() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -420,7 +420,7 @@ async fn test_arrays_with_custom_types() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -462,7 +462,7 @@ async fn str_in_array() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/str_in_array" + project = "e2e/sway/types/contracts/str_in_array" )), Deploy( name = "contract_instance", @@ -502,7 +502,7 @@ async fn test_enum_inside_struct() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/enum_inside_struct" + project = "e2e/sway/types/contracts/enum_inside_struct" )), Deploy( name = "contract_instance", @@ -544,7 +544,7 @@ async fn native_types_support() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/native_types" + project = "e2e/sway/types/contracts/native_types" )), Deploy( name = "contract_instance", @@ -582,7 +582,7 @@ async fn enum_coding_w_variable_width_variants() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/enum_encoding" + project = "e2e/sway/types/contracts/enum_encoding" )), Deploy( name = "contract_instance", @@ -623,7 +623,7 @@ async fn enum_coding_w_unit_enums() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/enum_encoding" + project = "e2e/sway/types/contracts/enum_encoding" )), Deploy( name = "contract_instance", @@ -662,7 +662,7 @@ async fn enum_as_input() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/enum_as_input" + project = "e2e/sway/types/contracts/enum_as_input" )), Deploy( name = "contract_instance", @@ -711,7 +711,7 @@ async fn enum_as_input() -> Result<()> { async fn can_use_try_into_to_construct_enum_from_bytes() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/types/contracts/enum_inside_struct/out/release\ + abi = "e2e/sway/types/contracts/enum_inside_struct/out/release\ /enum_inside_struct-abi.json" )); let shaker_in_bytes: Vec = vec![0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2]; @@ -738,7 +738,7 @@ async fn type_inside_enum() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/type_inside_enum" + project = "e2e/sway/types/contracts/type_inside_enum" )), Deploy( name = "contract_instance", @@ -1086,7 +1086,7 @@ async fn test_rust_option_can_be_decoded() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/options" + project = "e2e/sway/types/contracts/options" )), Deploy( name = "contract_instance", @@ -1138,7 +1138,7 @@ async fn test_rust_option_can_be_encoded() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/options" + project = "e2e/sway/types/contracts/options" )), Deploy( name = "contract_instance", @@ -1192,7 +1192,7 @@ async fn test_rust_result_can_be_decoded() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/results" + project = "e2e/sway/types/contracts/results" )), Deploy( name = "contract_instance", @@ -1244,7 +1244,7 @@ async fn test_rust_result_can_be_encoded() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/results" + project = "e2e/sway/types/contracts/results" )), Deploy( name = "contract_instance", @@ -1279,7 +1279,7 @@ async fn test_identity_can_be_decoded() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/identity" + project = "e2e/sway/types/contracts/identity" )), Deploy( name = "contract_instance", @@ -1324,7 +1324,7 @@ async fn test_identity_can_be_encoded() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/identity" + project = "e2e/sway/types/contracts/identity" )), Deploy( name = "contract_instance", @@ -1372,7 +1372,7 @@ async fn test_identity_with_two_contracts() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/identity" + project = "e2e/sway/types/contracts/identity" )), Deploy( name = "contract_instance", @@ -1417,7 +1417,7 @@ async fn generics_test() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/generics" + project = "e2e/sway/types/contracts/generics" )), Deploy( name = "contract_instance", @@ -1552,7 +1552,7 @@ async fn test_vector() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/vectors" + project = "e2e/sway/types/contracts/vectors" )), Deploy( name = "contract_instance", @@ -1639,7 +1639,7 @@ async fn test_b256() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/b256" + project = "e2e/sway/types/contracts/b256" )), Deploy( name = "contract_instance", @@ -1677,7 +1677,7 @@ async fn test_b512() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/b512" + project = "e2e/sway/types/contracts/b512" )), Deploy( name = "contract_instance", @@ -1725,7 +1725,7 @@ async fn test_u128() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/u128" + project = "e2e/sway/types/contracts/u128" )), Deploy( name = "contract_instance", @@ -1777,7 +1777,7 @@ async fn test_u256() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "TypesContract", - project = "packages/fuels/tests/types/contracts/u256" + project = "e2e/sway/types/contracts/u256" )), Deploy( name = "contract_instance", @@ -1814,7 +1814,7 @@ async fn test_base_type_in_vec_output() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "VectorOutputContract", - project = "packages/fuels/tests/types/contracts/vector_output" + project = "e2e/sway/types/contracts/vector_output" )), Deploy( name = "contract_instance", @@ -1853,7 +1853,7 @@ async fn test_composite_types_in_vec_output() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "VectorOutputContract", - project = "packages/fuels/tests/types/contracts/vector_output" + project = "e2e/sway/types/contracts/vector_output" )), Deploy( name = "contract_instance", @@ -1922,7 +1922,7 @@ async fn test_bytes_output() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "BytesOutputContract", - project = "packages/fuels/tests/types/contracts/bytes" + project = "e2e/sway/types/contracts/bytes" )), Deploy( name = "contract_instance", @@ -1945,7 +1945,7 @@ async fn test_bytes_as_input() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "BytesInputContract", - project = "packages/fuels/tests/types/contracts/bytes" + project = "e2e/sway/types/contracts/bytes" )), Deploy( name = "contract_instance", @@ -1981,7 +1981,7 @@ async fn test_contract_raw_slice() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "RawSliceContract", - project = "packages/fuels/tests/types/contracts/raw_slice" + project = "e2e/sway/types/contracts/raw_slice" )), Deploy( name = "contract_instance", @@ -2026,7 +2026,7 @@ async fn test_contract_returning_string_slice() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "StringSliceContract", - project = "packages/fuels/tests/types/contracts/string_slice" + project = "e2e/sway/types/contracts/string_slice" )), Deploy( name = "contract_instance", @@ -2051,7 +2051,7 @@ async fn test_contract_std_lib_string() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "StdLibString", - project = "packages/fuels/tests/types/contracts/std_lib_string" + project = "e2e/sway/types/contracts/std_lib_string" )), Deploy( name = "contract_instance", @@ -2089,7 +2089,7 @@ async fn test_heap_type_in_enums() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "HeapTypeInEnum", - project = "packages/fuels/tests/types/contracts/heap_type_in_enums" + project = "e2e/sway/types/contracts/heap_type_in_enums" )), Deploy( name = "contract_instance", @@ -2201,7 +2201,7 @@ async fn nested_heap_types() -> Result<()> { Wallets("wallet"), Abigen(Contract( name = "HeapTypeInEnum", - project = "packages/fuels/tests/types/contracts/heap_types" + project = "e2e/sway/types/contracts/heap_types" )), Deploy( name = "contract_instance", diff --git a/packages/fuels/tests/types_predicates.rs b/e2e/tests/types_predicates.rs similarity index 76% rename from packages/fuels/tests/types_predicates.rs rename to e2e/tests/types_predicates.rs index c1a515b3f0..67dc7cd905 100644 --- a/packages/fuels/tests/types_predicates.rs +++ b/e2e/tests/types_predicates.rs @@ -126,12 +126,12 @@ async fn setup_predicate_test( async fn spend_predicate_coins_messages_single_u64() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/u64/out/release/u64-abi.json" + abi = "e2e/sway/types/predicates/u64/out/release/u64-abi.json" )); let data = MyPredicateEncoder::default().encode_data(32768)?; - assert_predicate_spendable(data, "tests/types/predicates/u64").await?; + assert_predicate_spendable(data, "sway/types/predicates/u64").await?; Ok(()) } @@ -140,7 +140,7 @@ async fn spend_predicate_coins_messages_single_u64() -> Result<()> { async fn spend_predicate_coins_messages_address() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/address/out/release/address-abi.json" + abi = "e2e/sway/types/predicates/address/out/release/address-abi.json" )); let addr: Address = @@ -148,7 +148,7 @@ async fn spend_predicate_coins_messages_address() -> Result<()> { let data = MyPredicateEncoder::default().encode_data(addr)?; - assert_predicate_spendable(data, "tests/types/predicates/address").await?; + assert_predicate_spendable(data, "sway/types/predicates/address").await?; Ok(()) } @@ -157,13 +157,13 @@ async fn spend_predicate_coins_messages_address() -> Result<()> { async fn spend_predicate_coins_messages_enums() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/enums/out/release/enums-abi.json" + abi = "e2e/sway/types/predicates/enums/out/release/enums-abi.json" )); let data = MyPredicateEncoder::default().encode_data(TestEnum::A(32), AnotherTestEnum::B(32))?; - assert_predicate_spendable(data, "tests/types/predicates/enums").await?; + assert_predicate_spendable(data, "sway/types/predicates/enums").await?; Ok(()) } @@ -172,7 +172,7 @@ async fn spend_predicate_coins_messages_enums() -> Result<()> { async fn spend_predicate_coins_messages_structs() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/structs/out/release/structs-abi.json" + abi = "e2e/sway/types/predicates/structs/out/release/structs-abi.json" )); let data = MyPredicateEncoder::default().encode_data( @@ -183,7 +183,7 @@ async fn spend_predicate_coins_messages_structs() -> Result<()> { }, )?; - assert_predicate_spendable(data, "tests/types/predicates/structs").await?; + assert_predicate_spendable(data, "sway/types/predicates/structs").await?; Ok(()) } @@ -192,13 +192,13 @@ async fn spend_predicate_coins_messages_structs() -> Result<()> { async fn spend_predicate_coins_messages_tuple() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/predicate_tuples/out/release/predicate_tuples-abi.json" + abi = "e2e/sway/types/predicates/predicate_tuples/out/release/predicate_tuples-abi.json" )); let data = MyPredicateEncoder::default() .encode_data((16, TestStruct { value: 32 }, TestEnum::Value(64)), 128)?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_tuples").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_tuples").await?; Ok(()) } @@ -207,20 +207,22 @@ async fn spend_predicate_coins_messages_tuple() -> Result<()> { async fn spend_predicate_coins_messages_vector() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = - "packages/fuels/tests/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" + abi = "e2e/sway/types/predicates/predicate_vector/out/release/predicate_vector-abi.json" )); let data = MyPredicateEncoder::default().encode_data(18, 24, vec![2, 4, 42])?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_vector").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_vector").await?; Ok(()) } #[tokio::test] async fn spend_predicate_coins_messages_vectors() -> Result<()> { - abigen!(Predicate(name="MyPredicate", abi="packages/fuels/tests/types/predicates/predicate_vectors/out/release/predicate_vectors-abi.json")); + abigen!(Predicate( + name = "MyPredicate", + abi = "e2e/sway/types/predicates/predicate_vectors/out/release/predicate_vectors-abi.json" + )); let u32_vec = vec![0, 4, 3]; let vec_in_vec = vec![vec![0, 2, 2], vec![0, 1, 2]]; @@ -258,21 +260,25 @@ async fn spend_predicate_coins_messages_vectors() -> Result<()> { vec_in_a_vec_in_a_struct_in_a_vec, )?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_vectors").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_vectors").await?; Ok(()) } #[tokio::test] async fn spend_predicate_coins_messages_generics() -> Result<()> { - abigen!(Predicate(name="MyPredicate", abi="packages/fuels/tests/types/predicates/predicate_generics/out/release/predicate_generics-abi.json")); + abigen!(Predicate( + name = "MyPredicate", + abi = + "e2e/sway/types/predicates/predicate_generics/out/release/predicate_generics-abi.json" + )); let data = MyPredicateEncoder::default().encode_data( GenericStruct { value: 64u8 }, GenericEnum::Generic(GenericStruct { value: 64u16 }), )?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_generics").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_generics").await?; Ok(()) } @@ -281,7 +287,7 @@ async fn spend_predicate_coins_messages_generics() -> Result<()> { async fn spend_predicate_coins_messages_bytes_hash() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/predicate_bytes_hash/out/release/predicate_bytes_hash-abi.json" + abi = "e2e/sway/types/predicates/predicate_bytes_hash/out/release/predicate_bytes_hash-abi.json" )); @@ -295,7 +301,7 @@ async fn spend_predicate_coins_messages_bytes_hash() -> Result<()> { let data = MyPredicateEncoder::default().encode_data(bytes, bits256)?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_bytes_hash").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_bytes_hash").await?; Ok(()) } @@ -304,7 +310,7 @@ async fn spend_predicate_coins_messages_bytes_hash() -> Result<()> { async fn spend_predicate_coins_messages_bytes() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/predicate_bytes/out/release/predicate_bytes-abi.json" + abi = "e2e/sway/types/predicates/predicate_bytes/out/release/predicate_bytes-abi.json" )); let bytes = Bytes(vec![40, 41, 42]); @@ -315,7 +321,7 @@ async fn spend_predicate_coins_messages_bytes() -> Result<()> { let data = MyPredicateEncoder::default().encode_data(wrapper)?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_bytes").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_bytes").await?; Ok(()) } @@ -324,7 +330,7 @@ async fn spend_predicate_coins_messages_bytes() -> Result<()> { async fn spend_predicate_coins_messages_raw_slice() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/predicate_raw_slice/out/release/predicate_raw_slice-abi.json" + abi = "e2e/sway/types/predicates/predicate_raw_slice/out/release/predicate_raw_slice-abi.json" )); let raw_slice = RawSlice(vec![40, 41, 42]); @@ -335,7 +341,7 @@ async fn spend_predicate_coins_messages_raw_slice() -> Result<()> { let data = MyPredicateEncoder::default().encode_data(wrapper)?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_raw_slice").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_raw_slice").await?; Ok(()) } @@ -352,11 +358,11 @@ fn u128_from(parts: (u64, u64)) -> u128 { async fn predicate_handles_u128() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/predicate_u128/out/release/predicate_u128-abi.json" + abi = "e2e/sway/types/predicates/predicate_u128/out/release/predicate_u128-abi.json" )); let data = MyPredicateEncoder::default().encode_data(u128_from((8, 2)))?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_u128").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_u128").await?; Ok(()) } @@ -365,11 +371,11 @@ async fn predicate_handles_u128() -> Result<()> { async fn predicate_handles_b256() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/predicate_b256/out/release/predicate_b256-abi.json" + abi = "e2e/sway/types/predicates/predicate_b256/out/release/predicate_b256-abi.json" )); let data = MyPredicateEncoder::default().encode_data(Bits256([1; 32]))?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_b256").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_b256").await?; Ok(()) } @@ -391,11 +397,11 @@ fn u256_from(parts: (u64, u64, u64, u64)) -> U256 { async fn predicate_handles_u256() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/predicate_u256/out/release/predicate_u256-abi.json" + abi = "e2e/sway/types/predicates/predicate_u256/out/release/predicate_u256-abi.json" )); let data = MyPredicateEncoder::default().encode_data(u256_from((10, 11, 12, 13)))?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_u256").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_u256").await?; Ok(()) } @@ -404,11 +410,11 @@ async fn predicate_handles_u256() -> Result<()> { async fn predicate_handles_std_string() -> Result<()> { abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/types/predicates/predicate_std_lib_string/out/release/predicate_std_lib_string-abi.json" + abi = "e2e/sway/types/predicates/predicate_std_lib_string/out/release/predicate_std_lib_string-abi.json" )); let data = MyPredicateEncoder::default().encode_data(10, 11, String::from("Hello World"))?; - assert_predicate_spendable(data, "tests/types/predicates/predicate_std_lib_string").await?; + assert_predicate_spendable(data, "sway/types/predicates/predicate_std_lib_string").await?; Ok(()) } diff --git a/packages/fuels/tests/types_scripts.rs b/e2e/tests/types_scripts.rs similarity index 91% rename from packages/fuels/tests/types_scripts.rs rename to e2e/tests/types_scripts.rs index 2de55f0a90..dcb00797c4 100644 --- a/packages/fuels/tests/types_scripts.rs +++ b/e2e/tests/types_scripts.rs @@ -9,7 +9,7 @@ async fn script_b256() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/types/scripts/script_b256" + project = "e2e/sway/types/scripts/script_b256" )), LoadScript( name = "script_instance", @@ -32,7 +32,7 @@ async fn main_function_generic_arguments() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/types/scripts/script_generics" + project = "e2e/sway/types/scripts/script_generics" )), LoadScript( name = "script_instance", @@ -74,7 +74,7 @@ async fn main_function_option_result() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/types/scripts/options_results" + project = "e2e/sway/types/scripts/options_results" )), LoadScript( name = "script_instance", @@ -108,7 +108,7 @@ async fn main_function_tuple_types() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/types/scripts/script_tuples" + project = "e2e/sway/types/scripts/script_tuples" )), LoadScript( name = "script_instance", @@ -153,7 +153,7 @@ async fn main_function_vector_arguments() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/types/scripts/script_vectors" + project = "e2e/sway/types/scripts/script_vectors" )), LoadScript( name = "script_instance", @@ -214,7 +214,7 @@ async fn main_function_vector_arguments() -> Result<()> { // Wallets("wallet"), // Abigen(Script( // name = "BimBamScript", -// project = "packages/fuels/tests/types/scripts/script_raw_slice", +// project = "e2e/sway/types/scripts/script_raw_slice", // )), // LoadScript( // name = "script_instance", @@ -241,7 +241,7 @@ async fn main_function_bytes_arguments() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "BimBamScript", - project = "packages/fuels/tests/types/scripts/script_bytes", + project = "e2e/sway/types/scripts/script_bytes", )), LoadScript( name = "script_instance", @@ -275,7 +275,7 @@ async fn script_handles_u128() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/types/scripts/script_u128", + project = "e2e/sway/types/scripts/script_u128", )), LoadScript( name = "script_instance", @@ -312,7 +312,7 @@ async fn script_handles_u256() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/types/scripts/script_u256", + project = "e2e/sway/types/scripts/script_u256", )), LoadScript( name = "script_instance", @@ -336,7 +336,7 @@ async fn script_handles_std_string() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/types/scripts/script_std_lib_string", + project = "e2e/sway/types/scripts/script_std_lib_string", )), LoadScript( name = "script_instance", @@ -357,7 +357,7 @@ async fn nested_heap_types() -> Result<()> { Wallets("wallet"), Abigen(Script( name = "MyScript", - project = "packages/fuels/tests/types/scripts/script_heap_types", + project = "e2e/sway/types/scripts/script_heap_types", )), LoadScript( name = "script_instance", diff --git a/packages/fuels/tests/wallets.rs b/e2e/tests/wallets.rs similarity index 99% rename from packages/fuels/tests/wallets.rs rename to e2e/tests/wallets.rs index d329c50ab8..8774425a33 100644 --- a/packages/fuels/tests/wallets.rs +++ b/e2e/tests/wallets.rs @@ -1,7 +1,11 @@ use std::iter::repeat; -use fuel_tx::{input::coin::CoinSigned, Bytes32, Input, Output, TxPointer, UtxoId}; -use fuels::prelude::*; +use fuel_tx::{input::coin::CoinSigned, Input}; +use fuels::{ + prelude::*, + tx::{TxPointer, UtxoId}, + types::{output::Output, Bytes32}, +}; #[tokio::test] async fn test_wallet_balance_api_multi_asset() -> Result<()> { diff --git a/examples/contracts/src/lib.rs b/examples/contracts/src/lib.rs index ac4d9010c0..6f71274ca4 100644 --- a/examples/contracts/src/lib.rs +++ b/examples/contracts/src/lib.rs @@ -41,7 +41,7 @@ mod tests { // This will load and deploy your contract binary to the chain so that its ID can // be used to initialize the instance let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -62,7 +62,7 @@ mod tests { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -89,13 +89,13 @@ mod tests { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -128,7 +128,7 @@ mod tests { let wallet = launch_provider_and_get_wallet().await?; let contract_id_1 = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -158,7 +158,7 @@ mod tests { .with_maturity(0); let contract_id_2 = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", configuration, )? .deploy(&wallet, tx_policies) @@ -176,7 +176,7 @@ mod tests { // ANCHOR: abigen_example abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); // ANCHOR_END: abigen_example @@ -221,14 +221,14 @@ mod tests { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let wallets = launch_custom_provider_and_get_wallets(WalletsConfig::default(), None, None).await?; let contract_id_1 = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallets[0], TxPolicies::default()) @@ -247,7 +247,7 @@ mod tests { assert_eq!(42, response.value); let contract_id_2 = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default().with_salt([1; 32]), )? .deploy(&wallets[1], TxPolicies::default()) @@ -273,13 +273,13 @@ mod tests { use fuels::prelude::*; abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -342,13 +342,13 @@ mod tests { use fuels::prelude::*; abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/token_ops/out/release/token_ops-abi.json" + abi = "e2e/sway/contracts/token_ops/out/release/token_ops-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/token_ops/out/release/token_ops\ + "../../e2e/sway/contracts/token_ops/out/release/token_ops\ .bin", LoadConfiguration::default(), )? @@ -380,22 +380,23 @@ mod tests { #[allow(unused_variables)] async fn dependency_estimation() -> Result<()> { use fuels::prelude::*; - abigen!( - Contract(name="MyContract", - abi="packages/fuels/tests/contracts/lib_contract_caller/out/release/lib_contract_caller-abi.json" + abigen!(Contract( + name = "MyContract", + abi = "e2e/sway/contracts/lib_contract_caller/out/release/lib_contract_caller-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; let called_contract_id: ContractId = Contract::load_from( - "../../packages/fuels/tests/contracts/lib_contract/out/release/lib_contract.bin", + "../../e2e/sway/contracts/lib_contract/out/release/lib_contract.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) .await? .into(); - let bin_path = "../../packages/fuels/tests/contracts/lib_contract_caller/out/release/lib_contract_caller.bin"; + let bin_path = + "../../e2e/sway/contracts/lib_contract_caller/out/release/lib_contract_caller.bin"; let caller_contract_id = Contract::load_from(bin_path, LoadConfiguration::default())? .deploy(&wallet, TxPolicies::default()) .await?; @@ -455,7 +456,7 @@ mod tests { abigen!(Contract( name = "MyContract", // Replace with your contract ABI.json path - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let wallet_original = launch_provider_and_get_wallet().await?; @@ -485,13 +486,13 @@ mod tests { use fuels::prelude::*; abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -523,13 +524,13 @@ mod tests { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -579,13 +580,13 @@ mod tests { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let wallet = launch_provider_and_get_wallet().await?; let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) @@ -623,7 +624,7 @@ mod tests { use fuels::prelude::*; abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/contracts/contract_test/out/release/contract_test-abi.json" + abi = "e2e/sway/contracts/contract_test/out/release/contract_test-abi.json" )); let config = WalletsConfig::new(Some(2), Some(1), Some(DEFAULT_COIN_AMOUNT)); @@ -632,7 +633,7 @@ mod tests { let wallet_2 = wallets.pop().unwrap(); let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet_1, TxPolicies::default()) @@ -662,7 +663,7 @@ mod tests { Wallets("wallet"), Abigen(Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -699,11 +700,11 @@ mod tests { Abigen( Contract( name = "MyCallerContract", - project = "packages/fuels/tests/contracts/low_level_caller" + project = "e2e/sway/contracts/low_level_caller" ), Contract( name = "MyTargetContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" ), ), Deploy( @@ -780,7 +781,7 @@ mod tests { Wallets("wallet"), Abigen(Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -841,7 +842,7 @@ mod tests { Wallets("wallet"), Abigen(Contract( name = "TestContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", @@ -884,7 +885,7 @@ mod tests { Wallets("wallet"), Abigen(Contract( name = "MyContract", - project = "packages/fuels/tests/contracts/contract_test" + project = "e2e/sway/contracts/contract_test" )), Deploy( name = "contract_instance", diff --git a/examples/cookbook/src/lib.rs b/examples/cookbook/src/lib.rs index 429e67e252..d72bc7221b 100644 --- a/examples/cookbook/src/lib.rs +++ b/examples/cookbook/src/lib.rs @@ -28,8 +28,7 @@ mod tests { // ANCHOR: liquidity_abigen abigen!(Contract( name = "MyContract", - abi = - "packages/fuels/tests/contracts/liquidity_pool/out/release/liquidity_pool-abi.json" + abi = "e2e/sway/contracts/liquidity_pool/out/release/liquidity_pool-abi.json" )); // ANCHOR_END: liquidity_abigen @@ -53,7 +52,7 @@ mod tests { // ANCHOR: liquidity_deploy let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/liquidity_pool/out/release/liquidity_pool.bin", + "../../e2e/sway/contracts/liquidity_pool/out/release/liquidity_pool.bin", LoadConfiguration::default(), )? .deploy(wallet, TxPolicies::default()) @@ -226,7 +225,7 @@ mod tests { let mut hot_wallet = WalletUnlocked::new_random(None); let mut cold_wallet = WalletUnlocked::new_random(None); - let code_path = "../../packages/fuels/tests/predicates/swap/out/release/swap.bin"; + let code_path = "../../e2e/sway/predicates/swap/out/release/swap.bin"; let mut predicate = Predicate::load_from(code_path)?; let num_coins = 5; diff --git a/examples/debugging/src/lib.rs b/examples/debugging/src/lib.rs index ecad774668..b00bda8301 100644 --- a/examples/debugging/src/lib.rs +++ b/examples/debugging/src/lib.rs @@ -30,11 +30,10 @@ mod tests { fn decoded_debug_matches_rust_debug() -> Result<()> { abigen!(Contract( name = "MyContract", - abi = "packages/fuels/tests/types/contracts/generics/out/release/generics-abi.json" + abi = "e2e/sway/types/contracts/generics/out/release/generics-abi.json" )); - let json_abi_file = - "../../packages/fuels/tests/types/contracts/generics/out/release/generics-abi.json"; + let json_abi_file = "../../e2e/sway/types/contracts/generics/out/release/generics-abi.json"; let abi_file_contents = std::fs::read_to_string(json_abi_file)?; let parsed_abi: ProgramABI = serde_json::from_str(&abi_file_contents)?; diff --git a/examples/macros/src/lib.rs b/examples/macros/src/lib.rs index 80f4c5c792..a888db6097 100644 --- a/examples/macros/src/lib.rs +++ b/examples/macros/src/lib.rs @@ -8,10 +8,22 @@ mod tests { fn example_of_abigen_usage() { // ANCHOR: multiple_abigen_program_types abigen!( - Contract(name="ContractA", abi="packages/fuels/tests/bindings/sharing_types/contract_a/out/release/contract_a-abi.json"), - Contract(name="ContractB", abi="packages/fuels/tests/bindings/sharing_types/contract_b/out/release/contract_b-abi.json"), - Script(name="MyScript", abi="packages/fuels/tests/scripts/arguments/out/release/arguments-abi.json"), - Predicate(name="MyPredicateEncoder", abi="packages/fuels/tests/predicates/basic_predicate/out/release/basic_predicate-abi.json"), + Contract( + name = "ContractA", + abi = "e2e/sway/bindings/sharing_types/contract_a/out/release/contract_a-abi.json" + ), + Contract( + name = "ContractB", + abi = "e2e/sway/bindings/sharing_types/contract_b/out/release/contract_b-abi.json" + ), + Script( + name = "MyScript", + abi = "e2e/sway/scripts/arguments/out/release/arguments-abi.json" + ), + Predicate( + name = "MyPredicateEncoder", + abi = "e2e/sway/predicates/basic_predicate/out/release/basic_predicate-abi.json" + ), ); // ANCHOR_END: multiple_abigen_program_types } diff --git a/examples/predicates/src/lib.rs b/examples/predicates/src/lib.rs index eea556a61a..9aef37678e 100644 --- a/examples/predicates/src/lib.rs +++ b/examples/predicates/src/lib.rs @@ -56,12 +56,11 @@ mod tests { // ANCHOR: predicate_load abigen!(Predicate( name = "MyPredicate", - abi = "packages/fuels/tests/predicates/signatures/out/release/signatures-abi.json" + abi = "e2e/sway/predicates/signatures/out/release/signatures-abi.json" )); let predicate_data = MyPredicateEncoder::default().encode_data(signatures)?; - let code_path = - "../../packages/fuels/tests/predicates/signatures/out/release/signatures.bin"; + let code_path = "../../e2e/sway/predicates/signatures/out/release/signatures.bin"; let predicate: Predicate = Predicate::load_from(code_path)? .with_provider(provider) @@ -125,13 +124,15 @@ mod tests { let first_wallet = &wallets[0]; let second_wallet = &wallets[1]; - abigen!(Predicate(name="MyPredicate", abi="packages/fuels/tests/predicates/basic_predicate/out/release/basic_predicate-abi.json")); + abigen!(Predicate( + name = "MyPredicate", + abi = "e2e/sway/predicates/basic_predicate/out/release/basic_predicate-abi.json" + )); // ANCHOR_END: predicate_data_setup // ANCHOR: with_predicate_data let predicate_data = MyPredicateEncoder::default().encode_data(4096, 4096)?; - let code_path = - "../../packages/fuels/tests/predicates/basic_predicate/out/release/basic_predicate.bin"; + let code_path = "../../e2e/sway/predicates/basic_predicate/out/release/basic_predicate.bin"; let predicate: Predicate = Predicate::load_from(code_path)? .with_provider(first_wallet.try_provider()?.clone()) diff --git a/examples/wallets/src/lib.rs b/examples/wallets/src/lib.rs index 0952dd6950..66a46049b0 100644 --- a/examples/wallets/src/lib.rs +++ b/examples/wallets/src/lib.rs @@ -175,7 +175,7 @@ mod tests { .unwrap(); let contract_id = Contract::load_from( - "../../packages/fuels/tests/contracts/contract_test/out/release/contract_test.bin", + "../../e2e/sway/contracts/contract_test/out/release/contract_test.bin", LoadConfiguration::default(), )? .deploy(&wallet, TxPolicies::default()) diff --git a/packages/fuels-accounts/Cargo.toml b/packages/fuels-accounts/Cargo.toml index d6ddadc58c..1c6b01d22e 100644 --- a/packages/fuels-accounts/Cargo.toml +++ b/packages/fuels-accounts/Cargo.toml @@ -28,6 +28,7 @@ tokio = { workspace = true, features = ["full"], optional = true } zeroize = { workspace = true, features = ["derive"] } [dev-dependencies] +fuel-tx = { workspace = true, features = ["test-helpers", "random"] } tempfile = { workspace = true } tokio = { workspace = true, features = ["test-util"] } diff --git a/packages/fuels-accounts/src/predicate.rs b/packages/fuels-accounts/src/predicate.rs index 7983a7878f..d27c7d18a8 100644 --- a/packages/fuels-accounts/src/predicate.rs +++ b/packages/fuels-accounts/src/predicate.rs @@ -3,6 +3,7 @@ use std::{fmt::Debug, fs}; #[cfg(feature = "std")] use fuels_core::types::{input::Input, AssetId}; use fuels_core::{ + error, types::{bech32::Bech32Address, errors::Result}, Configurables, }; @@ -39,7 +40,12 @@ impl Predicate { } pub fn load_from(file_path: &str) -> Result { - let code = fs::read(file_path)?; + let code = fs::read(file_path).map_err(|e| { + error!( + IO, + "could not read predicate binary {file_path:?}. Reason: {e}" + ) + })?; Ok(Self::from_code(code)) } diff --git a/packages/fuels-code-gen/src/program_bindings/abigen/bindings/script.rs b/packages/fuels-code-gen/src/program_bindings/abigen/bindings/script.rs index 18fffa7294..49a1ad9b11 100644 --- a/packages/fuels-code-gen/src/program_bindings/abigen/bindings/script.rs +++ b/packages/fuels-code-gen/src/program_bindings/abigen/bindings/script.rs @@ -50,7 +50,7 @@ pub(crate) fn script_bindings( { pub fn new(account: T, binary_filepath: &str) -> Self { let binary = ::std::fs::read(binary_filepath) - .expect("Could not read from binary filepath"); + .expect(&format!("could not read script binary {binary_filepath:?}")); Self { account, binary, diff --git a/packages/fuels-core/Cargo.toml b/packages/fuels-core/Cargo.toml index a86ee51dd9..7c33da1f28 100644 --- a/packages/fuels-core/Cargo.toml +++ b/packages/fuels-core/Cargo.toml @@ -17,10 +17,10 @@ fuel-abi-types = { workspace = true } fuel-asm = { workspace = true } fuel-core-chain-config = { workspace = true } fuel-core-client = { workspace = true, optional = true } +fuel-core-types = { workspace = true } fuel-crypto = { workspace = true } fuel-tx = { workspace = true } fuel-types = { workspace = true, features = ["default"] } -fuel-core-types = { workspace = true } fuel-vm = { workspace = true } fuels-macros = { workspace = true } hex = { workspace = true, features = ["std"] } @@ -31,6 +31,7 @@ thiserror = { workspace = true, default-features = false } uint = { workspace = true, default-features = false } [dev-dependencies] +fuel-tx = { workspace = true, features = ["test-helpers", "random"] } tokio = { workspace = true, features = ["test-util", "macros"] } [features] diff --git a/packages/fuels-core/src/types/errors.rs b/packages/fuels-core/src/types/errors.rs index 58743627ba..34812a7d9b 100644 --- a/packages/fuels-core/src/types/errors.rs +++ b/packages/fuels-core/src/types/errors.rs @@ -31,7 +31,7 @@ use transaction::Reason; #[derive(Error, Debug)] pub enum Error { #[error("io: {0}")] - IO(#[from] std::io::Error), + IO(String), #[error("codec: {0}")] Codec(String), #[error("transaction {0}")] @@ -42,6 +42,12 @@ pub enum Error { Other(String), } +impl From for Error { + fn from(value: std::io::Error) -> Self { + Self::IO(value.to_string()) + } +} + pub type Result = std::result::Result; /// This macro can only be used for `Error` variants that have a `String` field. diff --git a/packages/fuels-programs/src/contract.rs b/packages/fuels-programs/src/contract.rs index cff1165884..e49cb62e69 100644 --- a/packages/fuels-programs/src/contract.rs +++ b/packages/fuels-programs/src/contract.rs @@ -17,7 +17,7 @@ use fuels_core::{ traits::{Parameterize, Tokenizable}, types::{ bech32::{Bech32Address, Bech32ContractId}, - errors::{error, Error, Result}, + errors::{error, Result}, param_types::ParamType, transaction::{ScriptTransaction, Transaction, TxPolicies}, transaction_builders::{CreateTransactionBuilder, ScriptTransactionBuilder}, @@ -381,10 +381,7 @@ fn expected_storage_slots_filepath(contract_binary: &Path) -> Option { fn validate_path_and_extension(file_path: &Path, extension: &str) -> Result<()> { if !file_path.exists() { - return Err(Error::IO(io::Error::new( - io::ErrorKind::NotFound, - format!("file {file_path:?} does not exist"), - ))); + return Err(error!(IO, "file {file_path:?} does not exist")); } let path_extension = file_path @@ -951,6 +948,7 @@ where mod tests { use std::collections::HashSet; + use fuels_core::types::errors::Error; use tempfile::tempdir; use super::*; diff --git a/packages/fuels-test-helpers/src/fuel_bin_service.rs b/packages/fuels-test-helpers/src/fuel_bin_service.rs index bfa9c0dd4b..d506e1d365 100644 --- a/packages/fuels-test-helpers/src/fuel_bin_service.rs +++ b/packages/fuels-test-helpers/src/fuel_bin_service.rs @@ -7,10 +7,7 @@ use std::{ use fuel_core_chain_config::{ChainConfig, SnapshotWriter, StateConfig}; use fuel_core_client::client::FuelClient; use fuel_core_services::State; -use fuels_core::{ - error, - types::errors::{Error, Result as FuelResult}, -}; +use fuels_core::{error, types::errors::Result as FuelResult}; use portpicker::{is_free, pick_unused_port}; use tempfile::{tempdir, TempDir}; use tokio::{process::Command, spawn, task::JoinHandle, time::sleep}; @@ -116,7 +113,12 @@ impl FuelService { let bound_address = match requested_port { 0 => get_socket_address()?, _ if is_free(requested_port) => node_config.addr, - _ => return Err(Error::IO(std::io::ErrorKind::AddrInUse.into())), + _ => { + return Err(error!( + IO, + "could not find a free port to start a fuel node" + )) + } }; let node_config = NodeConfig { diff --git a/packages/fuels/Cargo.toml b/packages/fuels/Cargo.toml index 4a213e9a64..5da9527934 100644 --- a/packages/fuels/Cargo.toml +++ b/packages/fuels/Cargo.toml @@ -24,19 +24,6 @@ fuels-macros = { workspace = true } fuels-programs = { workspace = true, optional = true } fuels-test-helpers = { workspace = true, optional = true } -[dev-dependencies] -chrono = { workspace = true } -fuel-core = { workspace = true, default-features = false } -fuel-core-types = { workspace = true } -fuels-code-gen = { workspace = true } -fuels-test-helpers = { workspace = true } -hex = { workspace = true, default-features = false } -rand = { workspace = true } -sha2 = { workspace = true } -tempfile = { workspace = true } -tokio = { workspace = true, features = ["time", "test-util"] } -tai64 = { workspace = true } - [features] default = ["std", "fuels-test-helpers?/fuels-accounts", "coin-cache"] coin-cache = ["fuels-accounts/coin-cache"] @@ -53,7 +40,5 @@ std = [ "fuels-core/std", "fuels-test-helpers?/std", ] -# TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked. -test-type-paths = [] fuel-core-lib = ["fuels-test-helpers?/fuel-core-lib", "dep:fuel-core"] rocksdb = ["fuel-core?/rocksdb"] diff --git a/packages/fuels/Forc.toml b/packages/fuels/Forc.toml deleted file mode 100644 index 4db2bab6a0..0000000000 --- a/packages/fuels/Forc.toml +++ /dev/null @@ -1,113 +0,0 @@ -[workspace] -members = [ - 'tests/bindings/sharing_types/contract_a', - 'tests/bindings/sharing_types/contract_b', - 'tests/bindings/sharing_types/shared_lib', - 'tests/bindings/simple_contract', - 'tests/bindings/type_paths', - 'tests/contracts/asserts', - 'tests/contracts/auth_testing_abi', - 'tests/contracts/auth_testing_contract', - 'tests/contracts/block_timestamp', - 'tests/contracts/configurables', - 'tests/contracts/contract_test', - 'tests/contracts/large_return_data', - 'tests/contracts/lib_contract', - 'tests/contracts/lib_contract_abi', - 'tests/contracts/lib_contract_caller', - 'tests/contracts/library_test', - 'tests/contracts/liquidity_pool', - 'tests/contracts/low_level_caller', - 'tests/contracts/msg_methods', - 'tests/contracts/multiple_read_calls', - 'tests/contracts/needs_custom_decoder', - 'tests/contracts/payable_annotation', - 'tests/contracts/require', - 'tests/contracts/revert_transaction_error', - 'tests/contracts/storage', - 'tests/contracts/token_ops', - 'tests/contracts/transaction_block_height', - 'tests/logs/contract_logs', - 'tests/logs/contract_logs_abi', - 'tests/logs/contract_with_contract_logs', - 'tests/logs/script_heap_logs', - 'tests/logs/script_logs', - 'tests/logs/script_needs_custom_decoder_logging', - 'tests/logs/script_with_contract_logs', - 'tests/predicates/basic_predicate', - 'tests/predicates/predicate_configurables', - 'tests/predicates/predicate_witnesses', - 'tests/predicates/signatures', - 'tests/predicates/swap', - 'tests/scripts/arguments', - 'tests/scripts/basic_script', - 'tests/scripts/require_from_contract', - 'tests/scripts/script_array', - 'tests/scripts/script_asserts', - 'tests/scripts/script_configurables', - 'tests/scripts/script_enum', - 'tests/scripts/script_needs_custom_decoder', - 'tests/scripts/script_require', - 'tests/scripts/script_struct', - 'tests/scripts/transfer_script', - 'tests/types/contracts/b256', - 'tests/types/contracts/b512', - 'tests/types/contracts/bytes', - 'tests/types/contracts/call_empty_return', - 'tests/types/contracts/complex_types_contract', - 'tests/types/contracts/empty_arguments', - 'tests/types/contracts/enum_as_input', - 'tests/types/contracts/enum_encoding', - 'tests/types/contracts/enum_inside_struct', - 'tests/types/contracts/evm_address', - 'tests/types/contracts/generics', - 'tests/types/contracts/heap_type_in_enums', - 'tests/types/contracts/heap_types', - 'tests/types/contracts/identity', - 'tests/types/contracts/native_types', - 'tests/types/contracts/nested_structs', - 'tests/types/contracts/options', - 'tests/types/contracts/raw_slice', - 'tests/types/contracts/results', - 'tests/types/contracts/std_lib_string', - 'tests/types/contracts/str_in_array', - 'tests/types/contracts/string_slice', - 'tests/types/contracts/tuples', - 'tests/types/contracts/two_structs', - 'tests/types/contracts/type_inside_enum', - 'tests/types/contracts/u128', - 'tests/types/contracts/u256', - 'tests/types/contracts/vector_output', - 'tests/types/contracts/vectors', - 'tests/types/predicates/address', - 'tests/types/predicates/enums', - 'tests/types/predicates/predicate_b256', - 'tests/types/predicates/predicate_bytes', - 'tests/types/predicates/predicate_bytes_hash', - 'tests/types/predicates/predicate_generics', - 'tests/types/predicates/predicate_raw_slice', - 'tests/types/predicates/predicate_std_lib_string', - 'tests/types/predicates/predicate_tuples', - 'tests/types/predicates/predicate_u128', - 'tests/types/predicates/predicate_u256', - 'tests/types/predicates/predicate_vector', - 'tests/types/predicates/predicate_vectors', - 'tests/types/predicates/structs', - 'tests/types/predicates/u64', - 'tests/types/scripts/options_results', - 'tests/types/scripts/script_b256', - 'tests/types/scripts/script_bytes', - 'tests/types/scripts/script_generics', - 'tests/types/scripts/script_heap_types', - #TODO: Decide what to do with this test project once - # https://github.com/FuelLabs/sway/issues/5727 is resolved - # 'tests/types/scripts/script_raw_slice', - 'tests/types/scripts/script_std_lib_string', - 'tests/types/scripts/script_tuples', - 'tests/types/scripts/script_u128', - 'tests/types/scripts/script_u256', - 'tests/types/scripts/script_vectors', -] - -[patch.'https://github.com/fuellabs/sway'] -std = { git = "https://github.com/fuellabs/sway", branch = "xunilrj/new-encoding-configurables" } diff --git a/packages/fuels/src/lib.rs b/packages/fuels/src/lib.rs index b6603cf126..bffe9132dc 100644 --- a/packages/fuels/src/lib.rs +++ b/packages/fuels/src/lib.rs @@ -58,17 +58,8 @@ pub mod test_helpers { pub use fuels_test_helpers::*; } -/// Easy imports of frequently used #[doc(hidden)] pub mod prelude { - //! The fuels-rs prelude - //! - //! The purpose of this module is to alleviate imports of many common types: - //! - //! ``` - //! # #![allow(unused_imports)] - //! use fuels::prelude::*; - //! ``` #[cfg(feature = "std")] pub use super::{ accounts::{ diff --git a/packages/wasm-tests/.cargo/config.toml b/wasm-tests/.cargo/config.toml similarity index 100% rename from packages/wasm-tests/.cargo/config.toml rename to wasm-tests/.cargo/config.toml diff --git a/packages/wasm-tests/Cargo.toml b/wasm-tests/Cargo.toml similarity index 51% rename from packages/wasm-tests/Cargo.toml rename to wasm-tests/Cargo.toml index 8c20d38a26..4d13e5d1a7 100644 --- a/packages/wasm-tests/Cargo.toml +++ b/wasm-tests/Cargo.toml @@ -13,11 +13,7 @@ rust-version = { workspace = true } crate-type = ['cdylib'] [dev-dependencies] -# `fuels` intentionally not specified through `workspace=true`. In -# the workspace cargo.toml `fuels` has default features enabled (so -# that our examples don't inherit `fuels` with disabled features). -# Cargo wouldn't respect any attempts here to disable them again. -fuels = { path = "../fuels", default-features = false } -fuels-core = { path = "../fuels-core", default-features = false } +fuels = { workspace = true } +fuels-core = { workspace = true } getrandom = { version = "0.2.11", features = ["js"] } wasm-bindgen-test = "0.3.39" diff --git a/packages/wasm-tests/src/lib.rs b/wasm-tests/src/lib.rs similarity index 100% rename from packages/wasm-tests/src/lib.rs rename to wasm-tests/src/lib.rs