mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-10 07:35:40 +01:00
fa4cb13b52test: [doc] Manually unify stale headers (MarcoFalke)fa5f297748scripted-diff: [doc] Unify stale copyright headers (MarcoFalke) Pull request description: Historically, the upper year range in file headers was bumped manually or with a script. This has many issues: * The script is causing churn. See for example commit306ccd4, or drive-by first-time contributions bumping them one-by-one. (A few from this year: https://github.com/bitcoin/bitcoin/pull/32008, https://github.com/bitcoin/bitcoin/pull/31642, https://github.com/bitcoin/bitcoin/pull/32963, ...) * Some, or likely most, upper year values were wrong. Reasons for incorrect dates could be code moves, cherry-picks, or simply bugs in the script. * The upper range is not needed for anything. * Anyone who wants to find the initial file creation date, or file history, can use `git log` or `git blame` to get more accurate results. * Many places are already using the `-present` suffix, with the meaning that the upper range is omitted. To fix all issues, this bumps the upper range of the copyright headers to `-present`. Further notes: * Obviously, the yearly 4-line bump commit for the build system (c.f.b537a2c02a) is fine and will remain. * For new code, the date range can be fully omitted, as it is done already by some developers. Obviously, developers are free to pick whatever style they want. One can list the commits for each style. * For example, to list all commits that use `-present`: `git log --format='%an (%ae) [%h: %s]' -S 'present The Bitcoin'`. * Alternatively, to list all commits that use no range at all: `git log --format='%an (%ae) [%h: %s]' -S '(c) The Bitcoin'`. <!-- * The lower range can be wrong as well, so it could be omitted as well, but this is left for a follow-up. A previous attempt was in https://github.com/bitcoin/bitcoin/pull/26817. ACKs for top commit: l0rinc: ACKfa4cb13b52rkrux: re-ACKfa4cb13b52janb84: ACKfa4cb13b52Tree-SHA512: e5132781bdc4417d1e2922809b27ef4cf0abb37ffb68c65aab8a5391d3c917b61a18928ec2ec2c75ef5184cb79a5b8c8290d63e949220dbeab3bd2c0dfbdc4c5
45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
// Copyright (c) 2020-present The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_TEST_UTIL_VALIDATION_H
|
|
#define BITCOIN_TEST_UTIL_VALIDATION_H
|
|
|
|
#include <validation.h>
|
|
|
|
namespace node {
|
|
class BlockManager;
|
|
}
|
|
class CValidationInterface;
|
|
|
|
struct TestBlockManager : public node::BlockManager {
|
|
/** Test-only method to clear internal state for fuzzing */
|
|
void CleanupForFuzzing();
|
|
};
|
|
|
|
struct TestChainstateManager : public ChainstateManager {
|
|
/** Disable the next write of all chainstates */
|
|
void DisableNextWrite();
|
|
/** Reset the ibd cache to its initial state */
|
|
void ResetIbd();
|
|
/** Toggle IsInitialBlockDownload from true to false */
|
|
void JumpOutOfIbd();
|
|
/** Wrappers that avoid making chainstatemanager internals public for tests */
|
|
void InvalidBlockFound(CBlockIndex* pindex, const BlockValidationState& state) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
|
void InvalidChainFound(CBlockIndex* pindexNew) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
|
CBlockIndex* FindMostWorkChain() EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
|
void ResetBestInvalid() EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
|
};
|
|
|
|
class ValidationInterfaceTest
|
|
{
|
|
public:
|
|
static void BlockConnected(
|
|
const kernel::ChainstateRole& role,
|
|
CValidationInterface& obj,
|
|
const std::shared_ptr<const CBlock>& block,
|
|
const CBlockIndex* pindex);
|
|
};
|
|
|
|
#endif // BITCOIN_TEST_UTIL_VALIDATION_H
|