diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/Forc.lock new file mode 100644 index 00000000000..efaec2f6f2a --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/Forc.lock @@ -0,0 +1,13 @@ +[[package]] +name = "core" +source = "path+from-root-2A7B279266ACFF97" + +[[package]] +name = "issue_6335_repro" +source = "member" +dependencies = ["std"] + +[[package]] +name = "std" +source = "path+from-root-2A7B279266ACFF97" +dependencies = ["core"] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/Forc.toml new file mode 100644 index 00000000000..5f7f8ed6230 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/Forc.toml @@ -0,0 +1,9 @@ +[project] +authors = ["Fuel Labs "] +entry = "main.sw" +implicit-std = false +license = "Apache-2.0" +name = "issue_6335_repro" + +[dependencies] +std = { path = "../../../../reduced_std_libs/sway-lib-std-conversions" } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/src/main.sw new file mode 100644 index 00000000000..36c95885603 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/src/main.sw @@ -0,0 +1,25 @@ +contract; + +use std::bytes::*; + +abi MyAbi { + fn test() -> u64; +} + +abi FakeAbi { + fn test() -> Bytes; +} + +impl MyAbi for Contract { + fn test() -> u64 { + 64 + } +} + +#[test] +fn test() { + let caller = abi(FakeAbi, CONTRACT_ID); + let res = caller.test(); + assert(res.len() == 64); + let s: str[30] = abi_decode(res.as_raw_slice()); +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/test.toml new file mode 100644 index 00000000000..526e7df8fdb --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/issue_6335_repro/test.toml @@ -0,0 +1,4 @@ +category = "compile" +validate_abi = false +validate_storage_slots = false +expected_warnings = 0