From 9002f39cd90bc505424f3933ac0b6c02a34e56c2 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 28 Dec 2023 03:50:39 +0700 Subject: [PATCH] refactor: drop circular dependency llmq/quorums <-> llmq/utils --- src/llmq/utils.cpp | 7 ++++++- test/lint/lint-circular-dependencies.sh | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/llmq/utils.cpp b/src/llmq/utils.cpp index ad7a512153..5f170221d8 100644 --- a/src/llmq/utils.cpp +++ b/src/llmq/utils.cpp @@ -5,7 +5,6 @@ #include #include -#include #include #include @@ -25,6 +24,12 @@ #include class CBLSSignature; +namespace llmq +{ +class CQuorum; +using CQuorumPtr = std::shared_ptr; +using CQuorumCPtr = std::shared_ptr; +} /** * Forward declarations diff --git a/test/lint/lint-circular-dependencies.sh b/test/lint/lint-circular-dependencies.sh index 3ad88a486c..8ac4c0d8be 100755 --- a/test/lint/lint-circular-dependencies.sh +++ b/test/lint/lint-circular-dependencies.sh @@ -33,10 +33,10 @@ EXPECTED_CIRCULAR_DEPENDENCIES=( "governance/classes -> governance/governance -> governance/classes" "governance/governance -> governance/object -> governance/governance" "governance/governance -> masternode/sync -> governance/governance" - "llmq/quorums -> llmq/utils -> llmq/quorums" "llmq/chainlocks -> llmq/instantsend -> llmq/chainlocks" "llmq/chainlocks -> llmq/instantsend -> net_processing -> llmq/chainlocks" "llmq/dkgsessionmgr -> net_processing -> llmq/dkgsessionmgr" + "llmq/dkgsessionmgr -> net_processing -> llmq/quorums -> llmq/dkgsessionmgr" "llmq/instantsend -> net_processing -> llmq/instantsend" "llmq/instantsend -> txmempool -> llmq/instantsend" "llmq/instantsend -> validation -> llmq/instantsend" @@ -85,6 +85,7 @@ EXPECTED_CIRCULAR_DEPENDENCIES=( "evo/simplifiedmns -> llmq/blockprocessor -> llmq/utils -> llmq/snapshot -> evo/simplifiedmns" "llmq/blockprocessor -> llmq/utils -> llmq/snapshot -> llmq/blockprocessor" "llmq/context -> llmq/dkgsessionmgr -> net_processing -> llmq/context" + "llmq/dkgsession -> llmq/dkgsessionmgr -> net_processing -> llmq/quorums -> llmq/dkgsession" "llmq/commitment -> llmq/utils -> llmq/snapshot -> llmq/commitment" "spork -> validation -> spork" "governance/governance -> validation -> governance/governance"