Update WASM oracle docs: clarify file resolution and asset usage
The documentation incorrectly stated that WASM oracle files "must be a package's asset". In reality, the oracle loader searches the target directory directly—assets are a convenience feature for automatic file copying.
Changes
-
File resolution clarification: Documented that files are resolved from the target directory (
target/dev/,target/release/, etc.) based on the build profile - Asset recommendation: Repositioned assets as the recommended approach (automatic copying) rather than a hard requirement
- Alternative approach: Noted that files can be manually placed in the target directory
- Code comment updates: Updated inline comments to reflect actual resolution behavior
The implementation in scarb-oracle-hint-service/src/assets.rs confirms this behavior: Assets::for_executable() uses the executable's parent directory (the target directory) as the search path.
Original prompt
This section details on the original issue you should resolve
<issue_title>Update WASM Oracles docs</issue_title> <issue_description>Currently, in the docs of wasm protocol of oracles, we write that package used in connection string must be an asset. This is not required, assets are a QoL function but oracle source can manually be added to target dir (check source code for resolution logic for exact path).
Update the docs to say that the file is searched for in target dir (find specific path) but the recommended approach is to use
assetsbecause Scarb will copy the file automatically.</issue_description>Comments on the Issue (you are @copilot in this section)
- Fixes software-mansion/scarb#2823
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.