Proto/client: retrieve ticket balances for smart rollups
What
Allow octez-client get ticket balance <for> to work with smart rollups.
Closes #6871 (closed)
Why
Many tickets may be deposited into smart rollups (for example with Etherlink, tickets representing 'mutez' are deposited). While there is an RPC to retrieve the ticket balance of individual tickets for a smart rollup, the octez-client command does not currently support it.
How
We add a new Destination_alias in the client, and use it for <src> for the get ticket balance command:
- If the argument is a contract address, use the contract RPC
- If it is a smart rollup address, use the smart rollup RPC.
Manually testing the MR
On master, the following will fail:
$ alias gclient='./octez-client --endpoint <ghostnet RPC>'
$ gclient get ticket balance for sr18wx6ezkeRjt1SZSeZ2UQzQN3Uc3YLMLqg \
with ticketer KT1Bp9YUvUBJgXxf5UrYTM2CGRUPixURqx4m and type 'pair nat (option bytes)' and content 'Pair 0 None'
Error:
Erroneous command line argument 5 (sr18wx6ezkeRjt1SZSeZ2UQzQN3Uc3YLMLqg).
bad contract notation
Invalid contract notation "sr18wx6ezkeRjt1SZSeZ2UQzQN3Uc3YLMLqg"
no contract or key named sr18wx6ezkeRjt1SZSeZ2UQzQN3Uc3YLMLqg
With this MR, you instead get the correct result:
$ gclient get ticket balance for sr18wx6ezkeRjt1SZSeZ2UQzQN3Uc3YLMLqg \
with ticketer KT1Bp9YUvUBJgXxf5UrYTM2CGRUPixURqx4m and type 'pair nat (option bytes)' and content 'Pair 0 None'
560255555749
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Emma Turner