refactor: Use ChainType enum exhaustively

This is a follow up of https://github.com/bitcoin/bitcoin/pull/27491,
more concretely
https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188847896,
for not using default cases (as per the style guide), and
https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188852707 and
https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188851857 for
avoiding dead code.

Also change chain name to chain type in docstrings
This commit is contained in:
TheCharlatan
2023-05-09 22:03:50 +02:00
parent fc06881f13
commit e23088707b
7 changed files with 9 additions and 13 deletions

View File

@@ -117,7 +117,7 @@ std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, c
return CChainParams::RegTest(opts);
}
}
throw std::invalid_argument(strprintf("%s: Invalid ChainType value", __func__));
assert(false);
}
void SelectParams(const ChainType chain)