[go: up one dir, main page]

Tezlink/Kernel/Receipts : Derive NomReader and BinWriter for (AppliedOperation,TezBlock,BalanceTooLow)

Related to !18493 (merged)

What

Refactors some Tezlink kernel types by introducing enc_wrappers to handle binary serialization of common primitives like BlockHash/OperationHash and BlockNumber.

Why

Unifies and simplifies the binary encoding/decoding of Tezos-related types, such as hashes and block numbers

How

  • Introduced the enc_wrappers module containing reusable wrapper types:
    • Hash for H256
    • BlockNumber for U256
  • Replaced old BlockHash definitions in operation.rs and operation_result.rs with unified types from enc_wrappers.
  • Updated related test code and function logic to use these wrappers.
  • Annotated structures like TezBlock and AppliedOperation with derive macros for BinWriter and NomReader where applicable.

Manually testing the MR

Run existing Tezlink kernel unit tests:

cd etherlink/kernel_latest/tezos
cargo test
Edited by Brahima Dibassi

Merge request reports

Loading