forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: calculate contract dependency ids with tests disabled (FuelLabs#…
…4159) ## Description closes FuelLabs#4155. unblocks FuelLabs#4156. Since we are using the build profile derived from build flags of forc for nodes in the dependency graph, contract dependencies can end-up getting compiled with tests (we are fine if we compile with `forc build` but this issue surfaces once we use `forc build --tests`). This is not something we want because of two reasons: 1. In terms of `forc-pkg`: We shouldn’t allow this as inserted contract id and deployed contract id should be the same for the feature to work all the time. (This is the case if you run forc build today but if you run forc build --tests the inserted contract ids are essentially wrong, if you have some tests in those packages) 2. In terms of `forc-test`: The contract deployment’s are done without the tests so their contract ids are calculated without the tests, since forc-pkg inserts the contract id calculated with tests included. The actual contract id in the interpreter instance and injected contract id is different. This means calls using the following abi declaration is failing: `let abi = abi(MyContractABIinContractDependency, contract_dependency::CONTRACT_ID)` . Basically we cannot use contract id namespace injection feature with the unit tests. `forc-test` related problems are not apparent yet since multi contract calls are not enabled (they will be with FuelLabs#4156). ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers.
- Loading branch information
1 parent
ed15a08
commit 3d5c69c
Showing
5 changed files
with
204 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.