Skip to content

Sapling client: forge/submit with binary/JSON format

Depends/rebased on !139 (closed). Please merge !139 (closed) first.

"tezos-client sapling forge" was initially forging transactions and writing on the disk in JSON. Submitting the transaction using "tezos-client sapling submit" was also using the JSON format. For a smart contract, a sapling_transaction object is bytes, and the JSON given in the submit command was transformed into its bytes representation to be sent to the shielded-tez smart contract.

Even if the combinaison "sapling forge/sapling submit" does work well, forging transactions for other smart contracts than the shielded-tez example is not possible because there is no way to convert the JSON given by "sapling forge" into the bytes format.

This commit changes forge/submit to use the binary format by default, and --json can be used to write/read in JSON. With this change, arguments of type sapling_transaction can be constructed using "sapling forge" and smart contracts expecting arguments of type sapling_transaction can be called using the usual "tezos-client transfer".

However, it is still not feasible to call any smart contract because of the Contract_input.t type. The code is essentially related to the shielded-tez smart contract. The context must be changed.

TODO:

  • Test when submitting a sapling transaction in JSON (resp. binary) format without (resp. with) --json argument
  • Submitting a shielded transaction with tezos-client transfer using the binary format of the transaction.
Edited by Danny Willems

Merge request reports