Running scripts

run_compiled_script is a helper function for testing simple Sway scripts and reducing boilerplate code related to setting up contracts and deployment. As the argument, it takes the path to the generated binary file (.bin).

        let path_to_bin = "../fuels/tests/test_projects/logging/out/debug/logging.bin";
        let return_val = run_compiled_script(path_to_bin).await?;

        let correct_hex =
            hex::decode("ef86afa9696cf0dc6385e2c407a6e159a1103cefb7e2ae0636fb33d3cb2a9e4a");

        assert_eq!(correct_hex?, return_val[0].data().unwrap());