diff --git a/src/bls/bls.h b/src/bls/bls.h index 48c3d02018..a670256486 100644 --- a/src/bls/bls.h +++ b/src/bls/bls.h @@ -434,22 +434,22 @@ public: return hash; } }; -typedef CBLSLazyWrapper CBLSLazySignature; -typedef CBLSLazyWrapper CBLSLazyPublicKey; -typedef CBLSLazyWrapper CBLSLazySecretKey; +using CBLSLazySignature = CBLSLazyWrapper; +using CBLSLazyPublicKey = CBLSLazyWrapper; +using CBLSLazySecretKey = CBLSLazyWrapper; #endif -typedef std::vector BLSIdVector; -typedef std::vector BLSVerificationVector; -typedef std::vector BLSPublicKeyVector; -typedef std::vector BLSSecretKeyVector; -typedef std::vector BLSSignatureVector; +using BLSIdVector = std::vector; +using BLSVerificationVector = std::vector; +using BLSPublicKeyVector = std::vector; +using BLSSecretKeyVector = std::vector; +using BLSSignatureVector = std::vector; -typedef std::shared_ptr BLSIdVectorPtr; -typedef std::shared_ptr BLSVerificationVectorPtr; -typedef std::shared_ptr BLSPublicKeyVectorPtr; -typedef std::shared_ptr BLSSecretKeyVectorPtr; -typedef std::shared_ptr BLSSignatureVectorPtr; +using BLSIdVectorPtr = std::shared_ptr; +using BLSVerificationVectorPtr = std::shared_ptr; +using BLSPublicKeyVectorPtr = std::shared_ptr; +using BLSSecretKeyVectorPtr = std::shared_ptr; +using BLSSignatureVectorPtr = std::shared_ptr; bool BLSInit(); diff --git a/src/bls/bls_batchverifier.h b/src/bls/bls_batchverifier.h index 8f644cc23d..2225de415a 100644 --- a/src/bls/bls_batchverifier.h +++ b/src/bls/bls_batchverifier.h @@ -21,9 +21,9 @@ private: CBLSPublicKey pubKey; }; - typedef std::map MessageMap; - typedef typename MessageMap::iterator MessageMapIterator; - typedef std::map> MessagesBySourceMap; + using MessageMap = std::map; + using MessageMapIterator = typename MessageMap::iterator; + using MessagesBySourceMap = std::map>; bool secureVerification; bool perMessageFallback; diff --git a/src/bls/bls_ies.h b/src/bls/bls_ies.h index c5d7421bab..43d4c0be10 100644 --- a/src/bls/bls_ies.h +++ b/src/bls/bls_ies.h @@ -69,8 +69,8 @@ public: class CBLSIESMultiRecipientBlobs { public: - typedef std::vector Blob; - typedef std::vector BlobVector; + using Blob = std::vector; + using BlobVector = std::vector; CBLSPublicKey ephemeralPubKey; uint256 ivSeed; @@ -96,7 +96,7 @@ template class CBLSIESMultiRecipientObjects : public CBLSIESMultiRecipientBlobs { public: - typedef std::vector ObjectVector; + using ObjectVector = std::vector; bool Encrypt(const std::vector& recipients, const ObjectVector& _objects, int nVersion) { diff --git a/src/bls/bls_worker.cpp b/src/bls/bls_worker.cpp index e10cc7230d..a0b73606fc 100644 --- a/src/bls/bls_worker.cpp +++ b/src/bls/bls_worker.cpp @@ -129,8 +129,6 @@ bool CBLSWorker::GenerateContributions(int quorumThreshold, const BLSIdVector& i // input vector is stored. This means that the input vector must stay alive for the whole lifetime of the Aggregator template struct Aggregator : public std::enable_shared_from_this> { - typedef T ElementType; - size_t batchSize{16}; std::shared_ptr > inputVec; @@ -146,7 +144,7 @@ struct Aggregator : public std::enable_shared_from_this> { // keeps track of currently queued/in-progress batches. If it reaches 0, we are done std::atomic waitCount{0}; - typedef std::function DoneCallback; + using DoneCallback = std::function; DoneCallback doneCallback; // TP can either be a pointer or a reference @@ -331,11 +329,11 @@ struct Aggregator : public std::enable_shared_from_this> { // Same rules for the input vectors apply to the VectorAggregator as for the Aggregator (they must stay alive) template struct VectorAggregator : public std::enable_shared_from_this> { - typedef Aggregator AggregatorType; - typedef std::vector VectorType; - typedef std::shared_ptr VectorPtrType; - typedef std::vector VectorVectorType; - typedef std::function DoneCallback; + using AggregatorType = Aggregator; + using VectorType = std::vector; + using VectorPtrType = std::shared_ptr; + using VectorVectorType = std::vector; + using DoneCallback = std::function; DoneCallback doneCallback; const VectorVectorType& vecs; diff --git a/src/bls/bls_worker.h b/src/bls/bls_worker.h index fd9426fc76..25f137732b 100644 --- a/src/bls/bls_worker.h +++ b/src/bls/bls_worker.h @@ -20,9 +20,9 @@ class CBLSWorker { public: - typedef std::function SignDoneCallback; - typedef std::function SigVerifyDoneCallback; - typedef std::function CancelCond; + using SignDoneCallback = std::function; + using SigVerifyDoneCallback = std::function; + using CancelCond = std::function; private: ctpl::thread_pool workerPool; diff --git a/src/cachemap.h b/src/cachemap.h index e1f225abc9..5c8e8921db 100644 --- a/src/cachemap.h +++ b/src/cachemap.h @@ -42,21 +42,21 @@ template class CacheMap { public: - typedef Size size_type; + using size_type = Size; - typedef CacheItem item_t; + using item_t = CacheItem; - typedef std::list list_t; + using list_t = std::list; - typedef typename list_t::iterator list_it; + using list_it = typename list_t::iterator; - typedef typename list_t::const_iterator list_cit; + using list_cit = typename list_t::const_iterator; - typedef std::map map_t; + using map_t = std::map; - typedef typename map_t::iterator map_it; + using map_it = typename map_t::iterator; - typedef typename map_t::const_iterator map_cit; + using map_cit = typename map_t::const_iterator; private: size_type nMaxSize; diff --git a/src/cachemultimap.h b/src/cachemultimap.h index 89bbe4bdc3..5b7d002540 100644 --- a/src/cachemultimap.h +++ b/src/cachemultimap.h @@ -21,27 +21,27 @@ template class CacheMultiMap { public: - typedef Size size_type; + using size_type = Size; - typedef CacheItem item_t; + using item_t = CacheItem; - typedef std::list list_t; + using list_t = std::list; - typedef typename list_t::iterator list_it; + using list_it = typename list_t::iterator; - typedef typename list_t::const_iterator list_cit; + using list_cit = typename list_t::const_iterator; - typedef std::map it_map_t; + using it_map_t = std::map; - typedef typename it_map_t::iterator it_map_it; + using it_map_it = typename it_map_t::iterator; - typedef typename it_map_t::const_iterator it_map_cit; + using it_map_cit = typename it_map_t::const_iterator; - typedef std::map map_t; + using map_t = std::map; - typedef typename map_t::iterator map_it; + using map_it = typename map_t::iterator; - typedef typename map_t::const_iterator map_cit; + using map_cit = typename map_t::const_iterator; private: size_type nMaxSize; diff --git a/src/coinjoin/client.h b/src/coinjoin/client.h index 1dc97ad896..05868ee631 100644 --- a/src/coinjoin/client.h +++ b/src/coinjoin/client.h @@ -11,7 +11,7 @@ #include class CDeterministicMN; -typedef std::shared_ptr CDeterministicMNCPtr; +using CDeterministicMNCPtr = std::shared_ptr; class CCoinJoinClientManager; class CCoinJoinClientQueueManager; diff --git a/src/evo/deterministicmns.h b/src/evo/deterministicmns.h index 0c90690172..8c1086c301 100644 --- a/src/evo/deterministicmns.h +++ b/src/evo/deterministicmns.h @@ -131,8 +131,8 @@ public: std::string ToString() const; void ToJson(UniValue& obj) const; }; -typedef std::shared_ptr CDeterministicMNStatePtr; -typedef std::shared_ptr CDeterministicMNStateCPtr; +using CDeterministicMNStatePtr = std::shared_ptr; +using CDeterministicMNStateCPtr = std::shared_ptr; class CDeterministicMNStateDiff { @@ -259,7 +259,7 @@ public: std::string ToString() const; void ToJson(UniValue& obj) const; }; -typedef std::shared_ptr CDeterministicMNCPtr; +using CDeterministicMNCPtr = std::shared_ptr; class CDeterministicMNListDiff; @@ -301,9 +301,9 @@ inline void SerReadWrite(Stream& s, immer::map& obj, CSerActi class CDeterministicMNList { public: - typedef immer::map MnMap; - typedef immer::map MnInternalIdMap; - typedef immer::map > MnUniquePropertyMap; + using MnMap = immer::map; + using MnInternalIdMap = immer::map; + using MnUniquePropertyMap = immer::map >; private: uint256 blockHash; diff --git a/src/evo/evodb.h b/src/evo/evodb.h index 82417fd0fb..8702168f57 100644 --- a/src/evo/evodb.h +++ b/src/evo/evodb.h @@ -36,8 +36,8 @@ public: private: CDBWrapper db; - typedef CDBTransaction RootTransaction; - typedef CDBTransaction CurTransaction; + using RootTransaction = CDBTransaction; + using CurTransaction = CDBTransaction; CDBBatch rootBatch; RootTransaction rootDBTransaction; diff --git a/src/governance/classes.h b/src/governance/classes.h index 601c2a6471..f106f1d8b8 100644 --- a/src/governance/classes.h +++ b/src/governance/classes.h @@ -17,7 +17,7 @@ class CSuperblock; class CGovernanceTriggerManager; class CSuperblockManager; -typedef std::shared_ptr CSuperblock_sptr; +using CSuperblock_sptr = std::shared_ptr; // DECLARE GLOBAL VARIABLES FOR GOVERNANCE CLASSES extern CGovernanceTriggerManager triggerman; diff --git a/src/governance/governance.h b/src/governance/governance.h index 40490c5c18..8d30df7cc6 100644 --- a/src/governance/governance.h +++ b/src/governance/governance.h @@ -23,7 +23,7 @@ extern CGovernanceManager governance; static const int RATE_BUFFER_SIZE = 5; class CDeterministicMNList; -typedef std::shared_ptr CDeterministicMNListPtr; +using CDeterministicMNListPtr = std::shared_ptr; class CRateCheckBuffer { @@ -145,13 +145,13 @@ public: // Types }; - typedef CacheMap object_ref_cm_t; + using object_ref_cm_t = CacheMap; - typedef CacheMultiMap vote_cmm_t; + using vote_cmm_t = CacheMultiMap; - typedef std::map txout_m_t; + using txout_m_t = std::map; - typedef std::set hash_s_t; + using hash_s_t = std::set; private: static const int MAX_CACHE_SIZE = 1000000; diff --git a/src/governance/object.h b/src/governance/object.h index 9b55887c42..1963996880 100644 --- a/src/governance/object.h +++ b/src/governance/object.h @@ -44,7 +44,7 @@ static const int SEEN_OBJECT_ERROR_INVALID = 1; static const int SEEN_OBJECT_EXECUTED = 3; //used for triggers static const int SEEN_OBJECT_UNKNOWN = 4; // the default -typedef std::pair vote_time_pair_t; +using vote_time_pair_t = std::pair; inline bool operator<(const vote_time_pair_t& p1, const vote_time_pair_t& p2) { @@ -72,7 +72,7 @@ struct vote_instance_t { } }; -typedef std::map vote_instance_m_t; +using vote_instance_m_t = std::map; struct vote_rec_t { vote_instance_m_t mapInstances; @@ -91,7 +91,7 @@ struct vote_rec_t { class CGovernanceObject { public: // Types - typedef std::map vote_m_t; + using vote_m_t = std::map; private: /// critical section to protect the inner data structures diff --git a/src/governance/votedb.h b/src/governance/votedb.h index 1d681a9df1..0b52163fb0 100644 --- a/src/governance/votedb.h +++ b/src/governance/votedb.h @@ -24,9 +24,9 @@ class CGovernanceObjectVoteFile { public: // Types - typedef std::list vote_l_t; + using vote_l_t = std::list; - typedef std::map vote_m_t; + using vote_m_t = std::map; private: int nMemoryVotes; diff --git a/src/llmq/quorums.h b/src/llmq/quorums.h index b0d9d1c1de..f4481b7393 100644 --- a/src/llmq/quorums.h +++ b/src/llmq/quorums.h @@ -21,7 +21,7 @@ class CNode; class CBlockIndex; class CDeterministicMN; -typedef std::shared_ptr CDeterministicMNCPtr; +using CDeterministicMNCPtr = std::shared_ptr; namespace llmq @@ -140,11 +140,11 @@ public: */ class CQuorum; -typedef std::shared_ptr CQuorumPtr; -typedef std::shared_ptr CQuorumCPtr; +using CQuorumPtr = std::shared_ptr; +using CQuorumCPtr = std::shared_ptr; class CFinalCommitment; -typedef std::shared_ptr CFinalCommitmentPtr; +using CFinalCommitmentPtr = std::shared_ptr; class CQuorum diff --git a/src/llmq/quorums_blockprocessor.h b/src/llmq/quorums_blockprocessor.h index 1d30d9d538..cccd38c487 100644 --- a/src/llmq/quorums_blockprocessor.h +++ b/src/llmq/quorums_blockprocessor.h @@ -27,7 +27,7 @@ namespace llmq { class CFinalCommitment; -typedef std::shared_ptr CFinalCommitmentPtr; +using CFinalCommitmentPtr = std::shared_ptr; class CQuorumBlockProcessor { diff --git a/src/llmq/quorums_chainlocks.h b/src/llmq/quorums_chainlocks.h index 9aeae9def0..4f3e61fff3 100644 --- a/src/llmq/quorums_chainlocks.h +++ b/src/llmq/quorums_chainlocks.h @@ -70,7 +70,7 @@ private: uint256 lastSignedMsgHash GUARDED_BY(cs); // We keep track of txids from recently received blocks so that we can check if all TXs got islocked - typedef std::unordered_map>> BlockTxs; + using BlockTxs = std::unordered_map>>; BlockTxs blockTxs GUARDED_BY(cs); std::unordered_map txFirstSeenTime GUARDED_BY(cs); diff --git a/src/llmq/quorums_commitment.h b/src/llmq/quorums_commitment.h index 15f0f7f6e3..56dfb4f797 100644 --- a/src/llmq/quorums_commitment.h +++ b/src/llmq/quorums_commitment.h @@ -101,7 +101,7 @@ public: obj.pushKV("membersSig", membersSig.ToString()); } }; -typedef std::shared_ptr CFinalCommitmentPtr; +using CFinalCommitmentPtr = std::shared_ptr; class CFinalCommitmentTxPayload { diff --git a/src/llmq/quorums_dkgsession.cpp b/src/llmq/quorums_dkgsession.cpp index 573d8f9ef0..2bceec7ddd 100644 --- a/src/llmq/quorums_dkgsession.cpp +++ b/src/llmq/quorums_dkgsession.cpp @@ -1198,7 +1198,7 @@ std::vector CDKGSession::FinalizeCommitments() CDKGLogger logger(*this, __func__); - typedef std::vector Key; + using Key = std::vector; std::map> commitmentsMap; { diff --git a/src/llmq/quorums_dkgsessionhandler.h b/src/llmq/quorums_dkgsessionhandler.h index cff892bee4..8316870bda 100644 --- a/src/llmq/quorums_dkgsessionhandler.h +++ b/src/llmq/quorums_dkgsessionhandler.h @@ -40,7 +40,7 @@ enum QuorumPhase { class CDKGPendingMessages { public: - typedef std::pair> BinaryMessage; + using BinaryMessage = std::pair>; private: mutable CCriticalSection cs; @@ -138,8 +138,8 @@ private: std::pair GetPhaseAndQuorumHash() const; - typedef std::function StartPhaseFunc; - typedef std::function WhileWaitFunc; + using StartPhaseFunc = std::function; + using WhileWaitFunc = std::function; void WaitForNextPhase(QuorumPhase curPhase, QuorumPhase nextPhase, const uint256& expectedQuorumHash, const WhileWaitFunc& runWhileWaiting) const; void WaitForNewQuorum(const uint256& oldQuorumHash) const; void SleepBeforePhase(QuorumPhase curPhase, const uint256& expectedQuorumHash, double randomSleepFactor, const WhileWaitFunc& runWhileWaiting) const; diff --git a/src/llmq/quorums_instantsend.h b/src/llmq/quorums_instantsend.h index c9907c2f0c..1fe3caa5b8 100644 --- a/src/llmq/quorums_instantsend.h +++ b/src/llmq/quorums_instantsend.h @@ -53,7 +53,7 @@ struct CInstantSendLock bool IsDeterministic() const { return nVersion != islock_version; } }; -typedef std::shared_ptr CInstantSendLockPtr; +using CInstantSendLockPtr = std::shared_ptr; class CInstantSendDb { diff --git a/src/llmq/quorums_signing.h b/src/llmq/quorums_signing.h index c3b71b83e5..04b63b5fff 100644 --- a/src/llmq/quorums_signing.h +++ b/src/llmq/quorums_signing.h @@ -17,7 +17,7 @@ #include -typedef int64_t NodeId; +using NodeId = int64_t; class CInv; class CNode; @@ -25,7 +25,7 @@ namespace llmq { class CQuorum; -typedef std::shared_ptr CQuorumCPtr; +using CQuorumCPtr = std::shared_ptr; // Keep recovered signatures for a week. This is a "-maxrecsigsage" option default. static const int64_t DEFAULT_MAX_RECOVERED_SIGS_AGE = 60 * 60 * 24 * 7; diff --git a/src/llmq/quorums_signing_shares.h b/src/llmq/quorums_signing_shares.h index bac46caaed..4796fdb3d0 100644 --- a/src/llmq/quorums_signing_shares.h +++ b/src/llmq/quorums_signing_shares.h @@ -22,7 +22,7 @@ class CScheduler; namespace llmq { // -typedef std::pair SigShareKey; +using SigShareKey = std::pair; constexpr uint32_t UNINITIALIZED_SESSION_ID{std::numeric_limits::max()}; diff --git a/src/llmq/quorums_utils.h b/src/llmq/quorums_utils.h index 4de821279c..c0ffedc4e8 100644 --- a/src/llmq/quorums_utils.h +++ b/src/llmq/quorums_utils.h @@ -17,7 +17,7 @@ class CBlockIndex; class CDeterministicMN; -typedef std::shared_ptr CDeterministicMNCPtr; +using CDeterministicMNCPtr = std::shared_ptr; class CBLSPublicKey; namespace llmq diff --git a/src/masternode/meta.h b/src/masternode/meta.h index 1f54b9bf21..b02f940e1d 100644 --- a/src/masternode/meta.h +++ b/src/masternode/meta.h @@ -83,7 +83,7 @@ public: void SetLastOutboundSuccess(int64_t t) { lastOutboundSuccess = t; } int64_t GetLastOutboundSuccess() const { return lastOutboundSuccess; } }; -typedef std::shared_ptr CMasternodeMetaInfoPtr; +using CMasternodeMetaInfoPtr = std::shared_ptr; class CMasternodeMetaMan { diff --git a/src/qt/masternodelist.h b/src/qt/masternodelist.h index 3b0ab784f0..40203d2de4 100644 --- a/src/qt/masternodelist.h +++ b/src/qt/masternodelist.h @@ -18,7 +18,7 @@ class MasternodeList; } class CDeterministicMN; -typedef std::shared_ptr CDeterministicMNCPtr; +using CDeterministicMNCPtr = std::shared_ptr; class ClientModel; class WalletModel; diff --git a/src/test/dip0020opcodes_tests.cpp b/src/test/dip0020opcodes_tests.cpp index a0d7e8cb1a..83ab805798 100644 --- a/src/test/dip0020opcodes_tests.cpp +++ b/src/test/dip0020opcodes_tests.cpp @@ -11,8 +11,8 @@ #include -typedef std::vector valtype; -typedef std::vector stacktype; +using valtype = std::vector; +using stacktype = std::vector; BOOST_FIXTURE_TEST_SUITE(dip0020opcodes_tests, BasicTestingSetup) diff --git a/src/test/evo_deterministicmns_tests.cpp b/src/test/evo_deterministicmns_tests.cpp index 7cb9be26cd..3f3c6d7c91 100644 --- a/src/test/evo_deterministicmns_tests.cpp +++ b/src/test/evo_deterministicmns_tests.cpp @@ -23,7 +23,7 @@ #include -typedef std::map> SimpleUTXOMap; +using SimpleUTXOMap = std::map>; static SimpleUTXOMap BuildSimpleUtxoMap(const std::vector& txs) {