-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
register
and register_at
fns to replace register_contract
, …
…`register_contract_with_constructor`, `register_contract_wasm`, `register_contract_wasm_with_constructor` (#1343) ### What Add `register` and `register_at` fns. Deprecate `register_contract` and `register_contract_wasm`. Unexport `register_contract_with_constructor` and `register_contract_wasm_with_constructor`. ### Why To reorient the register functions around what we expect the common cases to be: - registering without a contract id specified - registering with a constructor specified It's always been odd that the first parameter to most `register_contract` calls is `None`. It's confusing to look at the first time you see it, and for the most part most developers do not need to set a value for the contract id. Most contracts need initialization, and therefore I think most contracts over time will gain constructors. To do so in a way that is backwards compatible with previous releases. Close #1341 ### Known limitations It would be better imo if we could add the constructor arguments to the existing `register_contract` and `register_contract_wasm` fns, but that would be a breaking change. The `deploy_with_constructor` functions still exist which is inconsistent, but harder to align because to change the `deploy` function to always accept constructor args would be a breaking change. It's possible to update code that uses the existing register functions using a regex find and replace, but it's not the most trivial regex to work out. If folks wish to resolve the deprecation warning they'll need to update potentially every test they've written. That in itself is not a great developer experience. The old and new way don't look that different, and so for existing Soroban developers, the change from the old to new way may be confusing at a glance. This PR doesn't touch the register stellar asset contract functions at all. Ideas?
- Loading branch information
1 parent
1367be1
commit 9507fc4
Showing
58 changed files
with
344 additions
and
219 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.