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.
feat: allow multiple salt declarations in
forc deploy
(FuelLabs#4362)
## Description Closes FuelLabs#4117 Allow multiple salt declarations in `forc deploy`, with parsing and validation involved. The gist of it is that it collects all the salt inputs by the user as a `Vec<String>`, parses each input as a `Salt` and store them in a `ContractSaltMap` matching contract->salt, and later compares them against the contract dependencies to make sure that duplicate salts do not exist. This throws an error if: 1) multiple salts are present (if the same salt is declared but also found within a contract dependency), 2) if a salt is invalid, 3) if the salt input is invalid (there's a difference - the salt input is the string `<CONTRACT>:<SALT>`, while the salt above is `fuel_tx::Salt`, which has its own validation. 4) duplicate salts for the same contract were provided in the CLI. Tests consist of dummy folders (not entire full package initialized by forc) with only manifests to keep it the bare minimum required for these tests. ## 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. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] 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. --------- Co-authored-by: Mohammad Fawaz <[email protected]>
- Loading branch information
1 parent
c16c850
commit 650869f
Showing
9 changed files
with
295 additions
and
38 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
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
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
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
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.