dash/test/lint/lint-circular-dependencies.sh
dustinface ae506bae66
refactor: PrivateSend -> CoinJoin + Move the tab (#4038)
* qt|wallet|privatesend: Rename PrivateSend to CoinJoin in GUI strings

* qt: Move CoinJoin next to Transactions

* qt: Adjust status tip of privateSendCoinsMenuAction

Co-authored-by: thephez <thephez@users.noreply.github.com>

* rename: privateSend -> coinJoin

* rename: privatesend -> coinjoin

* rename: PrivateSend -> CoinJoin

* rename: use_ps -> use_cj

* rename: PRIVATESEND -> COINJOIN

* rename: privatesend -> coinjoin for files and folders

* refactor: Re-order coinjoin files in cmake/make files

* refactor: Re-order coinjoin includes where it makes sense

* test: Update lint-circular-dependencies.sh

* Few cleanups

* test: test/coinjoin_tests.cpp -> wallet/test/coinjoin_test.cpp

* s/AdvancedPSUI/AdvancedCJUI/g

* s/privateSentAmountChanged/coinJoinAmountChanged/g

* wallet: Rename "ps_salt" backwards compatible

* Minimal PrivateSend -> CoinJoin migration for settings and cmd-line

* wallet: Fix privatesendrounds -> coinjoinrounds migration

* qt: Migrate nPrivateSendAmount -> nCoinJoinAmount

* `-coinjoindenoms` never existed

* Migrate all PS options/settings

* rpc: Formatting only

* qt: Make Send/CoinJoin tabs a bit more distinguishable

Co-authored-by: thephez <thephez@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-03-17 18:36:11 -04:00

186 lines
11 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Check for circular dependencies
export LC_ALL=C
EXPECTED_CIRCULAR_DEPENDENCIES=(
"chainparamsbase -> util -> chainparamsbase"
"checkpoints -> validation -> checkpoints"
# "index/txindex -> validation -> index/txindex"
"policy/fees -> txmempool -> policy/fees"
"policy/policy -> validation -> policy/policy"
"qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel"
"qt/bantablemodel -> qt/clientmodel -> qt/bantablemodel"
"qt/bitcoingui -> qt/utilitydialog -> qt/bitcoingui"
"qt/bitcoingui -> qt/walletframe -> qt/bitcoingui"
"qt/bitcoingui -> qt/walletview -> qt/bitcoingui"
"qt/clientmodel -> qt/peertablemodel -> qt/clientmodel"
"qt/paymentserver -> qt/walletmodel -> qt/paymentserver"
"qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel"
"qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel"
"qt/walletmodel -> qt/walletmodeltransaction -> qt/walletmodel"
"rpc/rawtransaction -> wallet/rpcwallet -> rpc/rawtransaction"
"txmempool -> validation -> txmempool"
"validation -> validationinterface -> validation"
"wallet/fees -> wallet/wallet -> wallet/fees"
"wallet/rpcwallet -> wallet/wallet -> wallet/rpcwallet"
"wallet/wallet -> wallet/walletdb -> wallet/wallet"
"policy/fees -> policy/policy -> validation -> policy/fees"
"qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/addressbookpage"
"txmempool -> validation -> validationinterface -> txmempool"
"qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/receivecoinsdialog -> qt/addressbookpage"
"qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/signverifymessagedialog -> qt/addressbookpage"
"qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/sendcoinsdialog -> qt/sendcoinsentry -> qt/addressbookpage"
# Dash
"coinjoin/coinjoin-server -> init -> coinjoin/coinjoin-server"
"coinjoin/coinjoin-server -> net_processing -> coinjoin/coinjoin-server"
"coinjoin/coinjoin -> llmq/quorums_chainlocks -> net -> coinjoin/coinjoin"
"coinjoin/coinjoin -> llmq/quorums_instantsend -> wallet/wallet -> coinjoin/coinjoin"
"coinjoin/coinjoin-client -> init -> dsnotificationinterface -> coinjoin/coinjoin-client"
"coinjoin/coinjoin-client -> init -> masternode/masternode-utils -> coinjoin/coinjoin-client"
"coinjoin/coinjoin-client -> init -> net_processing -> coinjoin/coinjoin-client"
"coinjoin/coinjoin -> llmq/quorums_instantsend -> wallet/wallet -> wallet/coinselection -> coinjoin/coinjoin"
"evo/cbtx -> evo/simplifiedmns -> evo/cbtx"
"evo/cbtx -> evo/specialtx -> evo/cbtx"
"evo/deterministicmns -> evo/providertx -> evo/deterministicmns"
"evo/deterministicmns -> evo/simplifiedmns -> evo/deterministicmns"
"evo/deterministicmns -> evo/specialtx -> evo/deterministicmns"
"evo/deterministicmns -> llmq/quorums_commitment -> evo/deterministicmns"
"evo/deterministicmns -> llmq/quorums_utils -> evo/deterministicmns"
"evo/deterministicmns -> validation -> evo/deterministicmns"
"evo/mnauth -> net_processing -> evo/mnauth"
"evo/providertx -> validation -> evo/providertx"
"evo/specialtx -> llmq/quorums_blockprocessor -> evo/specialtx"
"evo/specialtx -> llmq/quorums_commitment -> evo/specialtx"
"evo/specialtx -> validation -> evo/specialtx"
"governance/governance -> governance/governance-classes -> governance/governance"
"governance/governance -> governance/governance-object -> governance/governance"
"governance/governance -> init -> governance/governance"
"governance/governance -> masternode/masternode-sync -> governance/governance"
"governance/governance -> net_processing -> governance/governance"
"governance/governance-object -> governance/governance-validators -> governance/governance-object"
"governance/governance-object -> governance/governance-vote -> governance/governance-object"
"governance/governance-object -> validationinterface -> governance/governance-object"
"init -> masternode/masternode-sync -> init"
"init -> masternode/masternode-utils -> init"
"init -> net_processing -> init"
"init -> netfulfilledman -> init"
"init -> rpc/server -> init"
"init -> txdb -> init"
"init -> validation -> init"
"init -> validationinterface -> init"
"llmq/quorums -> llmq/quorums_init -> llmq/quorums"
"llmq/quorums -> llmq/quorums_utils -> llmq/quorums"
"llmq/quorums_blockprocessor -> net_processing -> llmq/quorums_blockprocessor"
"llmq/quorums_chainlocks -> llmq/quorums_instantsend -> llmq/quorums_chainlocks"
"llmq/quorums_chainlocks -> net_processing -> llmq/quorums_chainlocks"
"llmq/quorums_chainlocks -> validation -> llmq/quorums_chainlocks"
"llmq/quorums_dkgsessionmgr -> net_processing -> llmq/quorums_dkgsessionmgr"
"llmq/quorums_instantsend -> net_processing -> llmq/quorums_instantsend"
"llmq/quorums_instantsend -> txmempool -> llmq/quorums_instantsend"
"llmq/quorums_instantsend -> validation -> llmq/quorums_instantsend"
"llmq/quorums_instantsend -> wallet/wallet -> llmq/quorums_instantsend"
"llmq/quorums_signing -> llmq/quorums_signing_shares -> llmq/quorums_signing"
"llmq/quorums_signing -> net_processing -> llmq/quorums_signing"
"llmq/quorums_signing_shares -> net_processing -> llmq/quorums_signing_shares"
"logging -> util -> logging"
"masternode/masternode-payments -> net_processing -> masternode/masternode-payments"
"masternode/masternode-payments -> validation -> masternode/masternode-payments"
"masternode/masternode-sync -> net -> masternode/masternode-sync"
"net -> netmessagemaker -> net"
"net_processing -> spork -> net_processing"
"netaddress -> netbase -> netaddress"
"qt/appearancewidget -> qt/guiutil -> qt/appearancewidget"
"qt/bitcoinaddressvalidator -> qt/guiutil -> qt/bitcoinaddressvalidator"
"qt/bitcoingui -> qt/guiutil -> qt/bitcoingui"
"qt/guiutil -> qt/optionsdialog -> qt/guiutil"
"qt/guiutil -> qt/qvalidatedlineedit -> qt/guiutil"
"core_io -> evo/cbtx -> evo/deterministicmns -> core_io"
"core_io -> evo/cbtx -> evo/simplifiedmns -> core_io"
"dsnotificationinterface -> governance/governance -> init -> dsnotificationinterface"
"evo/cbtx -> evo/deterministicmns -> validation -> evo/cbtx"
"evo/deterministicmns -> validationinterface -> governance/governance-vote -> evo/deterministicmns"
"evo/deterministicmns -> llmq/quorums_utils -> masternode/masternode-meta -> evo/deterministicmns"
"evo/deterministicmns -> llmq/quorums_utils -> net -> evo/deterministicmns"
"evo/simplifiedmns -> llmq/quorums_blockprocessor -> net_processing -> evo/simplifiedmns"
"governance/governance-classes -> init -> masternode/masternode-payments -> governance/governance-classes"
"httprpc -> httpserver -> init -> httprpc"
"httpserver -> init -> httpserver"
"init -> llmq/quorums_init -> llmq/quorums_signing_shares -> init"
"init -> llmq/quorums_signing -> llmq/quorums -> init"
"llmq/quorums -> llmq/quorums_init -> llmq/quorums_chainlocks -> llmq/quorums"
"llmq/quorums -> llmq/quorums_init -> llmq/quorums_signing -> llmq/quorums"
"llmq/quorums -> llmq/quorums_init -> llmq/quorums_signing_shares -> llmq/quorums"
"llmq/quorums_blockprocessor -> net_processing -> llmq/quorums_init -> llmq/quorums_blockprocessor"
"llmq/quorums_chainlocks -> net_processing -> llmq/quorums_init -> llmq/quorums_chainlocks"
"llmq/quorums_chainlocks -> net_processing -> validationinterface -> llmq/quorums_chainlocks"
"llmq/quorums_chainlocks -> llmq/quorums_instantsend -> wallet/wallet -> llmq/quorums_chainlocks"
"llmq/quorums_dkgsession -> llmq/quorums_dkgsessionmgr -> llmq/quorums_dkgsessionhandler -> llmq/quorums_dkgsession"
"llmq/quorums_dkgsessionhandler -> llmq/quorums_init -> llmq/quorums_dkgsessionmgr -> llmq/quorums_dkgsessionhandler"
"llmq/quorums_dkgsessionmgr -> net_processing -> llmq/quorums_init -> llmq/quorums_dkgsessionmgr"
"llmq/quorums_init -> llmq/quorums_instantsend -> net_processing -> llmq/quorums_init"
"llmq/quorums_instantsend -> net_processing -> validationinterface -> llmq/quorums_instantsend"
"logging -> util -> random -> logging"
"logging -> util -> sync -> logging"
"logging -> util -> stacktraces -> logging"
"coinjoin/coinjoin-client -> coinjoin/coinjoin-util -> wallet/wallet -> coinjoin/coinjoin-client"
"qt/appearancewidget -> qt/guiutil -> qt/optionsdialog -> qt/appearancewidget"
"qt/bitcoinaddressvalidator -> qt/guiutil -> qt/qvalidatedlineedit -> qt/bitcoinaddressvalidator"
"qt/guiutil -> qt/optionsdialog -> qt/optionsmodel -> qt/guiutil"
"bloom -> evo/cbtx -> evo/simplifiedmns -> merkleblock -> bloom"
"bloom -> evo/cbtx -> llmq/quorums_blockprocessor -> net -> bloom"
"evo/deterministicmns -> evo/simplifiedmns -> llmq/quorums_blockprocessor -> llmq/quorums_debug -> evo/deterministicmns"
"evo/deterministicmns -> validationinterface -> governance/governance-vote -> masternode/masternode-sync -> evo/deterministicmns"
"evo/deterministicmns -> evo/simplifiedmns -> llmq/quorums_blockprocessor -> net_processing -> evo/deterministicmns"
"evo/specialtx -> llmq/quorums_blockprocessor -> net_processing -> txmempool -> evo/specialtx"
"governance/governance-vote -> masternode/masternode-sync -> validation -> validationinterface -> governance/governance-vote"
"init -> llmq/quorums_init -> llmq/quorums_instantsend -> wallet/wallet -> init"
"evo/providertx -> evo/specialtx -> llmq/quorums_blockprocessor -> net_processing -> txmempool -> evo/providertx"
"governance/governance -> init -> llmq/quorums_init -> llmq/quorums_instantsend -> wallet/wallet -> governance/governance"
)
EXIT_CODE=0
CIRCULAR_DEPENDENCIES=()
IFS=$'\n'
for CIRC in $(cd src && ../contrib/devtools/circular-dependencies.py {*,*/*,*/*/*}.{h,cpp} | sed -e 's/^Circular dependency: //'); do
CIRCULAR_DEPENDENCIES+=($CIRC)
IS_EXPECTED_CIRC=0
for EXPECTED_CIRC in "${EXPECTED_CIRCULAR_DEPENDENCIES[@]}"; do
if [[ "${CIRC}" == "${EXPECTED_CIRC}" ]]; then
IS_EXPECTED_CIRC=1
break
fi
done
if [[ ${IS_EXPECTED_CIRC} == 0 ]]; then
echo "A new circular dependency in the form of \"${CIRC}\" appears to have been introduced."
echo
EXIT_CODE=1
fi
done
for EXPECTED_CIRC in "${EXPECTED_CIRCULAR_DEPENDENCIES[@]}"; do
IS_PRESENT_EXPECTED_CIRC=0
for CIRC in "${CIRCULAR_DEPENDENCIES[@]}"; do
if [[ "${CIRC}" == "${EXPECTED_CIRC}" ]]; then
IS_PRESENT_EXPECTED_CIRC=1
break
fi
done
if [[ ${IS_PRESENT_EXPECTED_CIRC} == 0 ]]; then
echo "Good job! The circular dependency \"${EXPECTED_CIRC}\" is no longer present."
echo "Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in $0"
echo "to make sure this circular dependency is not accidentally reintroduced."
echo
EXIT_CODE=1
fi
done
exit ${EXIT_CODE}