[go: up one dir, main page]

Plugin: Fix discrepancy of ticket update field in receipt for past protocols

Problem

We found a naming discrepancy in the ticket updates in receipt which was included in the Lima proposal.

For external operations, the ticket updates field is named ticket_updates like this:

"ticket_updates":[{"ticket_token":{"ticketer":"KT1JGcC8DuWHcShu6XvtfgKVnV2zcYsZ4TVH","content_type":{"prim":"unit"},"content":{"prim":"Unit"}},"updates":[{"account":"KT1JoRgUcR6NApwMLnBZ2pehCzp8tR4HtkHj","amount":"-2"}]}]

But for internal operations, the ticket updates field is named ticket_receipt like this:

"ticket_receipt":[{"ticket_token":{"ticketer":"KT1JGcC8DuWHcShu6XvtfgKVnV2zcYsZ4TVH","content_type":{"prim":"string"},"content":{"string":"Ferosinge"}},"updates":[{"account":"KT1JoRgUcR6NApwMLnBZ2pehCzp8tR4HtkHj","amount":"1"}]}]

(here is an example operation)

This naming discrepancy between external/internal operation was not intended (both should have been ticket_updates).

Solution

Override the encoding definition operation_data_encoding using the plugin feature. Namely, we:

  1. Define register_encoding/find_encoding in shell_plugin.ml
  2. Fetch the registered encoding here in block_services.ml.
Edited by Lin Oshitani