HomePhabricator

refactor: Replace string chain name constants with ChainTypes

Description

refactor: Replace string chain name constants with ChainTypes

Summary:
This commit effectively moves the definition of these constants
out of the chainparamsbase to their own file.

Using the ChainType enums provides better type safety compared to
passing around strings.

The commit is part of an ongoing effort to decouple the libbitcoinkernel
library from the ArgsManager and other functionality that should not be
part of the kernel library.

Backport note: the Config ctor could also take a ChainType param instead of a network string but lets do this in a separate diff

This is a partial backport of core#27491
https://github.com/bitcoin/bitcoin/pull/27491/commits/ba8fc7d788932b25864fb260ca14983aa2398c23

Depends on D17987

Test Plan:
With Chronik compiled:
ninja all check-all bench-bitcoin bitcoin-fuzzers

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
TheCharlatan <seb.kung@gmail.com>Authored on Apr 17 2023, 20:20
PiRKCommitted on Sat, Apr 26, 12:05
PiRKPushed on Sat, Apr 26, 12:05
Reviewer
Restricted Project
Differential Revision
D17988: refactor: Replace string chain name constants with ChainTypes
Parents
rABCd40c68b72040: [cashtab] Transaction row UI
Branches
Unknown
Tags
Unknown