Page MenuHomePhabricator

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

Authored by tobias_ruck on Apr 26 2023, 16:46.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chronik-opcode-const
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23494
Build 46607: Build Diffbuild-chronik
Build 46606: arc lint + arc unit