Skip to content

Proto: Introduce an allow-zero-amount-tickets flag

Joel Bjornson requested to merge jobjo/tezos:allow-zero-tickets-flag into master

Context

Addresses #3194 (closed). In preparation for !5447 (merged). This MR introduces a new flag to allow_zero_amount_tickets passed to Ticket_operations_diff.ticket_diffs_of_operations:

val ticket_diffs_of_operations :
  Alpha_context.context ->
  allow_zero_amount_tickets:bool ->
  Script_typed_ir.packed_internal_operation list ->
  (ticket_token_diff list * Alpha_context.context) tzresult Lwt.t

When the flag is set to false the function fails with an error Invalid_zero_amount_ticket in case a zero-amount ticket is detected.

This will be useful for Layer 2 to Layer 1 transactions containing tickets as zero-amount tickets are not permitted. It will also be useful to keep the flag for blocking zero-amount tickets in the Layer 1 protocol as well is we

Manually testing the MR

dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe -- test "^ticket operations diff"

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.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Joel Bjornson

Merge request reports