HomePhabricator

[Chronik] Add `Opcode::N` to get a constant with the opcode's number

Description

[Chronik] Add Opcode::N to get a constant with the opcode's number

Summary:
In some cases it is much cleaner to have a constant with the opcode number directly.

We use the fact that constants and modules don't share a namespace, and therefore we can define a module with the same name as the opcode and include constants in there, e.g. N, for the opcode number.

Test Plan: ninja check-crates

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D13795

Details

Provenance
tobias_ruckAuthored on Apr 27 2023, 23:36
tobias_ruckPushed on Apr 27 2023, 23:38
Reviewer
Restricted Project
Differential Revision
D13795: [Chronik] Add `Opcode::N` to get a constant with the opcode's number
Parents
rABC1efb53c8e387: test: Fix out-of-range port collisions
Branches
Unknown
Tags
Unknown