-
Notifications
You must be signed in to change notification settings - Fork 114
Description
What problem does your feature solve?
There are inconsistencies in the CLI options available across commands that simulate and send transactions with contract invocations:
-
--sendoption missing oncontract uploadandcontract deploy: Thecontract invokecommand has a--sendoption that controls whether to simulate-only or actually send the transaction. This option is not available oncontract uploadorcontract deploy, meaning users cannot use the same interface for simulating without sending. The workaround is to use--build-only | stellar tx simulate, but this is inconsistent with thecontract invokeexperience. -
--costoption missing oncontract uploadandcontract deploy: Thecontract invokecommand has a--costoption that provides visibility into the costs paid. This option is not available oncontract uploadorcontract deploy, so users have no visibility into the costs of these operations. -
--costoption missing onstellar tx simulate: Even when using the workaround of piping tostellar tx simulate, there's no--costoption on that command either. Users can get back a simulated transaction, but cannot see human-friendly cost output on the command line without manually decoding the transaction to extract the costs.
Use case: A developer wants to measure ahead of time what the cost of uploading or deploying a contract will be on mainnet. Currently there's no straightforward way to simulate these operations and see the costs without actually submitting the transaction or manually decoding XDR output.
What would you like to see?
Any command that simulates or sends transactions with contract invoke host operations should support a consistent set of options for:
- Deciding whether to simulate-only or send (
--send) - Gaining insight into costs (
--cost)
Some examples (not exhaustive):
- Add
--sendoption tocontract uploadandcontract deploy - Add
--costoption tocontract uploadandcontract deploy - Add
--costoption tostellar tx simulate
There may be other commands that would benefit from these options as well. The general principle is that commands dealing with transaction simulation and submission should have a consistent interface.
What alternatives are there?
- Use
--build-onlyand pipe tostellar tx simulate(but this still lacks--costoutput) - Pipe the output of
stellar tx simulatetostellar xdr decodeto extract cost information from the transaction XDR
Metadata
Metadata
Assignees
Labels
Type
Projects
Status