Open willemneal opened 2 weeks ago
The original implementation had --force
, but Leigh suggested to always replace the contract id. Is there any real case where you wouldn't want to persist the latest contract id?
https://github.com/stellar/stellar-cli/pull/1356#discussion_r1626762468
My feedback was that --force is confusing because it doesn't communicate the scope of what is being forced. An option like --force should be focused on the primary action being performed by a command which in this case is deploying the contract, and not related to an ancillary action being performed like saving an alias. Why: It's natural to see options related to their primary action. For example, if we add --force, this command looks like it forces deployment but is actually invalid:
$ stellar contract deploy --wasm ... --force
Or this command which is valid but I think most folks would assume means deployment is forced and the force is unrelated to the alias:
$ stellar contract deploy --wasm ... --force --alias c1
If we want aliases to not overwrite by default, then I think the path that results in a clearer API is:
rm
command for removing the aliasI expect that someone interacting with a pubnet network is probably keeping a record of their contract addresses concretely somewhere that isn't just in these aliases given that it is a production use case, and that these aliases are more useful during development, in which case overwriting feels fine. We overwrite elsewhere.
We could output a log line, or a stderr output saying the alias is being ovewritten and what the old value was and new value, so if someone accidentally ovewrites they can fix it.
Currently when reusing an alias it will overwrite the old contract id. Should we add a
--force
flag to allow this but fail otherwise?