From 235547f4607b220e218206fbd1827df52890584c Mon Sep 17 00:00:00 2001 From: yinyiqian1 Date: Wed, 22 Apr 2026 23:57:01 -0400 Subject: [PATCH] Revert "Merge develop into ConfidentialTransfer (#6987)" (#7001) --- .clang-format | 15 +- .clang-tidy | 102 +- .github/scripts/check-pr-description.py | 85 - .../scripts/levelization/results/loops.txt | 8 +- .../scripts/levelization/results/ordering.txt | 48 +- .github/scripts/rename/binary.sh | 10 +- .github/scripts/rename/cmake.sh | 38 +- .github/scripts/rename/config.sh | 28 +- .github/scripts/rename/copyright.sh | 54 +- .github/scripts/rename/definitions.sh | 10 +- .github/scripts/rename/docs.sh | 10 +- .github/scripts/rename/include.sh | 4 +- .github/scripts/rename/namespace.sh | 26 +- .github/workflows/check-pr-description.yml | 30 - .github/workflows/on-pr.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- .../workflows/reusable-build-test-config.yml | 51 +- .../workflows/reusable-clang-tidy-files.yml | 21 +- .github/workflows/reusable-clang-tidy.yml | 4 +- .gitignore | 1 - .pre-commit-config.yaml | 16 +- BUILD.md | 15 - CMakeLists.txt | 1 - CONTRIBUTING.md | 20 - bin/git/setup-upstreams.sh | 78 +- bin/git/squash-branches.sh | 41 +- bin/git/update-version.sh | 26 +- bin/pre-commit/clang_tidy_check.py | 206 --- cfg/xrpld-example.cfg | 69 - cmake/XrplCore.cmake | 12 + cmake/XrplProtocolAutogen.cmake | 415 +++-- cmake/XrplProtocolAutogenRun.cmake | 39 - conan/lockfile/regenerate.sh | 18 +- include/xrpl/basics/BasicConfig.h | 17 +- include/xrpl/basics/Buffer.h | 13 +- include/xrpl/basics/CompressionAlgorithms.h | 11 +- include/xrpl/basics/CountedObject.h | 4 +- include/xrpl/basics/DecayingSample.h | 2 +- include/xrpl/basics/Expected.h | 2 +- include/xrpl/basics/IntrusiveRefCounts.h | 10 +- include/xrpl/basics/LocalValue.h | 9 +- include/xrpl/basics/Log.h | 6 +- include/xrpl/basics/Number.h | 34 +- include/xrpl/basics/RangeSet.h | 10 - include/xrpl/basics/SlabAllocator.h | 38 +- include/xrpl/basics/Slice.h | 6 +- include/xrpl/basics/TaggedCache.h | 2 +- include/xrpl/basics/ToString.h | 2 +- include/xrpl/basics/algorithm.h | 6 +- include/xrpl/basics/base_uint.h | 32 +- include/xrpl/basics/contract.h | 3 +- .../xrpl/basics/partitioned_unordered_map.h | 3 +- include/xrpl/basics/random.h | 22 +- include/xrpl/basics/safe_cast.h | 18 +- include/xrpl/basics/strHex.h | 4 +- include/xrpl/basics/tagged_integer.h | 3 +- include/xrpl/beast/asio/io_latency_probe.h | 6 +- .../beast/container/aged_container_utility.h | 2 +- .../detail/aged_associative_container.h | 8 +- .../detail/aged_container_iterator.h | 21 +- .../container/detail/aged_ordered_container.h | 131 +- .../detail/aged_unordered_container.h | 140 +- .../detail/empty_base_optimization.h | 8 +- include/xrpl/beast/core/List.h | 6 +- include/xrpl/beast/core/LockFreeStack.h | 12 +- include/xrpl/beast/core/SemanticVersion.h | 4 +- include/xrpl/beast/hash/hash_append.h | 9 +- include/xrpl/beast/hash/xxhasher.h | 26 +- include/xrpl/beast/insight/Collector.h | 6 +- include/xrpl/beast/insight/Counter.h | 10 +- include/xrpl/beast/insight/CounterImpl.h | 6 +- include/xrpl/beast/insight/Event.h | 10 +- include/xrpl/beast/insight/EventImpl.h | 6 +- include/xrpl/beast/insight/Gauge.h | 10 +- include/xrpl/beast/insight/GaugeImpl.h | 6 +- include/xrpl/beast/insight/Group.h | 6 +- include/xrpl/beast/insight/Groups.h | 6 +- include/xrpl/beast/insight/Hook.h | 10 +- include/xrpl/beast/insight/HookImpl.h | 6 +- include/xrpl/beast/insight/Meter.h | 10 +- include/xrpl/beast/insight/MeterImpl.h | 6 +- include/xrpl/beast/insight/NullCollector.h | 6 +- include/xrpl/beast/insight/StatsDCollector.h | 6 +- include/xrpl/beast/net/IPAddress.h | 4 - include/xrpl/beast/net/IPAddressConversion.h | 6 +- include/xrpl/beast/net/IPAddressV4.h | 6 +- include/xrpl/beast/net/IPAddressV6.h | 6 +- include/xrpl/beast/net/IPEndpoint.h | 12 +- include/xrpl/beast/rfc2616.h | 13 +- include/xrpl/beast/test/yield_to.h | 8 +- include/xrpl/beast/type_name.h | 14 +- include/xrpl/beast/unit_test/amount.h | 6 +- .../beast/unit_test/detail/const_container.h | 8 +- include/xrpl/beast/unit_test/global_suites.h | 6 +- include/xrpl/beast/unit_test/match.h | 6 +- include/xrpl/beast/unit_test/recorder.h | 22 +- include/xrpl/beast/unit_test/reporter.h | 70 +- include/xrpl/beast/unit_test/results.h | 23 +- include/xrpl/beast/unit_test/runner.h | 10 +- include/xrpl/beast/unit_test/suite.h | 22 +- include/xrpl/beast/unit_test/suite_info.h | 6 +- include/xrpl/beast/unit_test/suite_list.h | 6 +- include/xrpl/beast/unit_test/thread.h | 30 +- include/xrpl/beast/utility/Journal.h | 87 +- include/xrpl/beast/utility/PropertyStream.h | 4 +- include/xrpl/beast/utility/WrappedSink.h | 6 +- include/xrpl/beast/utility/Zero.h | 8 +- include/xrpl/beast/utility/maybe_const.h | 6 +- include/xrpl/beast/xor_shift_engine.h | 16 +- include/xrpl/conditions/Condition.h | 7 +- include/xrpl/conditions/Fulfillment.h | 6 +- .../xrpl/conditions/detail/PreimageSha256.h | 6 +- include/xrpl/conditions/detail/error.h | 6 +- include/xrpl/conditions/detail/utils.h | 11 +- include/xrpl/core/ClosureCounter.h | 10 +- include/xrpl/core/HashRouter.h | 4 +- include/xrpl/core/JobQueue.h | 5 +- include/xrpl/core/JobTypeData.h | 6 +- include/xrpl/core/JobTypes.h | 3 +- include/xrpl/core/LoadEvent.h | 2 +- include/xrpl/core/PeerReservationTable.h | 4 +- include/xrpl/core/detail/Workers.h | 4 +- include/xrpl/json/json_writer.h | 16 +- include/xrpl/json/to_string.h | 9 +- include/xrpl/ledger/AmendmentTable.h | 7 +- include/xrpl/ledger/BookListeners.h | 4 +- include/xrpl/ledger/CachedView.h | 2 +- include/xrpl/ledger/CanonicalTXSet.h | 10 +- include/xrpl/ledger/Ledger.h | 10 +- include/xrpl/ledger/OpenView.h | 2 +- include/xrpl/ledger/PaymentSandbox.h | 5 +- include/xrpl/ledger/PendingSaves.h | 2 +- include/xrpl/ledger/detail/ApplyStateTable.h | 6 +- include/xrpl/ledger/detail/ApplyViewBase.h | 6 +- include/xrpl/ledger/detail/RawStateTable.h | 6 +- include/xrpl/ledger/helpers/AMMHelpers.h | 47 +- .../xrpl/ledger/helpers/DirectoryHelpers.h | 2 +- include/xrpl/ledger/helpers/NFTokenHelpers.h | 16 +- .../ledger/helpers/PaymentChannelHelpers.h | 2 - .../ledger/helpers/PermissionedDEXHelpers.h | 7 +- include/xrpl/net/AutoSocket.h | 46 +- include/xrpl/net/HTTPClientSSLContext.h | 12 +- include/xrpl/nodestore/Backend.h | 6 +- include/xrpl/nodestore/Database.h | 7 +- include/xrpl/nodestore/DatabaseRotating.h | 6 +- include/xrpl/nodestore/DummyScheduler.h | 8 +- include/xrpl/nodestore/Factory.h | 7 +- include/xrpl/nodestore/Manager.h | 7 +- include/xrpl/nodestore/Scheduler.h | 6 +- include/xrpl/nodestore/Task.h | 6 +- include/xrpl/nodestore/Types.h | 17 +- include/xrpl/nodestore/detail/BatchWriter.h | 8 +- .../xrpl/nodestore/detail/DatabaseNodeImp.h | 8 +- .../nodestore/detail/DatabaseRotatingImp.h | 8 +- include/xrpl/nodestore/detail/DecodedBlob.h | 6 +- include/xrpl/nodestore/detail/EncodedBlob.h | 6 +- include/xrpl/nodestore/detail/ManagerImp.h | 9 +- include/xrpl/nodestore/detail/codec.h | 22 +- include/xrpl/nodestore/detail/varint.h | 16 +- include/xrpl/protocol/AmountConversions.h | 28 - include/xrpl/protocol/ApiVersion.h | 2 - include/xrpl/protocol/Asset.h | 19 +- include/xrpl/protocol/Book.h | 8 +- include/xrpl/protocol/BuildInfo.h | 8 +- include/xrpl/protocol/Feature.h | 8 +- include/xrpl/protocol/IOUAmount.h | 4 +- include/xrpl/protocol/Indexes.h | 12 +- include/xrpl/protocol/Issue.h | 6 +- include/xrpl/protocol/KnownFormats.h | 5 +- include/xrpl/protocol/LedgerFormats.h | 2 +- include/xrpl/protocol/LedgerHeader.h | 4 +- include/xrpl/protocol/MPTAmount.h | 6 +- include/xrpl/protocol/MPTIssue.h | 12 +- include/xrpl/protocol/MultiApiJson.h | 6 +- .../xrpl/protocol/NFTSyntheticSerializer.h | 7 +- include/xrpl/protocol/PathAsset.h | 4 - include/xrpl/protocol/Permissions.h | 2 +- include/xrpl/protocol/PublicKey.h | 4 +- include/xrpl/protocol/Quality.h | 5 +- include/xrpl/protocol/RPCErr.h | 1 - include/xrpl/protocol/SField.h | 2 +- include/xrpl/protocol/STAmount.h | 35 +- include/xrpl/protocol/STBlob.h | 2 +- include/xrpl/protocol/STCurrency.h | 2 +- include/xrpl/protocol/STExchange.h | 2 +- include/xrpl/protocol/STObject.h | 36 +- include/xrpl/protocol/STValidation.h | 2 +- include/xrpl/protocol/STVector256.h | 4 +- include/xrpl/protocol/SecretKey.h | 4 +- include/xrpl/protocol/Serializer.h | 2 +- include/xrpl/protocol/TER.h | 18 +- include/xrpl/protocol/TxFlags.h | 2 +- include/xrpl/protocol/Units.h | 4 +- include/xrpl/protocol/XChainAttestations.h | 9 +- include/xrpl/protocol/XRPAmount.h | 6 +- include/xrpl/protocol/detail/STVar.h | 10 +- include/xrpl/protocol/detail/b58_utils.h | 16 +- include/xrpl/protocol/detail/token_errors.h | 8 +- include/xrpl/protocol/digest.h | 4 +- include/xrpl/protocol/json_get_or_throw.h | 2 +- include/xrpl/protocol/jss.h | 6 +- include/xrpl/protocol/nft.h | 6 +- include/xrpl/protocol/nftPageMask.h | 6 +- include/xrpl/protocol_autogen/README.md | 49 +- include/xrpl/rdb/SociDB.h | 2 +- include/xrpl/resource/Charge.h | 8 +- include/xrpl/resource/Consumer.h | 6 +- include/xrpl/resource/Disposition.h | 6 +- include/xrpl/resource/Fees.h | 6 +- include/xrpl/resource/Gossip.h | 6 +- include/xrpl/resource/ResourceManager.h | 8 +- include/xrpl/resource/detail/Entry.h | 8 +- include/xrpl/resource/detail/Import.h | 8 +- include/xrpl/resource/detail/Key.h | 10 +- include/xrpl/resource/detail/Kind.h | 6 +- include/xrpl/resource/detail/Logic.h | 10 +- include/xrpl/resource/detail/Tuning.h | 6 +- include/xrpl/server/LoadFeeTrack.h | 4 +- include/xrpl/server/Manifest.h | 11 +- include/xrpl/server/NetworkOPs.h | 2 +- include/xrpl/server/Port.h | 8 +- include/xrpl/server/SimpleWriter.h | 2 +- include/xrpl/server/detail/BaseHTTPPeer.h | 16 +- include/xrpl/server/detail/BasePeer.h | 4 +- include/xrpl/server/detail/BaseWSPeer.h | 11 +- include/xrpl/server/detail/Door.h | 13 +- include/xrpl/server/detail/ServerImpl.h | 4 +- include/xrpl/server/detail/io_list.h | 4 +- include/xrpl/shamap/SHAMap.h | 8 +- .../xrpl/shamap/SHAMapAccountStateLeafNode.h | 10 +- include/xrpl/shamap/SHAMapInnerNode.h | 4 +- include/xrpl/shamap/SHAMapLeafNode.h | 8 +- include/xrpl/shamap/SHAMapTreeNode.h | 11 +- include/xrpl/shamap/SHAMapTxLeafNode.h | 10 +- .../xrpl/shamap/SHAMapTxPlusMetaLeafNode.h | 6 +- include/xrpl/tx/Transactor.h | 92 +- include/xrpl/tx/applySteps.h | 2 +- include/xrpl/tx/invariants/AMMInvariant.h | 4 +- .../tx/invariants/PermissionedDEXInvariant.h | 3 +- include/xrpl/tx/invariants/VaultInvariant.h | 35 +- include/xrpl/tx/paths/Flow.h | 6 +- include/xrpl/tx/paths/Offer.h | 17 +- include/xrpl/tx/paths/detail/FlowDebugInfo.h | 25 +- include/xrpl/tx/paths/detail/StepChecks.h | 4 +- include/xrpl/tx/paths/detail/Steps.h | 15 +- include/xrpl/tx/paths/detail/StrandFlow.h | 37 +- .../tx/transactors/account/AccountDelete.h | 14 - .../xrpl/tx/transactors/account/AccountSet.h | 14 - .../tx/transactors/account/SetRegularKey.h | 14 - .../tx/transactors/account/SignerListSet.h | 14 - .../xrpl/tx/transactors/bridge/XChainBridge.h | 112 -- .../xrpl/tx/transactors/check/CheckCancel.h | 14 - include/xrpl/tx/transactors/check/CheckCash.h | 14 - .../xrpl/tx/transactors/check/CheckCreate.h | 14 - .../credentials/CredentialAccept.h | 14 - .../credentials/CredentialCreate.h | 14 - .../credentials/CredentialDelete.h | 14 - .../tx/transactors/delegate/DelegateSet.h | 14 - include/xrpl/tx/transactors/dex/AMMBid.h | 14 - include/xrpl/tx/transactors/dex/AMMClawback.h | 14 - include/xrpl/tx/transactors/dex/AMMCreate.h | 14 - include/xrpl/tx/transactors/dex/AMMDelete.h | 14 - include/xrpl/tx/transactors/dex/AMMDeposit.h | 14 - include/xrpl/tx/transactors/dex/AMMVote.h | 14 - include/xrpl/tx/transactors/dex/AMMWithdraw.h | 14 - include/xrpl/tx/transactors/dex/OfferCancel.h | 14 - include/xrpl/tx/transactors/dex/OfferCreate.h | 14 - include/xrpl/tx/transactors/did/DIDDelete.h | 14 - include/xrpl/tx/transactors/did/DIDSet.h | 14 - .../xrpl/tx/transactors/escrow/EscrowCancel.h | 14 - .../xrpl/tx/transactors/escrow/EscrowCreate.h | 14 - .../xrpl/tx/transactors/escrow/EscrowFinish.h | 14 - .../tx/transactors/lending/LendingHelpers.h | 2 +- .../lending/LoanBrokerCoverClawback.h | 14 - .../lending/LoanBrokerCoverDeposit.h | 14 - .../lending/LoanBrokerCoverWithdraw.h | 14 - .../tx/transactors/lending/LoanBrokerDelete.h | 14 - .../tx/transactors/lending/LoanBrokerSet.h | 14 - .../xrpl/tx/transactors/lending/LoanDelete.h | 14 - .../xrpl/tx/transactors/lending/LoanManage.h | 14 - include/xrpl/tx/transactors/lending/LoanPay.h | 14 - include/xrpl/tx/transactors/lending/LoanSet.h | 14 - .../tx/transactors/nft/NFTokenAcceptOffer.h | 14 - include/xrpl/tx/transactors/nft/NFTokenBurn.h | 14 - .../tx/transactors/nft/NFTokenCancelOffer.h | 14 - .../tx/transactors/nft/NFTokenCreateOffer.h | 14 - include/xrpl/tx/transactors/nft/NFTokenMint.h | 14 - .../xrpl/tx/transactors/nft/NFTokenModify.h | 14 - .../xrpl/tx/transactors/oracle/OracleDelete.h | 14 - .../xrpl/tx/transactors/oracle/OracleSet.h | 14 - .../tx/transactors/payment/DepositPreauth.h | 14 - include/xrpl/tx/transactors/payment/Payment.h | 14 - .../payment_channel/PaymentChannelClaim.h | 14 - .../payment_channel/PaymentChannelCreate.h | 14 - .../payment_channel/PaymentChannelFund.h | 14 - .../PermissionedDomainDelete.h | 14 - .../PermissionedDomainSet.h | 14 - include/xrpl/tx/transactors/system/Batch.h | 47 +- include/xrpl/tx/transactors/system/Change.h | 14 - .../tx/transactors/system/LedgerStateFix.h | 14 - .../xrpl/tx/transactors/system/TicketCreate.h | 14 - include/xrpl/tx/transactors/token/Clawback.h | 14 - .../token/ConfidentialMPTClawback.h | 14 - .../token/ConfidentialMPTConvert.h | 14 - .../token/ConfidentialMPTConvertBack.h | 14 - .../token/ConfidentialMPTMergeInbox.h | 14 - .../transactors/token/ConfidentialMPTSend.h | 14 - .../tx/transactors/token/MPTokenAuthorize.h | 16 +- .../transactors/token/MPTokenIssuanceCreate.h | 28 +- .../token/MPTokenIssuanceDestroy.h | 14 - .../tx/transactors/token/MPTokenIssuanceSet.h | 14 - include/xrpl/tx/transactors/token/TrustSet.h | 14 - .../xrpl/tx/transactors/vault/VaultClawback.h | 14 - .../xrpl/tx/transactors/vault/VaultCreate.h | 14 - .../xrpl/tx/transactors/vault/VaultDelete.h | 14 - .../xrpl/tx/transactors/vault/VaultDeposit.h | 14 - include/xrpl/tx/transactors/vault/VaultSet.h | 14 - .../xrpl/tx/transactors/vault/VaultWithdraw.h | 14 - .../generate_ledger_classes.py | 18 +- .../generate_tx_classes.py | 18 +- .../macro_parser_common.py | 0 .../codegen => scripts}/requirements.txt | 0 .../templates/LedgerEntry.h.mako | 0 .../templates/LedgerEntryTests.cpp.mako | 0 .../templates/Transaction.h.mako | 0 .../templates/TransactionTests.cpp.mako | 0 src/libxrpl/basics/Archive.cpp | 1 - src/libxrpl/basics/BasicConfig.cpp | 4 +- src/libxrpl/basics/CountedObject.cpp | 2 +- src/libxrpl/basics/FileUtilities.cpp | 1 + src/libxrpl/basics/Log.cpp | 5 +- src/libxrpl/basics/MallocTrim.cpp | 18 +- src/libxrpl/basics/Number.cpp | 3 +- src/libxrpl/basics/ResolverAsio.cpp | 14 +- src/libxrpl/basics/StringUtilities.cpp | 4 +- src/libxrpl/basics/contract.cpp | 3 +- src/libxrpl/basics/make_SSLContext.cpp | 13 +- src/libxrpl/basics/mulDiv.cpp | 4 +- .../beast/clock/basic_seconds_clock.cpp | 1 - src/libxrpl/beast/core/CurrentThreadName.cpp | 4 +- src/libxrpl/beast/core/SemanticVersion.cpp | 22 +- src/libxrpl/beast/insight/Collector.cpp | 6 +- src/libxrpl/beast/insight/Groups.cpp | 22 +- src/libxrpl/beast/insight/Hook.cpp | 7 +- src/libxrpl/beast/insight/Metric.cpp | 6 +- src/libxrpl/beast/insight/NullCollector.cpp | 26 +- src/libxrpl/beast/insight/StatsDCollector.cpp | 83 +- src/libxrpl/beast/net/IPAddressConversion.cpp | 7 +- src/libxrpl/beast/net/IPAddressV4.cpp | 6 +- src/libxrpl/beast/net/IPAddressV6.cpp | 11 +- src/libxrpl/beast/net/IPEndpoint.cpp | 13 +- .../beast/utility/beast_PropertyStream.cpp | 7 +- src/libxrpl/conditions/Condition.cpp | 16 +- src/libxrpl/conditions/Fulfillment.cpp | 14 +- src/libxrpl/conditions/error.cpp | 13 +- src/libxrpl/core/HashRouter.cpp | 12 - src/libxrpl/core/detail/Job.cpp | 10 +- src/libxrpl/core/detail/JobQueue.cpp | 21 +- src/libxrpl/core/detail/LoadEvent.cpp | 11 +- src/libxrpl/core/detail/LoadMonitor.cpp | 8 +- src/libxrpl/core/detail/Workers.cpp | 16 +- src/libxrpl/crypto/RFC1751.cpp | 3 +- src/libxrpl/crypto/csprng.cpp | 5 +- src/libxrpl/git/Git.cpp | 2 +- src/libxrpl/json/JsonPropertyStream.cpp | 1 - src/libxrpl/json/Output.cpp | 1 - src/libxrpl/json/Writer.cpp | 14 +- src/libxrpl/json/json_reader.cpp | 6 +- src/libxrpl/json/json_value.cpp | 10 +- src/libxrpl/json/json_valueiterator.cpp | 4 +- src/libxrpl/json/json_writer.cpp | 10 +- src/libxrpl/json/to_string.cpp | 3 +- src/libxrpl/ledger/AcceptedLedgerTx.cpp | 23 +- src/libxrpl/ledger/ApplyStateTable.cpp | 63 +- src/libxrpl/ledger/ApplyView.cpp | 133 +- src/libxrpl/ledger/ApplyViewBase.cpp | 19 +- src/libxrpl/ledger/ApplyViewImpl.cpp | 16 - src/libxrpl/ledger/BookDirs.cpp | 9 +- src/libxrpl/ledger/BookListeners.cpp | 8 - src/libxrpl/ledger/CachedView.cpp | 18 +- src/libxrpl/ledger/CanonicalTXSet.cpp | 10 - src/libxrpl/ledger/Dir.cpp | 11 - src/libxrpl/ledger/Ledger.cpp | 68 +- src/libxrpl/ledger/OpenView.cpp | 29 +- src/libxrpl/ledger/PaymentSandbox.cpp | 24 +- src/libxrpl/ledger/RawStateTable.cpp | 32 +- src/libxrpl/ledger/ReadView.cpp | 11 - src/libxrpl/ledger/View.cpp | 29 +- src/libxrpl/ledger/helpers/AMMHelpers.cpp | 40 +- .../ledger/helpers/AccountRootHelpers.cpp | 24 +- .../ledger/helpers/CredentialHelpers.cpp | 25 +- .../ledger/helpers/DirectoryHelpers.cpp | 15 +- src/libxrpl/ledger/helpers/MPTokenHelpers.cpp | 27 +- src/libxrpl/ledger/helpers/NFTokenHelpers.cpp | 86 +- src/libxrpl/ledger/helpers/OfferHelpers.cpp | 14 +- .../ledger/helpers/PaymentChannelHelpers.cpp | 14 +- .../ledger/helpers/PermissionedDEXHelpers.cpp | 59 +- .../ledger/helpers/RippleStateHelpers.cpp | 21 +- src/libxrpl/ledger/helpers/TokenHelpers.cpp | 23 +- src/libxrpl/ledger/helpers/VaultHelpers.cpp | 12 +- src/libxrpl/net/HTTPClient.cpp | 29 +- src/libxrpl/net/RegisterSSLCerts.cpp | 5 - src/libxrpl/nodestore/BatchWriter.cpp | 17 +- src/libxrpl/nodestore/Database.cpp | 34 +- src/libxrpl/nodestore/DatabaseNodeImp.cpp | 26 +- src/libxrpl/nodestore/DatabaseRotatingImp.cpp | 27 +- src/libxrpl/nodestore/DecodedBlob.cpp | 14 +- src/libxrpl/nodestore/DummyScheduler.cpp | 9 +- src/libxrpl/nodestore/ManagerImp.cpp | 34 +- src/libxrpl/nodestore/NodeObject.cpp | 4 - .../nodestore/backend/MemoryFactory.cpp | 21 +- src/libxrpl/nodestore/backend/NuDBFactory.cpp | 37 +- src/libxrpl/nodestore/backend/NullFactory.cpp | 20 +- .../nodestore/backend/RocksDBFactory.cpp | 40 +- src/libxrpl/protocol/AMMCore.cpp | 7 +- src/libxrpl/protocol/AccountID.cpp | 3 +- src/libxrpl/protocol/Asset.cpp | 6 +- src/libxrpl/protocol/Book.cpp | 3 +- src/libxrpl/protocol/BuildInfo.cpp | 17 +- src/libxrpl/protocol/ConfidentialTransfer.cpp | 19 - src/libxrpl/protocol/ErrorCodes.cpp | 3 +- src/libxrpl/protocol/Feature.cpp | 9 +- src/libxrpl/protocol/IOUAmount.cpp | 10 +- src/libxrpl/protocol/Indexes.cpp | 7 +- src/libxrpl/protocol/InnerObjectFormats.cpp | 1 - src/libxrpl/protocol/Issue.cpp | 3 +- src/libxrpl/protocol/Keylet.cpp | 3 +- src/libxrpl/protocol/LedgerFormats.cpp | 3 +- src/libxrpl/protocol/LedgerHeader.cpp | 5 +- src/libxrpl/protocol/MPTIssue.cpp | 6 +- .../protocol/NFTSyntheticSerializer.cpp | 9 +- src/libxrpl/protocol/NFTokenID.cpp | 42 +- src/libxrpl/protocol/NFTokenOfferID.cpp | 3 +- src/libxrpl/protocol/PathAsset.cpp | 5 +- src/libxrpl/protocol/Permissions.cpp | 14 +- src/libxrpl/protocol/PublicKey.cpp | 5 +- src/libxrpl/protocol/Quality.cpp | 5 +- src/libxrpl/protocol/QualityFunction.cpp | 3 +- src/libxrpl/protocol/RPCErr.cpp | 3 +- src/libxrpl/protocol/Rules.cpp | 3 +- src/libxrpl/protocol/SField.cpp | 5 +- src/libxrpl/protocol/SOTemplate.cpp | 4 +- src/libxrpl/protocol/STAccount.cpp | 3 +- src/libxrpl/protocol/STAmount.cpp | 14 +- src/libxrpl/protocol/STArray.cpp | 5 +- src/libxrpl/protocol/STBase.cpp | 3 +- src/libxrpl/protocol/STBlob.cpp | 3 +- src/libxrpl/protocol/STCurrency.cpp | 3 +- src/libxrpl/protocol/STInteger.cpp | 4 +- src/libxrpl/protocol/STIssue.cpp | 3 +- src/libxrpl/protocol/STLedgerEntry.cpp | 6 +- src/libxrpl/protocol/STNumber.cpp | 18 +- src/libxrpl/protocol/STObject.cpp | 26 +- src/libxrpl/protocol/STParsedJSON.cpp | 11 +- src/libxrpl/protocol/STPathSet.cpp | 5 +- src/libxrpl/protocol/STTakesAsset.cpp | 7 +- src/libxrpl/protocol/STTx.cpp | 7 +- src/libxrpl/protocol/STValidation.cpp | 4 +- src/libxrpl/protocol/STVar.cpp | 9 +- src/libxrpl/protocol/STVector256.cpp | 3 +- src/libxrpl/protocol/STXChainBridge.cpp | 3 +- src/libxrpl/protocol/SecretKey.cpp | 8 +- src/libxrpl/protocol/Seed.cpp | 3 +- src/libxrpl/protocol/Serializer.cpp | 5 +- src/libxrpl/protocol/Sign.cpp | 3 +- src/libxrpl/protocol/TxFormats.cpp | 6 +- src/libxrpl/protocol/TxMeta.cpp | 6 +- src/libxrpl/protocol/UintTypes.cpp | 5 +- src/libxrpl/protocol/XChainAttestations.cpp | 11 +- src/libxrpl/protocol/tokens.cpp | 5 +- src/libxrpl/protocol_autogen/placeholder.cpp | 4 + src/libxrpl/rdb/DatabaseCon.cpp | 13 +- src/libxrpl/rdb/SociDB.cpp | 30 +- src/libxrpl/resource/Charge.cpp | 9 +- src/libxrpl/resource/Consumer.cpp | 10 +- src/libxrpl/resource/Fees.cpp | 9 +- src/libxrpl/resource/ResourceManager.cpp | 9 +- src/libxrpl/server/InfoSub.cpp | 8 - src/libxrpl/server/JSONRPCUtil.cpp | 3 +- src/libxrpl/server/LoadFeeTrack.cpp | 6 +- src/libxrpl/server/Manifest.cpp | 33 +- src/libxrpl/server/Port.cpp | 4 +- src/libxrpl/server/State.cpp | 15 - src/libxrpl/server/Vacuum.cpp | 13 +- src/libxrpl/server/Wallet.cpp | 36 +- src/libxrpl/shamap/SHAMap.cpp | 50 +- src/libxrpl/shamap/SHAMapDelta.cpp | 91 +- src/libxrpl/shamap/SHAMapInnerNode.cpp | 21 +- src/libxrpl/shamap/SHAMapLeafNode.cpp | 13 - src/libxrpl/shamap/SHAMapNodeID.cpp | 11 +- src/libxrpl/shamap/SHAMapSync.cpp | 41 +- src/libxrpl/shamap/SHAMapTreeNode.cpp | 17 +- src/libxrpl/tx/ApplyContext.cpp | 26 +- src/libxrpl/tx/SignerEntries.cpp | 11 +- src/libxrpl/tx/Transactor.cpp | 104 +- src/libxrpl/tx/apply.cpp | 19 +- src/libxrpl/tx/applySteps.cpp | 37 +- src/libxrpl/tx/invariants/AMMInvariant.cpp | 21 +- src/libxrpl/tx/invariants/FreezeInvariant.cpp | 25 +- src/libxrpl/tx/invariants/InvariantCheck.cpp | 26 +- .../tx/invariants/LoanBrokerInvariant.cpp | 18 +- src/libxrpl/tx/invariants/LoanInvariant.cpp | 15 +- src/libxrpl/tx/invariants/MPTInvariant.cpp | 15 +- src/libxrpl/tx/invariants/NFTInvariant.cpp | 22 +- .../invariants/PermissionedDEXInvariant.cpp | 26 +- .../PermissionedDomainInvariant.cpp | 22 +- src/libxrpl/tx/invariants/VaultInvariant.cpp | 282 +-- src/libxrpl/tx/paths/AMMLiquidity.cpp | 25 - src/libxrpl/tx/paths/AMMOffer.cpp | 20 +- src/libxrpl/tx/paths/BookStep.cpp | 49 +- src/libxrpl/tx/paths/BookTip.cpp | 10 +- src/libxrpl/tx/paths/DirectStep.cpp | 23 +- src/libxrpl/tx/paths/Flow.cpp | 18 +- src/libxrpl/tx/paths/MPTEndpointStep.cpp | 22 +- src/libxrpl/tx/paths/OfferStream.cpp | 34 +- src/libxrpl/tx/paths/PaySteps.cpp | 28 +- src/libxrpl/tx/paths/RippleCalc.cpp | 27 +- src/libxrpl/tx/paths/XRPEndpointStep.cpp | 20 +- .../tx/transactors/account/AccountDelete.cpp | 43 +- .../tx/transactors/account/AccountSet.cpp | 40 +- .../tx/transactors/account/SetRegularKey.cpp | 37 +- .../tx/transactors/account/SignerListSet.cpp | 46 +- .../tx/transactors/bridge/XChainBridge.cpp | 192 +-- .../tx/transactors/check/CheckCancel.cpp | 29 +- .../tx/transactors/check/CheckCash.cpp | 40 +- .../tx/transactors/check/CheckCreate.cpp | 39 +- .../credentials/CredentialAccept.cpp | 35 +- .../credentials/CredentialCreate.cpp | 37 +- .../credentials/CredentialDelete.cpp | 33 +- .../tx/transactors/delegate/DelegateSet.cpp | 34 +- .../tx/transactors/delegate/DelegateUtils.cpp | 9 - src/libxrpl/tx/transactors/dex/AMMBid.cpp | 45 +- .../tx/transactors/dex/AMMClawback.cpp | 45 +- src/libxrpl/tx/transactors/dex/AMMCreate.cpp | 46 +- src/libxrpl/tx/transactors/dex/AMMDelete.cpp | 30 +- src/libxrpl/tx/transactors/dex/AMMDeposit.cpp | 42 +- src/libxrpl/tx/transactors/dex/AMMVote.cpp | 39 +- .../tx/transactors/dex/AMMWithdraw.cpp | 49 +- .../tx/transactors/dex/OfferCancel.cpp | 29 +- .../tx/transactors/dex/OfferCreate.cpp | 57 +- src/libxrpl/tx/transactors/did/DIDDelete.cpp | 29 +- src/libxrpl/tx/transactors/did/DIDSet.cpp | 34 +- .../tx/transactors/escrow/EscrowCancel.cpp | 36 +- .../tx/transactors/escrow/EscrowCreate.cpp | 45 +- .../tx/transactors/escrow/EscrowFinish.cpp | 40 +- .../tx/transactors/lending/LendingHelpers.cpp | 25 +- .../lending/LoanBrokerCoverClawback.cpp | 48 +- .../lending/LoanBrokerCoverDeposit.cpp | 33 +- .../lending/LoanBrokerCoverWithdraw.cpp | 41 +- .../transactors/lending/LoanBrokerDelete.cpp | 35 +- .../tx/transactors/lending/LoanBrokerSet.cpp | 39 +- .../tx/transactors/lending/LoanDelete.cpp | 30 +- .../tx/transactors/lending/LoanManage.cpp | 39 +- .../tx/transactors/lending/LoanPay.cpp | 37 +- .../tx/transactors/lending/LoanSet.cpp | 45 +- .../tx/transactors/nft/NFTokenAcceptOffer.cpp | 42 +- .../tx/transactors/nft/NFTokenBurn.cpp | 31 +- .../tx/transactors/nft/NFTokenCancelOffer.cpp | 45 +- .../tx/transactors/nft/NFTokenCreateOffer.cpp | 35 +- .../tx/transactors/nft/NFTokenMint.cpp | 37 +- .../tx/transactors/nft/NFTokenModify.cpp | 38 +- .../tx/transactors/oracle/OracleDelete.cpp | 39 +- .../tx/transactors/oracle/OracleSet.cpp | 43 +- .../tx/transactors/payment/DepositPreauth.cpp | 42 +- .../tx/transactors/payment/Payment.cpp | 51 +- .../payment_channel/PaymentChannelClaim.cpp | 39 +- .../payment_channel/PaymentChannelCreate.cpp | 36 +- .../payment_channel/PaymentChannelFund.cpp | 38 +- .../PermissionedDomainDelete.cpp | 36 +- .../PermissionedDomainSet.cpp | 38 +- src/libxrpl/tx/transactors/system/Batch.cpp | 51 +- src/libxrpl/tx/transactors/system/Change.cpp | 40 +- .../tx/transactors/system/LedgerStateFix.cpp | 36 +- .../tx/transactors/system/TicketCreate.cpp | 40 +- src/libxrpl/tx/transactors/token/Clawback.cpp | 39 +- .../token/ConfidentialMPTClawback.cpp | 34 +- .../token/ConfidentialMPTConvert.cpp | 44 +- .../token/ConfidentialMPTConvertBack.cpp | 45 +- .../token/ConfidentialMPTMergeInbox.cpp | 34 +- .../transactors/token/ConfidentialMPTSend.cpp | 48 +- .../tx/transactors/token/MPTokenAuthorize.cpp | 37 +- .../token/MPTokenIssuanceCreate.cpp | 46 +- .../token/MPTokenIssuanceDestroy.cpp | 34 +- .../transactors/token/MPTokenIssuanceSet.cpp | 122 +- src/libxrpl/tx/transactors/token/TrustSet.cpp | 38 +- .../tx/transactors/vault/VaultClawback.cpp | 44 +- .../tx/transactors/vault/VaultCreate.cpp | 34 +- .../tx/transactors/vault/VaultDelete.cpp | 35 +- .../tx/transactors/vault/VaultDeposit.cpp | 39 +- src/libxrpl/tx/transactors/vault/VaultSet.cpp | 32 +- .../tx/transactors/vault/VaultWithdraw.cpp | 40 +- src/test/app/AMMCalc_test.cpp | 35 +- src/test/app/AMMClawbackMPT_test.cpp | 29 +- src/test/app/AMMClawback_test.cpp | 57 +- src/test/app/AMMExtendedMPT_test.cpp | 54 +- src/test/app/AMMExtended_test.cpp | 61 +- src/test/app/AMMMPT_test.cpp | 54 +- src/test/app/AMM_test.cpp | 57 +- src/test/app/AccountDelete_test.cpp | 49 +- src/test/app/AccountSet_test.cpp | 59 +- src/test/app/AccountTxPaging_test.cpp | 12 +- src/test/app/AmendmentTable_test.cpp | 50 +- src/test/app/Batch_test.cpp | 74 +- src/test/app/CheckMPT_test.cpp | 55 +- src/test/app/Check_test.cpp | 71 +- src/test/app/Clawback_test.cpp | 23 +- src/test/app/ConfidentialTransfer_test.cpp | 44 +- src/test/app/Credentials_test.cpp | 29 +- src/test/app/CrossingLimitsMPT_test.cpp | 23 +- src/test/app/CrossingLimits_test.cpp | 21 +- src/test/app/DID_test.cpp | 22 +- src/test/app/DNS_test.cpp | 17 +- src/test/app/Delegate_test.cpp | 52 +- src/test/app/DeliverMin_test.cpp | 23 +- src/test/app/DepositAuth_test.cpp | 48 +- src/test/app/Discrepancy_test.cpp | 16 +- src/test/app/EscrowToken_test.cpp | 275 +-- src/test/app/Escrow_test.cpp | 90 +- src/test/app/FeeVote_test.cpp | 33 +- src/test/app/FixNFTokenPageLinks_test.cpp | 31 +- src/test/app/FlowMPT_test.cpp | 60 +- src/test/app/Flow_test.cpp | 50 +- src/test/app/Freeze_test.cpp | 28 +- src/test/app/GRPCServerTLS_test.cpp | 849 --------- src/test/app/HashRouter_test.cpp | 15 +- src/test/app/Invariants_test.cpp | 270 +-- src/test/app/LPTokenTransfer_test.cpp | 26 +- src/test/app/LedgerHistory_test.cpp | 26 +- src/test/app/LedgerLoad_test.cpp | 24 +- src/test/app/LedgerMaster_test.cpp | 23 +- src/test/app/LedgerReplay_test.cpp | 114 +- src/test/app/LendingHelpers_test.cpp | 18 +- src/test/app/LoadFeeTrack_test.cpp | 4 +- src/test/app/LoanBroker_test.cpp | 62 +- src/test/app/Loan_test.cpp | 227 +-- src/test/app/MPToken_test.cpp | 153 +- src/test/app/Manifest_test.cpp | 43 +- src/test/app/MultiSign_test.cpp | 52 +- src/test/app/NFTokenAuth_test.cpp | 29 +- src/test/app/NFTokenBurn_test.cpp | 45 +- src/test/app/NFTokenDir_test.cpp | 39 +- src/test/app/NFToken_test.cpp | 65 +- src/test/app/NetworkID_test.cpp | 23 +- src/test/app/NetworkOPs_test.cpp | 19 +- src/test/app/OfferMPT_test.cpp | 165 +- src/test/app/OfferStream_test.cpp | 3 +- src/test/app/Offer_test.cpp | 225 +-- src/test/app/Oracle_test.cpp | 42 +- src/test/app/OversizeMeta_test.cpp | 20 +- src/test/app/PathMPT_test.cpp | 64 +- src/test/app/Path_test.cpp | 87 +- src/test/app/PayChan_test.cpp | 53 +- src/test/app/PayStrandMPT_test.cpp | 39 +- src/test/app/PayStrand_test.cpp | 47 +- src/test/app/PermissionedDEX_test.cpp | 111 +- src/test/app/PermissionedDomains_test.cpp | 28 +- src/test/app/PseudoTx_test.cpp | 34 +- src/test/app/RCLValidations_test.cpp | 23 +- src/test/app/ReducedOffer_test.cpp | 26 +- src/test/app/Regression_test.cpp | 48 +- src/test/app/SHAMapStore_test.cpp | 38 +- src/test/app/SetAuth_test.cpp | 23 +- src/test/app/SetRegularKey_test.cpp | 23 +- src/test/app/TheoreticalQuality_test.cpp | 51 +- src/test/app/Ticket_test.cpp | 46 +- src/test/app/Transaction_ordering_test.cpp | 24 +- src/test/app/TrustAndBalance_test.cpp | 19 +- src/test/app/TrustSet_test.cpp | 28 +- src/test/app/TxQ_test.cpp | 52 +- src/test/app/ValidatorKeys_test.cpp | 17 +- src/test/app/ValidatorList_test.cpp | 59 +- src/test/app/ValidatorSite_test.cpp | 23 +- src/test/app/Vault_test.cpp | 41 +- src/test/app/XChain_test.cpp | 368 +--- src/test/app/tx/apply_test.cpp | 8 +- src/test/basics/Buffer_test.cpp | 16 +- src/test/basics/DetectCrash_test.cpp | 6 +- src/test/basics/Expected_test.cpp | 20 +- src/test/basics/FileUtilities_test.cpp | 5 +- src/test/basics/IOUAmount_test.cpp | 8 +- src/test/basics/IntrusiveShared_test.cpp | 40 +- src/test/basics/KeyCache_test.cpp | 5 +- src/test/basics/Number_test.cpp | 10 +- src/test/basics/PerfLog_test.cpp | 29 +- src/test/basics/StringUtilities_test.cpp | 4 +- src/test/basics/TaggedCache_test.cpp | 5 +- src/test/basics/Units_test.cpp | 15 +- src/test/basics/XRPAmount_test.cpp | 6 +- src/test/basics/base58_test.cpp | 37 +- src/test/basics/base_uint_test.cpp | 29 +- src/test/basics/hardened_hash_test.cpp | 15 +- src/test/basics/join_test.cpp | 16 +- src/test/beast/IPEndpointCommon.h | 6 +- src/test/beast/IPEndpoint_test.cpp | 21 +- src/test/beast/LexicalCast_test.cpp | 7 +- src/test/beast/SemanticVersion_test.cpp | 4 +- .../beast/aged_associative_container_test.cpp | 115 +- .../beast/beast_CurrentThreadName_test.cpp | 14 +- src/test/beast/beast_Journal_test.cpp | 4 +- src/test/beast/beast_PropertyStream_test.cpp | 4 +- src/test/beast/beast_Zero_test.cpp | 2 +- src/test/beast/beast_abstract_clock_test.cpp | 5 +- .../beast/beast_basic_seconds_clock_test.cpp | 2 +- .../beast/beast_io_latency_probe_test.cpp | 20 +- src/test/beast/define_print.cpp | 9 +- src/test/beast/xxhasher_test.cpp | 4 +- src/test/conditions/PreimageSha256_test.cpp | 13 +- .../consensus/ByzantineFailureSim_test.cpp | 20 +- src/test/consensus/Consensus_test.cpp | 35 +- .../DistributedValidatorsSim_test.cpp | 29 +- src/test/consensus/LedgerTiming_test.cpp | 13 +- src/test/consensus/LedgerTrie_test.cpp | 10 +- src/test/consensus/NegativeUNL_test.cpp | 173 +- .../consensus/RCLCensorshipDetector_test.cpp | 9 +- src/test/consensus/ScaleFreeSim_test.cpp | 22 +- src/test/consensus/Validations_test.cpp | 20 +- src/test/core/ClosureCounter_test.cpp | 13 +- src/test/core/Config_test.cpp | 101 +- src/test/core/Coroutine_test.cpp | 18 +- src/test/core/JobQueue_test.cpp | 12 +- src/test/core/SociDB_test.cpp | 28 +- src/test/core/Workers_test.cpp | 3 +- src/test/csf/BasicNetwork.h | 10 +- src/test/csf/BasicNetwork_test.cpp | 8 +- src/test/csf/CollectorRef.h | 46 +- src/test/csf/Digraph.h | 7 +- src/test/csf/Digraph_test.cpp | 10 +- src/test/csf/Histogram.h | 8 +- src/test/csf/Histogram_test.cpp | 8 +- src/test/csf/Peer.h | 44 +- src/test/csf/PeerGroup.h | 33 +- src/test/csf/Proposal.h | 8 +- src/test/csf/Scheduler.h | 12 +- src/test/csf/Scheduler_test.cpp | 8 +- src/test/csf/Sim.h | 8 +- src/test/csf/SimTime.h | 8 +- src/test/csf/TrustGraph.h | 9 +- src/test/csf/Tx.h | 15 +- src/test/csf/Validation.h | 10 +- src/test/csf/collectors.h | 17 +- src/test/csf/events.h | 8 +- src/test/csf/impl/Sim.cpp | 18 +- src/test/csf/impl/ledgers.cpp | 19 +- src/test/csf/ledgers.h | 12 +- src/test/csf/random.h | 14 +- src/test/csf/submitters.h | 10 +- src/test/csf/timers.h | 8 +- src/test/jtx/AMM.h | 28 +- src/test/jtx/AMMTest.h | 8 +- src/test/jtx/AbstractClient.h | 6 +- src/test/jtx/Account.h | 8 +- src/test/jtx/CaptureLogs.h | 6 +- src/test/jtx/CheckMessageLogs.h | 6 +- src/test/jtx/Env.h | 22 +- src/test/jtx/Env_ss.h | 8 +- src/test/jtx/Env_test.cpp | 67 +- src/test/jtx/JSONRPCClient.h | 6 +- src/test/jtx/JTx.h | 8 +- src/test/jtx/ManualTimeKeeper.h | 8 +- src/test/jtx/Oracle.h | 12 +- src/test/jtx/PathSet.h | 6 +- src/test/jtx/SignerUtils.h | 16 +- src/test/jtx/TestHelpers.h | 22 +- src/test/jtx/TrustedPublisherServer.h | 50 +- src/test/jtx/WSClient.h | 6 +- src/test/jtx/WSClient_test.cpp | 14 +- src/test/jtx/account_txn_id.h | 8 +- src/test/jtx/acctdelete.h | 9 +- src/test/jtx/amount.h | 44 +- src/test/jtx/attester.h | 7 +- src/test/jtx/balance.h | 20 +- src/test/jtx/basic_prop.h | 8 +- src/test/jtx/batch.h | 29 +- src/test/jtx/check.h | 13 +- src/test/jtx/credentials.h | 11 +- src/test/jtx/delegate.h | 13 +- src/test/jtx/delivermin.h | 12 +- src/test/jtx/deposit.h | 13 +- src/test/jtx/did.h | 13 +- src/test/jtx/directory.h | 8 +- src/test/jtx/domain.h | 8 +- src/test/jtx/envconfig.h | 52 +- src/test/jtx/escrow.h | 13 +- src/test/jtx/fee.h | 8 +- src/test/jtx/flags.h | 13 +- src/test/jtx/impl/AMM.cpp | 58 +- src/test/jtx/impl/AMMTest.cpp | 35 +- src/test/jtx/impl/Account.cpp | 24 +- src/test/jtx/impl/Env.cpp | 45 +- src/test/jtx/impl/JSONRPCClient.cpp | 33 +- src/test/jtx/impl/Oracle.cpp | 37 +- src/test/jtx/impl/TestHelpers.cpp | 81 +- src/test/jtx/impl/WSClient.cpp | 36 +- src/test/jtx/impl/account_txn_id.cpp | 13 +- src/test/jtx/impl/acctdelete.cpp | 17 +- src/test/jtx/impl/amount.cpp | 21 +- src/test/jtx/impl/attester.cpp | 13 +- src/test/jtx/impl/balance.cpp | 19 +- src/test/jtx/impl/batch.cpp | 35 +- src/test/jtx/impl/check.cpp | 19 +- src/test/jtx/impl/creds.cpp | 20 +- src/test/jtx/impl/delegate.cpp | 18 +- src/test/jtx/impl/delivermin.cpp | 11 +- src/test/jtx/impl/deposit.cpp | 17 +- src/test/jtx/impl/dids.cpp | 19 +- src/test/jtx/impl/directory.cpp | 22 +- src/test/jtx/impl/domain.cpp | 14 +- src/test/jtx/impl/envconfig.cpp | 58 +- src/test/jtx/impl/escrow.cpp | 22 +- src/test/jtx/impl/fee.cpp | 15 +- src/test/jtx/impl/flags.cpp | 15 +- src/test/jtx/impl/invoice_id.cpp | 13 +- src/test/jtx/impl/jtx_json.cpp | 15 +- src/test/jtx/impl/last_ledger_sequence.cpp | 11 +- src/test/jtx/impl/ledgerStateFixes.cpp | 16 +- src/test/jtx/impl/memo.cpp | 13 +- src/test/jtx/impl/mpt.cpp | 261 +-- src/test/jtx/impl/multisign.cpp | 26 +- src/test/jtx/impl/offer.cpp | 14 +- src/test/jtx/impl/owners.cpp | 17 +- src/test/jtx/impl/paths.cpp | 22 +- src/test/jtx/impl/pay.cpp | 13 +- src/test/jtx/impl/permissioned_dex.cpp | 24 +- src/test/jtx/impl/permissioned_domains.cpp | 34 +- src/test/jtx/impl/quality2.cpp | 13 +- src/test/jtx/impl/rate.cpp | 12 +- src/test/jtx/impl/regkey.cpp | 13 +- src/test/jtx/impl/sendmax.cpp | 11 +- src/test/jtx/impl/seq.cpp | 11 +- src/test/jtx/impl/sig.cpp | 11 +- src/test/jtx/impl/tag.cpp | 11 +- src/test/jtx/impl/ticket.cpp | 18 +- src/test/jtx/impl/token.cpp | 24 +- src/test/jtx/impl/trust.cpp | 15 +- src/test/jtx/impl/txflags.cpp | 11 +- src/test/jtx/impl/utility.cpp | 24 +- src/test/jtx/impl/vault.cpp | 19 +- src/test/jtx/impl/xchain_bridge.cpp | 31 +- src/test/jtx/invoice_id.h | 8 +- src/test/jtx/jtx_json.h | 8 +- src/test/jtx/last_ledger_sequence.h | 8 +- src/test/jtx/ledgerStateFix.h | 13 +- src/test/jtx/memo.h | 20 +- src/test/jtx/mpt.h | 32 +- src/test/jtx/multisign.h | 8 +- src/test/jtx/noop.h | 8 +- src/test/jtx/offer.h | 8 +- src/test/jtx/owners.h | 12 +- src/test/jtx/paths.h | 10 +- src/test/jtx/pay.h | 8 +- src/test/jtx/permissioned_dex.h | 8 +- src/test/jtx/permissioned_domains.h | 10 +- src/test/jtx/prop.h | 8 +- src/test/jtx/quality.h | 8 +- src/test/jtx/rate.h | 8 +- src/test/jtx/regkey.h | 8 +- src/test/jtx/require.h | 7 +- src/test/jtx/requires.h | 8 +- src/test/jtx/rpc.h | 13 +- src/test/jtx/sendmax.h | 12 +- src/test/jtx/seq.h | 8 +- src/test/jtx/sig.h | 8 +- src/test/jtx/tag.h | 10 +- src/test/jtx/tags.h | 26 +- src/test/jtx/ter.h | 8 +- src/test/jtx/ticket.h | 9 +- src/test/jtx/token.h | 13 +- src/test/jtx/trust.h | 8 +- src/test/jtx/txflags.h | 8 +- src/test/jtx/utility.h | 8 +- src/test/jtx/vault.h | 13 +- src/test/jtx/xchain_bridge.h | 10 +- src/test/ledger/BookDirs_test.cpp | 20 +- src/test/ledger/Directory_test.cpp | 42 +- src/test/ledger/PaymentSandbox_test.cpp | 27 +- src/test/ledger/PendingSaves_test.cpp | 8 +- src/test/ledger/SkipList_test.cpp | 15 +- src/test/ledger/View_test.cpp | 48 +- src/test/nodestore/Backend_test.cpp | 20 +- src/test/nodestore/Basics_test.cpp | 11 +- src/test/nodestore/Database_test.cpp | 32 +- src/test/nodestore/NuDBFactory_test.cpp | 15 +- src/test/nodestore/TestBase.h | 13 +- src/test/nodestore/Timing_test.cpp | 37 +- src/test/nodestore/import_test.cpp | 33 +- src/test/nodestore/varint_test.cpp | 12 +- src/test/overlay/ProtocolVersion_test.cpp | 5 +- src/test/overlay/TMGetObjectByHash_test.cpp | 39 +- src/test/overlay/cluster_test.cpp | 21 +- src/test/overlay/compression_test.cpp | 45 +- src/test/overlay/handshake_test.cpp | 9 +- src/test/overlay/reduce_relay_test.cpp | 84 +- src/test/overlay/short_read_test.cpp | 26 +- src/test/overlay/traffic_count_test.cpp | 18 +- src/test/overlay/tx_reduce_relay_test.cpp | 48 +- src/test/peerfinder/Livecache_test.cpp | 25 +- src/test/peerfinder/PeerFinder_test.cpp | 20 +- src/test/protocol/ApiVersion_test.cpp | 14 +- src/test/protocol/BuildInfo_test.cpp | 2 +- src/test/protocol/Hooks_test.cpp | 12 +- src/test/protocol/InnerObjectFormats_test.cpp | 31 +- src/test/protocol/Issue_test.cpp | 11 +- src/test/protocol/Memo_test.cpp | 13 +- src/test/protocol/MultiApiJson_test.cpp | 13 +- src/test/protocol/PublicKey_test.cpp | 12 +- src/test/protocol/Quality_test.cpp | 16 +- src/test/protocol/STAccount_test.cpp | 9 +- src/test/protocol/STAmount_test.cpp | 24 +- src/test/protocol/STInteger_test.cpp | 3 +- src/test/protocol/STIssue_test.cpp | 18 +- src/test/protocol/STNumber_test.cpp | 10 +- src/test/protocol/STObject_test.cpp | 32 +- src/test/protocol/STParsedJSON_test.cpp | 38 +- src/test/protocol/STTx_test.cpp | 25 +- src/test/protocol/STValidation_test.cpp | 17 +- src/test/protocol/SecretKey_test.cpp | 1534 ++++++++--------- src/test/protocol/Seed_test.cpp | 9 +- src/test/protocol/SeqProxy_test.cpp | 6 +- src/test/protocol/Serializer_test.cpp | 4 +- src/test/protocol/TER_test.cpp | 48 +- src/test/resource/Logic_test.cpp | 20 +- src/test/rpc/AMMInfo_test.cpp | 26 +- src/test/rpc/AccountCurrencies_test.cpp | 19 +- src/test/rpc/AccountInfo_test.cpp | 27 +- src/test/rpc/AccountLines_test.cpp | 39 +- src/test/rpc/AccountObjects_test.cpp | 41 +- src/test/rpc/AccountOffers_test.cpp | 20 +- src/test/rpc/AccountTx_test.cpp | 48 +- src/test/rpc/AmendmentBlocked_test.cpp | 17 +- src/test/rpc/BookChanges_test.cpp | 23 +- src/test/rpc/Book_test.cpp | 33 +- src/test/rpc/Connect_test.cpp | 4 +- src/test/rpc/DeliveredAmount_test.cpp | 29 +- src/test/rpc/DepositAuthorized_test.cpp | 24 +- src/test/rpc/Feature_test.cpp | 24 +- src/test/rpc/GatewayBalances_test.cpp | 20 +- src/test/rpc/GetAggregatePrice_test.cpp | 24 +- src/test/rpc/GetCounts_test.cpp | 12 +- src/test/rpc/Handler_test.cpp | 15 +- src/test/rpc/JSONRPC_test.cpp | 34 +- src/test/rpc/KeyGeneration_test.cpp | 81 +- src/test/rpc/LedgerClosed_test.cpp | 10 +- src/test/rpc/LedgerData_test.cpp | 25 +- src/test/rpc/LedgerEntry_test.cpp | 63 +- src/test/rpc/LedgerHeader_test.cpp | 2 - src/test/rpc/LedgerRPC_test.cpp | 32 +- src/test/rpc/LedgerRequest_test.cpp | 21 +- src/test/rpc/ManifestRPC_test.cpp | 13 +- src/test/rpc/NoRippleCheck_test.cpp | 24 +- src/test/rpc/NoRipple_test.cpp | 25 +- src/test/rpc/OwnerInfo_test.cpp | 14 +- src/test/rpc/Peers_test.cpp | 10 +- src/test/rpc/RPCCall_test.cpp | 23 +- src/test/rpc/RPCHelpers_test.cpp | 12 +- src/test/rpc/RPCOverload_test.cpp | 21 +- src/test/rpc/RobustTransaction_test.cpp | 19 +- src/test/rpc/Roles_test.cpp | 16 +- src/test/rpc/ServerDefinitions_test.cpp | 12 +- src/test/rpc/ServerInfo_test.cpp | 16 +- src/test/rpc/Simulate_test.cpp | 42 +- src/test/rpc/Status_test.cpp | 17 +- src/test/rpc/Subscribe_test.cpp | 53 +- src/test/rpc/TransactionEntry_test.cpp | 17 +- src/test/rpc/TransactionHistory_test.cpp | 12 +- src/test/rpc/Transaction_test.cpp | 27 +- src/test/rpc/ValidatorInfo_test.cpp | 13 +- src/test/rpc/ValidatorRPC_test.cpp | 28 +- src/test/rpc/Version_test.cpp | 13 +- src/test/server/ServerStatus_test.cpp | 41 +- src/test/server/Server_test.cpp | 31 +- src/test/shamap/FetchPack_test.cpp | 25 +- src/test/shamap/SHAMapSync_test.cpp | 25 +- src/test/shamap/SHAMap_test.cpp | 24 +- src/test/shamap/common.h | 6 +- src/test/unit_test/FileDirGuard.h | 14 +- src/test/unit_test/SuiteJournal.h | 10 +- src/test/unit_test/multi_runner.cpp | 27 +- src/test/unit_test/multi_runner.h | 16 +- src/test/unit_test/utils.h | 6 +- src/tests/libxrpl/CMakeLists.txt | 13 +- src/tests/libxrpl/basics/MallocTrim.cpp | 4 - src/tests/libxrpl/basics/Mutex.cpp | 2 - src/tests/libxrpl/basics/RangeSet.cpp | 3 - src/tests/libxrpl/basics/Slice.cpp | 1 - src/tests/libxrpl/basics/contract.cpp | 1 + src/tests/libxrpl/basics/scope.cpp | 2 - src/tests/libxrpl/basics/tagged_integer.cpp | 41 +- src/tests/libxrpl/crypto/csprng.cpp | 2 - src/tests/libxrpl/helpers/TestSink.cpp | 7 +- src/tests/libxrpl/json/Output.cpp | 1 - src/tests/libxrpl/json/Value.cpp | 10 +- src/tests/libxrpl/json/Writer.cpp | 4 +- src/tests/libxrpl/net/HTTPClient.cpp | 27 +- src/xrpld/app/consensus/RCLConsensus.cpp | 58 +- src/xrpld/app/consensus/RCLCxPeerPos.cpp | 9 - src/xrpld/app/consensus/RCLCxPeerPos.h | 2 +- src/xrpld/app/consensus/RCLValidations.cpp | 12 - src/xrpld/app/ledger/AcceptedLedger.cpp | 6 +- src/xrpld/app/ledger/AccountStateSF.cpp | 9 - src/xrpld/app/ledger/ConsensusTransSetSF.cpp | 17 +- src/xrpld/app/ledger/InboundLedger.h | 2 +- src/xrpld/app/ledger/LedgerCleaner.h | 2 +- src/xrpld/app/ledger/LedgerHistory.cpp | 29 +- src/xrpld/app/ledger/LedgerMaster.h | 4 +- src/xrpld/app/ledger/LedgerReplayTask.h | 8 +- src/xrpld/app/ledger/LedgerToJson.h | 2 +- src/xrpld/app/ledger/OrderBookDBImpl.cpp | 30 +- src/xrpld/app/ledger/TransactionStateSF.cpp | 10 - src/xrpld/app/ledger/detail/BuildLedger.cpp | 16 +- src/xrpld/app/ledger/detail/InboundLedger.cpp | 53 +- .../app/ledger/detail/InboundLedgers.cpp | 27 +- .../app/ledger/detail/InboundTransactions.cpp | 19 +- src/xrpld/app/ledger/detail/LedgerCleaner.cpp | 24 +- .../app/ledger/detail/LedgerDeltaAcquire.cpp | 28 +- .../app/ledger/detail/LedgerDeltaAcquire.h | 4 +- src/xrpld/app/ledger/detail/LedgerMaster.cpp | 49 +- .../app/ledger/detail/LedgerPersistence.cpp | 12 +- src/xrpld/app/ledger/detail/LedgerReplay.cpp | 6 - .../ledger/detail/LedgerReplayMsgHandler.cpp | 25 +- .../app/ledger/detail/LedgerReplayTask.cpp | 23 +- .../app/ledger/detail/LedgerReplayer.cpp | 40 +- src/xrpld/app/ledger/detail/LedgerToJson.cpp | 22 +- src/xrpld/app/ledger/detail/LocalTxs.cpp | 14 +- src/xrpld/app/ledger/detail/OpenLedger.cpp | 26 +- .../app/ledger/detail/SkipListAcquire.cpp | 27 +- .../app/ledger/detail/TimeoutCounter.cpp | 12 - .../app/ledger/detail/TransactionAcquire.cpp | 23 +- .../app/ledger/detail/TransactionAcquire.h | 3 +- .../app/ledger/detail/TransactionMaster.cpp | 21 +- src/xrpld/app/main/Application.cpp | 98 +- src/xrpld/app/main/Application.h | 9 + src/xrpld/app/main/BasicApp.cpp | 3 - src/xrpld/app/main/CollectorManager.cpp | 12 +- src/xrpld/app/main/GRPCServer.cpp | 241 +-- src/xrpld/app/main/GRPCServer.h | 17 +- src/xrpld/app/main/LoadManager.cpp | 11 +- src/xrpld/app/main/LoadManager.h | 1 - src/xrpld/app/main/Main.cpp | 34 +- src/xrpld/app/main/NodeIdentity.cpp | 14 +- src/xrpld/app/main/NodeStoreScheduler.cpp | 5 - src/xrpld/app/misc/DeliverMax.h | 7 +- src/xrpld/app/misc/FeeVoteImpl.cpp | 25 +- src/xrpld/app/misc/NegativeUNLVote.cpp | 25 +- src/xrpld/app/misc/NetworkOPs.cpp | 117 +- src/xrpld/app/misc/SHAMapStore.h | 2 - src/xrpld/app/misc/SHAMapStoreImp.cpp | 31 +- src/xrpld/app/misc/SHAMapStoreImp.h | 6 +- src/xrpld/app/misc/Transaction.h | 5 +- src/xrpld/app/misc/TxQ.h | 15 +- src/xrpld/app/misc/detail/AccountTxPaging.cpp | 13 +- src/xrpld/app/misc/detail/AmendmentTable.cpp | 47 +- src/xrpld/app/misc/detail/DeliverMax.cpp | 7 +- src/xrpld/app/misc/detail/Transaction.cpp | 26 +- src/xrpld/app/misc/detail/TxQ.cpp | 53 +- src/xrpld/app/misc/detail/ValidatorKeys.cpp | 8 - src/xrpld/app/misc/detail/ValidatorList.cpp | 60 +- src/xrpld/app/misc/detail/ValidatorSite.cpp | 54 +- src/xrpld/app/misc/detail/Work.h | 8 +- src/xrpld/app/misc/detail/WorkBase.h | 42 +- src/xrpld/app/misc/detail/WorkFile.h | 21 +- src/xrpld/app/misc/detail/WorkPlain.h | 15 +- src/xrpld/app/misc/detail/WorkSSL.cpp | 23 +- src/xrpld/app/misc/detail/WorkSSL.h | 10 +- .../app/misc/detail/setup_HashRouter.cpp | 7 - src/xrpld/app/rdb/backend/detail/Node.cpp | 75 +- src/xrpld/app/rdb/backend/detail/Node.h | 6 +- .../app/rdb/backend/detail/SQLiteDatabase.cpp | 37 +- src/xrpld/app/rdb/detail/PeerFinder.cpp | 22 - src/xrpld/app/tx/detail/Taker.h | 0 src/xrpld/consensus/Consensus.cpp | 10 - src/xrpld/consensus/Consensus.h | 18 +- src/xrpld/consensus/ConsensusParms.h | 8 +- src/xrpld/consensus/DisputedTx.h | 18 +- src/xrpld/consensus/LedgerTrie.h | 23 +- src/xrpld/consensus/Validations.h | 14 - src/xrpld/core/TimeKeeper.h | 4 +- src/xrpld/core/detail/Config.cpp | 66 +- .../core/detail/NetworkIDServiceImpl.cpp | 3 +- src/xrpld/overlay/ClusterNode.h | 7 +- src/xrpld/overlay/Compression.h | 48 +- src/xrpld/overlay/Overlay.h | 10 +- src/xrpld/overlay/ReduceRelayCommon.h | 8 +- src/xrpld/overlay/Slot.h | 30 +- src/xrpld/overlay/Squelch.h | 13 +- src/xrpld/overlay/detail/Cluster.cpp | 17 +- src/xrpld/overlay/detail/ConnectAttempt.cpp | 43 +- src/xrpld/overlay/detail/ConnectAttempt.h | 4 +- src/xrpld/overlay/detail/Handshake.cpp | 37 +- src/xrpld/overlay/detail/Message.cpp | 13 - src/xrpld/overlay/detail/OverlayImpl.cpp | 81 +- src/xrpld/overlay/detail/OverlayImpl.h | 2 +- src/xrpld/overlay/detail/PeerImp.cpp | 89 +- src/xrpld/overlay/detail/PeerImp.h | 14 +- .../overlay/detail/PeerReservationTable.cpp | 10 +- src/xrpld/overlay/detail/PeerSet.cpp | 29 +- src/xrpld/overlay/detail/ProtocolMessage.h | 6 +- src/xrpld/overlay/detail/ProtocolVersion.cpp | 26 +- src/xrpld/overlay/detail/ProtocolVersion.h | 2 +- src/xrpld/overlay/detail/TrafficCount.cpp | 6 - src/xrpld/overlay/detail/TrafficCount.h | 2 +- src/xrpld/overlay/detail/Tuning.h | 8 +- src/xrpld/overlay/detail/TxMetrics.cpp | 15 +- src/xrpld/overlay/detail/TxMetrics.h | 8 +- src/xrpld/overlay/detail/ZeroCopyStream.h | 2 +- src/xrpld/overlay/predicates.h | 10 +- src/xrpld/peerfinder/PeerfinderManager.h | 13 +- src/xrpld/peerfinder/Slot.h | 6 +- src/xrpld/peerfinder/detail/Bootcache.cpp | 16 +- src/xrpld/peerfinder/detail/Bootcache.h | 10 +- src/xrpld/peerfinder/detail/Checker.h | 18 +- src/xrpld/peerfinder/detail/Counts.h | 17 +- src/xrpld/peerfinder/detail/Endpoint.cpp | 16 +- src/xrpld/peerfinder/detail/Fixed.h | 6 +- src/xrpld/peerfinder/detail/Handouts.h | 16 +- src/xrpld/peerfinder/detail/Livecache.h | 15 +- src/xrpld/peerfinder/detail/Logic.h | 30 +- .../peerfinder/detail/PeerfinderConfig.cpp | 11 +- .../peerfinder/detail/PeerfinderManager.cpp | 24 +- src/xrpld/peerfinder/detail/SlotImp.cpp | 25 +- src/xrpld/peerfinder/detail/SlotImp.h | 10 +- src/xrpld/peerfinder/detail/Source.h | 10 +- src/xrpld/peerfinder/detail/SourceStrings.cpp | 21 +- src/xrpld/peerfinder/detail/SourceStrings.h | 6 +- src/xrpld/peerfinder/detail/Store.h | 10 +- src/xrpld/peerfinder/detail/StoreSqdb.h | 10 +- src/xrpld/peerfinder/detail/Tuning.h | 10 +- src/xrpld/peerfinder/make_Manager.h | 6 +- src/xrpld/perflog/detail/PerfLogImp.cpp | 32 +- src/xrpld/perflog/detail/PerfLogImp.h | 8 +- src/xrpld/rpc/BookChanges.h | 10 +- src/xrpld/rpc/CTID.h | 7 +- src/xrpld/rpc/Context.h | 4 +- src/xrpld/rpc/MPTokenIssuanceID.h | 7 +- src/xrpld/rpc/RPCHandler.h | 6 +- src/xrpld/rpc/Status.h | 12 +- src/xrpld/rpc/detail/AccountAssets.cpp | 11 - src/xrpld/rpc/detail/AssetCache.cpp | 16 - src/xrpld/rpc/detail/DeliveredAmount.cpp | 23 +- src/xrpld/rpc/detail/Handler.cpp | 371 +--- src/xrpld/rpc/detail/Handler.h | 6 +- src/xrpld/rpc/detail/LegacyPathFind.cpp | 11 +- src/xrpld/rpc/detail/MPTokenIssuanceID.cpp | 21 +- src/xrpld/rpc/detail/PathRequest.cpp | 37 +- src/xrpld/rpc/detail/PathRequest.h | 4 +- src/xrpld/rpc/detail/PathRequestManager.cpp | 36 +- src/xrpld/rpc/detail/Pathfinder.cpp | 47 +- src/xrpld/rpc/detail/Pathfinder.h | 1 - src/xrpld/rpc/detail/RPCCall.cpp | 303 +--- src/xrpld/rpc/detail/RPCHandler.cpp | 21 +- src/xrpld/rpc/detail/RPCHelpers.cpp | 53 +- src/xrpld/rpc/detail/RPCLedgerHelpers.cpp | 30 +- src/xrpld/rpc/detail/RPCSub.cpp | 32 +- src/xrpld/rpc/detail/Role.cpp | 24 +- src/xrpld/rpc/detail/ServerHandler.cpp | 100 +- src/xrpld/rpc/detail/Status.cpp | 13 +- src/xrpld/rpc/detail/TransactionSign.cpp | 70 +- src/xrpld/rpc/detail/TransactionSign.h | 1 - src/xrpld/rpc/detail/TrustLine.cpp | 8 - src/xrpld/rpc/detail/TrustLine.h | 22 +- src/xrpld/rpc/detail/Tuning.h | 30 +- src/xrpld/rpc/handlers/ChannelVerify.cpp | 9 - src/xrpld/rpc/handlers/VaultInfo.cpp | 7 +- .../rpc/handlers/account/AccountChannels.cpp | 25 +- .../handlers/account/AccountCurrencies.cpp | 9 - .../rpc/handlers/account/AccountInfo.cpp | 22 +- .../rpc/handlers/account/AccountLines.cpp | 28 +- .../rpc/handlers/account/AccountNFTs.cpp | 10 +- .../rpc/handlers/account/AccountObjects.cpp | 38 +- .../rpc/handlers/account/AccountOffers.cpp | 20 +- src/xrpld/rpc/handlers/account/AccountTx.cpp | 31 +- .../rpc/handlers/account/GatewayBalances.cpp | 16 - .../rpc/handlers/account/NoRippleCheck.cpp | 11 +- src/xrpld/rpc/handlers/account/OwnerInfo.cpp | 4 - src/xrpld/rpc/handlers/admin/BlackList.cpp | 1 - src/xrpld/rpc/handlers/admin/UnlList.cpp | 6 +- .../rpc/handlers/admin/data/CanDelete.cpp | 6 - .../rpc/handlers/admin/data/LedgerCleaner.cpp | 1 - .../rpc/handlers/admin/data/LedgerRequest.cpp | 2 +- .../admin/keygen/ValidationCreate.cpp | 7 - .../handlers/admin/keygen/WalletPropose.cpp | 8 +- src/xrpld/rpc/handlers/admin/log/LogLevel.cpp | 4 - .../rpc/handlers/admin/log/LogRotate.cpp | 2 - src/xrpld/rpc/handlers/admin/peer/Connect.cpp | 4 - .../admin/peer/PeerReservationsAdd.cpp | 6 +- .../admin/peer/PeerReservationsDel.cpp | 1 - src/xrpld/rpc/handlers/admin/peer/Peers.cpp | 8 +- .../admin/server_control/LedgerAccept.cpp | 2 +- .../handlers/admin/server_control/Stop.cpp | 1 - .../admin/signing/ChannelAuthorize.cpp | 11 - src/xrpld/rpc/handlers/admin/signing/Sign.cpp | 3 - .../rpc/handlers/admin/signing/SignFor.cpp | 3 - .../handlers/admin/status/ConsensusInfo.cpp | 1 + .../rpc/handlers/admin/status/FetchInfo.cpp | 1 + .../rpc/handlers/admin/status/GetCounts.cpp | 7 +- .../handlers/admin/status/ValidatorInfo.cpp | 3 +- .../admin/status/ValidatorListSites.cpp | 2 +- .../rpc/handlers/admin/status/Validators.cpp | 2 +- src/xrpld/rpc/handlers/ledger/Ledger.cpp | 23 +- src/xrpld/rpc/handlers/ledger/Ledger.h | 6 +- .../rpc/handlers/ledger/LedgerClosed.cpp | 2 - src/xrpld/rpc/handlers/ledger/LedgerData.cpp | 11 - src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp | 12 - src/xrpld/rpc/handlers/ledger/LedgerEntry.cpp | 34 +- .../rpc/handlers/ledger/LedgerEntryHelpers.h | 8 +- .../rpc/handlers/ledger/LedgerHeader.cpp | 6 - src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp | 28 +- .../rpc/handlers/orderbook/BookChanges.cpp | 3 - .../rpc/handlers/orderbook/BookOffers.cpp | 13 +- .../handlers/orderbook/DepositAuthorized.cpp | 13 - .../handlers/orderbook/GetAggregatePrice.cpp | 28 +- .../rpc/handlers/orderbook/NFTBuyOffers.cpp | 4 +- .../rpc/handlers/orderbook/NFTSellOffers.cpp | 4 +- src/xrpld/rpc/handlers/orderbook/PathFind.cpp | 2 - .../rpc/handlers/orderbook/RipplePathFind.cpp | 10 - .../rpc/handlers/server_info/Feature.cpp | 4 - src/xrpld/rpc/handlers/server_info/Fee.cpp | 4 +- .../rpc/handlers/server_info/Manifest.cpp | 2 - .../server_info/ServerDefinitions.cpp | 10 +- src/xrpld/rpc/handlers/server_info/Version.h | 10 +- .../rpc/handlers/subscribe/Subscribe.cpp | 14 +- .../rpc/handlers/subscribe/Unsubscribe.cpp | 7 - .../rpc/handlers/transaction/Simulate.cpp | 29 +- src/xrpld/rpc/handlers/transaction/Submit.cpp | 14 - .../transaction/SubmitMultiSigned.cpp | 3 +- .../handlers/transaction/TransactionEntry.cpp | 5 - src/xrpld/rpc/handlers/transaction/Tx.cpp | 21 +- .../rpc/handlers/transaction/TxHistory.cpp | 1 + src/xrpld/rpc/handlers/utility/Random.cpp | 2 - src/xrpld/rpc/json_body.h | 2 +- src/xrpld/shamap/NodeFamily.cpp | 16 +- src/xrpld/shamap/NodeFamily.h | 3 - 1231 files changed, 7982 insertions(+), 21986 deletions(-) delete mode 100644 .github/scripts/check-pr-description.py delete mode 100644 .github/workflows/check-pr-description.yml delete mode 100755 bin/pre-commit/clang_tidy_check.py delete mode 100644 cmake/XrplProtocolAutogenRun.cmake rename {cmake/scripts/codegen => scripts}/generate_ledger_classes.py (92%) rename {cmake/scripts/codegen => scripts}/generate_tx_classes.py (92%) rename {cmake/scripts/codegen => scripts}/macro_parser_common.py (100%) rename {cmake/scripts/codegen => scripts}/requirements.txt (100%) rename {cmake/scripts/codegen => scripts}/templates/LedgerEntry.h.mako (100%) rename {cmake/scripts/codegen => scripts}/templates/LedgerEntryTests.cpp.mako (100%) rename {cmake/scripts/codegen => scripts}/templates/Transaction.h.mako (100%) rename {cmake/scripts/codegen => scripts}/templates/TransactionTests.cpp.mako (100%) delete mode 100644 src/test/app/GRPCServerTLS_test.cpp create mode 100644 src/xrpld/app/tx/detail/Taker.h diff --git a/.clang-format b/.clang-format index b6089a2cd4..ca8edf678f 100644 --- a/.clang-format +++ b/.clang-format @@ -50,21 +50,20 @@ ForEachMacros: [Q_FOREACH, BOOST_FOREACH] IncludeBlocks: Regroup IncludeCategories: - Regex: "^<(test)/" - Priority: 1 + Priority: 0 - Regex: "^<(xrpld)/" - Priority: 2 + Priority: 1 - Regex: "^<(xrpl)/" - Priority: 3 + Priority: 2 - Regex: "^<(boost)/" - Priority: 4 + Priority: 3 - Regex: "^.*/" - Priority: 5 + Priority: 4 - Regex: '^.*\.h' - Priority: 6 + Priority: 5 - Regex: ".*" - Priority: 7 + Priority: 6 IncludeIsMainRegex: "$" -MainIncludeChar: AngleBracket IndentCaseLabels: true IndentFunctionDeclarationAfterType: false IndentRequiresClause: true diff --git a/.clang-tidy b/.clang-tidy index 3a21eba6c0..07274eb53a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -10,26 +10,26 @@ Checks: "-*, bugprone-chained-comparison, bugprone-compare-pointer-to-member-virtual-function, bugprone-copy-constructor-init, - bugprone-crtp-constructor-accessibility, + # bugprone-crtp-constructor-accessibility, # has issues bugprone-dangling-handle, bugprone-dynamic-static-initializers, - bugprone-empty-catch, + # bugprone-empty-catch, # has issues bugprone-fold-init-type, - bugprone-forward-declaration-namespace, - bugprone-inaccurate-erase, - bugprone-inc-dec-in-conditions, - bugprone-incorrect-enable-if, - bugprone-incorrect-roundings, - bugprone-infinite-loop, - bugprone-integer-division, + # bugprone-forward-declaration-namespace, # has issues + # bugprone-inaccurate-erase, + # bugprone-inc-dec-in-conditions, + # bugprone-incorrect-enable-if, + # bugprone-incorrect-roundings, + # bugprone-infinite-loop, + # bugprone-integer-division, bugprone-lambda-function-name, - bugprone-macro-parentheses, + # bugprone-macro-parentheses, # has issues bugprone-macro-repeated-side-effects, bugprone-misplaced-operator-in-strlen-in-alloc, bugprone-misplaced-pointer-arithmetic-in-alloc, bugprone-misplaced-widening-cast, bugprone-move-forwarding-reference, - bugprone-multi-level-implicit-pointer-conversion, + # bugprone-multi-level-implicit-pointer-conversion, # has issues bugprone-multiple-new-in-one-expression, bugprone-multiple-statement-macro, bugprone-no-escape, @@ -39,13 +39,13 @@ Checks: "-*, bugprone-pointer-arithmetic-on-polymorphic-object, bugprone-posix-return, bugprone-redundant-branch-condition, - bugprone-reserved-identifier, - bugprone-return-const-ref-from-parameter, + # bugprone-reserved-identifier, # has issues + # bugprone-return-const-ref-from-parameter, # has issues bugprone-shared-ptr-array-mismatch, bugprone-signal-handler, bugprone-signed-char-misuse, bugprone-sizeof-container, - bugprone-sizeof-expression, + # bugprone-sizeof-expression, # has issues bugprone-spuriously-wake-up-functions, bugprone-standalone-empty, bugprone-string-constructor, @@ -62,7 +62,7 @@ Checks: "-*, bugprone-suspicious-string-compare, bugprone-suspicious-stringview-data-usage, bugprone-swapped-arguments, - bugprone-switch-missing-default-case, + # bugprone-switch-missing-default-case, # has issues bugprone-terminating-continue, bugprone-throw-keyword-missing, bugprone-too-small-loop-variable, @@ -73,7 +73,7 @@ Checks: "-*, bugprone-unhandled-self-assignment, bugprone-unique-ptr-array-mismatch, bugprone-unsafe-functions, - bugprone-use-after-move, # has issues + # bugprone-use-after-move, # has issues bugprone-unused-raii, bugprone-unused-return-value, bugprone-unused-local-non-trivial-variable, @@ -90,28 +90,15 @@ Checks: "-*, misc-const-correctness, misc-definitions-in-headers, misc-header-include-cycle, - misc-include-cleaner, misc-misplaced-const, misc-redundant-expression, misc-static-assert, misc-throw-by-value-catch-by-reference, misc-unused-alias-decls, misc-unused-using-decls, - modernize-concat-nested-namespaces, + modernize-deprecated-headers, modernize-make-shared, modernize-make-unique, - modernize-pass-by-value, - modernize-type-traits, - modernize-use-designated-initializers, - modernize-use-emplace, - modernize-use-equals-default, - modernize-use-equals-delete, - modernize-use-override, - modernize-use-ranges, - modernize-use-starts-ends-with, - modernize-use-std-numbers, - modernize-use-using, - modernize-deprecated-headers, llvm-namespace-comment, performance-faster-string-find, performance-for-range-copy, @@ -121,38 +108,53 @@ Checks: "-*, performance-move-constructor-init, performance-no-automatic-move, performance-trivially-destructible, - readability-avoid-nested-conditional-operator, - readability-avoid-return-with-void-value, - readability-braces-around-statements, - readability-const-return-type, - readability-container-contains, - readability-container-size-empty, - readability-convert-member-functions-to-static, + # readability-avoid-nested-conditional-operator, # has issues + # readability-avoid-return-with-void-value, # has issues + # readability-braces-around-statements, # has issues + # readability-const-return-type, # has issues + # readability-container-contains, # has issues + # readability-container-size-empty, # has issues + # readability-convert-member-functions-to-static, # has issues readability-duplicate-include, - readability-else-after-return, - readability-enum-initial-value, - readability-implicit-bool-conversion, - readability-make-member-function-const, - readability-math-missing-parentheses, + # readability-else-after-return, # has issues + # readability-enum-initial-value, # has issues + # readability-implicit-bool-conversion, # has issues + # readability-make-member-function-const, # has issues + # readability-math-missing-parentheses, # has issues readability-misleading-indentation, readability-non-const-parameter, - readability-redundant-casting, - readability-redundant-declaration, - readability-redundant-inline-specifier, - readability-redundant-member-init, + # readability-redundant-casting, # has issues + # readability-redundant-declaration, # has issues + # readability-redundant-inline-specifier, # has issues + # readability-redundant-member-init, # has issues readability-redundant-string-init, readability-reference-to-constructed-temporary, - readability-simplify-boolean-expr, - readability-static-definition-in-anonymous-namespace, - readability-suspicious-call-argument, + # readability-simplify-boolean-expr, # has issues + # readability-static-definition-in-anonymous-namespace, # has issues + # readability-suspicious-call-argument, # has issues readability-use-std-min-max " # --- # other checks that have issues that need to be resolved: # +# misc-include-cleaner, +# # readability-inconsistent-declaration-parameter-name, # in this codebase this check will break a lot of arg names # readability-static-accessed-through-instance, # this check is probably unnecessary. it makes the code less readable # readability-identifier-naming, # https://github.com/XRPLF/rippled/pull/6571 +# +# modernize-concat-nested-namespaces, +# modernize-pass-by-value, +# modernize-type-traits, +# modernize-use-designated-initializers, +# modernize-use-emplace, +# modernize-use-equals-default, +# modernize-use-equals-delete, +# modernize-use-override, +# modernize-use-ranges, +# modernize-use-starts-ends-with, +# modernize-use-std-numbers, +# modernize-use-using, # --- # CheckOptions: @@ -192,7 +194,7 @@ CheckOptions: # readability-identifier-naming.FunctionIgnoredRegexp: ".*tag_invoke.*" bugprone-unsafe-functions.ReportMoreUnsafeFunctions: true bugprone-unused-return-value.CheckedReturnTypes: ::std::error_code;::std::error_condition;::std::errc - misc-include-cleaner.IgnoreHeaders: ".*/(detail|impl)/.*;.*fwd\\.h(pp)?;time.h;stdlib.h;sqlite3.h;netinet/in\\.h;sys/resource\\.h;sys/sysinfo\\.h;linux/sysinfo\\.h;__chrono/.*;bits/.*;_abort\\.h;boost/uuid/uuid_hash.hpp;boost/beast/core/flat_buffer\\.hpp;boost/beast/http/field\\.hpp;boost/beast/http/dynamic_body\\.hpp;boost/beast/http/message\\.hpp;boost/beast/http/read\\.hpp;boost/beast/http/write\\.hpp;openssl/obj_mac\\.h" +# misc-include-cleaner.IgnoreHeaders: '.*/(detail|impl)/.*;.*(expected|unexpected).*;.*ranges_lower_bound\.h;time.h;stdlib.h;__chrono/.*;fmt/chrono.h;boost/uuid/uuid_hash.hpp' # HeaderFilterRegex: '^.*/(test|xrpl|xrpld)/.*\.(h|hpp)$' ExcludeHeaderFilterRegex: '^.*/protocol_autogen/.*\.(h|hpp)$' diff --git a/.github/scripts/check-pr-description.py b/.github/scripts/check-pr-description.py deleted file mode 100644 index 36abb0f5a4..0000000000 --- a/.github/scripts/check-pr-description.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python3 - -""" -Checks that a pull request description has been customized from the -pull_request_template.md. Exits with code 1 if the description is empty -or identical to the template (ignoring HTML comments and whitespace). - -Usage: - python check-pr-description.py --template-file TEMPLATE --pr-body-file BODY -""" - -import argparse -import re -import sys -from pathlib import Path - - -def normalize(text: str) -> str: - """Strip HTML comments, trim lines, and remove blank lines.""" - # Remove HTML comments (possibly multi-line) - text = re.sub(r"", "", text, flags=re.DOTALL) - # Strip each line and drop empties - lines = [line.strip() for line in text.splitlines()] - lines = [line for line in lines if line] - return "\n".join(lines) - - -def main() -> int: - parser = argparse.ArgumentParser( - description="Check that a PR description differs from the template." - ) - parser.add_argument( - "--template-file", - type=Path, - required=True, - help="Path to the pull request template file.", - ) - parser.add_argument( - "--pr-body-file", - type=Path, - required=True, - help="Path to a file containing the PR body text.", - ) - args = parser.parse_args() - - template_path: Path = args.template_file - pr_body_path: Path = args.pr_body_file - - if not template_path.is_file(): - print(f"::error::Template file {template_path} not found") - return 1 - - if not pr_body_path.is_file(): - print(f"::error::PR body file {pr_body_path} not found") - return 1 - - template = template_path.read_text(encoding="utf-8") - pr_body = pr_body_path.read_text(encoding="utf-8") - - # Check if the PR body is empty or whitespace-only - if not pr_body.strip(): - print( - "::error::PR description is empty. " - "Please fill in the pull request template." - ) - return 1 - - norm_template = normalize(template) - norm_pr_body = normalize(pr_body) - - if norm_pr_body == norm_template: - print( - "::error::PR description (ignoring HTML comments) is identical" - " to the template. Please fill in the details of your change." - f"\n\nVisible template content:\n---\n{norm_template}\n---" - f"\n\nVisible PR description content:\n---\n{norm_pr_body}\n---" - ) - return 1 - - print("PR description has been customized from the template.") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.github/scripts/levelization/results/loops.txt b/.github/scripts/levelization/results/loops.txt index fb449441e3..7914704f9d 100644 --- a/.github/scripts/levelization/results/loops.txt +++ b/.github/scripts/levelization/results/loops.txt @@ -2,19 +2,19 @@ Loop: test.jtx test.toplevel test.toplevel > test.jtx Loop: test.jtx test.unit_test - test.unit_test ~= test.jtx + test.unit_test == test.jtx Loop: xrpld.app xrpld.overlay - xrpld.app > xrpld.overlay + xrpld.overlay ~= xrpld.app Loop: xrpld.app xrpld.peerfinder - xrpld.peerfinder ~= xrpld.app + xrpld.peerfinder == xrpld.app Loop: xrpld.app xrpld.rpc xrpld.rpc > xrpld.app Loop: xrpld.app xrpld.shamap - xrpld.shamap > xrpld.app + xrpld.shamap ~= xrpld.app Loop: xrpld.overlay xrpld.rpc xrpld.rpc ~= xrpld.overlay diff --git a/.github/scripts/levelization/results/ordering.txt b/.github/scripts/levelization/results/ordering.txt index 02a14a0077..38e77dedf8 100644 --- a/.github/scripts/levelization/results/ordering.txt +++ b/.github/scripts/levelization/results/ordering.txt @@ -3,17 +3,13 @@ libxrpl.conditions > xrpl.basics libxrpl.conditions > xrpl.conditions libxrpl.core > xrpl.basics libxrpl.core > xrpl.core -libxrpl.core > xrpl.json libxrpl.crypto > xrpl.basics libxrpl.json > xrpl.basics libxrpl.json > xrpl.json libxrpl.ledger > xrpl.basics libxrpl.ledger > xrpl.json libxrpl.ledger > xrpl.ledger -libxrpl.ledger > xrpl.nodestore libxrpl.ledger > xrpl.protocol -libxrpl.ledger > xrpl.server -libxrpl.ledger > xrpl.shamap libxrpl.net > xrpl.basics libxrpl.net > xrpl.net libxrpl.nodestore > xrpl.basics @@ -23,22 +19,19 @@ libxrpl.nodestore > xrpl.protocol libxrpl.protocol > xrpl.basics libxrpl.protocol > xrpl.json libxrpl.protocol > xrpl.protocol +libxrpl.protocol_autogen > xrpl.protocol_autogen libxrpl.rdb > xrpl.basics libxrpl.rdb > xrpl.core libxrpl.rdb > xrpl.rdb libxrpl.resource > xrpl.basics libxrpl.resource > xrpl.json -libxrpl.resource > xrpl.protocol libxrpl.resource > xrpl.resource libxrpl.server > xrpl.basics -libxrpl.server > xrpl.core libxrpl.server > xrpl.json libxrpl.server > xrpl.protocol libxrpl.server > xrpl.rdb -libxrpl.server > xrpl.resource libxrpl.server > xrpl.server libxrpl.shamap > xrpl.basics -libxrpl.shamap > xrpl.nodestore libxrpl.shamap > xrpl.protocol libxrpl.shamap > xrpl.shamap libxrpl.tx > xrpl.basics @@ -50,11 +43,12 @@ libxrpl.tx > xrpl.protocol libxrpl.tx > xrpl.server libxrpl.tx > xrpl.tx test.app > test.jtx +test.app > test.rpc +test.app > test.toplevel test.app > test.unit_test test.app > xrpl.basics test.app > xrpl.core test.app > xrpld.app -test.app > xrpld.consensus test.app > xrpld.core test.app > xrpld.overlay test.app > xrpld.rpc @@ -62,9 +56,9 @@ test.app > xrpl.json test.app > xrpl.ledger test.app > xrpl.nodestore test.app > xrpl.protocol +test.app > xrpl.rdb test.app > xrpl.resource test.app > xrpl.server -test.app > xrpl.shamap test.app > xrpl.tx test.basics > test.jtx test.basics > test.unit_test @@ -77,17 +71,16 @@ test.beast > xrpl.basics test.conditions > xrpl.basics test.conditions > xrpl.conditions test.consensus > test.csf -test.consensus > test.jtx test.consensus > test.toplevel test.consensus > test.unit_test test.consensus > xrpl.basics test.consensus > xrpld.app test.consensus > xrpld.consensus +test.consensus > xrpl.json test.consensus > xrpl.ledger -test.consensus > xrpl.protocol -test.consensus > xrpl.shamap test.consensus > xrpl.tx test.core > test.jtx +test.core > test.toplevel test.core > test.unit_test test.core > xrpl.basics test.core > xrpl.core @@ -115,32 +108,27 @@ test.jtx > xrpl.resource test.jtx > xrpl.server test.jtx > xrpl.tx test.ledger > test.jtx +test.ledger > test.toplevel test.ledger > xrpl.basics -test.ledger > xrpl.core -test.ledger > xrpld.app test.ledger > xrpld.core -test.ledger > xrpl.json test.ledger > xrpl.ledger test.ledger > xrpl.protocol test.nodestore > test.jtx +test.nodestore > test.toplevel test.nodestore > test.unit_test test.nodestore > xrpl.basics -test.nodestore > xrpld.core test.nodestore > xrpl.nodestore -test.nodestore > xrpl.protocol test.nodestore > xrpl.rdb test.overlay > test.jtx +test.overlay > test.toplevel test.overlay > test.unit_test test.overlay > xrpl.basics test.overlay > xrpld.app -test.overlay > xrpld.core test.overlay > xrpld.overlay test.overlay > xrpld.peerfinder -test.overlay > xrpl.json +test.overlay > xrpl.ledger test.overlay > xrpl.nodestore test.overlay > xrpl.protocol -test.overlay > xrpl.resource -test.overlay > xrpl.server test.overlay > xrpl.shamap test.peerfinder > test.beast test.peerfinder > test.unit_test @@ -148,7 +136,7 @@ test.peerfinder > xrpl.basics test.peerfinder > xrpld.core test.peerfinder > xrpld.peerfinder test.peerfinder > xrpl.protocol -test.protocol > test.jtx +test.protocol > test.toplevel test.protocol > test.unit_test test.protocol > xrpl.basics test.protocol > xrpl.json @@ -157,6 +145,7 @@ test.resource > test.unit_test test.resource > xrpl.basics test.resource > xrpl.resource test.rpc > test.jtx +test.rpc > test.toplevel test.rpc > xrpl.basics test.rpc > xrpl.core test.rpc > xrpld.app @@ -170,12 +159,13 @@ test.rpc > xrpl.resource test.rpc > xrpl.server test.rpc > xrpl.tx test.server > test.jtx +test.server > test.toplevel test.server > test.unit_test test.server > xrpl.basics test.server > xrpld.app test.server > xrpld.core +test.server > xrpld.rpc test.server > xrpl.json -test.server > xrpl.protocol test.server > xrpl.server test.shamap > test.unit_test test.shamap > xrpl.basics @@ -249,20 +239,19 @@ xrpld.consensus > xrpl.ledger xrpld.consensus > xrpl.protocol xrpld.core > xrpl.basics xrpld.core > xrpl.core +xrpld.core > xrpl.json xrpld.core > xrpl.net xrpld.core > xrpl.protocol xrpld.core > xrpl.rdb xrpld.overlay > xrpl.basics xrpld.overlay > xrpl.core -xrpld.overlay > xrpld.consensus xrpld.overlay > xrpld.core xrpld.overlay > xrpld.peerfinder xrpld.overlay > xrpl.json -xrpld.overlay > xrpl.ledger xrpld.overlay > xrpl.protocol +xrpld.overlay > xrpl.rdb xrpld.overlay > xrpl.resource xrpld.overlay > xrpl.server -xrpld.overlay > xrpl.shamap xrpld.overlay > xrpl.tx xrpld.peerfinder > xrpl.basics xrpld.peerfinder > xrpld.core @@ -272,7 +261,6 @@ xrpld.perflog > xrpl.basics xrpld.perflog > xrpl.core xrpld.perflog > xrpld.rpc xrpld.perflog > xrpl.json -xrpld.perflog > xrpl.protocol xrpld.rpc > xrpl.basics xrpld.rpc > xrpl.core xrpld.rpc > xrpld.core @@ -284,9 +272,5 @@ xrpld.rpc > xrpl.protocol xrpld.rpc > xrpl.rdb xrpld.rpc > xrpl.resource xrpld.rpc > xrpl.server -xrpld.rpc > xrpl.shamap xrpld.rpc > xrpl.tx -xrpld.shamap > xrpl.basics -xrpld.shamap > xrpld.core -xrpld.shamap > xrpl.protocol xrpld.shamap > xrpl.shamap diff --git a/.github/scripts/rename/binary.sh b/.github/scripts/rename/binary.sh index cdce6db4ba..81d48ce94b 100755 --- a/.github/scripts/rename/binary.sh +++ b/.github/scripts/rename/binary.sh @@ -6,11 +6,11 @@ set -e # On MacOS, ensure that GNU sed is installed and available as `gsed`. SED_COMMAND=sed if [[ "${OSTYPE}" == 'darwin'* ]]; then - if ! command -v gsed &> /dev/null; then - echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." - exit 1 - fi - SED_COMMAND=gsed + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed fi # This script changes the binary name from `rippled` to `xrpld`, and reverses diff --git a/.github/scripts/rename/cmake.sh b/.github/scripts/rename/cmake.sh index 9c91e8f277..6c3d30e948 100755 --- a/.github/scripts/rename/cmake.sh +++ b/.github/scripts/rename/cmake.sh @@ -8,16 +8,16 @@ set -e SED_COMMAND=sed HEAD_COMMAND=head if [[ "${OSTYPE}" == 'darwin'* ]]; then - if ! command -v gsed &> /dev/null; then - echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." - exit 1 - fi - SED_COMMAND=gsed - if ! command -v ghead &> /dev/null; then - echo "Error: ghead is not installed. Please install it using 'brew install coreutils'." - exit 1 - fi - HEAD_COMMAND=ghead + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed + if ! command -v ghead &> /dev/null; then + echo "Error: ghead is not installed. Please install it using 'brew install coreutils'." + exit 1 + fi + HEAD_COMMAND=ghead fi # This script renames CMake files from `RippleXXX.cmake` or `RippledXXX.cmake` @@ -44,10 +44,10 @@ pushd "${DIRECTORY}" find cmake -type f -name 'Rippled*.cmake' -exec bash -c 'mv "${1}" "${1/Rippled/Xrpl}"' - {} \; find cmake -type f -name 'Ripple*.cmake' -exec bash -c 'mv "${1}" "${1/Ripple/Xrpl}"' - {} \; if [ -e cmake/xrpl_add_test.cmake ]; then - mv cmake/xrpl_add_test.cmake cmake/XrplAddTest.cmake + mv cmake/xrpl_add_test.cmake cmake/XrplAddTest.cmake fi if [ -e include/xrpl/proto/ripple.proto ]; then - mv include/xrpl/proto/ripple.proto include/xrpl/proto/xrpl.proto + mv include/xrpl/proto/ripple.proto include/xrpl/proto/xrpl.proto fi # Rename inside the files. @@ -71,14 +71,14 @@ ${SED_COMMAND} -i 's@xrpl/validator-keys-tool@ripple/validator-keys-tool@' cmake # Ensure the name of the binary and config remain 'rippled' for now. ${SED_COMMAND} -i -E 's/xrpld(-example)?\.cfg/rippled\1.cfg/g' cmake/XrplInstall.cmake if grep -q '"xrpld"' cmake/XrplCore.cmake; then - # The script has been rerun, so just restore the name of the binary. - ${SED_COMMAND} -i 's/"xrpld"/"rippled"/' cmake/XrplCore.cmake + # The script has been rerun, so just restore the name of the binary. + ${SED_COMMAND} -i 's/"xrpld"/"rippled"/' cmake/XrplCore.cmake elif ! grep -q '"rippled"' cmake/XrplCore.cmake; then - ${HEAD_COMMAND} -n -1 cmake/XrplCore.cmake > cmake.tmp - echo ' # For the time being, we will keep the name of the binary as it was.' >> cmake.tmp - echo ' set_target_properties(xrpld PROPERTIES OUTPUT_NAME "rippled")' >> cmake.tmp - tail -1 cmake/XrplCore.cmake >> cmake.tmp - mv cmake.tmp cmake/XrplCore.cmake + ${HEAD_COMMAND} -n -1 cmake/XrplCore.cmake > cmake.tmp + echo ' # For the time being, we will keep the name of the binary as it was.' >> cmake.tmp + echo ' set_target_properties(xrpld PROPERTIES OUTPUT_NAME "rippled")' >> cmake.tmp + tail -1 cmake/XrplCore.cmake >> cmake.tmp + mv cmake.tmp cmake/XrplCore.cmake fi # Restore the symlink from 'xrpld' to 'rippled'. diff --git a/.github/scripts/rename/config.sh b/.github/scripts/rename/config.sh index b7aff82cdf..9a521e8a51 100755 --- a/.github/scripts/rename/config.sh +++ b/.github/scripts/rename/config.sh @@ -6,11 +6,11 @@ set -e # On MacOS, ensure that GNU sed is installed and available as `gsed`. SED_COMMAND=sed if [[ "${OSTYPE}" == 'darwin'* ]]; then - if ! command -v gsed &> /dev/null; then - echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." - exit 1 - fi - SED_COMMAND=gsed + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed fi # This script renames the config from `rippled.cfg` to `xrpld.cfg`, and updates @@ -32,28 +32,28 @@ pushd "${DIRECTORY}" # Add the xrpld.cfg to the .gitignore. if ! grep -q 'xrpld.cfg' .gitignore; then - ${SED_COMMAND} -i '/rippled.cfg/a\ + ${SED_COMMAND} -i '/rippled.cfg/a\ /xrpld.cfg' .gitignore fi # Rename the files. if [ -e rippled.cfg ]; then - mv rippled.cfg xrpld.cfg + mv rippled.cfg xrpld.cfg fi if [ -e cfg/rippled-example.cfg ]; then - mv cfg/rippled-example.cfg cfg/xrpld-example.cfg + mv cfg/rippled-example.cfg cfg/xrpld-example.cfg fi # Rename inside the files. DIRECTORIES=("cfg" "cmake" "include" "src") for DIRECTORY in "${DIRECTORIES[@]}"; do - echo "Processing directory: ${DIRECTORY}" + echo "Processing directory: ${DIRECTORY}" - find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.cmake" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" \) | while read -r FILE; do - echo "Processing file: ${FILE}" - ${SED_COMMAND} -i -E 's/rippled(-example)?[ .]cfg/xrpld\1.cfg/g' "${FILE}" - ${SED_COMMAND} -i 's/rippleConfig/xrpldConfig/g' "${FILE}" - done + find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.cmake" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" \) | while read -r FILE; do + echo "Processing file: ${FILE}" + ${SED_COMMAND} -i -E 's/rippled(-example)?[ .]cfg/xrpld\1.cfg/g' "${FILE}" + ${SED_COMMAND} -i 's/rippleConfig/xrpldConfig/g' "${FILE}" + done done ${SED_COMMAND} -i 's/rippled/xrpld/g' cfg/xrpld-example.cfg ${SED_COMMAND} -i 's/rippled/xrpld/g' src/test/core/Config_test.cpp diff --git a/.github/scripts/rename/copyright.sh b/.github/scripts/rename/copyright.sh index 9ebdad1e89..f212fe5fc7 100755 --- a/.github/scripts/rename/copyright.sh +++ b/.github/scripts/rename/copyright.sh @@ -6,11 +6,11 @@ set -e # On MacOS, ensure that GNU sed is installed and available as `gsed`. SED_COMMAND=sed if [[ "${OSTYPE}" == 'darwin'* ]]; then - if ! command -v gsed &> /dev/null; then - echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." - exit 1 - fi - SED_COMMAND=gsed + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed fi # This script removes superfluous copyright notices in source and header files @@ -43,56 +43,56 @@ ${SED_COMMAND} -i -E "s@\\\t@${PLACEHOLDER_TAB}@g" src/test/rpc/ValidatorInfo_te # Process the include/ and src/ directories. DIRECTORIES=("include" "src") for DIRECTORY in "${DIRECTORIES[@]}"; do - echo "Processing directory: ${DIRECTORY}" + echo "Processing directory: ${DIRECTORY}" - find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.macro" \) | while read -r FILE; do - echo "Processing file: ${FILE}" - # Handle the cases where the copyright notice is enclosed in /* ... */ - # and usually surrounded by //---- and //======. - ${SED_COMMAND} -z -i -E 's@^//-------+\n+@@' "${FILE}" - ${SED_COMMAND} -z -i -E 's@^.*Copyright.+(Ripple|Bougalis|Falco|Hinnant|Null|Ritchford|XRPLF).+PERFORMANCE OF THIS SOFTWARE\.\n\*/\n+@@' "${FILE}" # cspell: ignore Bougalis Falco Hinnant Ritchford - ${SED_COMMAND} -z -i -E 's@^//=======+\n+@@' "${FILE}" + find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.macro" \) | while read -r FILE; do + echo "Processing file: ${FILE}" + # Handle the cases where the copyright notice is enclosed in /* ... */ + # and usually surrounded by //---- and //======. + ${SED_COMMAND} -z -i -E 's@^//-------+\n+@@' "${FILE}" + ${SED_COMMAND} -z -i -E 's@^.*Copyright.+(Ripple|Bougalis|Falco|Hinnant|Null|Ritchford|XRPLF).+PERFORMANCE OF THIS SOFTWARE\.\n\*/\n+@@' "${FILE}" # cspell: ignore Bougalis Falco Hinnant Ritchford + ${SED_COMMAND} -z -i -E 's@^//=======+\n+@@' "${FILE}" - # Handle the cases where the copyright notice is commented out with //. - ${SED_COMMAND} -z -i -E 's@^//\n// Copyright.+Falco \(vinnie dot falco at gmail dot com\)\n//\n+@@' "${FILE}" # cspell: ignore Vinnie Falco - done + # Handle the cases where the copyright notice is commented out with //. + ${SED_COMMAND} -z -i -E 's@^//\n// Copyright.+Falco \(vinnie dot falco at gmail dot com\)\n//\n+@@' "${FILE}" # cspell: ignore Vinnie Falco + done done # Restore copyright notices that were removed from specific files, without # restoring the verbiage that is already present in LICENSE.md. Ensure that if # the script is run multiple times, duplicate notices are not added. if ! grep -q 'Raw Material Software' include/xrpl/beast/core/CurrentThreadName.h; then - echo -e "// Portions of this file are from JUCE (http://www.juce.com).\n// Copyright (c) 2013 - Raw Material Software Ltd.\n// Please visit http://www.juce.com\n\n$(cat include/xrpl/beast/core/CurrentThreadName.h)" > include/xrpl/beast/core/CurrentThreadName.h + echo -e "// Portions of this file are from JUCE (http://www.juce.com).\n// Copyright (c) 2013 - Raw Material Software Ltd.\n// Please visit http://www.juce.com\n\n$(cat include/xrpl/beast/core/CurrentThreadName.h)" > include/xrpl/beast/core/CurrentThreadName.h fi if ! grep -q 'Dev Null' src/test/app/NetworkID_test.cpp; then - echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/app/NetworkID_test.cpp)" > src/test/app/NetworkID_test.cpp + echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/app/NetworkID_test.cpp)" > src/test/app/NetworkID_test.cpp fi if ! grep -q 'Dev Null' src/test/app/tx/apply_test.cpp; then - echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/app/tx/apply_test.cpp)" > src/test/app/tx/apply_test.cpp + echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/app/tx/apply_test.cpp)" > src/test/app/tx/apply_test.cpp fi if ! grep -q 'Dev Null' src/test/rpc/ManifestRPC_test.cpp; then - echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/rpc/ManifestRPC_test.cpp)" > src/test/rpc/ManifestRPC_test.cpp + echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/rpc/ManifestRPC_test.cpp)" > src/test/rpc/ManifestRPC_test.cpp fi if ! grep -q 'Dev Null' src/test/rpc/ValidatorInfo_test.cpp; then - echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/rpc/ValidatorInfo_test.cpp)" > src/test/rpc/ValidatorInfo_test.cpp + echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/rpc/ValidatorInfo_test.cpp)" > src/test/rpc/ValidatorInfo_test.cpp fi if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/server_info/Manifest.cpp; then - echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/server_info/Manifest.cpp)" > src/xrpld/rpc/handlers/server_info/Manifest.cpp + echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/server_info/Manifest.cpp)" > src/xrpld/rpc/handlers/server_info/Manifest.cpp fi if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp; then - echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp)" > src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp + echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp)" > src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp fi if ! grep -q 'Bougalis' include/xrpl/basics/SlabAllocator.h; then - echo -e "// Copyright (c) 2022, Nikolaos D. Bougalis \n\n$(cat include/xrpl/basics/SlabAllocator.h)" > include/xrpl/basics/SlabAllocator.h # cspell: ignore Nikolaos Bougalis nikb + echo -e "// Copyright (c) 2022, Nikolaos D. Bougalis \n\n$(cat include/xrpl/basics/SlabAllocator.h)" > include/xrpl/basics/SlabAllocator.h # cspell: ignore Nikolaos Bougalis nikb fi if ! grep -q 'Bougalis' include/xrpl/basics/spinlock.h; then - echo -e "// Copyright (c) 2022, Nikolaos D. Bougalis \n\n$(cat include/xrpl/basics/spinlock.h)" > include/xrpl/basics/spinlock.h # cspell: ignore Nikolaos Bougalis nikb + echo -e "// Copyright (c) 2022, Nikolaos D. Bougalis \n\n$(cat include/xrpl/basics/spinlock.h)" > include/xrpl/basics/spinlock.h # cspell: ignore Nikolaos Bougalis nikb fi if ! grep -q 'Bougalis' include/xrpl/basics/tagged_integer.h; then - echo -e "// Copyright (c) 2014, Nikolaos D. Bougalis \n\n$(cat include/xrpl/basics/tagged_integer.h)" > include/xrpl/basics/tagged_integer.h # cspell: ignore Nikolaos Bougalis nikb + echo -e "// Copyright (c) 2014, Nikolaos D. Bougalis \n\n$(cat include/xrpl/basics/tagged_integer.h)" > include/xrpl/basics/tagged_integer.h # cspell: ignore Nikolaos Bougalis nikb fi if ! grep -q 'Ritchford' include/xrpl/beast/utility/Zero.h; then - echo -e "// Copyright (c) 2014, Tom Ritchford \n\n$(cat include/xrpl/beast/utility/Zero.h)" > include/xrpl/beast/utility/Zero.h # cspell: ignore Ritchford + echo -e "// Copyright (c) 2014, Tom Ritchford \n\n$(cat include/xrpl/beast/utility/Zero.h)" > include/xrpl/beast/utility/Zero.h # cspell: ignore Ritchford fi # Restore newlines and tabs in string literals in the affected file. diff --git a/.github/scripts/rename/definitions.sh b/.github/scripts/rename/definitions.sh index 5e004afe39..403e5eab0d 100755 --- a/.github/scripts/rename/definitions.sh +++ b/.github/scripts/rename/definitions.sh @@ -6,11 +6,11 @@ set -e # On MacOS, ensure that GNU sed is installed and available as `gsed`. SED_COMMAND=sed if [[ "${OSTYPE}" == 'darwin'* ]]; then - if ! command -v gsed &> /dev/null; then - echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." - exit 1 - fi - SED_COMMAND=gsed + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed fi # This script renames definitions, such as include guards, in this project. diff --git a/.github/scripts/rename/docs.sh b/.github/scripts/rename/docs.sh index 59cc5665bf..22d5e242d1 100755 --- a/.github/scripts/rename/docs.sh +++ b/.github/scripts/rename/docs.sh @@ -6,11 +6,11 @@ set -e # On MacOS, ensure that GNU sed is installed and available as `gsed`. SED_COMMAND=sed if [[ "${OSTYPE}" == 'darwin'* ]]; then - if ! command -v gsed &> /dev/null; then - echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." - exit 1 - fi - SED_COMMAND=gsed + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed fi # This script renames all remaining references to `ripple` and `rippled` to diff --git a/.github/scripts/rename/include.sh b/.github/scripts/rename/include.sh index 1f13e84c10..fbf165b975 100755 --- a/.github/scripts/rename/include.sh +++ b/.github/scripts/rename/include.sh @@ -23,8 +23,8 @@ fi find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" \) | while read -r FILE; do echo "Processing file: ${FILE}" if grep -q "#ifndef XRPL_" "${FILE}"; then - echo "Please replace all include guards by #pragma once." - exit 1 + echo "Please replace all include guards by #pragma once." + exit 1 fi done echo "Checking complete." diff --git a/.github/scripts/rename/namespace.sh b/.github/scripts/rename/namespace.sh index aba193b0cf..4dad55f7c7 100755 --- a/.github/scripts/rename/namespace.sh +++ b/.github/scripts/rename/namespace.sh @@ -6,11 +6,11 @@ set -e # On MacOS, ensure that GNU sed is installed and available as `gsed`. SED_COMMAND=sed if [[ "${OSTYPE}" == 'darwin'* ]]; then - if ! command -v gsed &> /dev/null; then - echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." - exit 1 - fi - SED_COMMAND=gsed + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed fi # This script renames the `ripple` namespace to `xrpl` in this project. @@ -35,15 +35,15 @@ pushd "${DIRECTORY}" DIRECTORIES=("include" "src" "tests") for DIRECTORY in "${DIRECTORIES[@]}"; do - echo "Processing directory: ${DIRECTORY}" + echo "Processing directory: ${DIRECTORY}" - find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.macro" \) | while read -r FILE; do - echo "Processing file: ${FILE}" - ${SED_COMMAND} -i 's/namespace ripple/namespace xrpl/g' "${FILE}" - ${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}" - ${SED_COMMAND} -i 's/"ripple:/"xrpl::/g' "${FILE}" - ${SED_COMMAND} -i -E 's/(BEAST_DEFINE_TESTSUITE.+)ripple(.+)/\1xrpl\2/g' "${FILE}" - done + find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.macro" \) | while read -r FILE; do + echo "Processing file: ${FILE}" + ${SED_COMMAND} -i 's/namespace ripple/namespace xrpl/g' "${FILE}" + ${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}" + ${SED_COMMAND} -i 's/"ripple:/"xrpl::/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(BEAST_DEFINE_TESTSUITE.+)ripple(.+)/\1xrpl\2/g' "${FILE}" + done done # Special case for NuDBFactory that has ripple twice in the test suite name. diff --git a/.github/workflows/check-pr-description.yml b/.github/workflows/check-pr-description.yml deleted file mode 100644 index f6eee50291..0000000000 --- a/.github/workflows/check-pr-description.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Check PR description - -on: - merge_group: - types: - - checks_requested - pull_request: - types: [opened, edited, reopened, synchronize, ready_for_review] - branches: [develop] - -jobs: - check_description: - if: ${{ github.event.pull_request.draft != true }} - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Write PR body to file - env: - PR_BODY: ${{ github.event.pull_request.body }} - if: ${{ github.event_name == 'pull_request' }} - run: printenv PR_BODY > pr_body.md - - - name: Check PR description differs from template - if: ${{ github.event_name == 'pull_request' }} - run: > - python .github/scripts/check-pr-description.py - --template-file .github/pull_request_template.md - --pr-body-file pr_body.md diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index 28299a1264..66893d19d3 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -46,7 +46,7 @@ jobs: # that Github considers any skipped jobs to have passed, and in # turn the required checks as well. id: changes - uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 + uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5 with: files: | # These paths are unique to `on-pr.yml`. diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index d619be5543..48832cb079 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -82,7 +82,7 @@ jobs: - name: Create documentation artifact if: ${{ github.event.repository.visibility == 'public' && github.event_name == 'push' }} - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 + uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 with: path: ${{ env.BUILD_DIR }}/docs/html diff --git a/.github/workflows/reusable-build-test-config.yml b/.github/workflows/reusable-build-test-config.yml index abbec1ceb4..57112ed96a 100644 --- a/.github/workflows/reusable-build-test-config.yml +++ b/.github/workflows/reusable-build-test-config.yml @@ -153,32 +153,6 @@ jobs: ${CMAKE_ARGS} \ .. - - name: Check protocol autogen files are up-to-date - working-directory: ${{ env.BUILD_DIR }} - env: - MESSAGE: | - - The generated protocol wrapper classes are out of date. - - This typically happens when the macro files or generator scripts - have changed but the generated files were not regenerated. - - To fix this: - 1. Run: cmake --build . --target setup_code_gen - 2. Run: cmake --build . --target code_gen - 3. Commit and push the regenerated files - run: | - set -e - cmake --build . --target setup_code_gen - cmake --build . --target code_gen - DIFF=$(git -C .. status --porcelain -- include/xrpl/protocol_autogen src/tests/libxrpl/protocol_autogen) - if [ -n "${DIFF}" ]; then - echo "::error::Generated protocol files are out of date" - git -C .. diff -- include/xrpl/protocol_autogen src/tests/libxrpl/protocol_autogen - echo "${MESSAGE}" - exit 1 - fi - - name: Build the binary working-directory: ${{ env.BUILD_DIR }} env: @@ -192,6 +166,29 @@ jobs: --parallel "${BUILD_NPROC}" \ --target "${CMAKE_TARGET}" + - name: Check protocol autogen files are up-to-date + env: + MESSAGE: | + + The generated protocol wrapper classes are out of date. + + This typically happens when your branch is behind develop and + the macro files or generator scripts have changed. + + To fix this: + 1. Update your branch from develop (merge or rebase) + 2. Build with code generation enabled (XRPL_NO_CODEGEN=OFF) + 3. Commit and push the regenerated files + run: | + set -e + DIFF=$(git status --porcelain -- include/xrpl/protocol_autogen src/tests/libxrpl/protocol_autogen) + if [ -n "${DIFF}" ]; then + echo "::error::Generated protocol files are out of date" + git diff -- include/xrpl/protocol_autogen src/tests/libxrpl/protocol_autogen + echo "${MESSAGE}" + exit 1 + fi + - name: Show ccache statistics if: ${{ inputs.ccache_enabled }} run: | @@ -203,7 +200,7 @@ jobs: - name: Upload the binary (Linux) if: ${{ github.event.repository.visibility == 'public' && runner.os == 'Linux' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: xrpld-${{ inputs.config_name }} path: ${{ env.BUILD_DIR }}/xrpld diff --git a/.github/workflows/reusable-clang-tidy-files.yml b/.github/workflows/reusable-clang-tidy-files.yml index 9b99f418b1..a64a773c86 100644 --- a/.github/workflows/reusable-clang-tidy-files.yml +++ b/.github/workflows/reusable-clang-tidy-files.yml @@ -80,31 +80,18 @@ jobs: env: TARGETS: ${{ inputs.files != '' && inputs.files || 'src tests' }} run: | - run-clang-tidy -j ${{ steps.nproc.outputs.nproc }} -p "${BUILD_DIR}" -quiet -fix -allow-no-checks ${TARGETS} 2>&1 | tee clang-tidy-output.txt + run-clang-tidy -j ${{ steps.nproc.outputs.nproc }} -p "${BUILD_DIR}" -quiet -allow-no-checks ${TARGETS} 2>&1 | tee clang-tidy-output.txt - name: Upload clang-tidy output if: ${{ github.event.repository.visibility == 'public' && steps.run_clang_tidy.outcome != 'success' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: clang-tidy-results path: clang-tidy-output.txt retention-days: 30 - - name: Generate git diff - if: ${{ steps.run_clang_tidy.outcome != 'success' }} - run: | - git diff | tee clang-tidy-git-diff.txt - - - name: Upload clang-tidy diff output - if: ${{ github.event.repository.visibility == 'public' && steps.run_clang_tidy.outcome != 'success' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: clang-tidy-git-diff - path: clang-tidy-git-diff.txt - retention-days: 30 - - name: Create an issue - if: ${{ steps.run_clang_tidy.outcome != 'success' && inputs.create_issue_on_failure }} + if: steps.run_clang_tidy.outcome != 'success' && inputs.create_issue_on_failure id: create_issue shell: bash env: @@ -169,7 +156,7 @@ jobs: rm -f create_issue.log issue.md clang-tidy-output.txt - name: Fail the workflow if clang-tidy failed - if: ${{ steps.run_clang_tidy.outcome != 'success' }} + if: steps.run_clang_tidy.outcome != 'success' run: | echo "Clang-tidy check failed!" exit 1 diff --git a/.github/workflows/reusable-clang-tidy.yml b/.github/workflows/reusable-clang-tidy.yml index 7a8bf6de57..4c927dec9f 100644 --- a/.github/workflows/reusable-clang-tidy.yml +++ b/.github/workflows/reusable-clang-tidy.yml @@ -31,7 +31,7 @@ jobs: - name: Get changed C++ files id: changed_files - uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 + uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5 with: files: | **/*.cpp @@ -41,7 +41,7 @@ jobs: - name: Get changed clang-tidy configuration id: changed_clang_tidy - uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 + uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5 with: files: | .clang-tidy diff --git a/.gitignore b/.gitignore index 6bd34ece04..7ee6d0c70a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ Debug/ Release/ /.build/ -/.venv/ /build/ /db/ /out.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 232e6ca5a3..59d42ccebc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,6 +17,7 @@ repos: args: [--maxkb=400, --enforce-all] - id: trailing-whitespace - id: end-of-file-fixer + - id: mixed-line-ending - id: check-merge-conflict args: [--assume-in-merge] @@ -37,19 +38,12 @@ repos: rev: c2bc67fe8f8f549cc489e00ba8b45aa18ee713b1 # frozen: v3.8.1 hooks: - id: prettier - args: [--end-of-line=auto] - repo: https://github.com/psf/black-pre-commit-mirror rev: ea488cebbfd88a5f50b8bd95d5c829d0bb76feb8 # frozen: 26.1.0 hooks: - id: black - - repo: https://github.com/openstack/bashate - rev: 5798d24d571676fc407e81df574c1ef57b520f23 # frozen: 2.1.1 - hooks: - - id: bashate - args: ["--ignore=E006"] - - repo: https://github.com/streetsidesoftware/cspell-cli rev: a42085ade523f591dca134379a595e7859986445 # frozen: v9.7.0 hooks: @@ -67,14 +61,6 @@ repos: - repo: local hooks: - - id: clang-tidy - name: "clang-tidy (enable with: TIDY=1)" - entry: ./bin/pre-commit/clang_tidy_check.py - language: python - types_or: [c++, c] - exclude: ^include/xrpl/protocol_autogen - pass_filenames: false # script determines the staged files itself - - id: nix-fmt name: Format Nix files entry: | diff --git a/BUILD.md b/BUILD.md index cf0a685abd..7406d60949 100644 --- a/BUILD.md +++ b/BUILD.md @@ -459,21 +459,6 @@ install ccache --version 4.11.3 --allow-downgrade`. The location of `xrpld` binary in your build directory depends on your CMake generator. Pass `--help` to see the rest of the command line options. -## Code generation - -The protocol wrapper classes in `include/xrpl/protocol_autogen/` are generated -from macro definition files in `include/xrpl/protocol/detail/`. If you modify -the macro files (e.g. `transactions.macro`, `ledger_entries.macro`) or the -generation scripts/templates in `cmake/scripts/codegen/`, you need to regenerate the -files: - -``` -cmake --build . --target setup_code_gen # create venv and install dependencies (once) -cmake --build . --target code_gen # regenerate code -``` - -The regenerated files should be committed alongside your changes. - ## Coverage report The coverage report is intended for developers using compilers GCC diff --git a/CMakeLists.txt b/CMakeLists.txt index 84a4b29108..fa17892e37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,7 +134,6 @@ if(coverage) endif() include(XrplCore) -include(XrplProtocolAutogen) include(XrplInstall) include(XrplValidatorKeys) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 56d3b48057..0589081055 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -267,26 +267,6 @@ See the [environment setup guide](./docs/build/environment.md#clang-tidy) for pl Before running clang-tidy, you must build the project to generate required files (particularly protobuf headers). Refer to [`BUILD.md`](./BUILD.md) for build instructions. -#### Via pre-commit (recommended) - -If you have already installed the pre-commit hooks (see above), you can run clang-tidy on your staged files using: - -``` -TIDY=1 pre-commit run clang-tidy -``` - -This runs clang-tidy locally with the same configuration/flags as CI, scoped to your staged C++ files. The `TIDY=1` environment variable is required to opt in — without it the hook is skipped. - -You can also have clang-tidy run automatically on every `git commit` by setting `TIDY=1` in your shell environment: - -``` -export TIDY=1 -``` - -With this set, the hook will run as part of `git commit` alongside the other pre-commit checks. - -#### Manually - Then run clang-tidy on your local changes: ``` diff --git a/bin/git/setup-upstreams.sh b/bin/git/setup-upstreams.sh index 57c3f935f9..61d8171569 100755 --- a/bin/git/setup-upstreams.sh +++ b/bin/git/setup-upstreams.sh @@ -1,13 +1,14 @@ #!/bin/bash -if [[ $# -ne 1 || "$1" == "--help" || "$1" == "-h" ]]; then - name=$( basename $0 ) - cat <<- USAGE - Usage: $name +if [[ $# -ne 1 || "$1" == "--help" || "$1" == "-h" ]] +then + name=$( basename $0 ) + cat <<- USAGE + Usage: $name - Where is the Github username of the upstream repo. e.g. XRPLF + Where is the Github username of the upstream repo. e.g. XRPLF USAGE - exit 0 + exit 0 fi # Create upstream remotes based on origin @@ -15,9 +16,10 @@ shift user="$1" # Get the origin URL. Expect it be an SSH-style URL origin=$( git remote get-url origin ) -if [[ "${origin}" == "" ]]; then - echo Invalid origin remote >&2 - exit 1 +if [[ "${origin}" == "" ]] +then + echo Invalid origin remote >&2 + exit 1 fi # echo "Origin: ${origin}" # Parse the origin @@ -28,9 +30,11 @@ IFS='@' read sshuser server <<< "${remote}" # echo "SSHUser: ${sshuser}, Server: ${server}" IFS='/' read originuser repo <<< "${originpath}" # echo "Originuser: ${originuser}, Repo: ${repo}" -if [[ "${sshuser}" == "" || "${server}" == "" || "${originuser}" == "" || "${repo}" == "" ]]; then - echo "Can't parse origin URL: ${origin}" >&2 - exit 1 +if [[ "${sshuser}" == "" || "${server}" == "" || "${originuser}" == "" + || "${repo}" == "" ]] +then + echo "Can't parse origin URL: ${origin}" >&2 + exit 1 fi upstream="https://${server}/${user}/${repo}" upstreampush="${remote}:${user}/${repo}" @@ -38,34 +42,42 @@ upstreamgroup="upstream upstream-push" current=$( git remote get-url upstream 2>/dev/null ) currentpush=$( git remote get-url upstream-push 2>/dev/null ) currentgroup=$( git config remotes.upstreams ) -if [[ "${current}" == "${upstream}" ]]; then - echo "Upstream already set up correctly. Skip" -elif [[ -n "${current}" && "${current}" != "${upstream}" && "${current}" != "${upstreampush}" ]]; then - echo "Upstream already set up as: ${current}. Skip" +if [[ "${current}" == "${upstream}" ]] +then + echo "Upstream already set up correctly. Skip" +elif [[ -n "${current}" && "${current}" != "${upstream}" && + "${current}" != "${upstreampush}" ]] +then + echo "Upstream already set up as: ${current}. Skip" else - if [[ "${current}" == "${upstreampush}" ]]; then - echo "Upstream set to dangerous push URL. Update." - _run git remote rename upstream upstream-push || \ - _run git remote remove upstream - currentpush=$( git remote get-url upstream-push 2>/dev/null ) - fi - _run git remote add upstream "${upstream}" + if [[ "${current}" == "${upstreampush}" ]] + then + echo "Upstream set to dangerous push URL. Update." + _run git remote rename upstream upstream-push || \ + _run git remote remove upstream + currentpush=$( git remote get-url upstream-push 2>/dev/null ) + fi + _run git remote add upstream "${upstream}" fi -if [[ "${currentpush}" == "${upstreampush}" ]]; then - echo "upstream-push already set up correctly. Skip" -elif [[ -n "${currentpush}" && "${currentpush}" != "${upstreampush}" ]]; then - echo "upstream-push already set up as: ${currentpush}. Skip" +if [[ "${currentpush}" == "${upstreampush}" ]] +then + echo "upstream-push already set up correctly. Skip" +elif [[ -n "${currentpush}" && "${currentpush}" != "${upstreampush}" ]] +then + echo "upstream-push already set up as: ${currentpush}. Skip" else - _run git remote add upstream-push "${upstreampush}" + _run git remote add upstream-push "${upstreampush}" fi -if [[ "${currentgroup}" == "${upstreamgroup}" ]]; then - echo "Upstreams group already set up correctly. Skip" -elif [[ -n "${currentgroup}" && "${currentgroup}" != "${upstreamgroup}" ]]; then - echo "Upstreams group already set up as: ${currentgroup}. Skip" +if [[ "${currentgroup}" == "${upstreamgroup}" ]] +then + echo "Upstreams group already set up correctly. Skip" +elif [[ -n "${currentgroup}" && "${currentgroup}" != "${upstreamgroup}" ]] +then + echo "Upstreams group already set up as: ${currentgroup}. Skip" else - _run git config --add remotes.upstreams "${upstreamgroup}" + _run git config --add remotes.upstreams "${upstreamgroup}" fi _run git fetch --jobs=$(nproc) upstreams diff --git a/bin/git/squash-branches.sh b/bin/git/squash-branches.sh index eb4aefe23c..4dcbf5aaa1 100755 --- a/bin/git/squash-branches.sh +++ b/bin/git/squash-branches.sh @@ -1,16 +1,17 @@ #!/bin/bash -if [[ $# -lt 3 || "$1" == "--help" || "$1" = "-h" ]]; then - name=$( basename $0 ) - cat <<- USAGE - Usage: $name workbranch base/branch user/branch [user/branch [...]] +if [[ $# -lt 3 || "$1" == "--help" || "$1" = "-h" ]] +then + name=$( basename $0 ) + cat <<- USAGE + Usage: $name workbranch base/branch user/branch [user/branch [...]] - * workbranch will be created locally from base/branch - * base/branch and user/branch may be specified as user:branch to allow - easy copying from Github PRs - * Remotes for each user must already be set up + * workbranch will be created locally from base/branch + * base/branch and user/branch may be specified as user:branch to allow + easy copying from Github PRs + * Remotes for each user must already be set up USAGE - exit 0 +exit 0 fi work="$1" @@ -23,8 +24,9 @@ unset branches[0] set -e users=() -for b in "${branches[@]}"; do - users+=( $( echo $b | cut -d/ -f1 ) ) +for b in "${branches[@]}" +do + users+=( $( echo $b | cut -d/ -f1 ) ) done users=( $( printf '%s\n' "${users[@]}" | sort -u ) ) @@ -32,9 +34,10 @@ users=( $( printf '%s\n' "${users[@]}" | sort -u ) ) git fetch --multiple upstreams "${users[@]}" git checkout -B "$work" --no-track "$base" -for b in "${branches[@]}"; do - git merge --squash "${b}" - git commit -S # Use the commit message provided on the PR +for b in "${branches[@]}" +do + git merge --squash "${b}" + git commit -S # Use the commit message provided on the PR done # Make sure the commits look right @@ -44,11 +47,13 @@ parts=( $( echo $base | sed "s/\// /" ) ) repo="${parts[0]}" b="${parts[1]}" push=$repo -if [[ "$push" == "upstream" ]]; then - push="upstream-push" +if [[ "$push" == "upstream" ]] +then + push="upstream-push" fi -if [[ "$repo" == "upstream" ]]; then - repo="upstreams" +if [[ "$repo" == "upstream" ]] +then + repo="upstreams" fi cat << PUSH diff --git a/bin/git/update-version.sh b/bin/git/update-version.sh index f74b40ddf0..c901a29e6a 100755 --- a/bin/git/update-version.sh +++ b/bin/git/update-version.sh @@ -1,16 +1,17 @@ #!/bin/bash -if [[ $# -ne 3 || "$1" == "--help" || "$1" = "-h" ]]; then - name=$( basename $0 ) - cat <<- USAGE - Usage: $name workbranch base/branch version +if [[ $# -ne 3 || "$1" == "--help" || "$1" = "-h" ]] +then + name=$( basename $0 ) + cat <<- USAGE + Usage: $name workbranch base/branch version - * workbranch will be created locally from base/branch. If it exists, - it will be reused, so make sure you don't overwrite any work. - * base/branch may be specified as user:branch to allow easy copying - from Github PRs. + * workbranch will be created locally from base/branch. If it exists, + it will be reused, so make sure you don't overwrite any work. + * base/branch may be specified as user:branch to allow easy copying + from Github PRs. USAGE - exit 0 +exit 0 fi work="$1" @@ -29,9 +30,10 @@ git fetch upstreams git checkout -B "${work}" --no-track "${base}" push=$( git rev-parse --abbrev-ref --symbolic-full-name '@{push}' \ - 2>/dev/null ) || true -if [[ "${push}" != "" ]]; then - echo "Warning: ${push} may already exist." + 2>/dev/null ) || true +if [[ "${push}" != "" ]] +then + echo "Warning: ${push} may already exist." fi build=$( find -name BuildInfo.cpp ) diff --git a/bin/pre-commit/clang_tidy_check.py b/bin/pre-commit/clang_tidy_check.py deleted file mode 100755 index 7fb51d1c46..0000000000 --- a/bin/pre-commit/clang_tidy_check.py +++ /dev/null @@ -1,206 +0,0 @@ -#!/usr/bin/env python3 -"""Pre-commit hook that runs clang-tidy on changed files using run-clang-tidy.""" - -from __future__ import annotations - -import json -import os -import re -import shutil -import subprocess -import sys -from collections import defaultdict -from pathlib import Path - -HEADER_EXTENSIONS = {".h", ".hpp", ".ipp"} -SOURCE_EXTENSIONS = {".cpp"} -INCLUDE_RE = re.compile(r"^\s*#\s*include\s*[<\"]([^>\"]+)[>\"]") - - -def find_run_clang_tidy() -> str | None: - for candidate in ("run-clang-tidy-21", "run-clang-tidy"): - if path := shutil.which(candidate): - return path - return None - - -def find_build_dir(repo_root: Path) -> Path | None: - for name in (".build", "build"): - candidate = repo_root / name - if (candidate / "compile_commands.json").exists(): - return candidate - return None - - -def build_include_graph(build_dir: Path, repo_root: Path) -> tuple[dict, set]: - """ - Scan all files reachable from compile_commands.json and build an inverted include graph. - - Returns: - inverted: header_path -> set of files that include it - source_files: set of all TU paths from compile_commands.json - """ - with open(build_dir / "compile_commands.json") as f: - db = json.load(f) - - source_files = {Path(e["file"]).resolve() for e in db} - include_roots = [repo_root / "include", repo_root / "src"] - inverted: dict[Path, set[Path]] = defaultdict(set) - - to_scan: set[Path] = set(source_files) - scanned: set[Path] = set() - - while to_scan: - file = to_scan.pop() - if file in scanned or not file.exists(): - continue - scanned.add(file) - - content = file.read_text() - - for line in content.splitlines(): - m = INCLUDE_RE.match(line) - if not m: - continue - for root in include_roots: - candidate = (root / m.group(1)).resolve() - if candidate.exists(): - inverted[candidate].add(file) - if candidate not in scanned: - to_scan.add(candidate) - break - - return inverted, source_files - - -def find_tus_for_headers( - headers: list[Path], - inverted: dict[Path, set[Path]], - source_files: set[Path], -) -> set[Path]: - """ - For each header, pick one TU that transitively includes it. - Prefers a TU whose stem matches the header's stem, otherwise picks the first found. - """ - result: set[Path] = set() - - for header in headers: - preferred: Path | None = None - visited: set[Path] = {header} - stack: list[Path] = [header] - - while stack: - h = stack.pop() - for inc in inverted.get(h, ()): - if inc in source_files: - if inc.stem == header.stem: - preferred = inc - break - if preferred is None: - preferred = inc - if inc not in visited: - visited.add(inc) - stack.append(inc) - if preferred is not None and preferred.stem == header.stem: - break - - if preferred is not None: - result.add(preferred) - - return result - - -def resolve_files( - input_files: list[str], build_dir: Path, repo_root: Path -) -> list[str]: - """ - Split input into source files and headers. Source files are passed through; - headers are resolved to the TUs that transitively include them. - """ - sources: list[Path] = [] - headers: list[Path] = [] - - for f in input_files: - p = Path(f).resolve() - if p.suffix in SOURCE_EXTENSIONS: - sources.append(p) - elif p.suffix in HEADER_EXTENSIONS: - headers.append(p) - - if not headers: - return [str(p) for p in sources] - - print( - f"Resolving {len(headers)} header(s) to compilation units...", file=sys.stderr - ) - inverted, source_files = build_include_graph(build_dir, repo_root) - tus = find_tus_for_headers(headers, inverted, source_files) - - if not tus: - print( - "Warning: no compilation units found that include the modified headers; " - "skipping clang-tidy for headers.", - file=sys.stderr, - ) - - return sorted({str(p) for p in (*sources, *tus)}) - - -def staged_files(repo_root: Path) -> list[str]: - result = subprocess.run( - ["git", "diff", "--staged", "--name-only", "--diff-filter=d"], - capture_output=True, - text=True, - cwd=repo_root, - ) - if result.returncode != 0: - print( - "clang-tidy check failed: 'git diff --staged' command failed.", - file=sys.stderr, - ) - if result.stderr: - print(result.stderr, file=sys.stderr) - sys.exit(result.returncode or 1) - return [str(repo_root / p) for p in result.stdout.splitlines() if p] - - -def main(): - if not os.environ.get("TIDY"): - return 0 - - repo_root = Path(__file__).parent.parent - files = staged_files(repo_root) - if not files: - return 0 - - run_clang_tidy = find_run_clang_tidy() - if not run_clang_tidy: - print( - "clang-tidy check failed: TIDY is enabled but neither " - "'run-clang-tidy-21' nor 'run-clang-tidy' was found in PATH.", - file=sys.stderr, - ) - return 1 - - build_dir = find_build_dir(repo_root) - if not build_dir: - print( - "clang-tidy check failed: no build directory with compile_commands.json found " - "(looked for .build/ and build/)", - file=sys.stderr, - ) - return 1 - - tidy_files = resolve_files(files, build_dir, repo_root) - if not tidy_files: - return 0 - - result = subprocess.run( - [run_clang_tidy, "-quiet", "-p", str(build_dir), "-fix", "-allow-no-checks"] - + tidy_files - ) - return result.returncode - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/cfg/xrpld-example.cfg b/cfg/xrpld-example.cfg index 4b17bf0500..6d65824fb9 100644 --- a/cfg/xrpld-example.cfg +++ b/cfg/xrpld-example.cfg @@ -1416,12 +1416,6 @@ # in this section to a comma-separated list of the addresses # of your Clio servers, in order to bypass xrpld's rate limiting. # -# TLS/SSL can be enabled for gRPC by specifying ssl_cert and ssl_key. -# Both parameters must be provided together. The ssl_cert_chain parameter -# is optional and provides intermediate CA certificates for the certificate -# chain. The ssl_client_ca parameter is optional and enables mutual TLS -# (client certificate verification). -# # This port is commented out but can be enabled by removing # the '#' from each corresponding line including the entry under [server] # @@ -1471,74 +1465,11 @@ admin = 127.0.0.1 protocol = ws send_queue_limit = 500 -# gRPC TLS/SSL Configuration -# -# The gRPC port supports optional TLS/SSL encryption. When TLS is not -# configured, the gRPC server will accept unencrypted connections. -# -# ssl_cert = -# ssl_key = -# -# To enable TLS for gRPC, both ssl_cert and ssl_key must be specified. -# If only one is provided, xrpld will fail to start. -# -# ssl_cert: Path to the server's SSL certificate file in PEM format. -# ssl_key: Path to the server's SSL private key file in PEM format. -# -# When configured, the gRPC server will only accept TLS-encrypted -# connections. Clients must use TLS (secure) channel credentials rather -# than plaintext / insecure connections. -# -# ssl_cert_chain = -# -# Optional. Path to intermediate CA certificate(s) in PEM format that -# complete the server's certificate chain. -# -# This file should contain the intermediate CA certificate(s) needed -# to build a trust chain from the server certificate (ssl_cert) to a -# root CA that clients trust. Multiple certificates should be -# concatenated in PEM format. -# -# This is needed when your server certificate was signed by an -# intermediate CA rather than directly by a root CA. Without this, -# clients may fail to verify your server certificate. -# -# If not specified, only the server certificate from ssl_cert will be -# presented to clients. -# -# ssl_client_ca = -# -# Optional. Path to a CA certificate file in PEM format for verifying -# client certificates (mutual TLS / mTLS). -# -# When specified, the gRPC server will verify client certificates -# against this CA. This enables mutual authentication where both the -# server and client verify each other's identity. -# -# This is typically NOT needed for public-facing gRPC servers. Only -# use this if you want to restrict access to clients with valid -# certificates signed by the specified CA. -# -# If not specified, the server will use one-way TLS (server -# authentication only) and will accept connections from any client. -# [port_grpc] port = 50051 ip = 127.0.0.1 secure_gateway = 127.0.0.1 -# Optional TLS/SSL configuration for gRPC -# To enable TLS, uncomment and configure both ssl_cert and ssl_key: -#ssl_cert = /etc/ssl/certs/grpc-server.crt -#ssl_key = /etc/ssl/private/grpc-server.key - -# Optional: Include intermediate CA certificates for complete certificate chain -#ssl_cert_chain = /etc/ssl/certs/grpc-intermediate-ca.crt - -# Optional: Enable mutual TLS (client certificate verification) -# Uncomment to require and verify client certificates: -#ssl_client_ca = /etc/ssl/certs/grpc-client-ca.crt - #[port_ws_public] #port = 6005 #ip = 127.0.0.1 diff --git a/cmake/XrplCore.cmake b/cmake/XrplCore.cmake index 9b1dc74049..a50e30f660 100644 --- a/cmake/XrplCore.cmake +++ b/cmake/XrplCore.cmake @@ -108,12 +108,24 @@ target_link_libraries( ) # Level 05 +## Set up code generation for protocol_autogen module +include(XrplProtocolAutogen) +# Must call setup_protocol_autogen before add_module so that: +# 1. Stale generated files are cleared before GLOB runs +# 2. Output file list is known for custom commands +setup_protocol_autogen() + add_module(xrpl protocol_autogen) target_link_libraries( xrpl.libxrpl.protocol_autogen PUBLIC xrpl.libxrpl.protocol ) +# Ensure code generation runs before compiling protocol_autogen +if(TARGET protocol_autogen_generate) + add_dependencies(xrpl.libxrpl.protocol_autogen protocol_autogen_generate) +endif() + # Level 06 add_module(xrpl core) target_link_libraries( diff --git a/cmake/XrplProtocolAutogen.cmake b/cmake/XrplProtocolAutogen.cmake index dd9ef6a9a4..e48d28959d 100644 --- a/cmake/XrplProtocolAutogen.cmake +++ b/cmake/XrplProtocolAutogen.cmake @@ -2,145 +2,308 @@ Protocol Autogen - Code generation for protocol wrapper classes #]===================================================================] +# Options for code generation +option( + XRPL_NO_CODEGEN + "Disable code generation (use pre-generated files from repository)" + OFF +) set(CODEGEN_VENV_DIR - "${CMAKE_CURRENT_SOURCE_DIR}/.venv" + "" CACHE PATH - "Path to a Python virtual environment for code generation. A venv will be created here by setup_code_gen and used to run generation scripts." + "Path to Python virtual environment for code generation. If provided, automatic venv setup is skipped." ) -# Directory paths -set(MACRO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol/detail") -set(AUTOGEN_HEADER_DIR - "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol_autogen" -) -set(AUTOGEN_TEST_DIR - "${CMAKE_CURRENT_SOURCE_DIR}/src/tests/libxrpl/protocol_autogen" -) -set(SCRIPTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/scripts/codegen") - -# Input macro files -set(TRANSACTIONS_MACRO "${MACRO_DIR}/transactions.macro") -set(LEDGER_ENTRIES_MACRO "${MACRO_DIR}/ledger_entries.macro") -set(SFIELDS_MACRO "${MACRO_DIR}/sfields.macro") - -# Python scripts and templates -set(GENERATE_TX_SCRIPT "${SCRIPTS_DIR}/generate_tx_classes.py") -set(GENERATE_LEDGER_SCRIPT "${SCRIPTS_DIR}/generate_ledger_classes.py") -set(REQUIREMENTS_FILE "${SCRIPTS_DIR}/requirements.txt") -set(MACRO_PARSER_COMMON "${SCRIPTS_DIR}/macro_parser_common.py") -set(TX_TEMPLATE "${SCRIPTS_DIR}/templates/Transaction.h.mako") -set(TX_TEST_TEMPLATE "${SCRIPTS_DIR}/templates/TransactionTests.cpp.mako") -set(LEDGER_TEMPLATE "${SCRIPTS_DIR}/templates/LedgerEntry.h.mako") -set(LEDGER_TEST_TEMPLATE "${SCRIPTS_DIR}/templates/LedgerEntryTests.cpp.mako") -set(ALL_INPUT_FILES - "${TRANSACTIONS_MACRO}" - "${LEDGER_ENTRIES_MACRO}" - "${SFIELDS_MACRO}" - "${GENERATE_TX_SCRIPT}" - "${GENERATE_LEDGER_SCRIPT}" - "${REQUIREMENTS_FILE}" - "${MACRO_PARSER_COMMON}" - "${TX_TEMPLATE}" - "${TX_TEST_TEMPLATE}" - "${LEDGER_TEMPLATE}" - "${LEDGER_TEST_TEMPLATE}" -) - -# Create output directories -file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/transactions") -file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/ledger_entries") -file(MAKE_DIRECTORY "${AUTOGEN_TEST_DIR}/ledger_entries") -file(MAKE_DIRECTORY "${AUTOGEN_TEST_DIR}/transactions") - -# Find Python3 -if(NOT Python3_EXECUTABLE) - find_package(Python3 COMPONENTS Interpreter QUIET) -endif() - -if(NOT Python3_EXECUTABLE) - find_program(Python3_EXECUTABLE NAMES python3 python) -endif() - -if(NOT Python3_EXECUTABLE) - message( - WARNING - "Python3 not found. The 'code_gen' and 'setup_code_gen' targets will not be available." +# Function to set up code generation for protocol_autogen module +# This runs at configure time to generate C++ wrapper classes from macro files +function(setup_protocol_autogen) + # Directory paths + set(MACRO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol/detail") + set(AUTOGEN_HEADER_DIR + "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol_autogen" ) - return() -endif() - -# Warn if pip is configured with a non-default index (may need VPN). -execute_process( - COMMAND ${Python3_EXECUTABLE} -m pip config get global.index-url - OUTPUT_VARIABLE PIP_INDEX_URL - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - RESULT_VARIABLE PIP_CONFIG_RESULT -) -if(PIP_CONFIG_RESULT EQUAL 0 AND PIP_INDEX_URL) - if( - NOT PIP_INDEX_URL STREQUAL "https://pypi.org/simple" - AND NOT PIP_INDEX_URL STREQUAL "https://pypi.python.org/simple" + set(AUTOGEN_TEST_DIR + "${CMAKE_CURRENT_SOURCE_DIR}/src/tests/libxrpl/protocol_autogen" ) + set(SCRIPTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/scripts") + + # Input macro files + set(TRANSACTIONS_MACRO "${MACRO_DIR}/transactions.macro") + set(LEDGER_ENTRIES_MACRO "${MACRO_DIR}/ledger_entries.macro") + set(SFIELDS_MACRO "${MACRO_DIR}/sfields.macro") + + # Python scripts and templates + set(GENERATE_TX_SCRIPT "${SCRIPTS_DIR}/generate_tx_classes.py") + set(GENERATE_LEDGER_SCRIPT "${SCRIPTS_DIR}/generate_ledger_classes.py") + set(REQUIREMENTS_FILE "${SCRIPTS_DIR}/requirements.txt") + set(MACRO_PARSER_COMMON "${SCRIPTS_DIR}/macro_parser_common.py") + set(TX_TEMPLATE "${SCRIPTS_DIR}/templates/Transaction.h.mako") + set(TX_TEST_TEMPLATE "${SCRIPTS_DIR}/templates/TransactionTests.cpp.mako") + set(LEDGER_TEMPLATE "${SCRIPTS_DIR}/templates/LedgerEntry.h.mako") + set(LEDGER_TEST_TEMPLATE + "${SCRIPTS_DIR}/templates/LedgerEntryTests.cpp.mako" + ) + + # Check if code generation is disabled + if(XRPL_NO_CODEGEN) message( WARNING - "Private pip index URL detected: ${PIP_INDEX_URL}\n" - "You may need to connect to VPN to access this URL." + "Protocol autogen: Code generation is disabled (XRPL_NO_CODEGEN=ON). " + "Generated files may be out of date." + ) + return() + endif() + + # Create output directories + file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/transactions") + file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/ledger_entries") + file(MAKE_DIRECTORY "${AUTOGEN_TEST_DIR}/ledger_entries") + file(MAKE_DIRECTORY "${AUTOGEN_TEST_DIR}/transactions") + + # Find Python3 - check if already found by Conan or find it ourselves + if(NOT Python3_EXECUTABLE) + find_package(Python3 COMPONENTS Interpreter QUIET) + endif() + + if(NOT Python3_EXECUTABLE) + # Try finding python3 executable directly + find_program(Python3_EXECUTABLE NAMES python3 python) + endif() + + if(NOT Python3_EXECUTABLE) + message( + FATAL_ERROR + "Python3 not found. Code generation cannot proceed.\n" + "Please install Python 3, or set -DXRPL_NO_CODEGEN=ON to use existing generated files." + ) + return() + endif() + + message(STATUS "Using Python3 for code generation: ${Python3_EXECUTABLE}") + + # Set up Python virtual environment for code generation + if(CODEGEN_VENV_DIR) + # User-provided venv - skip automatic setup + set(VENV_DIR "${CODEGEN_VENV_DIR}") + message(STATUS "Using user-provided Python venv: ${VENV_DIR}") + else() + # Use default venv in build directory + set(VENV_DIR "${CMAKE_CURRENT_BINARY_DIR}/codegen_venv") + endif() + + # Determine the Python executable path in the venv + if(WIN32) + set(VENV_PYTHON "${VENV_DIR}/Scripts/python.exe") + set(VENV_PIP "${VENV_DIR}/Scripts/pip.exe") + else() + set(VENV_PYTHON "${VENV_DIR}/bin/python") + set(VENV_PIP "${VENV_DIR}/bin/pip") + endif() + + # Only auto-setup venv if not user-provided + if(NOT CODEGEN_VENV_DIR) + # Check if venv needs to be created or updated + set(VENV_NEEDS_UPDATE FALSE) + if(NOT EXISTS "${VENV_PYTHON}") + set(VENV_NEEDS_UPDATE TRUE) + message( + STATUS + "Creating Python virtual environment for code generation..." + ) + elseif( + "${REQUIREMENTS_FILE}" + IS_NEWER_THAN + "${VENV_DIR}/.requirements_installed" + ) + set(VENV_NEEDS_UPDATE TRUE) + message( + STATUS + "Updating Python virtual environment (requirements changed)..." + ) + endif() + + # Create/update virtual environment if needed + if(VENV_NEEDS_UPDATE) + message( + STATUS + "Setting up Python virtual environment at ${VENV_DIR}" + ) + execute_process( + COMMAND ${Python3_EXECUTABLE} -m venv "${VENV_DIR}" + RESULT_VARIABLE VENV_RESULT + ERROR_VARIABLE VENV_ERROR + ) + if(NOT VENV_RESULT EQUAL 0) + message( + FATAL_ERROR + "Failed to create virtual environment: ${VENV_ERROR}" + ) + endif() + + # Check pip index URL configuration + execute_process( + COMMAND ${VENV_PIP} config get global.index-url + OUTPUT_VARIABLE PIP_INDEX_URL + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + + # Default PyPI URL + set(DEFAULT_PIP_INDEX "https://pypi.org/simple") + + # Show warning if using non-default index + if(PIP_INDEX_URL AND NOT PIP_INDEX_URL STREQUAL "") + if(NOT PIP_INDEX_URL STREQUAL DEFAULT_PIP_INDEX) + message( + WARNING + "Private pip index URL detected: ${PIP_INDEX_URL}\n" + "You may need to connect to VPN to access this URL." + ) + endif() + endif() + + message(STATUS "Installing Python dependencies...") + execute_process( + COMMAND ${VENV_PIP} install --upgrade pip + RESULT_VARIABLE PIP_UPGRADE_RESULT + OUTPUT_QUIET + ERROR_VARIABLE PIP_UPGRADE_ERROR + ) + if(NOT PIP_UPGRADE_RESULT EQUAL 0) + message(WARNING "Failed to upgrade pip: ${PIP_UPGRADE_ERROR}") + endif() + + execute_process( + COMMAND ${VENV_PIP} install -r "${REQUIREMENTS_FILE}" + RESULT_VARIABLE PIP_INSTALL_RESULT + ERROR_VARIABLE PIP_INSTALL_ERROR + ) + if(NOT PIP_INSTALL_RESULT EQUAL 0) + message( + FATAL_ERROR + "Failed to install Python dependencies: ${PIP_INSTALL_ERROR}" + ) + endif() + + # Mark requirements as installed + file(TOUCH "${VENV_DIR}/.requirements_installed") + message(STATUS "Python virtual environment ready") + endif() + endif() + + # At configure time - get list of output files for transactions + execute_process( + COMMAND + ${VENV_PYTHON} "${GENERATE_TX_SCRIPT}" "${TRANSACTIONS_MACRO}" + --header-dir "${AUTOGEN_HEADER_DIR}/transactions" --test-dir + "${AUTOGEN_TEST_DIR}/transactions" --list-outputs + OUTPUT_VARIABLE TX_OUTPUT_FILES + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE TX_LIST_RESULT + ERROR_VARIABLE TX_LIST_ERROR + ) + if(NOT TX_LIST_RESULT EQUAL 0) + message( + FATAL_ERROR + "Failed to list transaction output files:\n${TX_LIST_ERROR}" ) endif() -endif() + # Convert newline-separated list to CMake list + string(REPLACE "\\" "/" TX_OUTPUT_FILES "${TX_OUTPUT_FILES}") + string(REPLACE "\n" ";" TX_OUTPUT_FILES "${TX_OUTPUT_FILES}") -# Determine which Python interpreter to use for code generation. -if(CODEGEN_VENV_DIR) - if(WIN32) - set(CODEGEN_PYTHON "${CODEGEN_VENV_DIR}/Scripts/python.exe") - else() - set(CODEGEN_PYTHON "${CODEGEN_VENV_DIR}/bin/python") + # At configure time - get list of output files for ledger entries + execute_process( + COMMAND + ${VENV_PYTHON} "${GENERATE_LEDGER_SCRIPT}" "${LEDGER_ENTRIES_MACRO}" + --header-dir "${AUTOGEN_HEADER_DIR}/ledger_entries" --test-dir + "${AUTOGEN_TEST_DIR}/ledger_entries" --list-outputs + OUTPUT_VARIABLE LEDGER_OUTPUT_FILES + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE LEDGER_LIST_RESULT + ERROR_VARIABLE LEDGER_LIST_ERROR + ) + if(NOT LEDGER_LIST_RESULT EQUAL 0) + message( + FATAL_ERROR + "Failed to list ledger entry output files:\n${LEDGER_LIST_ERROR}" + ) endif() -else() - set(CODEGEN_PYTHON "${Python3_EXECUTABLE}") - message( - WARNING - "CODEGEN_VENV_DIR is not set. Dependencies will be installed globally.\n" - "If this is not intended, reconfigure with:\n" - " cmake . -UCODEGEN_VENV_DIR" - ) -endif() + # Convert newline-separated list to CMake list + string(REPLACE "\\" "/" LEDGER_OUTPUT_FILES "${LEDGER_OUTPUT_FILES}") + string(REPLACE "\n" ";" LEDGER_OUTPUT_FILES "${LEDGER_OUTPUT_FILES}") -# Custom target to create a venv and install Python dependencies. -# Run manually with: cmake --build . --target setup_code_gen -if(CODEGEN_VENV_DIR) - add_custom_target( - setup_code_gen - COMMAND ${Python3_EXECUTABLE} -m venv "${CODEGEN_VENV_DIR}" - COMMAND ${CODEGEN_PYTHON} -m pip install -r "${REQUIREMENTS_FILE}" + # Custom command to generate transaction classes at build time + add_custom_command( + OUTPUT ${TX_OUTPUT_FILES} + COMMAND + ${VENV_PYTHON} "${GENERATE_TX_SCRIPT}" "${TRANSACTIONS_MACRO}" + --header-dir "${AUTOGEN_HEADER_DIR}/transactions" --test-dir + "${AUTOGEN_TEST_DIR}/transactions" --sfields-macro + "${SFIELDS_MACRO}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Creating venv and installing code generation dependencies..." + DEPENDS + "${TRANSACTIONS_MACRO}" + "${SFIELDS_MACRO}" + "${GENERATE_TX_SCRIPT}" + "${MACRO_PARSER_COMMON}" + "${TX_TEMPLATE}" + "${TX_TEST_TEMPLATE}" + "${REQUIREMENTS_FILE}" + COMMENT "Generating transaction classes from transactions.macro..." + VERBATIM ) -else() - add_custom_target( - setup_code_gen - COMMAND ${Python3_EXECUTABLE} -m pip install -r "${REQUIREMENTS_FILE}" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Installing code generation dependencies..." - ) -endif() -# Custom target for code generation, excluded from ALL. -# Run manually with: cmake --build . --target code_gen -add_custom_target( - code_gen - COMMAND - ${CMAKE_COMMAND} -DCODEGEN_PYTHON=${CODEGEN_PYTHON} - -DGENERATE_TX_SCRIPT=${GENERATE_TX_SCRIPT} - -DGENERATE_LEDGER_SCRIPT=${GENERATE_LEDGER_SCRIPT} - -DTRANSACTIONS_MACRO=${TRANSACTIONS_MACRO} - -DLEDGER_ENTRIES_MACRO=${LEDGER_ENTRIES_MACRO} - -DSFIELDS_MACRO=${SFIELDS_MACRO} - -DAUTOGEN_HEADER_DIR=${AUTOGEN_HEADER_DIR} - -DAUTOGEN_TEST_DIR=${AUTOGEN_TEST_DIR} -P - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/XrplProtocolAutogenRun.cmake" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Running protocol code generation..." - SOURCES ${ALL_INPUT_FILES} -) + # Custom command to generate ledger entry classes at build time + add_custom_command( + OUTPUT ${LEDGER_OUTPUT_FILES} + COMMAND + ${VENV_PYTHON} "${GENERATE_LEDGER_SCRIPT}" "${LEDGER_ENTRIES_MACRO}" + --header-dir "${AUTOGEN_HEADER_DIR}/ledger_entries" --test-dir + "${AUTOGEN_TEST_DIR}/ledger_entries" --sfields-macro + "${SFIELDS_MACRO}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DEPENDS + "${LEDGER_ENTRIES_MACRO}" + "${SFIELDS_MACRO}" + "${GENERATE_LEDGER_SCRIPT}" + "${MACRO_PARSER_COMMON}" + "${LEDGER_TEMPLATE}" + "${LEDGER_TEST_TEMPLATE}" + "${REQUIREMENTS_FILE}" + COMMENT "Generating ledger entry classes from ledger_entries.macro..." + VERBATIM + ) + + # Create a custom target that depends on all generated files + add_custom_target( + protocol_autogen_generate + DEPENDS ${TX_OUTPUT_FILES} ${LEDGER_OUTPUT_FILES} + COMMENT "Protocol autogen code generation" + ) + + # Extract test files from output lists (files ending in Tests.cpp) + set(PROTOCOL_AUTOGEN_TEST_SOURCES "") + foreach(FILE ${TX_OUTPUT_FILES} ${LEDGER_OUTPUT_FILES}) + if(FILE MATCHES "Tests\\.cpp$") + list(APPEND PROTOCOL_AUTOGEN_TEST_SOURCES "${FILE}") + endif() + endforeach() + # Export test sources to parent scope for use in test CMakeLists.txt + set(PROTOCOL_AUTOGEN_TEST_SOURCES + "${PROTOCOL_AUTOGEN_TEST_SOURCES}" + CACHE INTERNAL + "Generated protocol_autogen test sources" + ) + + # Register dependencies so CMake reconfigures when macro files change + # (to update the list of output files) + set_property( + DIRECTORY + APPEND + PROPERTY + CMAKE_CONFIGURE_DEPENDS + "${TRANSACTIONS_MACRO}" + "${LEDGER_ENTRIES_MACRO}" + ) +endfunction() diff --git a/cmake/XrplProtocolAutogenRun.cmake b/cmake/XrplProtocolAutogenRun.cmake deleted file mode 100644 index 8bdb37a8e0..0000000000 --- a/cmake/XrplProtocolAutogenRun.cmake +++ /dev/null @@ -1,39 +0,0 @@ -#[===================================================================[ - Protocol Autogen - Run script invoked by the 'code_gen' target -#]===================================================================] - -# Generate transaction classes. -execute_process( - COMMAND - ${CODEGEN_PYTHON} "${GENERATE_TX_SCRIPT}" "${TRANSACTIONS_MACRO}" - --header-dir "${AUTOGEN_HEADER_DIR}/transactions" --test-dir - "${AUTOGEN_TEST_DIR}/transactions" --sfields-macro "${SFIELDS_MACRO}" - RESULT_VARIABLE TX_RESULT - OUTPUT_VARIABLE TX_OUTPUT - ERROR_VARIABLE TX_ERROR -) -if(NOT TX_RESULT EQUAL 0) - message( - FATAL_ERROR - "Transaction code generation failed:\n${TX_OUTPUT}\n${TX_ERROR}\n${TX_RESULT}" - ) -endif() - -# Generate ledger entry classes. -execute_process( - COMMAND - ${CODEGEN_PYTHON} "${GENERATE_LEDGER_SCRIPT}" "${LEDGER_ENTRIES_MACRO}" - --header-dir "${AUTOGEN_HEADER_DIR}/ledger_entries" --test-dir - "${AUTOGEN_TEST_DIR}/ledger_entries" --sfields-macro "${SFIELDS_MACRO}" - RESULT_VARIABLE LEDGER_RESULT - OUTPUT_VARIABLE LEDGER_OUTPUT - ERROR_VARIABLE LEDGER_ERROR -) -if(NOT LEDGER_RESULT EQUAL 0) - message( - FATAL_ERROR - "Ledger entry code generation failed:\n${LEDGER_OUTPUT}\n${LEDGER_ERROR}\n${TX_RESULT}" - ) -endif() - -message(STATUS "Protocol autogen: code generation complete") diff --git a/conan/lockfile/regenerate.sh b/conan/lockfile/regenerate.sh index 1aa47628f0..30d38dc2d7 100755 --- a/conan/lockfile/regenerate.sh +++ b/conan/lockfile/regenerate.sh @@ -23,14 +23,14 @@ rm -f conan.lock # first create command will create a new lockfile, while the subsequent create # commands will merge any additional dependencies into the created lockfile. conan lock create . \ - --options '&:jemalloc=True' \ - --options '&:rocksdb=True' \ - --profile:all=conan/lockfile/linux.profile + --options '&:jemalloc=True' \ + --options '&:rocksdb=True' \ + --profile:all=conan/lockfile/linux.profile conan lock create . \ - --options '&:jemalloc=True' \ - --options '&:rocksdb=True' \ - --profile:all=conan/lockfile/macos.profile + --options '&:jemalloc=True' \ + --options '&:rocksdb=True' \ + --profile:all=conan/lockfile/macos.profile conan lock create . \ - --options '&:jemalloc=True' \ - --options '&:rocksdb=True' \ - --profile:all=conan/lockfile/windows.profile + --options '&:jemalloc=True' \ + --options '&:rocksdb=True' \ + --profile:all=conan/lockfile/windows.profile diff --git a/include/xrpl/basics/BasicConfig.h b/include/xrpl/basics/BasicConfig.h index e1b0af516f..eaa53f93d6 100644 --- a/include/xrpl/basics/BasicConfig.h +++ b/include/xrpl/basics/BasicConfig.h @@ -33,7 +33,7 @@ private: public: /** Create an empty section. */ - explicit Section(std::string name = ""); + explicit Section(std::string const& name = ""); /** Returns the name of this section. */ std::string const& @@ -67,13 +67,9 @@ public: legacy(std::string value) { if (lines_.empty()) - { lines_.emplace_back(std::move(value)); - } else - { lines_[0] = std::move(value); - } } /** @@ -88,10 +84,8 @@ public: if (lines_.empty()) return ""; if (lines_.size() > 1) - { Throw( "A legacy value must have exactly one line. Section: " + name_); - } return lines_[0]; } @@ -275,7 +269,8 @@ public: bool had_trailing_comments() const { - return std::ranges::any_of(map_, [](auto s) { return s.second.had_trailing_comments(); }); + return std::any_of( + map_.cbegin(), map_.cend(), [](auto s) { return s.second.had_trailing_comments(); }); } protected: @@ -301,7 +296,7 @@ set(T& target, std::string const& name, Section const& section) if ((found_and_valid = val.has_value())) target = *val; } - catch (boost::bad_lexical_cast const&) // NOLINT(bugprone-empty-catch) + catch (boost::bad_lexical_cast&) { } return found_and_valid; @@ -335,7 +330,7 @@ get(Section const& section, std::string const& name, T const& defaultValue = T{} { return section.value_or(name, defaultValue); } - catch (boost::bad_lexical_cast const&) // NOLINT(bugprone-empty-catch) + catch (boost::bad_lexical_cast&) { } return defaultValue; @@ -350,7 +345,7 @@ get(Section const& section, std::string const& name, char const* defaultValue) if (val.has_value()) return *val; } - catch (boost::bad_lexical_cast const&) // NOLINT(bugprone-empty-catch) + catch (boost::bad_lexical_cast&) { } return defaultValue; diff --git a/include/xrpl/basics/Buffer.h b/include/xrpl/basics/Buffer.h index 52c092981c..5192daf632 100644 --- a/include/xrpl/basics/Buffer.h +++ b/include/xrpl/basics/Buffer.h @@ -24,8 +24,7 @@ public: Buffer() = default; /** Create an uninitialized buffer with the given size. */ - explicit Buffer(std::size_t size) - : p_((size != 0u) ? new std::uint8_t[size] : nullptr), size_(size) + explicit Buffer(std::size_t size) : p_(size ? new std::uint8_t[size] : nullptr), size_(size) { } @@ -37,7 +36,7 @@ public: */ Buffer(void const* data, std::size_t size) : Buffer(size) { - if (size != 0u) + if (size) std::memcpy(p_.get(), data, size); } @@ -92,7 +91,7 @@ public: { // Ensure the slice isn't a subset of the buffer. XRPL_ASSERT( - s.empty() || size_ == 0 || s.data() < p_.get() || s.data() >= p_.get() + size_, + s.size() == 0 || size_ == 0 || s.data() < p_.get() || s.data() >= p_.get() + size_, "xrpl::Buffer::operator=(Slice) : input not a subset"); if (auto p = alloc(s.size())) @@ -115,7 +114,7 @@ public: operator Slice() const noexcept { - if (size_ == 0u) + if (!size_) return Slice{}; return Slice{p_.get(), size_}; } @@ -156,7 +155,7 @@ public: { if (n != size_) { - p_.reset((n != 0u) ? new std::uint8_t[n] : nullptr); + p_.reset(n ? new std::uint8_t[n] : nullptr); size_ = n; } return p_.get(); @@ -200,7 +199,7 @@ operator==(Buffer const& lhs, Buffer const& rhs) noexcept if (lhs.size() != rhs.size()) return false; - if (lhs.empty()) + if (lhs.size() == 0) return true; return std::memcmp(lhs.data(), rhs.data(), lhs.size()) == 0; diff --git a/include/xrpl/basics/CompressionAlgorithms.h b/include/xrpl/basics/CompressionAlgorithms.h index e24c490337..c549a58b93 100644 --- a/include/xrpl/basics/CompressionAlgorithms.h +++ b/include/xrpl/basics/CompressionAlgorithms.h @@ -9,7 +9,9 @@ #include #include -namespace xrpl::compression_algorithms { +namespace xrpl { + +namespace compression_algorithms { /** LZ4 block compression. * @tparam BufferFactory Callable object or lambda. @@ -66,15 +68,12 @@ lz4Decompress( if (decompressedSize <= 0) Throw("lz4Decompress: integer overflow (output)"); - // NOLINTNEXTLINE(readability-suspicious-call-argument) if (LZ4_decompress_safe( reinterpret_cast(in), reinterpret_cast(decompressed), inSize, decompressedSize) != decompressedSize) - { Throw("lz4Decompress: failed"); - } return decompressedSize; } @@ -139,4 +138,6 @@ lz4Decompress( return lz4Decompress(chunk, inSize, decompressed, decompressedSize); } -} // namespace xrpl::compression_algorithms +} // namespace compression_algorithms + +} // namespace xrpl diff --git a/include/xrpl/basics/CountedObject.h b/include/xrpl/basics/CountedObject.h index 675d1b163b..1acba18949 100644 --- a/include/xrpl/basics/CountedObject.h +++ b/include/xrpl/basics/CountedObject.h @@ -112,6 +112,7 @@ private: return c; } +public: CountedObject() noexcept { getCounter().increment(); @@ -125,13 +126,10 @@ private: CountedObject& operator=(CountedObject const&) noexcept = default; -public: ~CountedObject() noexcept { getCounter().decrement(); } - - friend Object; }; } // namespace xrpl diff --git a/include/xrpl/basics/DecayingSample.h b/include/xrpl/basics/DecayingSample.h index d4c7388046..d3343535e9 100644 --- a/include/xrpl/basics/DecayingSample.h +++ b/include/xrpl/basics/DecayingSample.h @@ -67,7 +67,7 @@ private: } else { - while ((elapsed--) != 0u) + while (elapsed--) m_value -= (m_value + Window - 1) / Window; } } diff --git a/include/xrpl/basics/Expected.h b/include/xrpl/basics/Expected.h index 6cba7106fb..083a9233cf 100644 --- a/include/xrpl/basics/Expected.h +++ b/include/xrpl/basics/Expected.h @@ -61,7 +61,7 @@ template class Unexpected { public: - static_assert(!std::is_same_v, "E must not be void"); + static_assert(!std::is_same::value, "E must not be void"); Unexpected() = delete; diff --git a/include/xrpl/basics/IntrusiveRefCounts.h b/include/xrpl/basics/IntrusiveRefCounts.h index ea610a521e..36616bc64f 100644 --- a/include/xrpl/basics/IntrusiveRefCounts.h +++ b/include/xrpl/basics/IntrusiveRefCounts.h @@ -247,7 +247,7 @@ IntrusiveRefCounts::releaseStrongRef() const using enum ReleaseStrongRefAction; auto prevIntVal = refCounts.load(std::memory_order_acquire); - while (true) + while (1) { RefCountPair const prevVal{prevIntVal}; XRPL_ASSERT( @@ -298,7 +298,7 @@ IntrusiveRefCounts::addWeakReleaseStrongRef() const // Note: If this becomes a perf bottleneck, the `partialDestroyStartedMask` // may be able to be set non-atomically. But it is easier to reason about // the code if the flag is set atomically. - while (true) + while (1) { RefCountPair const prevVal{prevIntVal}; // Converted the last strong pointer to a weak pointer. @@ -343,7 +343,7 @@ IntrusiveRefCounts::releaseWeakRef() const RefCountPair prev = prevIntVal; if (prev.weak == 1 && prev.strong == 0) { - if (prev.partialDestroyStartedBit == 0u) + if (!prev.partialDestroyStartedBit) { // This case should only be hit if the partialDestroyStartedBit is // set non-atomically (and even then very rarely). The code is kept @@ -352,7 +352,7 @@ IntrusiveRefCounts::releaseWeakRef() const prevIntVal = refCounts.load(std::memory_order_acquire); prev = RefCountPair{prevIntVal}; } - if (prev.partialDestroyFinishedBit == 0u) + if (!prev.partialDestroyFinishedBit) { // partial destroy MUST finish before running a full destroy (when // using weak pointers) @@ -372,7 +372,7 @@ IntrusiveRefCounts::checkoutStrongRefFromWeak() const noexcept while (!refCounts.compare_exchange_weak(curValue, desiredValue, std::memory_order_acq_rel)) { RefCountPair const prev{curValue}; - if (prev.strong == 0u) + if (!prev.strong) return false; desiredValue = curValue + strongDelta; diff --git a/include/xrpl/basics/LocalValue.h b/include/xrpl/basics/LocalValue.h index 421ea7af23..4ac76b130d 100644 --- a/include/xrpl/basics/LocalValue.h +++ b/include/xrpl/basics/LocalValue.h @@ -4,7 +4,6 @@ #include #include -#include namespace xrpl { @@ -29,7 +28,7 @@ struct LocalValues T t_; Value() = default; - explicit Value(T t) : t_(std::move(t)) + explicit Value(T const& t) : t_(t) { } @@ -43,10 +42,10 @@ struct LocalValues // Keys are the address of a LocalValue. std::unordered_map> values; - static void + static inline void cleanup(LocalValues* lvs) { - if ((lvs != nullptr) && !lvs->onCoro) + if (lvs && !lvs->onCoro) delete lvs; } }; @@ -90,7 +89,7 @@ T& LocalValue::operator*() { auto lvs = detail::getLocalValues().get(); - if (lvs == nullptr) + if (!lvs) { lvs = new detail::LocalValues(); lvs->onCoro = false; diff --git a/include/xrpl/basics/Log.h b/include/xrpl/basics/Log.h index 4efbec5199..08da3e57b5 100644 --- a/include/xrpl/basics/Log.h +++ b/include/xrpl/basics/Log.h @@ -38,7 +38,7 @@ private: std::string partition_; public: - Sink(std::string partition, beast::severities::Severity thresh, Logs& logs); + Sink(std::string const& partition, beast::severities::Severity thresh, Logs& logs); Sink(Sink const&) = delete; Sink& @@ -226,7 +226,7 @@ private: // expensive argument lists if the stream is not active. #ifndef JLOG #define JLOG(x) \ - if (!(x)) \ + if (!x) \ { \ } \ else \ @@ -235,7 +235,7 @@ private: #ifndef CLOG #define CLOG(ss) \ - if (!(ss)) \ + if (!ss) \ ; \ else \ *ss diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index 51ade0b5ea..c39aae2dd3 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -78,7 +78,7 @@ struct MantissaRange } rep min; - rep max{(min * 10) - 1}; + rep max{min * 10 - 1}; int log; mantissa_scale scale; @@ -342,9 +342,7 @@ public: constexpr int signum() const noexcept { - if (negative_) - return -1; - return (mantissa_ != 0u) ? 1 : 0; + return negative_ ? -1 : (mantissa_ ? 1 : 0); } Number @@ -404,19 +402,19 @@ public: static void setMantissaScale(MantissaRange::mantissa_scale scale); - static internalrep + inline static internalrep minMantissa() { return range_.get().min; } - static internalrep + inline static internalrep maxMantissa() { return range_.get().max; } - static int + inline static int mantissaLog() { return range_.get().log; @@ -509,12 +507,16 @@ private: class Guard; }; -constexpr Number::Number(bool negative, internalrep mantissa, int exponent, unchecked) noexcept +inline constexpr Number::Number( + bool negative, + internalrep mantissa, + int exponent, + unchecked) noexcept : negative_(negative), mantissa_{mantissa}, exponent_{exponent} { } -constexpr Number::Number(internalrep mantissa, int exponent, unchecked) noexcept +inline constexpr Number::Number(internalrep mantissa, int exponent, unchecked) noexcept : Number(false, mantissa, exponent, unchecked{}) { } @@ -546,7 +548,7 @@ inline Number::Number(rep mantissa) : Number{mantissa, 0} * Please see the "---- External Interface ----" section of the class * documentation for an explanation of why the internal value may be modified. */ -constexpr Number::rep +inline constexpr Number::rep Number::mantissa() const noexcept { auto m = mantissa_; @@ -567,7 +569,7 @@ Number::mantissa() const noexcept * Please see the "---- External Interface ----" section of the class * documentation for an explanation of why the internal value may be modified. */ -constexpr int +inline constexpr int Number::exponent() const noexcept { auto e = exponent_; @@ -582,13 +584,13 @@ Number::exponent() const noexcept return e; } -constexpr Number +inline constexpr Number Number::operator+() const noexcept { return *this; } -constexpr Number +inline constexpr Number Number::operator-() const noexcept { if (mantissa_ == 0) @@ -703,19 +705,17 @@ Number::normalizeToRange(T minMantissa, T maxMantissa) const int exponent = exponent_; if constexpr (std::is_unsigned_v) - { XRPL_ASSERT_PARTS( !negative, "xrpl::Number::normalizeToRange", "Number is non-negative for unsigned range."); - } Number::normalize(negative, mantissa, exponent, minMantissa, maxMantissa); auto const sign = negative ? -1 : 1; return std::make_pair(static_cast(sign * mantissa), exponent); } -constexpr Number +inline constexpr Number abs(Number x) noexcept { if (x < Number{}) @@ -746,7 +746,7 @@ power(Number const& f, unsigned n, unsigned d); // Return 0 if abs(x) < limit, else returns x -constexpr Number +inline constexpr Number squelch(Number const& x, Number const& limit) noexcept { if (abs(x) < limit) diff --git a/include/xrpl/basics/RangeSet.h b/include/xrpl/basics/RangeSet.h index 4e54624056..f6e03cac79 100644 --- a/include/xrpl/basics/RangeSet.h +++ b/include/xrpl/basics/RangeSet.h @@ -117,32 +117,22 @@ from_string(RangeSet& rs, std::string const& s) case 1: { T front; if (!beast::lexicalCastChecked(front, intervals.front())) - { result = false; - } else - { rs.insert(front); - } break; } case 2: { T front; if (!beast::lexicalCastChecked(front, intervals.front())) - { result = false; - } else { T back; if (!beast::lexicalCastChecked(back, intervals.back())) - { result = false; - } else - { rs.insert(range(front, back)); - } } break; } diff --git a/include/xrpl/basics/SlabAllocator.h b/include/xrpl/basics/SlabAllocator.h index 094f7a0f34..4ed88a32f7 100644 --- a/include/xrpl/basics/SlabAllocator.h +++ b/include/xrpl/basics/SlabAllocator.h @@ -60,16 +60,18 @@ class SlabAllocator { // Use memcpy to avoid unaligned UB // (will optimize to equivalent code) - std::memcpy(data, static_cast(&l_), sizeof(std::uint8_t*)); + std::memcpy(data, &l_, sizeof(std::uint8_t*)); l_ = data; data += item; } } - // Calling this destructor will release the allocated memory but - // will not properly destroy any objects that are constructed in - // the block itself. - ~SlabBlock() = default; + ~SlabBlock() + { + // Calling this destructor will release the allocated memory but + // will not properly destroy any objects that are constructed in + // the block itself. + } SlabBlock(SlabBlock const& other) = delete; SlabBlock& @@ -96,11 +98,11 @@ class SlabAllocator ret = l_; - if (ret != nullptr) + if (ret) { // Use memcpy to avoid unaligned UB // (will optimize to equivalent code) - std::memcpy(static_cast(&l_), ret, sizeof(std::uint8_t*)); + std::memcpy(&l_, ret, sizeof(std::uint8_t*)); } } @@ -125,7 +127,7 @@ class SlabAllocator // Use memcpy to avoid unaligned UB // (will optimize to equivalent code) - std::memcpy(ptr, static_cast(&l_), sizeof(std::uint8_t*)); + std::memcpy(ptr, &l_, sizeof(std::uint8_t*)); l_ = ptr; } }; @@ -157,7 +159,7 @@ public: std::size_t extra, std::size_t alloc = 0, std::size_t align = 0) - : itemAlignment_((align != 0u) ? align : alignof(Type)) + : itemAlignment_(align ? align : alignof(Type)) , itemSize_(boost::alignment::align_up(sizeof(Type) + extra, itemAlignment_)) , slabSize_(alloc) { @@ -174,10 +176,12 @@ public: SlabAllocator& operator=(SlabAllocator&& other) = delete; - // FIXME: We can't destroy the memory blocks we've allocated, because - // we can't be sure that they are not being used. Cleaning the - // shutdown process up could make this possible. - ~SlabAllocator() = default; + ~SlabAllocator() + { + // FIXME: We can't destroy the memory blocks we've allocated, because + // we can't be sure that they are not being used. Cleaning the + // shutdown process up could make this possible. + } /** Returns the size of the memory block this allocator returns. */ constexpr std::size_t @@ -211,7 +215,7 @@ public: // We want to allocate the memory at a 2 MiB boundary, to make it // possible to use hugepage mappings on Linux: auto buf = boost::alignment::aligned_alloc(megabytes(std::size_t(2)), size); - if (buf == nullptr) [[unlikely]] + if (!buf) [[unlikely]] return nullptr; #if BOOST_OS_LINUX @@ -231,7 +235,7 @@ public: // This operation is essentially guaranteed not to fail but // let's be careful anyways. - if (boost::alignment::align(itemAlignment_, itemSize_, slabData, slabSize) == nullptr) + if (!boost::alignment::align(itemAlignment_, itemSize_, slabData, slabSize)) { boost::alignment::aligned_free(buf); return nullptr; @@ -343,7 +347,9 @@ public: SlabAllocatorSet& operator=(SlabAllocatorSet&& other) = delete; - ~SlabAllocatorSet() = default; + ~SlabAllocatorSet() + { + } /** Returns a suitably aligned pointer, if one is available. diff --git a/include/xrpl/basics/Slice.h b/include/xrpl/basics/Slice.h index 08ee9464ef..6aa5446236 100644 --- a/include/xrpl/basics/Slice.h +++ b/include/xrpl/basics/Slice.h @@ -183,7 +183,7 @@ operator==(Slice const& lhs, Slice const& rhs) noexcept if (lhs.size() != rhs.size()) return false; - if (lhs.empty()) + if (lhs.size() == 0) return true; return std::memcmp(lhs.data(), rhs.data(), lhs.size()) == 0; @@ -211,14 +211,14 @@ operator<<(Stream& s, Slice const& v) } template -std::enable_if_t || std::is_same_v, Slice> +std::enable_if_t::value || std::is_same::value, Slice> makeSlice(std::array const& a) { return Slice(a.data(), a.size()); } template -std::enable_if_t || std::is_same_v, Slice> +std::enable_if_t::value || std::is_same::value, Slice> makeSlice(std::vector const& v) { return Slice(v.data(), v.size()); diff --git a/include/xrpl/basics/TaggedCache.h b/include/xrpl/basics/TaggedCache.h index d20c850bad..1a19c653bc 100644 --- a/include/xrpl/basics/TaggedCache.h +++ b/include/xrpl/basics/TaggedCache.h @@ -251,7 +251,7 @@ private: } }; - using Entry = std::conditional_t; + typedef typename std::conditional::type Entry; using KeyOnlyCacheType = hardened_partitioned_hash_map; diff --git a/include/xrpl/basics/ToString.h b/include/xrpl/basics/ToString.h index 28f0245404..a6254a1880 100644 --- a/include/xrpl/basics/ToString.h +++ b/include/xrpl/basics/ToString.h @@ -12,7 +12,7 @@ namespace xrpl { */ template -std::enable_if_t, std::string> +typename std::enable_if::value, std::string>::type to_string(T t) { return std::to_string(t); diff --git a/include/xrpl/basics/algorithm.h b/include/xrpl/basics/algorithm.h index 9dae731a89..b3fdd5453d 100644 --- a/include/xrpl/basics/algorithm.h +++ b/include/xrpl/basics/algorithm.h @@ -23,10 +23,8 @@ generalized_set_intersection( { while (first1 != last1 && first2 != last2) { - if (comp(*first1, *first2)) - { // if *first1 < *first2 - ++first1; // then reduce first range - } + if (comp(*first1, *first2)) // if *first1 < *first2 + ++first1; // then reduce first range else { if (!comp(*first2, *first1)) // if *first1 == *first2 diff --git a/include/xrpl/basics/base_uint.h b/include/xrpl/basics/base_uint.h index 55b73bfb9b..5fb13319ea 100644 --- a/include/xrpl/basics/base_uint.h +++ b/include/xrpl/basics/base_uint.h @@ -183,17 +183,11 @@ private: return ParseResult::badChar; if (c >= 'a') - { nibble = static_cast(c - 'a' + 0xA); - } else if (c >= 'A') - { nibble = static_cast(c - 'A' + 0xA); - } else if (c <= '9') - { nibble = static_cast(c - '0'); - } if (nibble > 0xFu) return ParseResult::badChar; @@ -269,7 +263,7 @@ public: class Container, class = std::enable_if_t< detail::is_contiguous_container::value && - std::is_trivially_copyable_v>> + std::is_trivially_copyable::value>> explicit base_uint(Container const& c) { XRPL_ASSERT( @@ -281,7 +275,7 @@ public: template std::enable_if_t< detail::is_contiguous_container::value && - std::is_trivially_copyable_v, + std::is_trivially_copyable::value, base_uint&> operator=(Container const& c) { @@ -314,10 +308,8 @@ public: signum() const { for (int i = 0; i < WIDTH; i++) - { if (data_[i] != 0) return 1; - } return 0; } @@ -398,7 +390,7 @@ public: return *this; } - base_uint + base_uint const operator++(int) { // postfix operator @@ -423,7 +415,7 @@ public: return *this; } - base_uint + base_uint const operator--(int) { // postfix operator @@ -452,7 +444,7 @@ public: { std::uint64_t carry = 0; - for (int i = WIDTH - 1; i >= 0; i--) + for (int i = WIDTH; i--;) { std::uint64_t const n = carry + boost::endian::big_to_native(data_[i]) + boost::endian::big_to_native(b.data_[i]); @@ -540,7 +532,7 @@ using uint256 = base_uint<256>; using uint192 = base_uint<192>; template -[[nodiscard]] constexpr std::strong_ordering +[[nodiscard]] inline constexpr std::strong_ordering operator<=>(base_uint const& lhs, base_uint const& rhs) { // This comparison might seem wrong on a casual inspection because it @@ -561,7 +553,7 @@ operator<=>(base_uint const& lhs, base_uint const& rhs) } template -[[nodiscard]] constexpr bool +[[nodiscard]] inline constexpr bool operator==(base_uint const& lhs, base_uint const& rhs) { return (lhs <=> rhs) == 0; @@ -569,7 +561,7 @@ operator==(base_uint const& lhs, base_uint const& rhs) //------------------------------------------------------------------------------ template -constexpr bool +inline constexpr bool operator==(base_uint const& a, std::uint64_t b) { return a == base_uint(b); @@ -577,28 +569,28 @@ operator==(base_uint const& a, std::uint64_t b) //------------------------------------------------------------------------------ template -constexpr base_uint +inline constexpr base_uint operator^(base_uint const& a, base_uint const& b) { return base_uint(a) ^= b; } template -constexpr base_uint +inline constexpr base_uint operator&(base_uint const& a, base_uint const& b) { return base_uint(a) &= b; } template -constexpr base_uint +inline constexpr base_uint operator|(base_uint const& a, base_uint const& b) { return base_uint(a) |= b; } template -constexpr base_uint +inline constexpr base_uint operator+(base_uint const& a, base_uint const& b) { return base_uint(a) += b; diff --git a/include/xrpl/basics/contract.h b/include/xrpl/basics/contract.h index 0d9f567416..e2d6dafe55 100644 --- a/include/xrpl/basics/contract.h +++ b/include/xrpl/basics/contract.h @@ -49,7 +49,8 @@ template Throw(Args&&... args) { static_assert( - std::is_convertible_v, "Exception must derive from std::exception."); + std::is_convertible::value, + "Exception must derive from std::exception."); E e(std::forward(args)...); LogThrow(std::string("Throwing exception of type " + beast::type_name() + ": ") + e.what()); diff --git a/include/xrpl/basics/partitioned_unordered_map.h b/include/xrpl/basics/partitioned_unordered_map.h index 8af9341315..f9e55d71a6 100644 --- a/include/xrpl/basics/partitioned_unordered_map.h +++ b/include/xrpl/basics/partitioned_unordered_map.h @@ -231,8 +231,7 @@ public: { // Set partitions to the number of hardware threads if the parameter // is either empty or set to 0. - partitions_ = - partitions && (*partitions != 0u) ? *partitions : std::thread::hardware_concurrency(); + partitions_ = partitions && *partitions ? *partitions : std::thread::hardware_concurrency(); map_.resize(partitions_); XRPL_ASSERT( partitions_, diff --git a/include/xrpl/basics/random.h b/include/xrpl/basics/random.h index adf579442e..6a09d8161b 100644 --- a/include/xrpl/basics/random.h +++ b/include/xrpl/basics/random.h @@ -15,8 +15,8 @@ namespace xrpl { #ifndef __INTELLISENSE__ static_assert( // NOLINTNEXTLINE(misc-redundant-expression) - std::is_integral_v && - std::is_unsigned_v, + std::is_integral::value && + std::is_unsigned::value, "The XRPL default PRNG engine must return an unsigned integral type."); static_assert( @@ -91,7 +91,7 @@ default_prng() */ /** @{ */ template -std::enable_if_t && detail::is_engine::value, Integral> +std::enable_if_t::value && detail::is_engine::value, Integral> rand_int(Engine& engine, Integral min, Integral max) { XRPL_ASSERT(max > min, "xrpl::rand_int : max over min inputs"); @@ -103,35 +103,35 @@ rand_int(Engine& engine, Integral min, Integral max) } template -std::enable_if_t, Integral> +std::enable_if_t::value, Integral> rand_int(Integral min, Integral max) { return rand_int(default_prng(), min, max); } template -std::enable_if_t && detail::is_engine::value, Integral> +std::enable_if_t::value && detail::is_engine::value, Integral> rand_int(Engine& engine, Integral max) { return rand_int(engine, Integral(0), max); } template -std::enable_if_t, Integral> +std::enable_if_t::value, Integral> rand_int(Integral max) { return rand_int(default_prng(), max); } template -std::enable_if_t && detail::is_engine::value, Integral> +std::enable_if_t::value && detail::is_engine::value, Integral> rand_int(Engine& engine) { return rand_int(engine, std::numeric_limits::max()); } template -std::enable_if_t, Integral> +std::enable_if_t::value, Integral> rand_int() { return rand_int(default_prng(), std::numeric_limits::max()); @@ -142,7 +142,7 @@ rand_int() /** @{ */ template std::enable_if_t< - (std::is_same_v || std::is_same_v) && + (std::is_same::value || std::is_same::value) && detail::is_engine::value, Byte> rand_byte(Engine& engine) @@ -152,7 +152,9 @@ rand_byte(Engine& engine) } template -std::enable_if_t<(std::is_same_v || std::is_same_v), Byte> +std::enable_if_t< + (std::is_same::value || std::is_same::value), + Byte> rand_byte() { return rand_byte(default_prng()); diff --git a/include/xrpl/basics/safe_cast.h b/include/xrpl/basics/safe_cast.h index c167e660ce..1e33b9663a 100644 --- a/include/xrpl/basics/safe_cast.h +++ b/include/xrpl/basics/safe_cast.h @@ -12,12 +12,12 @@ namespace xrpl { template concept SafeToCast = (std::is_integral_v && std::is_integral_v) && - (std::is_signed_v || std::is_unsigned_v) && - (std::is_signed_v != std::is_signed_v ? sizeof(Dest) > sizeof(Src) - : sizeof(Dest) >= sizeof(Src)); + (std::is_signed::value || std::is_unsigned::value) && + (std::is_signed::value != std::is_signed::value ? sizeof(Dest) > sizeof(Src) + : sizeof(Dest) >= sizeof(Src)); template -constexpr std::enable_if_t && std::is_integral_v, Dest> +inline constexpr std::enable_if_t && std::is_integral_v, Dest> safe_cast(Src s) noexcept { static_assert( @@ -30,14 +30,14 @@ safe_cast(Src s) noexcept } template -constexpr std::enable_if_t && std::is_integral_v, Dest> +inline constexpr std::enable_if_t && std::is_integral_v, Dest> safe_cast(Src s) noexcept { return static_cast(safe_cast>(s)); } template -constexpr std::enable_if_t && std::is_enum_v, Dest> +inline constexpr std::enable_if_t && std::is_enum_v, Dest> safe_cast(Src s) noexcept { return safe_cast(static_cast>(s)); @@ -48,7 +48,7 @@ safe_cast(Src s) noexcept // underlying types become safe, it can be converted to a safe_cast. template -constexpr std::enable_if_t && std::is_integral_v, Dest> +inline constexpr std::enable_if_t && std::is_integral_v, Dest> unsafe_cast(Src s) noexcept { static_assert( @@ -59,14 +59,14 @@ unsafe_cast(Src s) noexcept } template -constexpr std::enable_if_t && std::is_integral_v, Dest> +inline constexpr std::enable_if_t && std::is_integral_v, Dest> unsafe_cast(Src s) noexcept { return static_cast(unsafe_cast>(s)); } template -constexpr std::enable_if_t && std::is_enum_v, Dest> +inline constexpr std::enable_if_t && std::is_enum_v, Dest> unsafe_cast(Src s) noexcept { return unsafe_cast(static_cast>(s)); diff --git a/include/xrpl/basics/strHex.h b/include/xrpl/basics/strHex.h index 9cae234f06..cc07bf5b9d 100644 --- a/include/xrpl/basics/strHex.h +++ b/include/xrpl/basics/strHex.h @@ -10,9 +10,9 @@ std::string strHex(FwdIt begin, FwdIt end) { static_assert( - std::is_convertible_v< + std::is_convertible< typename std::iterator_traits::iterator_category, - std::forward_iterator_tag>, + std::forward_iterator_tag>::value, "FwdIt must be a forward iterator"); std::string result; result.reserve(2 * std::distance(begin, end)); diff --git a/include/xrpl/basics/tagged_integer.h b/include/xrpl/basics/tagged_integer.h index 129c586126..18d6a707a0 100644 --- a/include/xrpl/basics/tagged_integer.h +++ b/include/xrpl/basics/tagged_integer.h @@ -44,7 +44,8 @@ public: template < class OtherInt, - class = std::enable_if_t && sizeof(OtherInt) <= sizeof(Int)>> + class = typename std::enable_if< + std::is_integral::value && sizeof(OtherInt) <= sizeof(Int)>::type> explicit constexpr tagged_integer(OtherInt value) noexcept : m_value(value) { static_assert(sizeof(tagged_integer) == sizeof(Int), "tagged_integer is adding padding"); diff --git a/include/xrpl/beast/asio/io_latency_probe.h b/include/xrpl/beast/asio/io_latency_probe.h index 9a8a63de4e..2dc1fcba15 100644 --- a/include/xrpl/beast/asio/io_latency_probe.h +++ b/include/xrpl/beast/asio/io_latency_probe.h @@ -184,7 +184,7 @@ private: void operator()() const { - if (m_probe == nullptr) + if (!m_probe) return; typename Clock::time_point const now(Clock::now()); typename Clock::duration const elapsed(now - m_start); @@ -202,7 +202,7 @@ private: // Calculate when we want to sample again, and // adjust for the expected latency. // - typename Clock::time_point const when(now + m_probe->m_period - (2 * elapsed)); + typename Clock::time_point const when(now + m_probe->m_period - 2 * elapsed); if (when <= now) { @@ -224,7 +224,7 @@ private: void operator()(boost::system::error_code const& ec) { - if (m_probe == nullptr) + if (!m_probe) return; typename Clock::time_point const now(Clock::now()); boost::asio::post( diff --git a/include/xrpl/beast/container/aged_container_utility.h b/include/xrpl/beast/container/aged_container_utility.h index 47aa8a5e66..cf6bae9990 100644 --- a/include/xrpl/beast/container/aged_container_utility.h +++ b/include/xrpl/beast/container/aged_container_utility.h @@ -9,7 +9,7 @@ namespace beast { /** Expire aged container items past the specified age. */ template -std::enable_if_t::value, std::size_t> +typename std::enable_if::value, std::size_t>::type expire(AgedContainer& c, std::chrono::duration const& age) { std::size_t n(0); diff --git a/include/xrpl/beast/container/detail/aged_associative_container.h b/include/xrpl/beast/container/detail/aged_associative_container.h index 5d3534004c..34e9560cbb 100644 --- a/include/xrpl/beast/container/detail/aged_associative_container.h +++ b/include/xrpl/beast/container/detail/aged_associative_container.h @@ -1,6 +1,7 @@ #pragma once -namespace beast::detail { +namespace beast { +namespace detail { // Extracts the key portion of value template @@ -25,8 +26,9 @@ struct aged_associative_container_extract_t Value const& operator()(Value const& value) const { - return value; // NOLINT(bugprone-return-const-ref-from-parameter) + return value; } }; -} // namespace beast::detail +} // namespace detail +} // namespace beast diff --git a/include/xrpl/beast/container/detail/aged_container_iterator.h b/include/xrpl/beast/container/detail/aged_container_iterator.h index 3f12a5610a..99aab2a9a9 100644 --- a/include/xrpl/beast/container/detail/aged_container_iterator.h +++ b/include/xrpl/beast/container/detail/aged_container_iterator.h @@ -2,7 +2,6 @@ #include #include -#include namespace beast { @@ -17,10 +16,10 @@ class aged_container_iterator { public: using iterator_category = typename std::iterator_traits::iterator_category; - using value_type = std::conditional_t< + using value_type = typename std::conditional< is_const, typename Iterator::value_type::stashed::value_type const, - typename Iterator::value_type::stashed::value_type>; + typename Iterator::value_type::stashed::value_type>::type; using difference_type = typename std::iterator_traits::difference_type; using pointer = value_type*; using reference = value_type&; @@ -33,9 +32,9 @@ public: template < bool other_is_const, class OtherIterator, - class = std::enable_if_t< - (!other_is_const || is_const) && - !static_cast(std::is_same_v)>> + class = typename std::enable_if< + (other_is_const == false || is_const == true) && + std::is_same::value == false>::type> explicit aged_container_iterator( aged_container_iterator const& other) : m_iter(other.m_iter) @@ -43,7 +42,9 @@ public: } // Disable constructing a const_iterator from a non-const_iterator. - template > + template < + bool other_is_const, + class = typename std::enable_if::type> aged_container_iterator(aged_container_iterator const& other) : m_iter(other.m_iter) { @@ -52,8 +53,8 @@ public: // Disable assigning a const_iterator to a non-const iterator template auto - operator=(aged_container_iterator const& other) - -> std::enable_if_t + operator=(aged_container_iterator const& other) -> typename std:: + enable_if::type { m_iter = other.m_iter; return *this; @@ -132,7 +133,7 @@ private: friend class aged_container_iterator; template - aged_container_iterator(OtherIterator iter) : m_iter(std::move(iter)) + aged_container_iterator(OtherIterator const& iter) : m_iter(iter) { } diff --git a/include/xrpl/beast/container/detail/aged_ordered_container.h b/include/xrpl/beast/container/detail/aged_ordered_container.h index b20639aec4..dad0d92e0b 100644 --- a/include/xrpl/beast/container/detail/aged_ordered_container.h +++ b/include/xrpl/beast/container/detail/aged_ordered_container.h @@ -57,7 +57,8 @@ template < class T, class Clock = std::chrono::steady_clock, class Compare = std::less, - class Allocator = std::allocator, Key>>> + class Allocator = + std::allocator, Key>::type>> class aged_ordered_container { public: @@ -66,7 +67,7 @@ public: using duration = typename clock_type::duration; using key_type = Key; using mapped_type = T; - using value_type = std::conditional_t, Key>; + using value_type = typename std::conditional, Key>::type; using size_type = std::size_t; using difference_type = std::ptrdiff_t; @@ -109,7 +110,8 @@ private: template < class... Args, - class = std::enable_if_t>> + class = + typename std::enable_if::value>::type> element(time_point const& when_, Args&&... args) : value(std::forward(args)...), when(when_) { @@ -133,7 +135,9 @@ private: return Compare::operator()(lhs.first, rhs.first); } - pair_value_compare() = default; + pair_value_compare() + { + } pair_value_compare(pair_value_compare const& other) : Compare(other) { @@ -196,7 +200,7 @@ private: using list_type = typename boost::intrusive:: make_list>::type; - using cont_type = std::conditional_t< + using cont_type = typename std::conditional< IsMulti, typename boost::intrusive::make_multiset< element, @@ -205,7 +209,7 @@ private: typename boost::intrusive::make_set< element, boost::intrusive::constant_time_size, - boost::intrusive::compare>::type>; + boost::intrusive::compare>::type>::type; using ElementAllocator = typename std::allocator_traits::template rebind_alloc; @@ -253,8 +257,7 @@ private: config_t(config_t&& other) : KeyValueCompare(std::move(other.key_compare())) - , beast::detail::empty_base_optimization(std::move( - static_cast&>(other))) + , beast::detail::empty_base_optimization(std::move(other)) , clock(other.clock) { } @@ -370,7 +373,7 @@ private: public: using key_compare = Compare; - using value_compare = std::conditional_t; + using value_compare = typename std::conditional::type; using allocator_type = Allocator; using reference = value_type&; using const_reference = value_type const&; @@ -398,8 +401,6 @@ public: class chronological_t { - chronological_t() = default; - public: // A set iterator (IsMap==false) is always const // because the elements of a set are immutable. @@ -487,7 +488,7 @@ public: iterator iterator_to(value_type& value) { - static_assert(std::is_standard_layout_v, "must be standard layout"); + static_assert(std::is_standard_layout::value, "must be standard layout"); return list.iterator_to(*reinterpret_cast( reinterpret_cast(&value) - ((std::size_t)std::addressof(((element*)0)->member)))); @@ -496,16 +497,20 @@ public: const_iterator iterator_to(value_type const& value) const { - static_assert(std::is_standard_layout_v, "must be standard layout"); + static_assert(std::is_standard_layout::value, "must be standard layout"); return list.iterator_to(*reinterpret_cast( reinterpret_cast(&value) - ((std::size_t)std::addressof(((element*)0)->member)))); } + private: + chronological_t() + { + } + chronological_t(chronological_t const&) = delete; chronological_t(chronological_t&&) = delete; - private: friend class aged_ordered_container; list_type mutable list; } chronological; @@ -611,30 +616,30 @@ public: class K, bool maybe_multi = IsMulti, bool maybe_map = IsMap, - class = std::enable_if_t> - std::conditional_t& + class = typename std::enable_if::type> + typename std::conditional::type& at(K const& k); template < class K, bool maybe_multi = IsMulti, bool maybe_map = IsMap, - class = std::enable_if_t> + class = typename std::enable_if::type> typename std::conditional::type const& at(K const& k) const; template < bool maybe_multi = IsMulti, bool maybe_map = IsMap, - class = std::enable_if_t> - std::conditional_t& + class = typename std::enable_if::type> + typename std::conditional::type& operator[](Key const& key); template < bool maybe_multi = IsMulti, bool maybe_map = IsMap, - class = std::enable_if_t> - std::conditional_t& + class = typename std::enable_if::type> + typename std::conditional::type& operator[](Key&& key); //-------------------------------------------------------------------------- @@ -718,7 +723,7 @@ public: iterator iterator_to(value_type& value) { - static_assert(std::is_standard_layout_v, "must be standard layout"); + static_assert(std::is_standard_layout::value, "must be standard layout"); return m_cont.iterator_to(*reinterpret_cast( reinterpret_cast(&value) - ((std::size_t)std::addressof(((element*)0)->member)))); @@ -727,7 +732,7 @@ public: const_iterator iterator_to(value_type const& value) const { - static_assert(std::is_standard_layout_v, "must be standard layout"); + static_assert(std::is_standard_layout::value, "must be standard layout"); return m_cont.iterator_to(*reinterpret_cast( reinterpret_cast(&value) - ((std::size_t)std::addressof(((element*)0)->member)))); @@ -769,35 +774,37 @@ public: // map, set template auto - insert(value_type const& value) -> std::enable_if_t>; + insert(value_type const& value) -> + typename std::enable_if>::type; // multimap, multiset template auto - insert(value_type const& value) -> std::enable_if_t; + insert(value_type const& value) -> typename std::enable_if::type; // set template auto - insert(value_type&& value) - -> std::enable_if_t>; + insert(value_type&& value) -> + typename std::enable_if>::type; // multiset template auto - insert(value_type&& value) -> std::enable_if_t; + insert(value_type&& value) -> + typename std::enable_if::type; //--- // map, set template auto - insert(const_iterator hint, value_type const& value) - -> std::enable_if_t; + insert(const_iterator hint, value_type const& value) -> + typename std::enable_if::type; // multimap, multiset template - std::enable_if_t + typename std::enable_if::type insert(const_iterator /*hint*/, value_type const& value) { // VFALCO TODO Figure out how to utilize 'hint' @@ -807,11 +814,12 @@ public: // map, set template auto - insert(const_iterator hint, value_type&& value) -> std::enable_if_t; + insert(const_iterator hint, value_type&& value) -> + typename std::enable_if::type; // multimap, multiset template - std::enable_if_t + typename std::enable_if::type insert(const_iterator /*hint*/, value_type&& value) { // VFALCO TODO Figure out how to utilize 'hint' @@ -820,9 +828,9 @@ public: // map, multimap template - std::enable_if_t< - maybe_map && std::is_constructible_v, - std::conditional_t>> + typename std::enable_if< + maybe_map && std::is_constructible::value, + typename std::conditional>::type>::type insert(P&& value) { return emplace(std::forward

(value)); @@ -830,9 +838,9 @@ public: // map, multimap template - std::enable_if_t< - maybe_map && std::is_constructible_v, - std::conditional_t>> + typename std::enable_if< + maybe_map && std::is_constructible::value, + typename std::conditional>::type>::type insert(const_iterator hint, P&& value) { return emplace_hint(hint, std::forward

(value)); @@ -855,22 +863,23 @@ public: // map, set template auto - emplace(Args&&... args) -> std::enable_if_t>; + emplace(Args&&... args) -> + typename std::enable_if>::type; // multiset, multimap template auto - emplace(Args&&... args) -> std::enable_if_t; + emplace(Args&&... args) -> typename std::enable_if::type; // map, set template auto - emplace_hint(const_iterator hint, Args&&... args) - -> std::enable_if_t>; + emplace_hint(const_iterator hint, Args&&... args) -> + typename std::enable_if>::type; // multiset, multimap template - std::enable_if_t + typename std::enable_if::type emplace_hint(const_iterator /*hint*/, Args&&... args) { // VFALCO TODO Figure out how to utilize 'hint' @@ -1154,12 +1163,12 @@ private: template < bool maybe_propagate = std::allocator_traits::propagate_on_container_swap::value> - std::enable_if_t + typename std::enable_if::type swap_data(aged_ordered_container& other) noexcept; template < bool maybe_propagate = std::allocator_traits::propagate_on_container_swap::value> - std::enable_if_t + typename std::enable_if::type swap_data(aged_ordered_container& other) noexcept; private: @@ -1386,7 +1395,7 @@ aged_ordered_container::opera template template -std::conditional_t& +typename std::conditional::type& aged_ordered_container::at(K const& k) { auto const iter(m_cont.find(k, std::cref(m_config.key_compare()))); @@ -1408,7 +1417,7 @@ aged_ordered_container::at(K template template -std::conditional_t& +typename std::conditional::type& aged_ordered_container::operator[]( Key const& key) { @@ -1427,7 +1436,7 @@ aged_ordered_container::opera template template -std::conditional_t& +typename std::conditional::type& aged_ordered_container::operator[](Key&& key) { typename cont_type::insert_commit_data d; @@ -1462,7 +1471,8 @@ template auto aged_ordered_container::insert( - value_type const& value) -> std::enable_if_t> + value_type const& value) -> + typename std::enable_if>::type { typename cont_type::insert_commit_data d; auto const result(m_cont.insert_check(extract(value), std::cref(m_config.key_compare()), d)); @@ -1481,7 +1491,7 @@ template auto aged_ordered_container::insert( - value_type const& value) -> std::enable_if_t + value_type const& value) -> typename std::enable_if::type { auto const before(m_cont.upper_bound(extract(value), std::cref(m_config.key_compare()))); element* const p(new_element(value)); @@ -1495,7 +1505,8 @@ template auto aged_ordered_container::insert( - value_type&& value) -> std::enable_if_t> + value_type&& value) -> + typename std::enable_if>::type { typename cont_type::insert_commit_data d; auto const result(m_cont.insert_check(extract(value), std::cref(m_config.key_compare()), d)); @@ -1514,7 +1525,7 @@ template auto aged_ordered_container::insert( - value_type&& value) -> std::enable_if_t + value_type&& value) -> typename std::enable_if::type { auto const before(m_cont.upper_bound(extract(value), std::cref(m_config.key_compare()))); element* const p(new_element(std::move(value))); @@ -1531,7 +1542,7 @@ template auto aged_ordered_container::insert( const_iterator hint, - value_type const& value) -> std::enable_if_t + value_type const& value) -> typename std::enable_if::type { typename cont_type::insert_commit_data d; auto const result( @@ -1552,7 +1563,7 @@ template auto aged_ordered_container::insert( const_iterator hint, - value_type&& value) -> std::enable_if_t + value_type&& value) -> typename std::enable_if::type { typename cont_type::insert_commit_data d; auto const result( @@ -1572,7 +1583,7 @@ template auto aged_ordered_container::emplace(Args&&... args) - -> std::enable_if_t> + -> typename std::enable_if>::type { // VFALCO NOTE Its unfortunate that we need to // construct element here @@ -1594,7 +1605,7 @@ template auto aged_ordered_container::emplace(Args&&... args) - -> std::enable_if_t + -> typename std::enable_if::type { element* const p(new_element(std::forward(args)...)); auto const before(m_cont.upper_bound(extract(p->value), std::cref(m_config.key_compare()))); @@ -1609,7 +1620,7 @@ template auto aged_ordered_container::emplace_hint( const_iterator hint, - Args&&... args) -> std::enable_if_t> + Args&&... args) -> typename std::enable_if>::type { // VFALCO NOTE Its unfortunate that we need to // construct element here @@ -1759,7 +1770,7 @@ aged_ordered_container::touch template template -std::enable_if_t +typename std::enable_if::type aged_ordered_container::swap_data( aged_ordered_container& other) noexcept { @@ -1770,7 +1781,7 @@ aged_ordered_container::swap_ template template -std::enable_if_t +typename std::enable_if::type aged_ordered_container::swap_data( aged_ordered_container& other) noexcept { diff --git a/include/xrpl/beast/container/detail/aged_unordered_container.h b/include/xrpl/beast/container/detail/aged_unordered_container.h index 15565bbada..dfc853f019 100644 --- a/include/xrpl/beast/container/detail/aged_unordered_container.h +++ b/include/xrpl/beast/container/detail/aged_unordered_container.h @@ -62,7 +62,8 @@ template < class Clock = std::chrono::steady_clock, class Hash = std::hash, class KeyEqual = std::equal_to, - class Allocator = std::allocator, Key>>> + class Allocator = + std::allocator, Key>::type>> class aged_unordered_container { public: @@ -71,7 +72,7 @@ public: using duration = typename clock_type::duration; using key_type = Key; using mapped_type = T; - using value_type = std::conditional_t, Key>; + using value_type = typename std::conditional, Key>::type; using size_type = std::size_t; using difference_type = std::ptrdiff_t; @@ -114,7 +115,8 @@ private: template < class... Args, - class = std::enable_if_t>> + class = + typename std::enable_if::value>::type> element(time_point const& when_, Args&&... args) : value(std::forward(args)...), when(when_) { @@ -131,7 +133,9 @@ private: using argument_type = element; using result_type = size_t; - ValueHash() = default; + ValueHash() + { + } ValueHash(Hash const& h) : Hash(h) { @@ -165,7 +169,9 @@ private: using second_argument_type = element; using result_type = bool; - KeyValueEqual() = default; + KeyValueEqual() + { + } KeyValueEqual(KeyEqual const& keyEqual) : KeyEqual(keyEqual) { @@ -205,7 +211,7 @@ private: using list_type = typename boost::intrusive:: make_list>::type; - using cont_type = std::conditional_t< + using cont_type = typename std::conditional< IsMulti, typename boost::intrusive::make_unordered_multiset< element, @@ -218,7 +224,7 @@ private: boost::intrusive::constant_time_size, boost::intrusive::hash, boost::intrusive::equal, - boost::intrusive::cache_begin>::type>; + boost::intrusive::cache_begin>::type>::type; using bucket_type = typename cont_type::bucket_type; using bucket_traits = typename cont_type::bucket_traits; @@ -656,7 +662,7 @@ public: iterator iterator_to(value_type& value) { - static_assert(std::is_standard_layout_v, "must be standard layout"); + static_assert(std::is_standard_layout::value, "must be standard layout"); return list.iterator_to(*reinterpret_cast( reinterpret_cast(&value) - ((std::size_t)std::addressof(((element*)0)->member)))); @@ -665,17 +671,20 @@ public: const_iterator iterator_to(value_type const& value) const { - static_assert(std::is_standard_layout_v, "must be standard layout"); + static_assert(std::is_standard_layout::value, "must be standard layout"); return list.iterator_to(*reinterpret_cast( reinterpret_cast(&value) - ((std::size_t)std::addressof(((element*)0)->member)))); } + private: + chronological_t() + { + } + chronological_t(chronological_t const&) = delete; chronological_t(chronological_t&&) = delete; - chronological_t() = default; - private: friend class aged_unordered_container; list_type mutable list; } chronological; @@ -853,30 +862,30 @@ public: class K, bool maybe_multi = IsMulti, bool maybe_map = IsMap, - class = std::enable_if_t> - std::conditional_t& + class = typename std::enable_if::type> + typename std::conditional::type& at(K const& k); template < class K, bool maybe_multi = IsMulti, bool maybe_map = IsMap, - class = std::enable_if_t> + class = typename std::enable_if::type> typename std::conditional::type const& at(K const& k) const; template < bool maybe_multi = IsMulti, bool maybe_map = IsMap, - class = std::enable_if_t> - std::conditional_t& + class = typename std::enable_if::type> + typename std::conditional::type& operator[](Key const& key); template < bool maybe_multi = IsMulti, bool maybe_map = IsMap, - class = std::enable_if_t> - std::conditional_t& + class = typename std::enable_if::type> + typename std::conditional::type& operator[](Key&& key); //-------------------------------------------------------------------------- @@ -924,7 +933,7 @@ public: iterator iterator_to(value_type& value) { - static_assert(std::is_standard_layout_v, "must be standard layout"); + static_assert(std::is_standard_layout::value, "must be standard layout"); return m_cont.iterator_to(*reinterpret_cast( reinterpret_cast(&value) - ((std::size_t)std::addressof(((element*)0)->member)))); @@ -933,7 +942,7 @@ public: const_iterator iterator_to(value_type const& value) const { - static_assert(std::is_standard_layout_v, "must be standard layout"); + static_assert(std::is_standard_layout::value, "must be standard layout"); return m_cont.iterator_to(*reinterpret_cast( reinterpret_cast(&value) - ((std::size_t)std::addressof(((element*)0)->member)))); @@ -975,27 +984,29 @@ public: // map, set template auto - insert(value_type const& value) -> std::enable_if_t>; + insert(value_type const& value) -> + typename std::enable_if>::type; // multimap, multiset template auto - insert(value_type const& value) -> std::enable_if_t; + insert(value_type const& value) -> typename std::enable_if::type; // map, set template auto - insert(value_type&& value) - -> std::enable_if_t>; + insert(value_type&& value) -> + typename std::enable_if>::type; // multimap, multiset template auto - insert(value_type&& value) -> std::enable_if_t; + insert(value_type&& value) -> + typename std::enable_if::type; // map, set template - std::enable_if_t + typename std::enable_if::type insert(const_iterator /*hint*/, value_type const& value) { // Hint is ignored but we provide the interface so @@ -1005,7 +1016,7 @@ public: // multimap, multiset template - std::enable_if_t + typename std::enable_if::type insert(const_iterator /*hint*/, value_type const& value) { // VFALCO TODO The hint could be used to let @@ -1015,7 +1026,7 @@ public: // map, set template - std::enable_if_t + typename std::enable_if::type insert(const_iterator /*hint*/, value_type&& value) { // Hint is ignored but we provide the interface so @@ -1025,7 +1036,7 @@ public: // multimap, multiset template - std::enable_if_t + typename std::enable_if::type insert(const_iterator /*hint*/, value_type&& value) { // VFALCO TODO The hint could be used to let @@ -1035,9 +1046,9 @@ public: // map, multimap template - std::enable_if_t< - maybe_map && std::is_constructible_v, - std::conditional_t>> + typename std::enable_if< + maybe_map && std::is_constructible::value, + typename std::conditional>::type>::type insert(P&& value) { return emplace(std::forward

(value)); @@ -1045,9 +1056,9 @@ public: // map, multimap template - std::enable_if_t< - maybe_map && std::is_constructible_v, - std::conditional_t>> + typename std::enable_if< + maybe_map && std::is_constructible::value, + typename std::conditional>::type>::type insert(const_iterator hint, P&& value) { return emplace_hint(hint, std::forward

(value)); @@ -1069,22 +1080,23 @@ public: // set, map template auto - emplace(Args&&... args) -> std::enable_if_t>; + emplace(Args&&... args) -> + typename std::enable_if>::type; // multiset, multimap template auto - emplace(Args&&... args) -> std::enable_if_t; + emplace(Args&&... args) -> typename std::enable_if::type; // set, map template auto - emplace_hint(const_iterator /*hint*/, Args&&... args) - -> std::enable_if_t>; + emplace_hint(const_iterator /*hint*/, Args&&... args) -> + typename std::enable_if>::type; // multiset, multimap template - std::enable_if_t + typename std::enable_if::type emplace_hint(const_iterator /*hint*/, Args&&... args) { // VFALCO TODO The hint could be used for multi, to let @@ -1316,7 +1328,7 @@ public: class OtherHash, class OtherAllocator, bool maybe_multi = IsMulti> - std::enable_if_t + typename std::enable_if::type operator==(aged_unordered_container< false, OtherIsMap, @@ -1335,7 +1347,7 @@ public: class OtherHash, class OtherAllocator, bool maybe_multi = IsMulti> - std::enable_if_t + typename std::enable_if::type operator==(aged_unordered_container< true, OtherIsMap, @@ -1389,13 +1401,14 @@ private: // map, set template auto - insert_unchecked(value_type const& value) - -> std::enable_if_t>; + insert_unchecked(value_type const& value) -> + typename std::enable_if>::type; // multimap, multiset template auto - insert_unchecked(value_type const& value) -> std::enable_if_t; + insert_unchecked(value_type const& value) -> + typename std::enable_if::type; template void @@ -1436,7 +1449,7 @@ private: template < bool maybe_propagate = std::allocator_traits::propagate_on_container_swap::value> - std::enable_if_t + typename std::enable_if::type swap_data(aged_unordered_container& other) noexcept { std::swap(m_config.key_compare(), other.m_config.key_compare()); @@ -1446,7 +1459,7 @@ private: template < bool maybe_propagate = std::allocator_traits::propagate_on_container_swap::value> - std::enable_if_t + typename std::enable_if::type swap_data(aged_unordered_container& other) noexcept { std::swap(m_config.key_compare(), other.m_config.key_compare()); @@ -2101,7 +2114,7 @@ template < class KeyEqual, class Allocator> template -std::conditional_t& +typename std::conditional::type& aged_unordered_container::at(K const& k) { auto const iter( @@ -2142,7 +2155,7 @@ template < class KeyEqual, class Allocator> template -std::conditional_t& +typename std::conditional::type& aged_unordered_container::operator[]( Key const& key) { @@ -2171,7 +2184,7 @@ template < class KeyEqual, class Allocator> template -std::conditional_t& +typename std::conditional::type& aged_unordered_container::operator[]( Key&& key) { @@ -2226,7 +2239,8 @@ template < template auto aged_unordered_container::insert( - value_type const& value) -> std::enable_if_t> + value_type const& value) -> + typename std::enable_if>::type { maybe_rehash(1); typename cont_type::insert_commit_data d; @@ -2258,7 +2272,7 @@ template < template auto aged_unordered_container::insert( - value_type const& value) -> std::enable_if_t + value_type const& value) -> typename std::enable_if::type { maybe_rehash(1); element* const p(new_element(value)); @@ -2280,7 +2294,8 @@ template < template auto aged_unordered_container::insert( - value_type&& value) -> std::enable_if_t> + value_type&& value) -> + typename std::enable_if>::type { maybe_rehash(1); typename cont_type::insert_commit_data d; @@ -2312,7 +2327,7 @@ template < template auto aged_unordered_container::insert( - value_type&& value) -> std::enable_if_t + value_type&& value) -> typename std::enable_if::type { maybe_rehash(1); element* const p(new_element(std::move(value))); @@ -2335,7 +2350,7 @@ template < template auto aged_unordered_container::emplace( - Args&&... args) -> std::enable_if_t> + Args&&... args) -> typename std::enable_if>::type { maybe_rehash(1); // VFALCO NOTE Its unfortunate that we need to @@ -2400,7 +2415,7 @@ template < template auto aged_unordered_container::emplace( - Args&&... args) -> std::enable_if_t + Args&&... args) -> typename std::enable_if::type { maybe_rehash(1); element* const p(new_element(std::forward(args)...)); @@ -2423,7 +2438,7 @@ template auto aged_unordered_container::emplace_hint( const_iterator /*hint*/, - Args&&... args) -> std::enable_if_t> + Args&&... args) -> typename std::enable_if>::type { maybe_rehash(1); // VFALCO NOTE Its unfortunate that we need to @@ -2575,7 +2590,7 @@ template < class OtherHash, class OtherAllocator, bool maybe_multi> -std::enable_if_t +typename std::enable_if::type aged_unordered_container::operator==( aged_unordered_container< false, @@ -2615,7 +2630,7 @@ template < class OtherHash, class OtherAllocator, bool maybe_multi> -std::enable_if_t +typename std::enable_if::type aged_unordered_container::operator==( aged_unordered_container< true, @@ -2662,8 +2677,8 @@ template < template auto aged_unordered_container:: - insert_unchecked(value_type const& value) - -> std::enable_if_t> + insert_unchecked(value_type const& value) -> + typename std::enable_if>::type { typename cont_type::insert_commit_data d; auto const result(m_cont.insert_check( @@ -2694,7 +2709,8 @@ template < template auto aged_unordered_container:: - insert_unchecked(value_type const& value) -> std::enable_if_t + insert_unchecked(value_type const& value) -> + typename std::enable_if::type { element* const p(new_element(value)); chronological.list.push_back(*p); diff --git a/include/xrpl/beast/container/detail/empty_base_optimization.h b/include/xrpl/beast/container/detail/empty_base_optimization.h index 337f3cf434..21a9d13ce8 100644 --- a/include/xrpl/beast/container/detail/empty_base_optimization.h +++ b/include/xrpl/beast/container/detail/empty_base_optimization.h @@ -11,11 +11,12 @@ #include #include -namespace beast::detail { +namespace beast { +namespace detail { template struct is_empty_base_optimization_derived - : std::integral_constant && !boost::is_final::value> + : std::integral_constant::value && !boost::is_final::value> { }; @@ -85,4 +86,5 @@ public: } }; -} // namespace beast::detail +} // namespace detail +} // namespace beast diff --git a/include/xrpl/beast/core/List.h b/include/xrpl/beast/core/List.h index ab88eae738..560467c8dd 100644 --- a/include/xrpl/beast/core/List.h +++ b/include/xrpl/beast/core/List.h @@ -16,7 +16,7 @@ struct CopyConst { explicit CopyConst() = default; - using type = std::remove_const_t; + using type = typename std::remove_const::type; }; template @@ -35,11 +35,9 @@ struct CopyConst template class ListNode { - ListNode() = default; - +private: using value_type = T; - friend T; friend class List; template diff --git a/include/xrpl/beast/core/LockFreeStack.h b/include/xrpl/beast/core/LockFreeStack.h index b1e911a7c5..cf512725fe 100644 --- a/include/xrpl/beast/core/LockFreeStack.h +++ b/include/xrpl/beast/core/LockFreeStack.h @@ -13,16 +13,18 @@ class LockFreeStackIterator { protected: using Node = typename Container::Node; - using NodePtr = std::conditional_t; + using NodePtr = typename std::conditional::type; public: using iterator_category = std::forward_iterator_tag; using value_type = typename Container::value_type; using difference_type = typename Container::difference_type; - using pointer = - std::conditional_t; - using reference = std:: - conditional_t; + using pointer = typename std:: + conditional::type; + using reference = typename std::conditional< + IsConst, + typename Container::const_reference, + typename Container::reference>::type; LockFreeStackIterator() : m_node() { diff --git a/include/xrpl/beast/core/SemanticVersion.h b/include/xrpl/beast/core/SemanticVersion.h index 244783234c..f839ef8c53 100644 --- a/include/xrpl/beast/core/SemanticVersion.h +++ b/include/xrpl/beast/core/SemanticVersion.h @@ -40,12 +40,12 @@ public: std::string print() const; - bool + inline bool isRelease() const noexcept { return preReleaseIdentifiers.empty(); } - bool + inline bool isPreRelease() const noexcept { return !isRelease(); diff --git a/include/xrpl/beast/hash/hash_append.h b/include/xrpl/beast/hash/hash_append.h index 3161ab3ce2..d456bb3a73 100644 --- a/include/xrpl/beast/hash/hash_append.h +++ b/include/xrpl/beast/hash/hash_append.h @@ -69,7 +69,7 @@ template struct is_uniquely_represented : public std::integral_constant< bool, - std::is_integral_v || std::is_enum_v || std::is_pointer_v> + std::is_integral::value || std::is_enum::value || std::is_pointer::value> { explicit is_uniquely_represented() = default; }; @@ -203,14 +203,13 @@ template inline std::enable_if_t::value> hash_append(Hasher& h, T const& t) noexcept { - // NOLINTNEXTLINE(bugprone-sizeof-expression) - h(static_cast(std::addressof(t)), sizeof(t)); + h(std::addressof(t), sizeof(t)); } template inline std::enable_if_t< !is_contiguously_hashable::value && - (std::is_integral_v || std::is_pointer_v || std::is_enum_v)> + (std::is_integral::value || std::is_pointer::value || std::is_enum::value)> hash_append(Hasher& h, T t) noexcept { detail::reverse_bytes(t); @@ -218,7 +217,7 @@ hash_append(Hasher& h, T t) noexcept } template -inline std::enable_if_t> +inline std::enable_if_t::value> hash_append(Hasher& h, T t) noexcept { if (t == 0) diff --git a/include/xrpl/beast/hash/xxhasher.h b/include/xrpl/beast/hash/xxhasher.h index 5cd060e465..7c6ae894fc 100644 --- a/include/xrpl/beast/hash/xxhasher.h +++ b/include/xrpl/beast/hash/xxhasher.h @@ -64,7 +64,7 @@ private: void flushToState(void const* data, std::size_t len) { - if (state_ == nullptr) + if (!state_) { state_ = allocState(); if (seed_.has_value()) @@ -78,7 +78,7 @@ private: } XXH3_64bits_update(state_, readBuffer_.data(), readBuffer_.size()); resetBuffers(); - if ((data != nullptr) && (len != 0u)) + if (data && len) { XXH3_64bits_update(state_, data, len); } @@ -87,18 +87,22 @@ private: result_type retrieveHash() { - if (state_ != nullptr) + if (state_) { flushToState(nullptr, 0); return XXH3_64bits_digest(state_); } - - if (seed_.has_value()) + else { - return XXH3_64bits_withSeed(readBuffer_.data(), readBuffer_.size(), *seed_); + if (seed_.has_value()) + { + return XXH3_64bits_withSeed(readBuffer_.data(), readBuffer_.size(), *seed_); + } + else + { + return XXH3_64bits(readBuffer_.data(), readBuffer_.size()); + } } - - return XXH3_64bits(readBuffer_.data(), readBuffer_.size()); } public: @@ -115,19 +119,19 @@ public: ~xxhasher() noexcept { - if (state_ != nullptr) + if (state_) { XXH3_freeState(state_); } } - template >* = nullptr> + template ::value>* = nullptr> explicit xxhasher(Seed seed) : seed_(seed) { resetBuffers(); } - template >* = nullptr> + template ::value>* = nullptr> xxhasher(Seed seed, Seed) : seed_(seed) { resetBuffers(); diff --git a/include/xrpl/beast/insight/Collector.h b/include/xrpl/beast/insight/Collector.h index 1d18c7e15c..89aa8c1cb5 100644 --- a/include/xrpl/beast/insight/Collector.h +++ b/include/xrpl/beast/insight/Collector.h @@ -8,7 +8,8 @@ #include -namespace beast::insight { +namespace beast { +namespace insight { /** Interface for a manager that allows collection of metrics. @@ -116,4 +117,5 @@ public: /** @} */ }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/Counter.h b/include/xrpl/beast/insight/Counter.h index c5b8178c2d..f6722c4e03 100644 --- a/include/xrpl/beast/insight/Counter.h +++ b/include/xrpl/beast/insight/Counter.h @@ -4,7 +4,8 @@ #include -namespace beast::insight { +namespace beast { +namespace insight { /** A metric for measuring an integral value. @@ -22,7 +23,9 @@ public: /** Create a null metric. A null metric reports no information. */ - Counter() = default; + Counter() + { + } /** Create the metric reference the specified implementation. Normally this won't be called directly. Instead, call the appropriate @@ -88,4 +91,5 @@ private: std::shared_ptr m_impl; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/CounterImpl.h b/include/xrpl/beast/insight/CounterImpl.h index 8b16681759..199315dcb8 100644 --- a/include/xrpl/beast/insight/CounterImpl.h +++ b/include/xrpl/beast/insight/CounterImpl.h @@ -3,7 +3,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { class Counter; @@ -17,4 +18,5 @@ public: increment(value_type amount) = 0; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/Event.h b/include/xrpl/beast/insight/Event.h index ada488f134..bc0c0dd403 100644 --- a/include/xrpl/beast/insight/Event.h +++ b/include/xrpl/beast/insight/Event.h @@ -5,7 +5,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { /** A metric for reporting event timing. @@ -24,7 +25,9 @@ public: /** Create a null metric. A null metric reports no information. */ - Event() = default; + Event() + { + } /** Create the metric reference the specified implementation. Normally this won't be called directly. Instead, call the appropriate @@ -55,4 +58,5 @@ private: std::shared_ptr m_impl; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/EventImpl.h b/include/xrpl/beast/insight/EventImpl.h index ede649d195..abd9741511 100644 --- a/include/xrpl/beast/insight/EventImpl.h +++ b/include/xrpl/beast/insight/EventImpl.h @@ -3,7 +3,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { class Event; @@ -17,4 +18,5 @@ public: notify(value_type const& value) = 0; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/Gauge.h b/include/xrpl/beast/insight/Gauge.h index b75060face..f2a88deda2 100644 --- a/include/xrpl/beast/insight/Gauge.h +++ b/include/xrpl/beast/insight/Gauge.h @@ -4,7 +4,8 @@ #include -namespace beast::insight { +namespace beast { +namespace insight { /** A metric for measuring an integral value. @@ -24,7 +25,9 @@ public: /** Create a null metric. A null metric reports no information. */ - Gauge() = default; + Gauge() + { + } /** Create the metric reference the specified implementation. Normally this won't be called directly. Instead, call the appropriate @@ -118,4 +121,5 @@ private: std::shared_ptr m_impl; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/GaugeImpl.h b/include/xrpl/beast/insight/GaugeImpl.h index 3b8afda5e7..29afbe6a4d 100644 --- a/include/xrpl/beast/insight/GaugeImpl.h +++ b/include/xrpl/beast/insight/GaugeImpl.h @@ -3,7 +3,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { class Gauge; @@ -20,4 +21,5 @@ public: increment(difference_type amount) = 0; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/Group.h b/include/xrpl/beast/insight/Group.h index 2b0d692f25..c85fd1bfb6 100644 --- a/include/xrpl/beast/insight/Group.h +++ b/include/xrpl/beast/insight/Group.h @@ -5,7 +5,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { /** A collector front-end that manages a group of metrics. */ class Group : public Collector @@ -18,4 +19,5 @@ public: name() const = 0; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/Groups.h b/include/xrpl/beast/insight/Groups.h index abc1aa004b..8ac93454d3 100644 --- a/include/xrpl/beast/insight/Groups.h +++ b/include/xrpl/beast/insight/Groups.h @@ -6,7 +6,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { /** A container for managing a set of metric groups. */ class Groups @@ -31,4 +32,5 @@ public: std::unique_ptr make_Groups(Collector::ptr const& collector); -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/Hook.h b/include/xrpl/beast/insight/Hook.h index d51a5d2300..ea511862d9 100644 --- a/include/xrpl/beast/insight/Hook.h +++ b/include/xrpl/beast/insight/Hook.h @@ -4,7 +4,8 @@ #include -namespace beast::insight { +namespace beast { +namespace insight { /** A reference to a handler for performing polled collection. */ class Hook final @@ -13,7 +14,9 @@ public: /** Create a null hook. A null hook has no associated handler. */ - Hook() = default; + Hook() + { + } /** Create a hook referencing the specified implementation. Normally this won't be called directly. Instead, call the appropriate @@ -34,4 +37,5 @@ private: std::shared_ptr m_impl; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/HookImpl.h b/include/xrpl/beast/insight/HookImpl.h index 9a503ba0d2..18208b554a 100644 --- a/include/xrpl/beast/insight/HookImpl.h +++ b/include/xrpl/beast/insight/HookImpl.h @@ -3,7 +3,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { class HookImpl : public std::enable_shared_from_this { @@ -13,4 +14,5 @@ public: virtual ~HookImpl() = 0; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/Meter.h b/include/xrpl/beast/insight/Meter.h index 7685a0ec90..193a1f1003 100644 --- a/include/xrpl/beast/insight/Meter.h +++ b/include/xrpl/beast/insight/Meter.h @@ -4,7 +4,8 @@ #include -namespace beast::insight { +namespace beast { +namespace insight { /** A metric for measuring an integral value. @@ -21,7 +22,9 @@ public: /** Create a null metric. A null metric reports no information. */ - Meter() = default; + Meter() + { + } /** Create the metric reference the specified implementation. Normally this won't be called directly. Instead, call the appropriate @@ -73,4 +76,5 @@ private: std::shared_ptr m_impl; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/MeterImpl.h b/include/xrpl/beast/insight/MeterImpl.h index 2220650131..22efdbe647 100644 --- a/include/xrpl/beast/insight/MeterImpl.h +++ b/include/xrpl/beast/insight/MeterImpl.h @@ -3,7 +3,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { class Meter; @@ -17,4 +18,5 @@ public: increment(value_type amount) = 0; }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/NullCollector.h b/include/xrpl/beast/insight/NullCollector.h index e6404c8f2c..1d16a11e17 100644 --- a/include/xrpl/beast/insight/NullCollector.h +++ b/include/xrpl/beast/insight/NullCollector.h @@ -2,7 +2,8 @@ #include -namespace beast::insight { +namespace beast { +namespace insight { /** A Collector which does not collect metrics. */ class NullCollector : public Collector @@ -14,4 +15,5 @@ public: New(); }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/insight/StatsDCollector.h b/include/xrpl/beast/insight/StatsDCollector.h index 161f351763..ab09967483 100644 --- a/include/xrpl/beast/insight/StatsDCollector.h +++ b/include/xrpl/beast/insight/StatsDCollector.h @@ -4,7 +4,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { /** A Collector that reports metrics to a StatsD server. Reference: @@ -24,4 +25,5 @@ public: New(IP::Endpoint const& address, std::string const& prefix, Journal journal); }; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/include/xrpl/beast/net/IPAddress.h b/include/xrpl/beast/net/IPAddress.h index 277a43e5d8..2ac4c3bc43 100644 --- a/include/xrpl/beast/net/IPAddress.h +++ b/include/xrpl/beast/net/IPAddress.h @@ -70,13 +70,9 @@ hash_append(Hasher& h, beast::IP::Address const& addr) noexcept { using beast::hash_append; if (addr.is_v4()) - { hash_append(h, addr.to_v4().to_bytes()); - } else if (addr.is_v6()) - { hash_append(h, addr.to_v6().to_bytes()); - } else { // LCOV_EXCL_START diff --git a/include/xrpl/beast/net/IPAddressConversion.h b/include/xrpl/beast/net/IPAddressConversion.h index 4e0328c113..2ebd0a6eef 100644 --- a/include/xrpl/beast/net/IPAddressConversion.h +++ b/include/xrpl/beast/net/IPAddressConversion.h @@ -4,7 +4,8 @@ #include -namespace beast::IP { +namespace beast { +namespace IP { /** Convert to Endpoint. The port is set to zero. @@ -26,7 +27,8 @@ to_asio_address(Endpoint const& endpoint); boost::asio::ip::tcp::endpoint to_asio_endpoint(Endpoint const& endpoint); -} // namespace beast::IP +} // namespace IP +} // namespace beast namespace beast { diff --git a/include/xrpl/beast/net/IPAddressV4.h b/include/xrpl/beast/net/IPAddressV4.h index 15bb959f49..0d586716d8 100644 --- a/include/xrpl/beast/net/IPAddressV4.h +++ b/include/xrpl/beast/net/IPAddressV4.h @@ -4,7 +4,8 @@ #include -namespace beast::IP { +namespace beast { +namespace IP { using AddressV4 = boost::asio::ip::address_v4; @@ -22,4 +23,5 @@ is_public(AddressV4 const& addr); char get_class(AddressV4 const& address); -} // namespace beast::IP +} // namespace IP +} // namespace beast diff --git a/include/xrpl/beast/net/IPAddressV6.h b/include/xrpl/beast/net/IPAddressV6.h index 83ac6d4dab..2f9dedb748 100644 --- a/include/xrpl/beast/net/IPAddressV6.h +++ b/include/xrpl/beast/net/IPAddressV6.h @@ -4,7 +4,8 @@ #include -namespace beast::IP { +namespace beast { +namespace IP { using AddressV6 = boost::asio::ip::address_v6; @@ -16,4 +17,5 @@ is_private(AddressV6 const& addr); bool is_public(AddressV6 const& addr); -} // namespace beast::IP +} // namespace IP +} // namespace beast diff --git a/include/xrpl/beast/net/IPEndpoint.h b/include/xrpl/beast/net/IPEndpoint.h index 88f3d7669b..7a0394cbd1 100644 --- a/include/xrpl/beast/net/IPEndpoint.h +++ b/include/xrpl/beast/net/IPEndpoint.h @@ -8,7 +8,8 @@ #include #include -namespace beast::IP { +namespace beast { +namespace IP { using Port = std::uint16_t; @@ -20,7 +21,7 @@ public: Endpoint(); /** Create an endpoint from the address and optional port. */ - explicit Endpoint(Address addr, Port port = 0); + explicit Endpoint(Address const& addr, Port port = 0); /** Create an Endpoint from a string. If the port is omitted, the endpoint will have a zero port. @@ -68,12 +69,12 @@ public: { return m_addr.is_v6(); } - AddressV4 + AddressV4 const to_v4() const { return m_addr.to_v4(); } - AddressV6 + AddressV6 const to_v6() const { return m_addr.to_v6(); @@ -183,7 +184,8 @@ operator<<(OutputStream& os, Endpoint const& endpoint) std::istream& operator>>(std::istream& is, Endpoint& endpoint); -} // namespace beast::IP +} // namespace IP +} // namespace beast //------------------------------------------------------------------------------ diff --git a/include/xrpl/beast/rfc2616.h b/include/xrpl/beast/rfc2616.h index 7278119c3b..b19c2c511a 100644 --- a/include/xrpl/beast/rfc2616.h +++ b/include/xrpl/beast/rfc2616.h @@ -12,7 +12,8 @@ #include #include -namespace beast::rfc2616 { +namespace beast { +namespace rfc2616 { namespace detail { @@ -52,9 +53,8 @@ is_white(char c) case '\t': case '\v': return true; - default: - return false; }; + return false; } template @@ -349,10 +349,8 @@ bool token_in_list(boost::string_ref const& value, boost::string_ref const& token) { for (auto const& item : make_list(value)) - { if (ci_equal(item, token)) return true; - } return false; } @@ -361,12 +359,11 @@ bool is_keep_alive(boost::beast::http::message const& m) { if (m.version() <= 10) - { return boost::beast::http::token_list{m[boost::beast::http::field::connection]}.exists( "keep-alive"); - } return !boost::beast::http::token_list{m[boost::beast::http::field::connection]}.exists( "close"); } -} // namespace beast::rfc2616 +} // namespace rfc2616 +} // namespace beast diff --git a/include/xrpl/beast/test/yield_to.h b/include/xrpl/beast/test/yield_to.h index e8db9e5864..918ca3c0cc 100644 --- a/include/xrpl/beast/test/yield_to.h +++ b/include/xrpl/beast/test/yield_to.h @@ -15,7 +15,8 @@ #include #include -namespace beast::test { +namespace beast { +namespace test { /** Mix-in to support tests using asio coroutines. @@ -43,7 +44,7 @@ public: : work_(boost::asio::make_work_guard(ios_)) { threads_.reserve(concurrency); - while ((concurrency--) != 0u) + while (concurrency--) threads_.emplace_back([&] { ios_.run(); }); } @@ -124,4 +125,5 @@ enable_yield_to::spawn(F0&& f, FN&&... fn) spawn(fn...); } -} // namespace beast::test +} // namespace test +} // namespace beast diff --git a/include/xrpl/beast/type_name.h b/include/xrpl/beast/type_name.h index d12f9c4b90..99b90d1757 100644 --- a/include/xrpl/beast/type_name.h +++ b/include/xrpl/beast/type_name.h @@ -15,7 +15,7 @@ template std::string type_name() { - using TR = std::remove_reference_t; + using TR = typename std::remove_reference::type; std::string name = typeid(TR).name(); @@ -27,18 +27,14 @@ type_name() } #endif - if (std::is_const_v) + if (std::is_const::value) name += " const"; - if (std::is_volatile_v) + if (std::is_volatile::value) name += " volatile"; - if (std::is_lvalue_reference_v) - { + if (std::is_lvalue_reference::value) name += "&"; - } - else if (std::is_rvalue_reference_v) - { + else if (std::is_rvalue_reference::value) name += "&&"; - } return name; } diff --git a/include/xrpl/beast/unit_test/amount.h b/include/xrpl/beast/unit_test/amount.h index ae1dd8fe31..aedced15a7 100644 --- a/include/xrpl/beast/unit_test/amount.h +++ b/include/xrpl/beast/unit_test/amount.h @@ -8,7 +8,8 @@ #include #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { /** Utility for producing nicely composed output of amounts with units. */ class amount @@ -41,4 +42,5 @@ operator<<(std::ostream& s, amount const& t) return s; } -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/detail/const_container.h b/include/xrpl/beast/unit_test/detail/const_container.h index 6a32c61b61..7c52e0e1ec 100644 --- a/include/xrpl/beast/unit_test/detail/const_container.h +++ b/include/xrpl/beast/unit_test/detail/const_container.h @@ -4,7 +4,9 @@ #pragma once -namespace beast::unit_test::detail { +namespace beast { +namespace unit_test { +namespace detail { /** Adapter to constrain a container interface. The interface allows for limited read only operations. Derived classes @@ -80,4 +82,6 @@ public: /** @} */ }; -} // namespace beast::unit_test::detail +} // namespace detail +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/global_suites.h b/include/xrpl/beast/unit_test/global_suites.h index ca33ddb11c..db5fee35dd 100644 --- a/include/xrpl/beast/unit_test/global_suites.h +++ b/include/xrpl/beast/unit_test/global_suites.h @@ -6,7 +6,8 @@ #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { namespace detail { @@ -41,4 +42,5 @@ global_suites() return detail::global_suites(); } -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/match.h b/include/xrpl/beast/unit_test/match.h index 084e2bc464..38816bb5c7 100644 --- a/include/xrpl/beast/unit_test/match.h +++ b/include/xrpl/beast/unit_test/match.h @@ -8,7 +8,8 @@ #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { // Predicate for implementing matches class selector @@ -162,4 +163,5 @@ match_library(std::string const& name) return selector(selector::library, name); } -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/recorder.h b/include/xrpl/beast/unit_test/recorder.h index f101d5318f..8f956fda88 100644 --- a/include/xrpl/beast/unit_test/recorder.h +++ b/include/xrpl/beast/unit_test/recorder.h @@ -7,7 +7,8 @@ #include #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { /** A test runner that stores the results. */ class recorder : public runner @@ -28,48 +29,49 @@ public: } private: - void + virtual void on_suite_begin(suite_info const& info) override { m_suite = suite_results(info.full_name()); } - void + virtual void on_suite_end() override { m_results.insert(std::move(m_suite)); } - void + virtual void on_case_begin(std::string const& name) override { m_case = case_results(name); } - void + virtual void on_case_end() override { - if (!m_case.tests.empty()) + if (m_case.tests.size() > 0) m_suite.insert(std::move(m_case)); } - void + virtual void on_pass() override { m_case.tests.pass(); } - void + virtual void on_fail(std::string const& reason) override { m_case.tests.fail(reason); } - void + virtual void on_log(std::string const& s) override { m_case.log.insert(s); } }; -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/reporter.h b/include/xrpl/beast/unit_test/reporter.h index 066d628ea2..63ad90ff7c 100644 --- a/include/xrpl/beast/unit_test/reporter.h +++ b/include/xrpl/beast/unit_test/reporter.h @@ -18,7 +18,8 @@ #include #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { namespace detail { @@ -85,7 +86,7 @@ public: reporter& operator=(reporter const&) = delete; - ~reporter() override; + ~reporter(); explicit reporter(std::ostream& os = std::cout); @@ -93,42 +94,42 @@ private: static std::string fmtdur(typename clock_type::duration const& d); - void + virtual void on_suite_begin(suite_info const& info) override; - void + virtual void on_suite_end() override; - void + virtual void on_case_begin(std::string const& name) override; - void + virtual void on_case_end() override; - void + virtual void on_pass() override; - void + virtual void on_fail(std::string const& reason) override; - void + virtual void on_log(std::string const& s) override; }; //------------------------------------------------------------------------------ -template +template void -reporter::suite_results::add(case_results const& r) +reporter<_>::suite_results::add(case_results const& r) { ++cases; total += r.total; failed += r.failed; } -template +template void -reporter::results::add(suite_results const& r) +reporter<_>::results::add(suite_results const& r) { ++suites; total += r.total; @@ -159,13 +160,13 @@ reporter::results::add(suite_results const& r) //------------------------------------------------------------------------------ -template -reporter::reporter(std::ostream& os) : os_(os) +template +reporter<_>::reporter(std::ostream& os) : os_(os) { } -template -reporter::~reporter() +template +reporter<_>::~reporter() { if (results_.top.size() > 0) { @@ -179,9 +180,9 @@ reporter::~reporter() << amount{results_.failed, "failure"} << std::endl; } -template +template std::string -reporter::fmtdur(typename clock_type::duration const& d) +reporter<_>::fmtdur(typename clock_type::duration const& d) { using namespace std::chrono; auto const ms = duration_cast(d); @@ -192,46 +193,46 @@ reporter::fmtdur(typename clock_type::duration const& d) return ss.str(); } -template +template void -reporter::on_suite_begin(suite_info const& info) +reporter<_>::on_suite_begin(suite_info const& info) { suite_results_ = suite_results{info.full_name()}; } -template +template void -reporter::on_suite_end() +reporter<_>::on_suite_end() { results_.add(suite_results_); } -template +template void -reporter::on_case_begin(std::string const& name) +reporter<_>::on_case_begin(std::string const& name) { case_results_ = case_results(name); os_ << suite_results_.name << (case_results_.name.empty() ? "" : (" " + case_results_.name)) << std::endl; } -template +template void -reporter::on_case_end() +reporter<_>::on_case_end() { suite_results_.add(case_results_); } -template +template void -reporter::on_pass() +reporter<_>::on_pass() { ++case_results_.total; } -template +template void -reporter::on_fail(std::string const& reason) +reporter<_>::on_fail(std::string const& reason) { ++case_results_.failed; ++case_results_.total; @@ -239,9 +240,9 @@ reporter::on_fail(std::string const& reason) << std::endl; } -template +template void -reporter::on_log(std::string const& s) +reporter<_>::on_log(std::string const& s) { os_ << s; } @@ -250,4 +251,5 @@ reporter::on_log(std::string const& s) using reporter = detail::reporter<>; -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/results.h b/include/xrpl/beast/unit_test/results.h index 5607071729..b8a8e2aadf 100644 --- a/include/xrpl/beast/unit_test/results.h +++ b/include/xrpl/beast/unit_test/results.h @@ -7,10 +7,10 @@ #include #include -#include #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { /** Holds a set of test condition outcomes in a testcase. */ class case_results @@ -23,7 +23,7 @@ public: { } - test(bool pass_, std::string reason_) : pass(pass_), reason(std::move(reason_)) + test(bool pass_, std::string const& reason_) : pass(pass_), reason(reason_) { } @@ -38,7 +38,9 @@ private: std::size_t failed_{0}; public: - tests_t() = default; + tests_t() + { + } /** Returns the total number of test conditions. */ std::size_t @@ -84,7 +86,7 @@ private: std::string name_; public: - explicit case_results(std::string name = "") : name_(std::move(name)) + explicit case_results(std::string const& name = "") : name_(name) { } @@ -113,7 +115,7 @@ private: std::size_t failed_ = 0; public: - explicit suite_results(std::string name = "") : name_(std::move(name)) + explicit suite_results(std::string const& name = "") : name_(name) { } @@ -143,9 +145,9 @@ public: void insert(case_results&& r) { + cont().emplace_back(std::move(r)); total_ += r.tests.total(); failed_ += r.tests.failed(); - cont().emplace_back(std::move(r)); } void @@ -170,7 +172,9 @@ private: std::size_t failed_{0}; public: - results() = default; + results() + { + } /** Returns the total number of test cases. */ std::size_t @@ -215,4 +219,5 @@ public: /** @} */ }; -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/runner.h b/include/xrpl/beast/unit_test/runner.h index 3443308675..c8a6956732 100644 --- a/include/xrpl/beast/unit_test/runner.h +++ b/include/xrpl/beast/unit_test/runner.h @@ -11,7 +11,8 @@ #include #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { /** Unit test runner interface. @@ -197,10 +198,8 @@ runner::run_if(FwdIter first, FwdIter last, Pred pred) { bool failed(false); for (; first != last; ++first) - { if (pred(*first)) failed = run(*first) || failed; - } return failed; } @@ -220,10 +219,8 @@ runner::run_each_if(SequenceContainer const& c, Pred pred) { bool failed(false); for (auto const& s : c) - { if (pred(s)) failed = run(s) || failed; - } return failed; } @@ -276,4 +273,5 @@ runner::log(std::string const& s) on_log(s); } -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/suite.h b/include/xrpl/beast/unit_test/suite.h index 1719c519cf..fa5157e126 100644 --- a/include/xrpl/beast/unit_test/suite.h +++ b/include/xrpl/beast/unit_test/suite.h @@ -14,7 +14,8 @@ #include #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { namespace detail { @@ -35,7 +36,7 @@ make_reason(String const& reason, char const* file, int line) } // namespace detail -class Thread; +class thread; enum abort_t { no_abort_on_fail, abort_on_fail }; @@ -74,7 +75,7 @@ private: { } - ~log_buf() override + ~log_buf() { sync(); } @@ -294,7 +295,7 @@ public: } private: - friend class Thread; + friend class thread; static suite** p_this_suite() @@ -308,7 +309,7 @@ private: run() = 0; void - propagate_abort() const; + propagate_abort(); template void @@ -485,13 +486,9 @@ suite::unexpected(Condition shouldBeFalse, String const& reason) { bool const b = static_cast(shouldBeFalse); if (!b) - { pass(); - } else - { fail(reason); - } return !b; } @@ -525,7 +522,7 @@ suite::fail(String const& reason, char const* file, int line) } inline void -suite::propagate_abort() const +suite::propagate_abort() { if (abort_ && aborted_) BOOST_THROW_EXCEPTION(abort_exception()); @@ -541,7 +538,7 @@ suite::run(runner& r) { run(); } - catch (abort_exception const&) // NOLINT(bugprone-empty-catch) + catch (abort_exception const&) { // ends the suite } @@ -572,7 +569,8 @@ suite::run(runner& r) ((cond) ? (pass(), true) : (fail((reason), __FILE__, __LINE__), false)) #endif -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast //------------------------------------------------------------------------------ diff --git a/include/xrpl/beast/unit_test/suite_info.h b/include/xrpl/beast/unit_test/suite_info.h index e7fa80b70e..0ffb330422 100644 --- a/include/xrpl/beast/unit_test/suite_info.h +++ b/include/xrpl/beast/unit_test/suite_info.h @@ -9,7 +9,8 @@ #include #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { class runner; @@ -109,4 +110,5 @@ make_suite_info( }); } -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/suite_list.h b/include/xrpl/beast/unit_test/suite_list.h index deffbdfe84..bbd2914c45 100644 --- a/include/xrpl/beast/unit_test/suite_list.h +++ b/include/xrpl/beast/unit_test/suite_list.h @@ -13,7 +13,8 @@ #include #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { /// A container of test suites. class suite_list : public detail::const_container> @@ -61,4 +62,5 @@ suite_list::insert( cont().emplace(make_suite_info(name, module, library, manual, priority)); } -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/unit_test/thread.h b/include/xrpl/beast/unit_test/thread.h index cc12380b0d..b49f8ed36e 100644 --- a/include/xrpl/beast/unit_test/thread.h +++ b/include/xrpl/beast/unit_test/thread.h @@ -10,10 +10,11 @@ #include #include -namespace beast::unit_test { +namespace beast { +namespace unit_test { /** Replacement for std::thread that handles exceptions in unit tests. */ -class Thread +class thread { private: suite* s_ = nullptr; @@ -23,17 +24,17 @@ public: using id = std::thread::id; using native_handle_type = std::thread::native_handle_type; - Thread() = default; - Thread(Thread const&) = delete; - Thread& - operator=(Thread const&) = delete; + thread() = default; + thread(thread const&) = delete; + thread& + operator=(thread const&) = delete; - Thread(Thread&& other) : s_(other.s_), t_(std::move(other.t_)) + thread(thread&& other) : s_(other.s_), t_(std::move(other.t_)) { } - Thread& - operator=(Thread&& other) + thread& + operator=(thread&& other) { s_ = other.s_; t_ = std::move(other.t_); @@ -41,10 +42,10 @@ public: } template - explicit Thread(suite& s, F&& f, Args&&... args) : s_(&s) + explicit thread(suite& s, F&& f, Args&&... args) : s_(&s) { std::function b = std::bind(std::forward(f), std::forward(args)...); - t_ = std::thread(&Thread::run, this, std::move(b)); + t_ = std::thread(&thread::run, this, std::move(b)); } bool @@ -79,7 +80,7 @@ public: } void - swap(Thread& other) + swap(thread& other) { std::swap(s_, other.s_); std::swap(t_, other.t_); @@ -93,7 +94,7 @@ private: { f(); } - catch (suite::abort_exception const&) // NOLINT(bugprone-empty-catch) + catch (suite::abort_exception const&) { } catch (std::exception const& e) @@ -107,4 +108,5 @@ private: } }; -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/include/xrpl/beast/utility/Journal.h b/include/xrpl/beast/utility/Journal.h index 975169cf5f..2ac5050b2d 100644 --- a/include/xrpl/beast/utility/Journal.h +++ b/include/xrpl/beast/utility/Journal.h @@ -13,13 +13,13 @@ enum Severity { kAll = 0, kTrace = kAll, - kDebug = 1, - kInfo = 2, - kWarning = 3, - kError = 4, - kFatal = 5, + kDebug, + kInfo, + kWarning, + kError, + kFatal, - kDisabled = 6, + kDisabled, kNone = kDisabled }; } // namespace severities @@ -55,16 +55,15 @@ public: class Sink { protected: + Sink() = delete; explicit Sink(Sink const& sink) = default; Sink(Severity thresh, bool console); + Sink& + operator=(Sink const& lhs) = delete; public: virtual ~Sink() = 0; - Sink() = delete; - Sink& - operator=(Sink const& lhs) = delete; - /** Returns `true` if text at the passed severity produces output. */ virtual bool active(Severity level) const; @@ -110,12 +109,12 @@ public: }; #ifndef __INTELLISENSE__ - static_assert(!std::is_default_constructible_v, ""); - static_assert(!std::is_copy_constructible_v, ""); - static_assert(!std::is_move_constructible_v, ""); - static_assert(!std::is_copy_assignable_v, ""); - static_assert(!std::is_move_assignable_v, ""); - static_assert(std::is_nothrow_destructible_v, ""); + static_assert(std::is_default_constructible::value == false, ""); + static_assert(std::is_copy_constructible::value == false, ""); + static_assert(std::is_move_constructible::value == false, ""); + static_assert(std::is_copy_assignable::value == false, ""); + static_assert(std::is_move_assignable::value == false, ""); + static_assert(std::is_nothrow_destructible::value == true, ""); #endif /** Returns a Sink which does nothing. */ @@ -166,12 +165,12 @@ public: }; #ifndef __INTELLISENSE__ - static_assert(!std::is_default_constructible_v, ""); - static_assert(std::is_copy_constructible_v, ""); - static_assert(std::is_move_constructible_v, ""); - static_assert(!std::is_copy_assignable_v, ""); - static_assert(!std::is_move_assignable_v, ""); - static_assert(std::is_nothrow_destructible_v, ""); + static_assert(std::is_default_constructible::value == false, ""); + static_assert(std::is_copy_constructible::value == true, ""); + static_assert(std::is_move_constructible::value == true, ""); + static_assert(std::is_copy_assignable::value == false, ""); + static_assert(std::is_move_assignable::value == false, ""); + static_assert(std::is_nothrow_destructible::value == true, ""); #endif //-------------------------------------------------------------------------- @@ -248,12 +247,12 @@ public: }; #ifndef __INTELLISENSE__ - static_assert(std::is_default_constructible_v, ""); - static_assert(std::is_copy_constructible_v, ""); - static_assert(std::is_move_constructible_v, ""); - static_assert(!std::is_copy_assignable_v, ""); - static_assert(!std::is_move_assignable_v, ""); - static_assert(std::is_nothrow_destructible_v, ""); + static_assert(std::is_default_constructible::value == true, ""); + static_assert(std::is_copy_constructible::value == true, ""); + static_assert(std::is_move_constructible::value == true, ""); + static_assert(std::is_copy_assignable::value == false, ""); + static_assert(std::is_move_assignable::value == false, ""); + static_assert(std::is_nothrow_destructible::value == true, ""); #endif //-------------------------------------------------------------------------- @@ -331,12 +330,12 @@ public: }; #ifndef __INTELLISENSE__ -static_assert(!std::is_default_constructible_v, ""); -static_assert(std::is_copy_constructible_v, ""); -static_assert(std::is_move_constructible_v, ""); -static_assert(std::is_copy_assignable_v, ""); -static_assert(std::is_move_assignable_v, ""); -static_assert(std::is_nothrow_destructible_v, ""); +static_assert(std::is_default_constructible::value == false, ""); +static_assert(std::is_copy_constructible::value == true, ""); +static_assert(std::is_move_constructible::value == true, ""); +static_assert(std::is_copy_assignable::value == true, ""); +static_assert(std::is_move_assignable::value == true, ""); +static_assert(std::is_nothrow_destructible::value == true, ""); #endif //------------------------------------------------------------------------------ @@ -372,6 +371,10 @@ class logstream_buf : public std::basic_stringbuf { beast::Journal::Stream strm_; + template + void + write(T const*) = delete; + void write(char const* s) { @@ -391,7 +394,7 @@ public: { } - ~logstream_buf() override + ~logstream_buf() { sync(); } @@ -403,10 +406,6 @@ public: this->str(""); return 0; } - - template - void - write(T const*) = delete; }; } // namespace detail @@ -414,11 +413,11 @@ public: template > class basic_logstream : public std::basic_ostream { - using char_type = CharT; - using traits_type = Traits; - using int_type = typename traits_type::int_type; - using pos_type = typename traits_type::pos_type; - using off_type = typename traits_type::off_type; + typedef CharT char_type; + typedef Traits traits_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; detail::logstream_buf buf_; diff --git a/include/xrpl/beast/utility/PropertyStream.h b/include/xrpl/beast/utility/PropertyStream.h index b2bd8c7a35..290730c1a2 100644 --- a/include/xrpl/beast/utility/PropertyStream.h +++ b/include/xrpl/beast/utility/PropertyStream.h @@ -174,7 +174,7 @@ private: std::ostringstream mutable m_ostream; public: - Proxy(Map const& map, std::string key); + Proxy(Map const& map, std::string const& key); Proxy(Proxy const& other); ~Proxy(); @@ -315,7 +315,7 @@ private: List children_; public: - explicit Source(std::string name); + explicit Source(std::string const& name); virtual ~Source(); Source(Source const&) = delete; diff --git a/include/xrpl/beast/utility/WrappedSink.h b/include/xrpl/beast/utility/WrappedSink.h index 7e36ce99d7..bb8a1a6994 100644 --- a/include/xrpl/beast/utility/WrappedSink.h +++ b/include/xrpl/beast/utility/WrappedSink.h @@ -2,8 +2,6 @@ #include -#include - namespace beast { /** Wraps a Journal::Sink to prefix its output with a string. */ @@ -19,8 +17,8 @@ private: std::string prefix_; public: - explicit WrappedSink(beast::Journal::Sink& sink, std::string prefix = "") - : Sink(sink), sink_(sink), prefix_(std::move(prefix)) + explicit WrappedSink(beast::Journal::Sink& sink, std::string const& prefix = "") + : Sink(sink), sink_(sink), prefix_(prefix) { } diff --git a/include/xrpl/beast/utility/Zero.h b/include/xrpl/beast/utility/Zero.h index ff212b9c98..3b50b3fe00 100644 --- a/include/xrpl/beast/utility/Zero.h +++ b/include/xrpl/beast/utility/Zero.h @@ -27,7 +27,7 @@ struct Zero }; namespace { -constexpr Zero zero{}; +static constexpr Zero zero{}; } // namespace /** Default implementation of signum calls the method on the class. */ @@ -38,7 +38,8 @@ signum(T const& t) return t.signum(); } -namespace detail::zero_helper { +namespace detail { +namespace zero_helper { // For argument dependent lookup to function properly, calls to signum must // be made from a namespace that does not include overloads of the function.. @@ -49,7 +50,8 @@ call_signum(T const& t) return signum(t); } -} // namespace detail::zero_helper +} // namespace zero_helper +} // namespace detail // Handle operators where T is on the left side using signum. diff --git a/include/xrpl/beast/utility/maybe_const.h b/include/xrpl/beast/utility/maybe_const.h index bcfd7a7532..3f6e1f95bd 100644 --- a/include/xrpl/beast/utility/maybe_const.h +++ b/include/xrpl/beast/utility/maybe_const.h @@ -9,8 +9,10 @@ template struct maybe_const { explicit maybe_const() = default; - using type = std:: - conditional_t::type const, std::remove_const_t>; + using type = typename std::conditional< + IsConst, + typename std::remove_const::type const, + typename std::remove_const::type>::type; }; /** Alias for omitting `typename`. */ diff --git a/include/xrpl/beast/xor_shift_engine.h b/include/xrpl/beast/xor_shift_engine.h index 85504f51aa..4fbe5ec165 100644 --- a/include/xrpl/beast/xor_shift_engine.h +++ b/include/xrpl/beast/xor_shift_engine.h @@ -43,15 +43,15 @@ private: murmurhash3(result_type x); }; -template -xor_shift_engine::xor_shift_engine(result_type val) +template +xor_shift_engine<_>::xor_shift_engine(result_type val) { seed(val); } -template +template void -xor_shift_engine::seed(result_type seed) +xor_shift_engine<_>::seed(result_type seed) { if (seed == 0) throw std::domain_error("invalid seed"); @@ -59,9 +59,9 @@ xor_shift_engine::seed(result_type seed) s_[1] = murmurhash3(s_[0]); } -template +template auto -xor_shift_engine::operator()() -> result_type +xor_shift_engine<_>::operator()() -> result_type { result_type s1 = s_[0]; result_type const s0 = s_[1]; @@ -70,9 +70,9 @@ xor_shift_engine::operator()() -> result_type return (s_[1] = (s1 ^ s0 ^ (s1 >> 17) ^ (s0 >> 26))) + s0; } -template +template auto -xor_shift_engine::murmurhash3(result_type x) -> result_type +xor_shift_engine<_>::murmurhash3(result_type x) -> result_type { x ^= x >> 33; x *= 0xff51afd7ed558ccdULL; diff --git a/include/xrpl/conditions/Condition.h b/include/xrpl/conditions/Condition.h index 4b24c5a289..6b306a3982 100644 --- a/include/xrpl/conditions/Condition.h +++ b/include/xrpl/conditions/Condition.h @@ -7,7 +7,8 @@ #include #include -namespace xrpl::cryptoconditions { +namespace xrpl { +namespace cryptoconditions { enum class Type : std::uint8_t { preimageSha256 = 0, @@ -87,4 +88,6 @@ operator!=(Condition const& lhs, Condition const& rhs) return !(lhs == rhs); } -} // namespace xrpl::cryptoconditions +} // namespace cryptoconditions + +} // namespace xrpl diff --git a/include/xrpl/conditions/Fulfillment.h b/include/xrpl/conditions/Fulfillment.h index 71ff9d83ef..ab47804e45 100644 --- a/include/xrpl/conditions/Fulfillment.h +++ b/include/xrpl/conditions/Fulfillment.h @@ -4,7 +4,8 @@ #include #include -namespace xrpl::cryptoconditions { +namespace xrpl { +namespace cryptoconditions { struct Fulfillment { @@ -118,4 +119,5 @@ validate(Fulfillment const& f, Condition const& c, Slice m); bool validate(Fulfillment const& f, Condition const& c); -} // namespace xrpl::cryptoconditions +} // namespace cryptoconditions +} // namespace xrpl diff --git a/include/xrpl/conditions/detail/PreimageSha256.h b/include/xrpl/conditions/detail/PreimageSha256.h index bfa59ab749..8726473c2d 100644 --- a/include/xrpl/conditions/detail/PreimageSha256.h +++ b/include/xrpl/conditions/detail/PreimageSha256.h @@ -9,7 +9,8 @@ #include -namespace xrpl::cryptoconditions { +namespace xrpl { +namespace cryptoconditions { class PreimageSha256 final : public Fulfillment { @@ -126,4 +127,5 @@ public: } }; -} // namespace xrpl::cryptoconditions +} // namespace cryptoconditions +} // namespace xrpl diff --git a/include/xrpl/conditions/detail/error.h b/include/xrpl/conditions/detail/error.h index 73cee4c9f3..fdeed3d9ac 100644 --- a/include/xrpl/conditions/detail/error.h +++ b/include/xrpl/conditions/detail/error.h @@ -2,7 +2,8 @@ #include -namespace xrpl::cryptoconditions { +namespace xrpl { +namespace cryptoconditions { enum class error { generic = 1, @@ -27,7 +28,8 @@ enum class error { std::error_code make_error_code(error ev); -} // namespace xrpl::cryptoconditions +} // namespace cryptoconditions +} // namespace xrpl namespace std { diff --git a/include/xrpl/conditions/detail/utils.h b/include/xrpl/conditions/detail/utils.h index 8629987b8b..17d93d43b5 100644 --- a/include/xrpl/conditions/detail/utils.h +++ b/include/xrpl/conditions/detail/utils.h @@ -8,12 +8,15 @@ #include +namespace xrpl { +namespace cryptoconditions { + // A collection of functions to decode binary blobs // encoded with X.690 Distinguished Encoding Rules. // // This is a very trivial decoder and only implements // the bare minimum needed to support PreimageSha256. -namespace xrpl::cryptoconditions::der { +namespace der { // The preamble encapsulates the DER identifier and // length octets: @@ -86,7 +89,7 @@ parsePreamble(Slice& s, std::error_code& ec) p.length = s[0]; s += 1; - if ((p.length & 0x80) != 0u) + if (p.length & 0x80) { // Long form length: std::size_t const cnt = p.length & 0x7F; @@ -201,4 +204,6 @@ parseInteger(Slice& s, std::size_t count, std::error_code& ec) return v; } -} // namespace xrpl::cryptoconditions::der +} // namespace der +} // namespace cryptoconditions +} // namespace xrpl diff --git a/include/xrpl/core/ClosureCounter.h b/include/xrpl/core/ClosureCounter.h index ef857ace72..b1939b2e63 100644 --- a/include/xrpl/core/ClosureCounter.h +++ b/include/xrpl/core/ClosureCounter.h @@ -34,9 +34,9 @@ template class ClosureCounter { private: - std::mutex mutable mutex_; - std::condition_variable allClosuresDoneCond_; // guard with mutex_ - bool waitForClosures_{false}; // guard with mutex_ + std::mutex mutable mutex_{}; + std::condition_variable allClosuresDoneCond_{}; // guard with mutex_ + bool waitForClosures_{false}; // guard with mutex_ std::atomic closureCount_{0}; // Increment the count. @@ -75,7 +75,7 @@ private: std::remove_reference_t closure_; static_assert( - std::is_same_v()...)), Ret_t>, + std::is_same()...)), Ret_t>::value, "Closure arguments don't match ClosureCounter Ret_t or Args_t"); public: @@ -86,7 +86,7 @@ private: ++counter_; } - Substitute(Substitute&& rhs) noexcept(std::is_nothrow_move_constructible_v) + Substitute(Substitute&& rhs) noexcept(std::is_nothrow_move_constructible::value) : counter_(rhs.counter_), closure_(std::move(rhs.closure_)) { ++counter_; diff --git a/include/xrpl/core/HashRouter.h b/include/xrpl/core/HashRouter.h index 3bc87f9524..b4f07f6dc0 100644 --- a/include/xrpl/core/HashRouter.h +++ b/include/xrpl/core/HashRouter.h @@ -109,7 +109,9 @@ private: class Entry : public CountedObject { public: - Entry() = default; + Entry() + { + } void addPeer(PeerShortID peer) diff --git a/include/xrpl/core/JobQueue.h b/include/xrpl/core/JobQueue.h index 3c1bde89c3..558e55cf31 100644 --- a/include/xrpl/core/JobQueue.h +++ b/include/xrpl/core/JobQueue.h @@ -128,7 +128,7 @@ public: beast::Journal journal, Logs& logs, perf::PerfLog& perfLog); - ~JobQueue() override; + ~JobQueue(); /** Adds a job to the JobQueue. @@ -141,7 +141,8 @@ public: */ template < typename JobHandler, - typename = std::enable_if_t()()), void>>> + typename = + std::enable_if_t()()), void>::value>> bool addJob(JobType type, std::string const& name, JobHandler&& jobHandler) { diff --git a/include/xrpl/core/JobTypeData.h b/include/xrpl/core/JobTypeData.h index 917f838990..c180629af7 100644 --- a/include/xrpl/core/JobTypeData.h +++ b/include/xrpl/core/JobTypeData.h @@ -4,8 +4,6 @@ #include #include -#include - namespace xrpl { struct JobTypeData @@ -35,9 +33,9 @@ public: JobTypeData( JobTypeInfo const& info_, - beast::insight::Collector::ptr collector, + beast::insight::Collector::ptr const& collector, Logs& logs) noexcept - : m_load(logs.journal("LoadMonitor")), m_collector(std::move(collector)), info(info_) + : m_load(logs.journal("LoadMonitor")), m_collector(collector), info(info_) { m_load.setTargetLatency(info.getAverageLatency(), info.getPeakLatency()); diff --git a/include/xrpl/core/JobTypes.h b/include/xrpl/core/JobTypes.h index 1fb6f61573..98de97a1b4 100644 --- a/include/xrpl/core/JobTypes.h +++ b/include/xrpl/core/JobTypes.h @@ -33,7 +33,8 @@ private: std::chrono::milliseconds avgLatency, std::chrono::milliseconds peakLatency) { XRPL_ASSERT( - !m_map.contains(jt), "xrpl::JobTypes::JobTypes::add : unique job type input"); + m_map.find(jt) == m_map.end(), + "xrpl::JobTypes::JobTypes::add : unique job type input"); [[maybe_unused]] auto const inserted = m_map diff --git a/include/xrpl/core/LoadEvent.h b/include/xrpl/core/LoadEvent.h index 87d4a5563d..f94e1020bf 100644 --- a/include/xrpl/core/LoadEvent.h +++ b/include/xrpl/core/LoadEvent.h @@ -16,7 +16,7 @@ class LoadEvent { public: // VFALCO TODO remove the dependency on LoadMonitor. Is that possible? - LoadEvent(LoadMonitor& monitor, std::string name, bool shouldStart); + LoadEvent(LoadMonitor& monitor, std::string const& name, bool shouldStart); LoadEvent(LoadEvent const&) = delete; ~LoadEvent(); diff --git a/include/xrpl/core/PeerReservationTable.h b/include/xrpl/core/PeerReservationTable.h index 3fb85e392f..fc943f0807 100644 --- a/include/xrpl/core/PeerReservationTable.h +++ b/include/xrpl/core/PeerReservationTable.h @@ -20,7 +20,7 @@ struct PeerReservation final { public: PublicKey nodeId; - std::string description = {}; // NOLINT(readability-redundant-member-init) + std::string description{}; auto toJson() const -> Json::Value; @@ -68,7 +68,7 @@ public: contains(PublicKey const& nodeId) { std::lock_guard const lock(this->mutex_); - return table_.contains({.nodeId = nodeId, .description = {}}); + return table_.find({nodeId}) != table_.end(); } // Because `ApplicationImp` has two-phase initialization, so must we. diff --git a/include/xrpl/core/detail/Workers.h b/include/xrpl/core/detail/Workers.h index bd82f9d57b..dbc93ecf81 100644 --- a/include/xrpl/core/detail/Workers.h +++ b/include/xrpl/core/detail/Workers.h @@ -93,7 +93,7 @@ public: explicit Workers( Callback& callback, perf::PerfLog* perfLog, - std::string threadNames = "Worker", + std::string const& threadNames = "Worker", int numberOfThreads = static_cast(std::thread::hardware_concurrency())); ~Workers(); @@ -164,7 +164,7 @@ private: public beast::LockFreeStack::Node { public: - Worker(Workers& workers, std::string threadName, int const instance); + Worker(Workers& workers, std::string const& threadName, int const instance); ~Worker(); diff --git a/include/xrpl/json/json_writer.h b/include/xrpl/json/json_writer.h index 45961fe030..e49abcd81a 100644 --- a/include/xrpl/json/json_writer.h +++ b/include/xrpl/json/json_writer.h @@ -15,7 +15,9 @@ class Value; class WriterBase { public: - virtual ~WriterBase() = default; + virtual ~WriterBase() + { + } virtual std::string write(Value const& root) = 0; }; @@ -32,7 +34,9 @@ class FastWriter : public WriterBase { public: FastWriter() = default; - ~FastWriter() override = default; + virtual ~FastWriter() + { + } public: // overridden from Writer std::string @@ -67,7 +71,9 @@ class StyledWriter : public WriterBase { public: StyledWriter(); - ~StyledWriter() override = default; + virtual ~StyledWriter() + { + } public: // overridden from Writer /** \brief Serialize a Value in JSON @@ -130,7 +136,9 @@ class StyledStreamWriter { public: StyledStreamWriter(std::string indentation = "\t"); - ~StyledStreamWriter() = default; + ~StyledStreamWriter() + { + } public: /** \brief Serialize a Value in JSON diff --git a/include/xrpl/json/to_string.h b/include/xrpl/json/to_string.h index c9820e2e55..fb379f5759 100644 --- a/include/xrpl/json/to_string.h +++ b/include/xrpl/json/to_string.h @@ -1,11 +1,12 @@ #pragma once -#include - +#include #include namespace Json { +class Value; + /** Writes a Json::Value to an std::string. */ std::string to_string(Value const&); @@ -14,4 +15,8 @@ to_string(Value const&); std::string pretty(Value const&); +/** Output using the StyledStreamWriter. @see Json::operator>>(). */ +std::ostream& +operator<<(std::ostream&, Value const& root); + } // namespace Json diff --git a/include/xrpl/ledger/AmendmentTable.h b/include/xrpl/ledger/AmendmentTable.h index 8df09f74c3..6ecfe2a240 100644 --- a/include/xrpl/ledger/AmendmentTable.h +++ b/include/xrpl/ledger/AmendmentTable.h @@ -8,7 +8,6 @@ #include #include -#include namespace xrpl { @@ -24,8 +23,8 @@ public: struct FeatureInfo { FeatureInfo() = delete; - FeatureInfo(std::string n, uint256 const& f, VoteBehavior v) - : name(std::move(n)), feature(f), vote(v) + FeatureInfo(std::string const& n, uint256 const& f, VoteBehavior v) + : name(n), feature(f), vote(v) { } @@ -76,12 +75,10 @@ public: doValidatedLedger(std::shared_ptr const& lastValidatedLedger) { if (needValidatedLedger(lastValidatedLedger->seq())) - { doValidatedLedger( lastValidatedLedger->seq(), getEnabledAmendments(*lastValidatedLedger), getMajorityAmendments(*lastValidatedLedger)); - } } /** Called to determine whether the amendment logic needs to process diff --git a/include/xrpl/ledger/BookListeners.h b/include/xrpl/ledger/BookListeners.h index c77271b20e..3ed267448b 100644 --- a/include/xrpl/ledger/BookListeners.h +++ b/include/xrpl/ledger/BookListeners.h @@ -14,7 +14,9 @@ class BookListeners public: using pointer = std::shared_ptr; - BookListeners() = default; + BookListeners() + { + } /** Add a new subscription for this book */ diff --git a/include/xrpl/ledger/CachedView.h b/include/xrpl/ledger/CachedView.h index 5dad2598f4..7cab1dc1b3 100644 --- a/include/xrpl/ledger/CachedView.h +++ b/include/xrpl/ledger/CachedView.h @@ -132,7 +132,7 @@ template class CachedView : public detail::CachedViewImpl { private: - static_assert(std::is_base_of_v, ""); + static_assert(std::is_base_of::value, ""); std::shared_ptr sp_; diff --git a/include/xrpl/ledger/CanonicalTXSet.h b/include/xrpl/ledger/CanonicalTXSet.h index 857b82a734..45f58b5701 100644 --- a/include/xrpl/ledger/CanonicalTXSet.h +++ b/include/xrpl/ledger/CanonicalTXSet.h @@ -29,31 +29,31 @@ private: friend bool operator<(Key const& lhs, Key const& rhs); - friend bool + inline friend bool operator>(Key const& lhs, Key const& rhs) { return rhs < lhs; } - friend bool + inline friend bool operator<=(Key const& lhs, Key const& rhs) { return !(lhs > rhs); } - friend bool + inline friend bool operator>=(Key const& lhs, Key const& rhs) { return !(lhs < rhs); } - friend bool + inline friend bool operator==(Key const& lhs, Key const& rhs) { return lhs.txId_ == rhs.txId_; } - friend bool + inline friend bool operator!=(Key const& lhs, Key const& rhs) { return !(lhs == rhs); diff --git a/include/xrpl/ledger/Ledger.h b/include/xrpl/ledger/Ledger.h index 69fb27975d..75a8f55dc0 100644 --- a/include/xrpl/ledger/Ledger.h +++ b/include/xrpl/ledger/Ledger.h @@ -82,12 +82,12 @@ public: */ Ledger( create_genesis_t, - Rules rules, + Rules const& rules, Fees const& fees, std::vector const& amendments, Family& family); - Ledger(LedgerHeader const& info, Rules rules, Family& family); + Ledger(LedgerHeader const& info, Rules const& rules, Family& family); /** Used for ledgers loaded from JSON files @@ -100,7 +100,7 @@ public: LedgerHeader const& info, bool& loaded, bool acquire, - Rules rules, + Rules const& rules, Fees const& fees, Family& family, beast::Journal j); @@ -117,11 +117,11 @@ public: Ledger( std::uint32_t ledgerSeq, NetClock::time_point closeTime, - Rules rules, + Rules const& rules, Fees const& fees, Family& family); - ~Ledger() override = default; + ~Ledger() = default; // // ReadView diff --git a/include/xrpl/ledger/OpenView.h b/include/xrpl/ledger/OpenView.h index 3420aa1df0..5c942ce5e3 100644 --- a/include/xrpl/ledger/OpenView.h +++ b/include/xrpl/ledger/OpenView.h @@ -135,7 +135,7 @@ public: OpenView( open_ledger_t, ReadView const* base, - Rules rules, + Rules const& rules, std::shared_ptr hold = nullptr); OpenView(open_ledger_t, Rules const& rules, std::shared_ptr const& base) diff --git a/include/xrpl/ledger/PaymentSandbox.h b/include/xrpl/ledger/PaymentSandbox.h index 223a3c0c5a..d6f7820e8a 100644 --- a/include/xrpl/ledger/PaymentSandbox.h +++ b/include/xrpl/ledger/PaymentSandbox.h @@ -6,7 +6,6 @@ #include #include -#include namespace xrpl { @@ -64,8 +63,8 @@ private: public: struct AdjustmentIOU { - AdjustmentIOU(STAmount d, STAmount c, STAmount b) - : debits(std::move(d)), credits(std::move(c)), origBalance(std::move(b)) + AdjustmentIOU(STAmount const& d, STAmount const& c, STAmount const& b) + : debits(d), credits(c), origBalance(b) { } STAmount debits; diff --git a/include/xrpl/ledger/PendingSaves.h b/include/xrpl/ledger/PendingSaves.h index ff70d48bb9..4e952547da 100644 --- a/include/xrpl/ledger/PendingSaves.h +++ b/include/xrpl/ledger/PendingSaves.h @@ -65,7 +65,7 @@ public: pending(LedgerIndex seq) { std::lock_guard const lock(mutex_); - return map_.contains(seq); + return map_.find(seq) != map_.end(); } /** Check if a ledger should be dispatched diff --git a/include/xrpl/ledger/detail/ApplyStateTable.h b/include/xrpl/ledger/detail/ApplyStateTable.h index 0ded0aa273..07af5247f6 100644 --- a/include/xrpl/ledger/detail/ApplyStateTable.h +++ b/include/xrpl/ledger/detail/ApplyStateTable.h @@ -10,7 +10,8 @@ #include -namespace xrpl::detail { +namespace xrpl { +namespace detail { // Helper class that buffers modifications class ApplyStateTable @@ -124,4 +125,5 @@ private: beast::Journal j); }; -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/include/xrpl/ledger/detail/ApplyViewBase.h b/include/xrpl/ledger/detail/ApplyViewBase.h index 0e93ac5d2f..b3ec3c0fea 100644 --- a/include/xrpl/ledger/detail/ApplyViewBase.h +++ b/include/xrpl/ledger/detail/ApplyViewBase.h @@ -5,7 +5,8 @@ #include #include -namespace xrpl::detail { +namespace xrpl { +namespace detail { class ApplyViewBase : public ApplyView, public RawView { @@ -101,4 +102,5 @@ protected: detail::ApplyStateTable items_; }; -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/include/xrpl/ledger/detail/RawStateTable.h b/include/xrpl/ledger/detail/RawStateTable.h index b3307b3ea4..499b9204c6 100644 --- a/include/xrpl/ledger/detail/RawStateTable.h +++ b/include/xrpl/ledger/detail/RawStateTable.h @@ -9,7 +9,8 @@ #include #include -namespace xrpl::detail { +namespace xrpl { +namespace detail { // Helper class that buffers raw modifications class RawStateTable @@ -107,4 +108,5 @@ private: XRPAmount dropsDestroyed_{0}; }; -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/include/xrpl/ledger/helpers/AMMHelpers.h b/include/xrpl/ledger/helpers/AMMHelpers.h index d261f9e018..34597b3cb5 100644 --- a/include/xrpl/ledger/helpers/AMMHelpers.h +++ b/include/xrpl/ledger/helpers/AMMHelpers.h @@ -208,10 +208,10 @@ getAMMOfferStartWithTakerGets( // Try to reduce the offer size to improve the quality. // The quality might still not match the targetQuality for a tiny offer. - auto amounts = getAmounts(*nTakerGets); - if (Quality{amounts} < targetQuality) + if (auto amounts = getAmounts(*nTakerGets); Quality{amounts} < targetQuality) return getAmounts(detail::reduceOffer(amounts.out)); - return amounts; + else + return amounts; } /** Generate AMM offer starting with takerPays when AMM pool @@ -275,10 +275,10 @@ getAMMOfferStartWithTakerPays( // Try to reduce the offer size to improve the quality. // The quality might still not match the targetQuality for a tiny offer. - auto amounts = getAmounts(*nTakerPays); - if (Quality{amounts} < targetQuality) + if (auto amounts = getAmounts(*nTakerPays); Quality{amounts} < targetQuality) return getAmounts(detail::reduceOffer(amounts.in)); - return amounts; + else + return amounts; } /** Generate AMM offer so that either updated Spot Price Quality (SPQ) @@ -318,12 +318,9 @@ changeSpotPriceQuality( auto const& a = f; auto const b = pool.in * (1 + f); Number const c = pool.in * pool.in - pool.in * pool.out * quality.rate(); - auto const res = b * b - 4 * a * c; - if (res < 0) - { + if (auto const res = b * b - 4 * a * c; res < 0) return std::nullopt; // LCOV_EXCL_LINE - } - if (auto const nTakerPaysPropose = (-b + root2(res)) / (2 * a); nTakerPaysPropose > 0) + else if (auto const nTakerPaysPropose = (-b + root2(res)) / (2 * a); nTakerPaysPropose > 0) { auto const nTakerPays = [&]() { // The fee might make the AMM offer quality less than CLOB @@ -468,11 +465,13 @@ swapAssetIn(TAmounts const& pool, TIn const& assetIn, std::uint16_t t return toAmount(getAsset(pool.out), swapOut, Number::downward); } - - return toAmount( - getAsset(pool.out), - pool.out - (pool.in * pool.out) / (pool.in + assetIn * feeMult(tfee)), - Number::downward); + else + { + return toAmount( + getAsset(pool.out), + pool.out - (pool.in * pool.out) / (pool.in + assetIn * feeMult(tfee)), + Number::downward); + } } /** Swap assetOut out of the pool and swap in a proportional amount @@ -534,11 +533,13 @@ swapAssetOut(TAmounts const& pool, TOut const& assetOut, std::uint16_ return toAmount(getAsset(pool.in), swapIn, Number::upward); } - - return toAmount( - getAsset(pool.in), - ((pool.in * pool.out) / (pool.out - assetOut) - pool.in) / feeMult(tfee), - Number::upward); + else + { + return toAmount( + getAsset(pool.in), + ((pool.in * pool.out) / (pool.out - assetOut) - pool.in) / feeMult(tfee), + Number::upward); + } } /** Return square of n. @@ -622,13 +623,9 @@ getRoundedAsset(Rules const& rules, STAmount const& balance, A const& frac, IsDe if (!rules.enabled(fixAMMv1_3)) { if constexpr (std::is_same_v) - { return multiply(balance, frac, balance.asset()); - } else - { return toSTAmount(balance.asset(), balance * frac); - } } auto const rm = detail::getAssetRounding(isDeposit); return multiply(balance, frac, rm); diff --git a/include/xrpl/ledger/helpers/DirectoryHelpers.h b/include/xrpl/ledger/helpers/DirectoryHelpers.h index 2ae188182d..189dfcd263 100644 --- a/include/xrpl/ledger/helpers/DirectoryHelpers.h +++ b/include/xrpl/ledger/helpers/DirectoryHelpers.h @@ -189,7 +189,7 @@ forEachItem( AccountID const& id, std::function const&)> const& f) { - forEachItem(view, keylet::ownerDir(id), f); + return forEachItem(view, keylet::ownerDir(id), f); } /** Iterate all items after an item in an owner directory. diff --git a/include/xrpl/ledger/helpers/NFTokenHelpers.h b/include/xrpl/ledger/helpers/NFTokenHelpers.h index 49fd520d51..d8dac4caaf 100644 --- a/include/xrpl/ledger/helpers/NFTokenHelpers.h +++ b/include/xrpl/ledger/helpers/NFTokenHelpers.h @@ -8,9 +8,9 @@ #include #include -#include +namespace xrpl { -namespace xrpl::nft { +namespace nft { /** Delete up to a specified number of offers from the specified token offer * directory. */ @@ -20,6 +20,10 @@ removeTokenOffersWithLimit( Keylet const& directory, std::size_t maxDeletableOffers); +/** Returns tesSUCCESS if NFToken has few enough offers that it can be burned */ +TER +notTooManyOffers(ReadView const& view, uint256 const& nftokenID); + /** Finds the specified token in the owner's token directory. */ std::optional findToken(ReadView const& view, AccountID const& owner, uint256 const& nftokenID); @@ -30,8 +34,8 @@ struct TokenAndPage STObject token; std::shared_ptr page; - TokenAndPage(STObject token_, std::shared_ptr page_) - : token(std::move(token_)), page(std::move(page_)) + TokenAndPage(STObject const& token_, std::shared_ptr page_) + : token(token_), page(std::move(page_)) { } }; @@ -136,4 +140,6 @@ checkTrustlineDeepFrozen( beast::Journal const j, Issue const& issue); -} // namespace xrpl::nft +} // namespace nft + +} // namespace xrpl diff --git a/include/xrpl/ledger/helpers/PaymentChannelHelpers.h b/include/xrpl/ledger/helpers/PaymentChannelHelpers.h index 24838f1331..5d1a4c0aa1 100644 --- a/include/xrpl/ledger/helpers/PaymentChannelHelpers.h +++ b/include/xrpl/ledger/helpers/PaymentChannelHelpers.h @@ -1,8 +1,6 @@ #pragma once -#include #include -#include #include namespace xrpl { diff --git a/include/xrpl/ledger/helpers/PermissionedDEXHelpers.h b/include/xrpl/ledger/helpers/PermissionedDEXHelpers.h index 04b12f2fc5..3992f8885e 100644 --- a/include/xrpl/ledger/helpers/PermissionedDEXHelpers.h +++ b/include/xrpl/ledger/helpers/PermissionedDEXHelpers.h @@ -1,7 +1,8 @@ #pragma once #include -namespace xrpl::permissioned_dex { +namespace xrpl { +namespace permissioned_dex { // Check if an account is in a permissioned domain [[nodiscard]] bool @@ -15,4 +16,6 @@ offerInDomain( Domain const& domainID, beast::Journal j); -} // namespace xrpl::permissioned_dex +} // namespace permissioned_dex + +} // namespace xrpl diff --git a/include/xrpl/net/AutoSocket.h b/include/xrpl/net/AutoSocket.h index 45e4919b8a..29cec23998 100644 --- a/include/xrpl/net/AutoSocket.h +++ b/include/xrpl/net/AutoSocket.h @@ -44,7 +44,7 @@ public: } bool - isSecure() const + isSecure() { return mSecure; } @@ -126,9 +126,7 @@ public: async_shutdown(ShutdownHandler handler) { if (isSecure()) - { mSocket->async_shutdown(handler); - } else { error_code ec; @@ -136,7 +134,7 @@ public: { lowest_layer().shutdown(plain_socket::shutdown_both); } - catch (boost::system::system_error const& e) + catch (boost::system::system_error& e) { ec = e.code(); } @@ -149,13 +147,9 @@ public: async_read_some(Seq const& buffers, Handler handler) { if (isSecure()) - { mSocket->async_read_some(buffers, handler); - } else - { PlainSocket().async_read_some(buffers, handler); - } } template @@ -163,13 +157,9 @@ public: async_read_until(Seq const& buffers, Condition condition, Handler handler) { if (isSecure()) - { boost::asio::async_read_until(*mSocket, buffers, condition, handler); - } else - { boost::asio::async_read_until(PlainSocket(), buffers, condition, handler); - } } template @@ -180,13 +170,9 @@ public: Handler handler) { if (isSecure()) - { boost::asio::async_read_until(*mSocket, buffers, delim, handler); - } else - { boost::asio::async_read_until(PlainSocket(), buffers, delim, handler); - } } template @@ -197,13 +183,9 @@ public: Handler handler) { if (isSecure()) - { boost::asio::async_read_until(*mSocket, buffers, cond, handler); - } else - { boost::asio::async_read_until(PlainSocket(), buffers, cond, handler); - } } template @@ -211,13 +193,9 @@ public: async_write(Buf const& buffers, Handler handler) { if (isSecure()) - { boost::asio::async_write(*mSocket, buffers, handler); - } else - { boost::asio::async_write(PlainSocket(), buffers, handler); - } } template @@ -225,13 +203,9 @@ public: async_write(boost::asio::basic_streambuf& buffers, Handler handler) { if (isSecure()) - { boost::asio::async_write(*mSocket, buffers, handler); - } else - { boost::asio::async_write(PlainSocket(), buffers, handler); - } } template @@ -239,13 +213,9 @@ public: async_read(Buf const& buffers, Condition cond, Handler handler) { if (isSecure()) - { boost::asio::async_read(*mSocket, buffers, cond, handler); - } else - { boost::asio::async_read(PlainSocket(), buffers, cond, handler); - } } template @@ -253,13 +223,9 @@ public: async_read(boost::asio::basic_streambuf& buffers, Condition cond, Handler handler) { if (isSecure()) - { boost::asio::async_read(*mSocket, buffers, cond, handler); - } else - { boost::asio::async_read(PlainSocket(), buffers, cond, handler); - } } template @@ -267,13 +233,9 @@ public: async_read(Buf const& buffers, Handler handler) { if (isSecure()) - { boost::asio::async_read(*mSocket, buffers, handler); - } else - { boost::asio::async_read(PlainSocket(), buffers, handler); - } } template @@ -281,13 +243,9 @@ public: async_write_some(Seq const& buffers, Handler handler) { if (isSecure()) - { mSocket->async_write_some(buffers, handler); - } else - { PlainSocket().async_write_some(buffers, handler); - } } protected: diff --git a/include/xrpl/net/HTTPClientSSLContext.h b/include/xrpl/net/HTTPClientSSLContext.h index d211b21afe..80e5835f5e 100644 --- a/include/xrpl/net/HTTPClientSSLContext.h +++ b/include/xrpl/net/HTTPClientSSLContext.h @@ -30,10 +30,8 @@ public: registerSSLCerts(ssl_context_, ec, j_); if (ec && sslVerifyDir.empty()) - { Throw(boost::str( boost::format("Failed to set_default_verify_paths: %s") % ec.message())); - } } else { @@ -45,10 +43,8 @@ public: ssl_context_.add_verify_path(sslVerifyDir, ec); if (ec) - { Throw( boost::str(boost::format("Failed to add verify path: %s") % ec.message())); - } } } @@ -79,8 +75,8 @@ public: template < class T, class = std::enable_if_t< - std::is_same_v> || - std::is_same_v>>> + std::is_same>::value || + std::is_same>::value>> boost::system::error_code preConnectVerify(T& strm, std::string const& host) { @@ -99,8 +95,8 @@ public: template < class T, class = std::enable_if_t< - std::is_same_v> || - std::is_same_v>>> + std::is_same>::value || + std::is_same>::value>> /** * @brief invoked after connect/async_connect but before sending data * on an ssl stream - to setup name verification. diff --git a/include/xrpl/nodestore/Backend.h b/include/xrpl/nodestore/Backend.h index d1b0ecb6dd..36fd36ec00 100644 --- a/include/xrpl/nodestore/Backend.h +++ b/include/xrpl/nodestore/Backend.h @@ -4,7 +4,8 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { /** A backend used for the NodeStore. @@ -139,4 +140,5 @@ public: fdRequired() const = 0; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/Database.h b/include/xrpl/nodestore/Database.h index c21c1e27dd..e33b8a3a5c 100644 --- a/include/xrpl/nodestore/Database.h +++ b/include/xrpl/nodestore/Database.h @@ -10,7 +10,9 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { + +namespace NodeStore { /** Persistency layer for NodeObject @@ -272,4 +274,5 @@ private: threadEntry(); }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/DatabaseRotating.h b/include/xrpl/nodestore/DatabaseRotating.h index a7deed294a..23a749f972 100644 --- a/include/xrpl/nodestore/DatabaseRotating.h +++ b/include/xrpl/nodestore/DatabaseRotating.h @@ -2,7 +2,8 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { /* This class has two key-value store Backend objects for persisting SHAMap * records. This facilitates online deletion of data. New backends are @@ -35,4 +36,5 @@ public: f) = 0; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/DummyScheduler.h b/include/xrpl/nodestore/DummyScheduler.h index 472684ff13..9fce4a6100 100644 --- a/include/xrpl/nodestore/DummyScheduler.h +++ b/include/xrpl/nodestore/DummyScheduler.h @@ -2,14 +2,15 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { /** Simple NodeStore Scheduler that just performs the tasks synchronously. */ class DummyScheduler : public Scheduler { public: DummyScheduler() = default; - ~DummyScheduler() override = default; + ~DummyScheduler() = default; void scheduleTask(Task& task) override; void @@ -18,4 +19,5 @@ public: onBatchWrite(BatchWriteReport const& report) override; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/Factory.h b/include/xrpl/nodestore/Factory.h index 1656e73840..e01bdfabf2 100644 --- a/include/xrpl/nodestore/Factory.h +++ b/include/xrpl/nodestore/Factory.h @@ -7,7 +7,9 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { + +namespace NodeStore { /** Base class for backend factories. */ class Factory @@ -57,4 +59,5 @@ public: } }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/Manager.h b/include/xrpl/nodestore/Manager.h index 7f718d7835..ff00ee3ee1 100644 --- a/include/xrpl/nodestore/Manager.h +++ b/include/xrpl/nodestore/Manager.h @@ -3,7 +3,9 @@ #include #include -namespace xrpl::NodeStore { +namespace xrpl { + +namespace NodeStore { /** Singleton for managing NodeStore factories and back ends. */ class Manager @@ -79,4 +81,5 @@ public: beast::Journal journal) = 0; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/Scheduler.h b/include/xrpl/nodestore/Scheduler.h index bf256648aa..dc3e1e3d15 100644 --- a/include/xrpl/nodestore/Scheduler.h +++ b/include/xrpl/nodestore/Scheduler.h @@ -4,7 +4,8 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { enum class FetchType { synchronous, async }; @@ -63,4 +64,5 @@ public: onBatchWrite(BatchWriteReport const& report) = 0; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/Task.h b/include/xrpl/nodestore/Task.h index 0695970a68..4bfc88bd13 100644 --- a/include/xrpl/nodestore/Task.h +++ b/include/xrpl/nodestore/Task.h @@ -1,6 +1,7 @@ #pragma once -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { /** Derived classes perform scheduled tasks. */ struct Task @@ -14,4 +15,5 @@ struct Task performScheduledTask() = 0; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/Types.h b/include/xrpl/nodestore/Types.h index 851cbcfb8b..5adbc40f70 100644 --- a/include/xrpl/nodestore/Types.h +++ b/include/xrpl/nodestore/Types.h @@ -4,7 +4,8 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { enum { // This is only used to pre-allocate the array for @@ -21,11 +22,11 @@ enum { /** Return codes from Backend operations. */ enum Status { - ok = 0, - notFound = 1, - dataCorrupt = 2, - unknown = 3, - backendError = 4, + ok, + notFound, + dataCorrupt, + unknown, + backendError, customCode = 100 }; @@ -33,4 +34,6 @@ enum Status { /** A batch of NodeObjects to write at once. */ using Batch = std::vector>; -} // namespace xrpl::NodeStore +} // namespace NodeStore + +} // namespace xrpl diff --git a/include/xrpl/nodestore/detail/BatchWriter.h b/include/xrpl/nodestore/detail/BatchWriter.h index 1112ccc324..93993d1c3e 100644 --- a/include/xrpl/nodestore/detail/BatchWriter.h +++ b/include/xrpl/nodestore/detail/BatchWriter.h @@ -7,7 +7,8 @@ #include #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { /** Batch-writing assist logic. @@ -40,7 +41,7 @@ public: Anything pending in the batch is written out before this returns. */ - ~BatchWriter() override; + ~BatchWriter(); /** Store the object. @@ -75,4 +76,5 @@ private: Batch mWriteSet; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/detail/DatabaseNodeImp.h b/include/xrpl/nodestore/detail/DatabaseNodeImp.h index 88fb994bee..21f06fef8d 100644 --- a/include/xrpl/nodestore/detail/DatabaseNodeImp.h +++ b/include/xrpl/nodestore/detail/DatabaseNodeImp.h @@ -4,7 +4,8 @@ #include #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { class DatabaseNodeImp : public Database { @@ -28,7 +29,7 @@ public: "backend"); } - ~DatabaseNodeImp() override + ~DatabaseNodeImp() { stop(); } @@ -91,4 +92,5 @@ private: } }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h index 7010c87ebf..8d4cd9ddbc 100644 --- a/include/xrpl/nodestore/detail/DatabaseRotatingImp.h +++ b/include/xrpl/nodestore/detail/DatabaseRotatingImp.h @@ -4,7 +4,8 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { class DatabaseRotatingImp : public DatabaseRotating { @@ -22,7 +23,7 @@ public: Section const& config, beast::Journal j); - ~DatabaseRotatingImp() override + ~DatabaseRotatingImp() { stop(); } @@ -68,4 +69,5 @@ private: for_each(std::function)> f) override; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/detail/DecodedBlob.h b/include/xrpl/nodestore/detail/DecodedBlob.h index 052c143009..dc6704a08d 100644 --- a/include/xrpl/nodestore/detail/DecodedBlob.h +++ b/include/xrpl/nodestore/detail/DecodedBlob.h @@ -2,7 +2,8 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { /** Parsed key/value blob into NodeObject components. @@ -40,4 +41,5 @@ private: int m_dataBytes; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/detail/EncodedBlob.h b/include/xrpl/nodestore/detail/EncodedBlob.h index 343e1720a0..b05583475e 100644 --- a/include/xrpl/nodestore/detail/EncodedBlob.h +++ b/include/xrpl/nodestore/detail/EncodedBlob.h @@ -9,7 +9,8 @@ #include #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { /** Convert a NodeObject from in-memory to database format. @@ -104,4 +105,5 @@ public: } }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/detail/ManagerImp.h b/include/xrpl/nodestore/detail/ManagerImp.h index 46363f9dab..cb10a740c1 100644 --- a/include/xrpl/nodestore/detail/ManagerImp.h +++ b/include/xrpl/nodestore/detail/ManagerImp.h @@ -2,7 +2,9 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { + +namespace NodeStore { class ManagerImp : public Manager { @@ -19,7 +21,7 @@ public: ManagerImp(); - ~ManagerImp() override = default; + ~ManagerImp() = default; Factory* find(std::string const& name) override; @@ -46,4 +48,5 @@ public: beast::Journal journal) override; }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/detail/codec.h b/include/xrpl/nodestore/detail/codec.h index c159558f83..4e12c6b4db 100644 --- a/include/xrpl/nodestore/detail/codec.h +++ b/include/xrpl/nodestore/detail/codec.h @@ -17,7 +17,8 @@ #include #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { template std::pair @@ -112,11 +113,9 @@ nodeobject_decompress(void const* in, std::size_t in_size, BufferFactory&& bf) { auto const hs = field::size; // Mask if (in_size < hs + 32) - { Throw( "nodeobject codec v1: short inner node size: " + std::string("in_size = ") + std::to_string(in_size) + " hs = " + std::to_string(hs)); - } istream is(p, in_size); std::uint16_t mask = 0; read(is, mask); // Mask @@ -137,12 +136,10 @@ nodeobject_decompress(void const* in, std::size_t in_size, BufferFactory&& bf) if (mask & bit) { if (in_size < 32) - { Throw( "nodeobject codec v1: short inner node subsize: " + std::string("in_size = ") + std::to_string(in_size) + " i = " + std::to_string(i)); - } std::memcpy(os.data(32), is(32), 32); in_size -= 32; } @@ -152,20 +149,16 @@ nodeobject_decompress(void const* in, std::size_t in_size, BufferFactory&& bf) } } if (in_size > 0) - { Throw( "nodeobject codec v1: long inner node, in_size = " + std::to_string(in_size)); - } break; } case 3: // full v1 inner node { - if (in_size != 16 * 32) - { // hashes + if (in_size != 16 * 32) // hashes Throw( "nodeobject codec v1: short full inner node, in_size = " + std::to_string(in_size)); - } istream is(p, in_size); result.second = 525; void* const out = bf(result.second); @@ -221,7 +214,7 @@ nodeobject_compress(void const* in, std::size_t in_size, BufferFactory&& bf) void const* const h = is(32); if (std::memcmp(h, zero32(), 32) == 0) continue; - std::memcpy(vh.data() + (32 * n), h, 32); + std::memcpy(vh.data() + 32 * n, h, 32); mask |= bit; ++n; } @@ -232,7 +225,7 @@ nodeobject_compress(void const* in, std::size_t in_size, BufferFactory&& bf) auto const type = 2U; auto const vs = size_varint(type); result.second = vs + field::size + // mask - (n * 32); // hashes + n * 32; // hashes std::uint8_t* out = reinterpret_cast(bf(result.second)); result.first = out; ostream os(out, result.second); @@ -244,7 +237,7 @@ nodeobject_compress(void const* in, std::size_t in_size, BufferFactory&& bf) // 3 = full v1 inner node auto const type = 3U; auto const vs = size_varint(type); - result.second = vs + (n * 32); // hashes + result.second = vs + n * 32; // hashes std::uint8_t* out = reinterpret_cast(bf(result.second)); result.first = out; ostream os(out, result.second); @@ -312,4 +305,5 @@ filter_inner(void* in, std::size_t in_size) } } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/nodestore/detail/varint.h b/include/xrpl/nodestore/detail/varint.h index e63944c63b..c84ed383ed 100644 --- a/include/xrpl/nodestore/detail/varint.h +++ b/include/xrpl/nodestore/detail/varint.h @@ -5,7 +5,8 @@ #include #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { // This is a variant of the base128 varint format from // google protocol buffers: @@ -17,7 +18,7 @@ struct varint; // Metafuncton to return largest // possible size of T represented as varint. // T must be unsigned -template > +template ::value> struct varint_traits; template @@ -41,10 +42,8 @@ read_varint(void const* buf, std::size_t buflen, std::size_t& t) std::uint8_t const* p = reinterpret_cast(buf); std::size_t n = 0; while (p[n] & 0x80) - { if (++n >= buflen) return 0; - } if (++n > buflen) return 0; // Special case for 0 @@ -66,7 +65,7 @@ read_varint(void const* buf, std::size_t buflen, std::size_t& t) return used; } -template >* = nullptr> +template ::value>* = nullptr> std::size_t size_varint(T v) { @@ -98,7 +97,7 @@ write_varint(void* p0, std::size_t v) // input stream -template >* = nullptr> +template ::value>* = nullptr> void read(nudb::detail::istream& is, std::size_t& u) { @@ -111,11 +110,12 @@ read(nudb::detail::istream& is, std::size_t& u) // output stream -template >* = nullptr> +template ::value>* = nullptr> void write(nudb::detail::ostream& os, std::size_t t) { write_varint(os.data(size_varint(t)), t); } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/include/xrpl/protocol/AmountConversions.h b/include/xrpl/protocol/AmountConversions.h index 9fb45e7bf8..e1965c1d5c 100644 --- a/include/xrpl/protocol/AmountConversions.h +++ b/include/xrpl/protocol/AmountConversions.h @@ -148,17 +148,11 @@ toAmount(Asset const& asset, Number const& n, Number::rounding_mode mode = Numbe Number::setround(mode); if constexpr (std::is_same_v) - { return IOUAmount(n); - } else if constexpr (std::is_same_v) - { return XRPAmount(static_cast(n)); - } else if constexpr (std::is_same_v) - { return MPTAmount(static_cast(n)); - } else if constexpr (std::is_same_v) { if (isXRP(asset)) @@ -177,17 +171,11 @@ T toMaxAmount(Asset const& asset) { if constexpr (std::is_same_v) - { return IOUAmount(STAmount::cMaxValue, STAmount::cMaxOffset); - } else if constexpr (std::is_same_v) - { return XRPAmount(static_cast(STAmount::cMaxNativeN)); - } else if constexpr (std::is_same_v) - { return MPTAmount(maxMPTokenAmount); - } else if constexpr (std::is_same_v) { return asset.visit( @@ -216,21 +204,13 @@ Asset getAsset(T const& amt) { if constexpr (std::is_same_v) - { return noIssue(); - } else if constexpr (std::is_same_v) - { return xrpIssue(); - } else if constexpr (std::is_same_v) - { return noMPT(); - } else if constexpr (std::is_same_v) - { return amt.asset(); - } else { constexpr bool alwaysFalse = !std::is_same_v; @@ -243,21 +223,13 @@ constexpr T get(STAmount const& a) { if constexpr (std::is_same_v) - { return a.iou(); - } else if constexpr (std::is_same_v) - { return a.xrp(); - } else if constexpr (std::is_same_v) - { return a.mpt(); - } else if constexpr (std::is_same_v) - { return a; - } else { constexpr bool alwaysFalse = !std::is_same_v; diff --git a/include/xrpl/protocol/ApiVersion.h b/include/xrpl/protocol/ApiVersion.h index 653b4830bf..8772b5a49d 100644 --- a/include/xrpl/protocol/ApiVersion.h +++ b/include/xrpl/protocol/ApiVersion.h @@ -138,11 +138,9 @@ forApiVersions(Fn const& fn, Args&&... args) { constexpr auto size = maxVer + 1 - minVer; [&](std::index_sequence) { - // NOLINTBEGIN(bugprone-use-after-move) (((void)fn( std::integral_constant{}, std::forward(args)...)), ...); - // NOLINTEND(bugprone-use-after-move) }(std::make_index_sequence{}); } diff --git a/include/xrpl/protocol/Asset.h b/include/xrpl/protocol/Asset.h index b1f0338665..c8c629ab48 100644 --- a/include/xrpl/protocol/Asset.h +++ b/include/xrpl/protocol/Asset.h @@ -221,13 +221,9 @@ operator==(Asset const& lhs, Asset const& rhs) return std::visit( [&](TLhs const& issLhs, TRhs const& issRhs) { if constexpr (std::is_same_v) - { return issLhs == issRhs; - } else - { return false; - } }, lhs.issue_, rhs.issue_); @@ -239,17 +235,11 @@ operator<=>(Asset const& lhs, Asset const& rhs) return std::visit( [](TLhs const& lhs_, TRhs const& rhs_) { if constexpr (std::is_same_v) - { return std::weak_ordering(lhs_ <=> rhs_); - } else if constexpr (is_issue_v && is_mptissue_v) - { return std::weak_ordering::greater; - } else - { return std::weak_ordering::less; - } }, lhs.issue_, rhs.issue_); @@ -277,17 +267,11 @@ equalTokens(Asset const& lhs, Asset const& rhs) return std::visit( [&](TLhs const& issLhs, TRhs const& issRhs) { if constexpr (std::is_same_v && std::is_same_v) - { return issLhs.currency == issRhs.currency; - } else if constexpr (std::is_same_v && std::is_same_v) - { return issLhs.getMptID() == issRhs.getMptID(); - } else - { return false; - } }, lhs.issue_, rhs.issue_); @@ -308,6 +292,9 @@ validJSONAsset(Json::Value const& jv); Asset assetFromJson(Json::Value const& jv); +Json::Value +to_json(Asset const& asset); + inline bool isConsistent(Asset const& asset) { diff --git a/include/xrpl/protocol/Book.h b/include/xrpl/protocol/Book.h index cda4daf603..638d9b387d 100644 --- a/include/xrpl/protocol/Book.h +++ b/include/xrpl/protocol/Book.h @@ -19,7 +19,9 @@ public: Asset out; std::optional domain; - Book() = default; + Book() + { + } Book(Asset const& in_, Asset const& out_, std::optional const& domain_) : in(in_), out(out_), domain(domain_) @@ -51,7 +53,7 @@ reversed(Book const& book); /** Equality comparison. */ /** @{ */ -[[nodiscard]] constexpr bool +[[nodiscard]] inline constexpr bool operator==(Book const& lhs, Book const& rhs) { return (lhs.in == rhs.in) && (lhs.out == rhs.out) && (lhs.domain == rhs.domain); @@ -60,7 +62,7 @@ operator==(Book const& lhs, Book const& rhs) /** Strict weak ordering. */ /** @{ */ -[[nodiscard]] constexpr std::weak_ordering +[[nodiscard]] inline constexpr std::weak_ordering operator<=>(Book const& lhs, Book const& rhs) { if (auto const c{lhs.in <=> rhs.in}; c != 0) diff --git a/include/xrpl/protocol/BuildInfo.h b/include/xrpl/protocol/BuildInfo.h index 47a27339a8..522747bc94 100644 --- a/include/xrpl/protocol/BuildInfo.h +++ b/include/xrpl/protocol/BuildInfo.h @@ -3,9 +3,11 @@ #include #include +namespace xrpl { + /** Versioning information for this build. */ // VFALCO The namespace is deprecated -namespace xrpl::BuildInfo { +namespace BuildInfo { /** Server version. Follows the Semantic Versioning Specification: @@ -74,4 +76,6 @@ isXrpldVersion(std::uint64_t version); bool isNewerVersion(std::uint64_t version); -} // namespace xrpl::BuildInfo +} // namespace BuildInfo + +} // namespace xrpl diff --git a/include/xrpl/protocol/Feature.h b/include/xrpl/protocol/Feature.h index 8f96935ca1..112f66f4a1 100644 --- a/include/xrpl/protocol/Feature.h +++ b/include/xrpl/protocol/Feature.h @@ -107,8 +107,8 @@ validFeatureName(auto fn) -> bool return true; } -enum class VoteBehavior : int { Obsolete = -1, DefaultNo = 0, DefaultYes = 1 }; -enum class AmendmentSupport : int { Retired = -1, Supported = 0, Unsupported = 1 }; +enum class VoteBehavior : int { Obsolete = -1, DefaultNo = 0, DefaultYes }; +enum class AmendmentSupport : int { Retired = -1, Supported = 0, Unsupported }; /** All amendments libxrpl knows about. */ std::map const& @@ -125,12 +125,10 @@ namespace detail { #pragma push_macro("XRPL_RETIRE_FIX") #undef XRPL_RETIRE_FIX -// NOLINTBEGIN(bugprone-macro-parentheses) #define XRPL_FEATURE(name, supported, vote) +1 #define XRPL_FIX(name, supported, vote) +1 #define XRPL_RETIRE_FEATURE(name) +1 #define XRPL_RETIRE_FIX(name) +1 -// NOLINTEND(bugprone-macro-parentheses) // This value SHOULD be equal to the number of amendments registered in // Feature.cpp. Because it's only used to reserve storage, and determine how @@ -375,10 +373,8 @@ void foreachFeature(FeatureBitset bs, F&& f) { for (size_t i = 0; i < bs.size(); ++i) - { if (bs[i]) f(bitsetIndexToFeature(i)); - } } #pragma push_macro("XRPL_FEATURE") diff --git a/include/xrpl/protocol/IOUAmount.h b/include/xrpl/protocol/IOUAmount.h index 1744345a1b..47aa35e0e8 100644 --- a/include/xrpl/protocol/IOUAmount.h +++ b/include/xrpl/protocol/IOUAmount.h @@ -151,9 +151,7 @@ operator bool() const noexcept inline int IOUAmount::signum() const noexcept { - if (mantissa_ < 0) - return -1; - return (mantissa_ != 0) ? 1 : 0; + return (mantissa_ < 0) ? -1 : (mantissa_ ? 1 : 0); } inline IOUAmount::exponent_type diff --git a/include/xrpl/protocol/Indexes.h b/include/xrpl/protocol/Indexes.h index f4dd5e6816..574bbfbde6 100644 --- a/include/xrpl/protocol/Indexes.h +++ b/include/xrpl/protocol/Indexes.h @@ -374,14 +374,14 @@ struct keyletDesc // This list should include all of the keylet functions that take a single // AccountID parameter. std::array, 6> const directAccountKeylets{ - {{.function = &keylet::account, .expectedLEName = jss::AccountRoot, .includeInTests = false}, - {.function = &keylet::ownerDir, .expectedLEName = jss::DirectoryNode, .includeInTests = true}, - {.function = &keylet::signers, .expectedLEName = jss::SignerList, .includeInTests = true}, + {{&keylet::account, jss::AccountRoot, false}, + {&keylet::ownerDir, jss::DirectoryNode, true}, + {&keylet::signers, jss::SignerList, true}, // It's normally impossible to create an item at nftpage_min, but // test it anyway, since the invariant checks for it. - {.function = &keylet::nftpage_min, .expectedLEName = jss::NFTokenPage, .includeInTests = true}, - {.function = &keylet::nftpage_max, .expectedLEName = jss::NFTokenPage, .includeInTests = true}, - {.function = &keylet::did, .expectedLEName = jss::DID, .includeInTests = true}}}; + {&keylet::nftpage_min, jss::NFTokenPage, true}, + {&keylet::nftpage_max, jss::NFTokenPage, true}, + {&keylet::did, jss::DID, true}}}; MPTID makeMptID(std::uint32_t sequence, AccountID const& account); diff --git a/include/xrpl/protocol/Issue.h b/include/xrpl/protocol/Issue.h index 569b01725d..7bd01185c9 100644 --- a/include/xrpl/protocol/Issue.h +++ b/include/xrpl/protocol/Issue.h @@ -12,8 +12,8 @@ namespace xrpl { class Issue { public: - Currency currency; - AccountID account; + Currency currency{}; + AccountID account{}; Issue() = default; @@ -68,7 +68,7 @@ hash_append(Hasher& h, Issue const& r) /** Equality comparison. */ /** @{ */ -[[nodiscard]] constexpr bool +[[nodiscard]] inline constexpr bool operator==(Issue const& lhs, Issue const& rhs) { return (lhs.currency == rhs.currency) && (isXRP(lhs.currency) || lhs.account == rhs.account); diff --git a/include/xrpl/protocol/KnownFormats.h b/include/xrpl/protocol/KnownFormats.h index fb93940fa8..c454683e19 100644 --- a/include/xrpl/protocol/KnownFormats.h +++ b/include/xrpl/protocol/KnownFormats.h @@ -38,7 +38,7 @@ public: { // Verify that KeyType is appropriate. static_assert( - std::is_enum_v || std::is_integral_v, + std::is_enum::value || std::is_integral::value, "KnownFormats KeyType must be integral or enum."); } @@ -74,12 +74,10 @@ public: Derived classes will load the object with all the known formats. */ -private: KnownFormats() : name_(beast::type_name()) { } -public: /** Destroy the known formats object. The defined formats are deleted. @@ -183,7 +181,6 @@ private: boost::container::flat_map names_; boost::container::flat_map types_; - friend Derived; }; } // namespace xrpl diff --git a/include/xrpl/protocol/LedgerFormats.h b/include/xrpl/protocol/LedgerFormats.h index 401e918d9f..dd25aaeffe 100644 --- a/include/xrpl/protocol/LedgerFormats.h +++ b/include/xrpl/protocol/LedgerFormats.h @@ -213,7 +213,7 @@ enum LedgerEntryType : std::uint16_t { // lsfRequireDestTag = 0x00020000, // ... // }; -#define TO_VALUE(name, value) name = (value), +#define TO_VALUE(name, value) name = value, #define NULL_NAME(name, values) values #define NULL_OUTPUT(name, value) enum LedgerSpecificFlags : std::uint32_t { XMACRO(NULL_NAME, TO_VALUE, NULL_OUTPUT) }; diff --git a/include/xrpl/protocol/LedgerHeader.h b/include/xrpl/protocol/LedgerHeader.h index 1035e5e892..6e22ad268d 100644 --- a/include/xrpl/protocol/LedgerHeader.h +++ b/include/xrpl/protocol/LedgerHeader.h @@ -19,7 +19,7 @@ struct LedgerHeader // LedgerIndex seq = 0; - NetClock::time_point parentCloseTime; + NetClock::time_point parentCloseTime = {}; // // For closed ledgers @@ -49,7 +49,7 @@ struct LedgerHeader // closed. For open ledgers, the time the ledger // will close if there's no transactions. // - NetClock::time_point closeTime; + NetClock::time_point closeTime = {}; }; // ledger close flags diff --git a/include/xrpl/protocol/MPTAmount.h b/include/xrpl/protocol/MPTAmount.h index 4a6297cc74..33b6e5abe4 100644 --- a/include/xrpl/protocol/MPTAmount.h +++ b/include/xrpl/protocol/MPTAmount.h @@ -109,9 +109,7 @@ operator bool() const noexcept constexpr int MPTAmount::signum() const noexcept { - if (value_ < 0) - return -1; - return (value_ != 0) ? 1 : 0; + return (value_ < 0) ? -1 : (value_ ? 1 : 0); } /** Returns the underlying value. Code SHOULD NOT call this @@ -143,7 +141,7 @@ mulRatio(MPTAmount const& amt, std::uint32_t num, std::uint32_t den, bool roundU { using namespace boost::multiprecision; - if (den == 0u) + if (!den) Throw("division by zero"); int128_t const amt128(amt.value()); diff --git a/include/xrpl/protocol/MPTIssue.h b/include/xrpl/protocol/MPTIssue.h index 727aef9008..60b7072902 100644 --- a/include/xrpl/protocol/MPTIssue.h +++ b/include/xrpl/protocol/MPTIssue.h @@ -47,14 +47,14 @@ public: friend constexpr std::weak_ordering operator<=>(MPTIssue const& lhs, MPTIssue const& rhs); - static bool - native() + bool + native() const { return false; } - static bool - integral() + bool + integral() const { return true; } @@ -94,9 +94,9 @@ getMPTIssuer(MPTID const& mptid) } // Disallow temporary -AccountID const& +inline AccountID const& getMPTIssuer(MPTID const&&) = delete; -AccountID const& +inline AccountID const& getMPTIssuer(MPTID&&) = delete; inline MPTID diff --git a/include/xrpl/protocol/MultiApiJson.h b/include/xrpl/protocol/MultiApiJson.h index 8d287767a6..1ebe72f15e 100644 --- a/include/xrpl/protocol/MultiApiJson.h +++ b/include/xrpl/protocol/MultiApiJson.h @@ -74,14 +74,10 @@ struct MultiApiJson { int count = 0; for (auto& a : this->val) - { if (a.isMember(key)) count += 1; - } - if (count == 0) - return none; - return count < size ? some : all; + return (count == 0 ? none : (count < size ? some : all)); } static constexpr struct visitor_t final diff --git a/include/xrpl/protocol/NFTSyntheticSerializer.h b/include/xrpl/protocol/NFTSyntheticSerializer.h index dcfd132ed8..c33a6edc7d 100644 --- a/include/xrpl/protocol/NFTSyntheticSerializer.h +++ b/include/xrpl/protocol/NFTSyntheticSerializer.h @@ -6,7 +6,9 @@ #include -namespace xrpl::RPC { +namespace xrpl { + +namespace RPC { /** Adds common synthetic fields to transaction-related JSON responses @@ -17,4 +19,5 @@ void insertNFTSyntheticInJson(Json::Value&, std::shared_ptr const&, TxMeta const&); /** @} */ -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/include/xrpl/protocol/PathAsset.h b/include/xrpl/protocol/PathAsset.h index 662e568bec..31bd8f384f 100644 --- a/include/xrpl/protocol/PathAsset.h +++ b/include/xrpl/protocol/PathAsset.h @@ -100,13 +100,9 @@ operator==(PathAsset const& lhs, PathAsset const& rhs) return std::visit( [](TLhs const& lhs_, TRhs const& rhs_) { if constexpr (std::is_same_v) - { return lhs_ == rhs_; - } else - { return false; - } }, lhs.value(), rhs.value()); diff --git a/include/xrpl/protocol/Permissions.h b/include/xrpl/protocol/Permissions.h index ea8bd77643..0ec4f04f1a 100644 --- a/include/xrpl/protocol/Permissions.h +++ b/include/xrpl/protocol/Permissions.h @@ -20,7 +20,7 @@ enum GranularPermissionType : std::uint32_t { #pragma push_macro("PERMISSION") #undef PERMISSION -#define PERMISSION(type, txType, value) type = (value), +#define PERMISSION(type, txType, value) type = value, #include diff --git a/include/xrpl/protocol/PublicKey.h b/include/xrpl/protocol/PublicKey.h index 9003175f3d..64ced93ffb 100644 --- a/include/xrpl/protocol/PublicKey.h +++ b/include/xrpl/protocol/PublicKey.h @@ -69,8 +69,8 @@ public: return buf_; } - static std::size_t - size() noexcept + std::size_t + size() const noexcept { return size_; } diff --git a/include/xrpl/protocol/Quality.h b/include/xrpl/protocol/Quality.h index b0e3e65d6c..851e34d396 100644 --- a/include/xrpl/protocol/Quality.h +++ b/include/xrpl/protocol/Quality.h @@ -8,7 +8,6 @@ #include #include #include -#include namespace xrpl { @@ -30,7 +29,7 @@ struct TAmounts { } - TAmounts(In in_, Out out_) : in(std::move(in_)), out(std::move(out_)) + TAmounts(In const& in_, Out const& out_) : in(in_), out(out_) { } @@ -282,7 +281,7 @@ public: double const minVD = static_cast(minVMantissa); double const maxVD = - (expDiff != 0) ? maxVMantissa * pow(10, expDiff) : static_cast(maxVMantissa); + expDiff ? maxVMantissa * pow(10, expDiff) : static_cast(maxVMantissa); // maxVD and minVD are scaled so they have the same exponents. Dividing // cancels out the exponents, so we only need to deal with the (scaled) diff --git a/include/xrpl/protocol/RPCErr.h b/include/xrpl/protocol/RPCErr.h index e42bf5e637..34c4bf8f99 100644 --- a/include/xrpl/protocol/RPCErr.h +++ b/include/xrpl/protocol/RPCErr.h @@ -1,7 +1,6 @@ #pragma once #include -#include namespace xrpl { diff --git a/include/xrpl/protocol/SField.h b/include/xrpl/protocol/SField.h index cbc2c12f4e..7a864b1b58 100644 --- a/include/xrpl/protocol/SField.h +++ b/include/xrpl/protocol/SField.h @@ -84,7 +84,7 @@ class STCurrency; #pragma push_macro("TO_MAP") #undef TO_MAP -#define TO_ENUM(name, value) name = (value), +#define TO_ENUM(name, value) name = value, #define TO_MAP(name, value) {#name, value}, enum SerializedTypeID { XMACRO(TO_ENUM) }; diff --git a/include/xrpl/protocol/STAmount.h b/include/xrpl/protocol/STAmount.h index 695bd3c0b1..3fa4a53e3f 100644 --- a/include/xrpl/protocol/STAmount.h +++ b/include/xrpl/protocol/STAmount.h @@ -42,13 +42,13 @@ private: public: using value_type = STAmount; - constexpr static int cMinOffset = -96; - constexpr static int cMaxOffset = 80; + static int const cMinOffset = -96; + static int const cMaxOffset = 80; // Maximum native value supported by the code constexpr static std::uint64_t cMinValue = 1'000'000'000'000'000ull; static_assert(isPowerOfTen(cMinValue)); - constexpr static std::uint64_t cMaxValue = (cMinValue * 10) - 1; + constexpr static std::uint64_t cMaxValue = cMinValue * 10 - 1; static_assert(cMaxValue == 9'999'999'999'999'999ull); constexpr static std::uint64_t cMaxNative = 9'000'000'000'000'000'000ull; @@ -359,13 +359,9 @@ inline STAmount::STAmount(IOUAmount const& amount, Issue const& issue) : mAsset(issue), mOffset(amount.exponent()), mIsNegative(amount < beast::zero) { if (mIsNegative) - { mValue = unsafe_cast(-amount.mantissa()); - } else - { mValue = unsafe_cast(amount.mantissa()); - } canonicalize(); } @@ -374,13 +370,9 @@ inline STAmount::STAmount(MPTAmount const& amount, MPTIssue const& mptIssue) : mAsset(mptIssue), mOffset(0), mIsNegative(amount < beast::zero) { if (mIsNegative) - { mValue = unsafe_cast(-amount.value()); - } else - { mValue = unsafe_cast(amount.value()); - } canonicalize(); } @@ -409,7 +401,7 @@ amountFromJsonNoThrow(STAmount& result, Json::Value const& jvSource); inline STAmount const& toSTAmount(STAmount const& a) { - return a; // NOLINT(bugprone-return-const-ref-from-parameter) + return a; } //------------------------------------------------------------------------------ @@ -484,9 +476,7 @@ STAmount::getIssuer() const inline int STAmount::signum() const noexcept { - if (mValue == 0u) - return 0; - return mIsNegative ? -1 : 1; + return mValue ? (mIsNegative ? -1 : 1) : 0; } inline STAmount @@ -734,21 +724,6 @@ canAdd(STAmount const& amt1, STAmount const& amt2); bool canSubtract(STAmount const& amt1, STAmount const& amt2); -/** Get the scale of a Number for a given asset. - * - * "scale" is similar to "exponent", but from the perspective of STAmount, which has different rules - * and mantissa ranges for determining the exponent than Number. - * - * @param number The Number to get the scale of. - * @param asset The asset to use for determining the scale. - * @return The scale of this Number for the given asset. - */ -inline int -scale(Number const& number, Asset const& asset) -{ - return STAmount{asset, number}.exponent(); -} - } // namespace xrpl //------------------------------------------------------------------------------ diff --git a/include/xrpl/protocol/STBlob.h b/include/xrpl/protocol/STBlob.h index b9dc78ffe4..71d1a04478 100644 --- a/include/xrpl/protocol/STBlob.h +++ b/include/xrpl/protocol/STBlob.h @@ -95,7 +95,7 @@ STBlob::size() const inline std::uint8_t const* STBlob::data() const { - return value_.data(); + return reinterpret_cast(value_.data()); } inline STBlob& diff --git a/include/xrpl/protocol/STCurrency.h b/include/xrpl/protocol/STCurrency.h index 5fd4c08fbb..dc5b079c6d 100644 --- a/include/xrpl/protocol/STCurrency.h +++ b/include/xrpl/protocol/STCurrency.h @@ -11,7 +11,7 @@ namespace xrpl { class STCurrency final : public STBase { private: - Currency currency_; + Currency currency_{}; public: using value_type = Currency; diff --git a/include/xrpl/protocol/STExchange.h b/include/xrpl/protocol/STExchange.h index c733df37cf..4b576991b7 100644 --- a/include/xrpl/protocol/STExchange.h +++ b/include/xrpl/protocol/STExchange.h @@ -123,7 +123,7 @@ template void set(STObject& st, TypedField const& f, T&& t) { - st.set(STExchange>::set(f, std::forward(t))); + st.set(STExchange::type>::set(f, std::forward(t))); } /** Set a blob field using an init function. */ diff --git a/include/xrpl/protocol/STObject.h b/include/xrpl/protocol/STObject.h index 34bd19b9a0..7553521237 100644 --- a/include/xrpl/protocol/STObject.h +++ b/include/xrpl/protocol/STObject.h @@ -62,7 +62,7 @@ class STObject : public STBase, public CountedObject public: using iterator = boost::transform_iterator; - ~STObject() override = default; + virtual ~STObject() = default; STObject(STObject const&) = default; template @@ -436,7 +436,8 @@ private: // by value. template < typename T, - typename V = std::remove_cv_t().value())>>> + typename V = typename std::remove_cv< + typename std::remove_reference().value())>::type>::type> V getFieldByValue(SField const& field) const; @@ -578,7 +579,7 @@ class STObject::OptionalProxy : public Proxy private: using value_type = typename T::value_type; - using optional_type = std::optional>; + using optional_type = std::optional::type>; public: OptionalProxy(OptionalProxy const&) = default; @@ -703,7 +704,7 @@ class STObject::FieldErr : public std::runtime_error template STObject::Proxy::Proxy(STObject* st, TypedField const* f) : st_(st), f_(f) { - if (st_->mType != nullptr) + if (st_->mType) { // STObject has associated template if (!st_->peekAtPField(*f_)) @@ -769,13 +770,9 @@ STObject::Proxy::assign(U&& u) } T* t = nullptr; if (style_ == soeINVALID) - { t = dynamic_cast(st_->getPField(*f_, true)); - } else - { t = dynamic_cast(st_->makeFieldPresent(*f_)); - } XRPL_ASSERT(t, "xrpl::STObject::Proxy::assign : type cast succeeded"); *t = std::forward(u); } @@ -861,13 +858,9 @@ STObject::OptionalProxy::operator=( -> OptionalProxy& { if (v) - { this->assign(std::move(*v)); - } else - { disengage(); - } return *this; } @@ -876,13 +869,9 @@ auto STObject::OptionalProxy::operator=(optional_type const& v) -> OptionalProxy& { if (v) - { this->assign(*v); - } else - { disengage(); - } return *this; } @@ -914,13 +903,9 @@ STObject::OptionalProxy::disengage() if (this->style_ == soeREQUIRED || this->style_ == soeDEFAULT) Throw("Template field error '" + this->f_->getName() + "'"); if (this->style_ == soeINVALID) - { this->st_->delField(*this->f_); - } else - { this->st_->makeFieldAbsent(*this->f_); - } } template @@ -1073,11 +1058,9 @@ STObject::at(TypedField const& f) const { auto const b = peekAtPField(f); if (!b) - { // This is a free object (no constraints) // with no template Throw("Missing field: " + f.getName()); - } if (auto const u = dynamic_cast(b)) return u->value(); @@ -1155,13 +1138,9 @@ STObject::setFieldH160(SField const& field, base_uint<160, Tag> const& v) using Bits = STBitString<160>; if (auto cf = dynamic_cast(rf)) - { cf->setValue(v); - } else - { Throw("Wrong field type"); - } } inline bool @@ -1209,10 +1188,7 @@ STObject::getFieldByConstRef(SField const& field, V const& empty) const SerializedTypeID const id = rf->getSType(); if (id == STI_NOTPRESENT) - { - // NOLINTNEXTLINE(bugprone-return-const-ref-from-parameter) return empty; // optional field not present - } T const* cf = dynamic_cast(rf); @@ -1227,7 +1203,7 @@ template void STObject::setFieldUsingSetValue(SField const& field, V value) { - static_assert(!std::is_lvalue_reference_v, ""); + static_assert(!std::is_lvalue_reference::value, ""); STBase* rf = getPField(field, true); diff --git a/include/xrpl/protocol/STValidation.h b/include/xrpl/protocol/STValidation.h index c645336b59..861e2152f8 100644 --- a/include/xrpl/protocol/STValidation.h +++ b/include/xrpl/protocol/STValidation.h @@ -36,7 +36,7 @@ class STValidation final : public STObject, public CountedObject // that use manifests this will be derived from the master public key. NodeID const nodeID_; - NetClock::time_point seenTime_; + NetClock::time_point seenTime_ = {}; public: /** Construct a STValidation from a peer from serialized data. diff --git a/include/xrpl/protocol/STVector256.h b/include/xrpl/protocol/STVector256.h index 69b06ec1da..815224def2 100644 --- a/include/xrpl/protocol/STVector256.h +++ b/include/xrpl/protocol/STVector256.h @@ -148,7 +148,7 @@ STVector256::size() const inline void STVector256::resize(std::size_t n) { - mValue.resize(n); + return mValue.resize(n); } inline bool @@ -220,7 +220,7 @@ STVector256::erase(std::vector::iterator position) inline void STVector256::clear() noexcept { - mValue.clear(); + return mValue.clear(); } } // namespace xrpl diff --git a/include/xrpl/protocol/SecretKey.h b/include/xrpl/protocol/SecretKey.h index c17b3984e9..530b6fc35f 100644 --- a/include/xrpl/protocol/SecretKey.h +++ b/include/xrpl/protocol/SecretKey.h @@ -85,10 +85,10 @@ public: } }; -bool +inline bool operator==(SecretKey const& lhs, SecretKey const& rhs) = delete; -bool +inline bool operator!=(SecretKey const& lhs, SecretKey const& rhs) = delete; //------------------------------------------------------------------------------ diff --git a/include/xrpl/protocol/Serializer.h b/include/xrpl/protocol/Serializer.h index 6ce60022e3..2d3489fe7b 100644 --- a/include/xrpl/protocol/Serializer.h +++ b/include/xrpl/protocol/Serializer.h @@ -33,7 +33,7 @@ public: { mData.resize(size); - if (size != 0u) + if (size) { XRPL_ASSERT(data, "xrpl::Serializer::Serializer(void const*) : non-null input"); std::memcpy(mData.data(), data, size); diff --git a/include/xrpl/protocol/TER.h b/include/xrpl/protocol/TER.h index 4ea885611a..5d15cf1ad7 100644 --- a/include/xrpl/protocol/TER.h +++ b/include/xrpl/protocol/TER.h @@ -491,7 +491,8 @@ public: template constexpr auto operator==(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same_v && std::is_same_v, + std::is_same::value && + std::is_same::value, bool> { return TERtoInt(lhs) == TERtoInt(rhs); @@ -500,7 +501,8 @@ operator==(L const& lhs, R const& rhs) -> std::enable_if_t< template constexpr auto operator!=(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same_v && std::is_same_v, + std::is_same::value && + std::is_same::value, bool> { return TERtoInt(lhs) != TERtoInt(rhs); @@ -509,7 +511,8 @@ operator!=(L const& lhs, R const& rhs) -> std::enable_if_t< template constexpr auto operator<(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same_v && std::is_same_v, + std::is_same::value && + std::is_same::value, bool> { return TERtoInt(lhs) < TERtoInt(rhs); @@ -518,7 +521,8 @@ operator<(L const& lhs, R const& rhs) -> std::enable_if_t< template constexpr auto operator<=(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same_v && std::is_same_v, + std::is_same::value && + std::is_same::value, bool> { return TERtoInt(lhs) <= TERtoInt(rhs); @@ -527,7 +531,8 @@ operator<=(L const& lhs, R const& rhs) -> std::enable_if_t< template constexpr auto operator>(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same_v && std::is_same_v, + std::is_same::value && + std::is_same::value, bool> { return TERtoInt(lhs) > TERtoInt(rhs); @@ -536,7 +541,8 @@ operator>(L const& lhs, R const& rhs) -> std::enable_if_t< template constexpr auto operator>=(L const& lhs, R const& rhs) -> std::enable_if_t< - std::is_same_v && std::is_same_v, + std::is_same::value && + std::is_same::value, bool> { return TERtoInt(lhs) >= TERtoInt(rhs); diff --git a/include/xrpl/protocol/TxFlags.h b/include/xrpl/protocol/TxFlags.h index 37a57fabd3..b90e48a3b8 100644 --- a/include/xrpl/protocol/TxFlags.h +++ b/include/xrpl/protocol/TxFlags.h @@ -236,7 +236,7 @@ XMACRO(NULL_NAME, TO_VALUE, NULL_OUTPUT, NULL_MASK_ADJ) // The mask adjustment (maskAdj) allows adding flags back to the mask, making them invalid. // For example, Batch uses MASK_ADJ(tfInnerBatchTxn) to reject tfInnerBatchTxn on outer Batch. #define TO_MASK(name, values, maskAdj) \ - inline constexpr FlagValue tf##name##Mask = ~(tfUniversal values) | (maskAdj); + inline constexpr FlagValue tf##name##Mask = ~(tfUniversal values) | maskAdj; #define VALUE_TO_MASK(name, value) | name #define MASK_ADJ_TO_MASK(value) value XMACRO(TO_MASK, VALUE_TO_MASK, VALUE_TO_MASK, MASK_ADJ_TO_MASK) diff --git a/include/xrpl/protocol/Units.h b/include/xrpl/protocol/Units.h index b606ca2cdf..196464fa16 100644 --- a/include/xrpl/protocol/Units.h +++ b/include/xrpl/protocol/Units.h @@ -267,9 +267,7 @@ public: constexpr int signum() const noexcept { - if (value_ < 0) - return -1; - return value_ ? 1 : 0; + return (value_ < 0) ? -1 : (value_ ? 1 : 0); } /** Returns the number of drops */ diff --git a/include/xrpl/protocol/XChainAttestations.h b/include/xrpl/protocol/XChainAttestations.h index 44a2334ca0..06eff0fcf2 100644 --- a/include/xrpl/protocol/XChainAttestations.h +++ b/include/xrpl/protocol/XChainAttestations.h @@ -15,7 +15,6 @@ #include #include -#include #include namespace xrpl { @@ -46,7 +45,7 @@ struct AttestationBase PublicKey const& publicKey_, Buffer signature_, AccountID const& sendingAccount_, - STAmount sendingAmount_, + STAmount const& sendingAmount_, AccountID const& rewardAccount_, bool wasLockingChainSend_); @@ -170,7 +169,7 @@ struct AttestationCreateAccount : AttestationBase Buffer signature_, AccountID const& sendingAccount_, STAmount const& sendingAmount_, - STAmount rewardAmount_, + STAmount const& rewardAmount_, AccountID const& rewardAccount_, bool wasLockingChainSend_, std::uint64_t createCount_, @@ -257,8 +256,8 @@ struct XChainClaimAttestation bool wasLockingChainSend; std::optional dst; MatchFields(TSignedAttestation const& att); - MatchFields(STAmount a, bool b, std::optional const& d) - : amount{std::move(a)}, wasLockingChainSend{b}, dst{d} + MatchFields(STAmount const& a, bool b, std::optional const& d) + : amount{a}, wasLockingChainSend{b}, dst{d} { } }; diff --git a/include/xrpl/protocol/XRPAmount.h b/include/xrpl/protocol/XRPAmount.h index 0cb5121ef1..6e4133361b 100644 --- a/include/xrpl/protocol/XRPAmount.h +++ b/include/xrpl/protocol/XRPAmount.h @@ -149,9 +149,7 @@ public: constexpr int signum() const noexcept { - if (drops_ < 0) - return -1; - return (drops_ != 0) ? 1 : 0; + return (drops_ < 0) ? -1 : (drops_ ? 1 : 0); } /** Returns the number of drops */ @@ -264,7 +262,7 @@ mulRatio(XRPAmount const& amt, std::uint32_t num, std::uint32_t den, bool roundU { using namespace boost::multiprecision; - if (den == 0u) + if (!den) Throw("division by zero"); int128_t const amt128(amt.drops()); diff --git a/include/xrpl/protocol/detail/STVar.h b/include/xrpl/protocol/detail/STVar.h index 5526aed8fa..1131437850 100644 --- a/include/xrpl/protocol/detail/STVar.h +++ b/include/xrpl/protocol/detail/STVar.h @@ -7,7 +7,8 @@ #include #include -namespace xrpl::detail { +namespace xrpl { +namespace detail { struct defaultObject_t { @@ -111,13 +112,9 @@ private: construct(Args&&... args) { if constexpr (sizeof(T) > max_size) - { p_ = new T(std::forward(args)...); - } else - { p_ = new (&d_) T(std::forward(args)...); - } } /** Construct requested Serializable Type according to id. @@ -157,4 +154,5 @@ operator!=(STVar const& lhs, STVar const& rhs) return !(lhs == rhs); } -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/include/xrpl/protocol/detail/b58_utils.h b/include/xrpl/protocol/detail/b58_utils.h index ec0e159230..5ad12d56e3 100644 --- a/include/xrpl/protocol/detail/b58_utils.h +++ b/include/xrpl/protocol/detail/b58_utils.h @@ -17,8 +17,8 @@ template using Result = boost::outcome_v2::result; #ifndef _MSC_VER - -namespace b58_fast::detail { +namespace b58_fast { +namespace detail { // This optimizes to what hand written asm would do (single divide) [[nodiscard]] inline std::tuple @@ -33,7 +33,7 @@ carrying_mul(std::uint64_t a, std::uint64_t b, std::uint64_t carry) { unsigned __int128 const x = a; unsigned __int128 const y = b; - unsigned __int128 const c = (x * y) + carry; + unsigned __int128 const c = x * y + carry; return {c & 0xffff'ffff'ffff'ffff, c >> 64}; } @@ -64,13 +64,13 @@ inplace_bigint_add(std::span a, std::uint64_t b) for (auto& v : a.subspan(1)) { - if (carry == 0u) + if (!carry) { return TokenCodecErrc::success; } std::tie(v, carry) = carrying_add(v, 1); } - if (carry != 0u) + if (carry) { return TokenCodecErrc::overflowAdd; } @@ -105,7 +105,7 @@ inplace_bigint_mul(std::span a, std::uint64_t b) [[nodiscard]] inline std::uint64_t inplace_bigint_div_rem(std::span numerator, std::uint64_t divisor) { - if (numerator.empty()) + if (numerator.size() == 0) { // should never happen, but if it does then it seems natural to define // the a null set of numbers to be zero, so the remainder is also zero. @@ -170,8 +170,8 @@ b58_10_to_b58_be(std::uint64_t input) return result; } -} // namespace b58_fast::detail - +} // namespace detail +} // namespace b58_fast #endif } // namespace xrpl diff --git a/include/xrpl/protocol/detail/token_errors.h b/include/xrpl/protocol/detail/token_errors.h index 5511fb06b3..54b283c41a 100644 --- a/include/xrpl/protocol/detail/token_errors.h +++ b/include/xrpl/protocol/detail/token_errors.h @@ -30,14 +30,14 @@ class TokenCodecErrcCategory : public std::error_category { public: // Return a short descriptive name for the category - char const* - name() const noexcept final + virtual char const* + name() const noexcept override final { return "TokenCodecError"; } // Return what each enum means in text - std::string - message(int c) const final + virtual std::string + message(int c) const override final { switch (static_cast(c)) { diff --git a/include/xrpl/protocol/digest.h b/include/xrpl/protocol/digest.h index bbb38fa543..7664069e1c 100644 --- a/include/xrpl/protocol/digest.h +++ b/include/xrpl/protocol/digest.h @@ -177,12 +177,12 @@ public: } private: - void + inline void erase(std::false_type) { } - void + inline void erase(std::true_type) { secure_erase(&h_, sizeof(h_)); diff --git a/include/xrpl/protocol/json_get_or_throw.h b/include/xrpl/protocol/json_get_or_throw.h index 949fb64cf2..4406d9ff24 100644 --- a/include/xrpl/protocol/json_get_or_throw.h +++ b/include/xrpl/protocol/json_get_or_throw.h @@ -146,7 +146,7 @@ getOptional(Json::Value const& v, xrpl::SField const& field) { return getOrThrow(v, field); } - catch (...) // NOLINT(bugprone-empty-catch) + catch (...) { } return {}; diff --git a/include/xrpl/protocol/jss.h b/include/xrpl/protocol/jss.h index f3aad125cc..366a75df76 100644 --- a/include/xrpl/protocol/jss.h +++ b/include/xrpl/protocol/jss.h @@ -2,7 +2,8 @@ #include -namespace xrpl::jss { +namespace xrpl { +namespace jss { // JSON static strings @@ -713,4 +714,5 @@ JSS(write_load); // out: GetCounts #undef JSS -} // namespace xrpl::jss +} // namespace jss +} // namespace xrpl diff --git a/include/xrpl/protocol/nft.h b/include/xrpl/protocol/nft.h index 6dce8d1045..821d146ff7 100644 --- a/include/xrpl/protocol/nft.h +++ b/include/xrpl/protocol/nft.h @@ -9,7 +9,8 @@ #include #include -namespace xrpl::nft { +namespace xrpl { +namespace nft { // Separate taxons from regular integers. struct TaxonTag @@ -101,4 +102,5 @@ getIssuer(uint256 const& id) return AccountID::fromVoid(id.data() + 4); } -} // namespace xrpl::nft +} // namespace nft +} // namespace xrpl diff --git a/include/xrpl/protocol/nftPageMask.h b/include/xrpl/protocol/nftPageMask.h index 9889db5341..2f7337c328 100644 --- a/include/xrpl/protocol/nftPageMask.h +++ b/include/xrpl/protocol/nftPageMask.h @@ -4,11 +4,13 @@ #include -namespace xrpl::nft { +namespace xrpl { +namespace nft { // NFT directory pages order their contents based only on the low 96 bits of // the NFToken value. This mask provides easy access to the necessary mask. uint256 constexpr pageMask( std::string_view("0000000000000000000000000000000000000000ffffffffffffffffffffffff")); -} // namespace xrpl::nft +} // namespace nft +} // namespace xrpl diff --git a/include/xrpl/protocol_autogen/README.md b/include/xrpl/protocol_autogen/README.md index 860ed1a242..be90788b05 100644 --- a/include/xrpl/protocol_autogen/README.md +++ b/include/xrpl/protocol_autogen/README.md @@ -4,33 +4,42 @@ This directory contains auto-generated C++ wrapper classes for XRP Ledger protoc ## Generated Files -The files in this directory are generated from macro definition files: +The files in this directory are automatically generated at **CMake configure time** from macro definition files: -- **Transaction classes** (in `transactions/`): Generated from `include/xrpl/protocol/detail/transactions.macro` by `cmake/scripts/codegen/generate_tx_classes.py` -- **Ledger entry classes** (in `ledger_entries/`): Generated from `include/xrpl/protocol/detail/ledger_entries.macro` by `cmake/scripts/codegen/generate_ledger_classes.py` +- **Transaction classes** (in `transactions/`): Generated from `include/xrpl/protocol/detail/transactions.macro` by `scripts/generate_tx_classes.py` +- **Ledger entry classes** (in `ledger_entries/`): Generated from `include/xrpl/protocol/detail/ledger_entries.macro` by `scripts/generate_ledger_classes.py` ## Generation Process -Generation requires a one-time setup step to create a virtual environment -and install Python dependencies, followed by running the generation target: +The generation happens automatically when you **configure** the project (not during build). When you run CMake, the system: -```bash -cmake --build . --target setup_code_gen # create venv and install dependencies (once) -cmake --build . --target code_gen # generate code -``` +1. Creates a Python virtual environment in the build directory (`codegen_venv`) +2. Installs Python dependencies from `scripts/requirements.txt` into the venv (only if needed) +3. Runs the Python generation scripts using the venv Python interpreter +4. Parses the macro files to extract type definitions +5. Generates type-safe C++ wrapper classes using Mako templates +6. Places the generated headers in this directory -By default, `CODEGEN_VENV_DIR` points to `.venv` in the project root. The -`setup_code_gen` target creates a venv there and installs the required packages. -The `code_gen` target then uses the venv's Python interpreter to run generation. +### When Regeneration Happens + +The code is regenerated when: + +- You run CMake configure for the first time +- The Python virtual environment doesn't exist +- `scripts/requirements.txt` has been modified + +To force regeneration, delete the build directory and reconfigure. ### Python Dependencies -The code generation requires the following Python packages (installed by `setup_code_gen`): +The code generation requires the following Python packages (automatically installed): - `pcpp` - C preprocessor for Python - `pyparsing` - Parser combinator library - `Mako` - Template engine +These are isolated in a virtual environment and won't affect your system Python installation. + ## Version Control The generated `.h` files **are checked into version control**. This means: @@ -41,15 +50,15 @@ The generated `.h` files **are checked into version control**. This means: ## Modifying Generated Code -**Do not manually edit generated files.** Any changes will be overwritten the next time `code_gen` is run. +**Do not manually edit generated files.** Any changes will be overwritten the next time CMake configure runs. To modify the generated classes: - Edit the macro files in `include/xrpl/protocol/detail/` -- Edit the Mako templates in `cmake/scripts/codegen/templates/` -- Edit the generation scripts in `cmake/scripts/codegen/` -- Update Python dependencies in `cmake/scripts/codegen/requirements.txt` -- Run `cmake --build . --target code_gen` to regenerate +- Edit the Mako templates in `scripts/templates/` +- Edit the generation scripts in `scripts/` +- Update Python dependencies in `scripts/requirements.txt` +- Run CMake configure to regenerate ## Adding Common Fields @@ -64,7 +73,7 @@ Base classes: Templates (update to pass required common fields to base class constructors): -- `cmake/scripts/codegen/templates/Transaction.h.mako` -- `cmake/scripts/codegen/templates/LedgerEntry.h.mako` +- `scripts/templates/Transaction.h.mako` +- `scripts/templates/LedgerEntry.h.mako` These files are **not auto-generated** and must be updated by hand. diff --git a/include/xrpl/rdb/SociDB.h b/include/xrpl/rdb/SociDB.h index 43086ed931..9c575359c1 100644 --- a/include/xrpl/rdb/SociDB.h +++ b/include/xrpl/rdb/SociDB.h @@ -39,7 +39,7 @@ class BasicConfig; class DBConfig { std::string connectionString_; - explicit DBConfig(std::string dbPath); + explicit DBConfig(std::string const& dbPath); public: DBConfig(BasicConfig const& config, std::string const& dbName); diff --git a/include/xrpl/resource/Charge.h b/include/xrpl/resource/Charge.h index 436e87e158..55b13731b9 100644 --- a/include/xrpl/resource/Charge.h +++ b/include/xrpl/resource/Charge.h @@ -2,7 +2,8 @@ #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { /** A consumption charge. */ class Charge @@ -15,7 +16,7 @@ public: Charge() = delete; /** Create a charge with the specified cost and name. */ - Charge(value_type cost, std::string label = std::string()); + Charge(value_type cost, std::string const& label = std::string()); /** Return the human readable label associated with the charge. */ std::string const& @@ -46,4 +47,5 @@ private: std::ostream& operator<<(std::ostream& os, Charge const& v); -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/Consumer.h b/include/xrpl/resource/Consumer.h index 21d9f9c74f..45cc221212 100644 --- a/include/xrpl/resource/Consumer.h +++ b/include/xrpl/resource/Consumer.h @@ -5,7 +5,8 @@ #include #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { struct Entry; class Logic; @@ -78,4 +79,5 @@ private: std::ostream& operator<<(std::ostream& os, Consumer const& v); -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/Disposition.h b/include/xrpl/resource/Disposition.h index 22830ad470..096afb6a6f 100644 --- a/include/xrpl/resource/Disposition.h +++ b/include/xrpl/resource/Disposition.h @@ -1,6 +1,7 @@ #pragma once -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { /** The disposition of a consumer after applying a load charge. */ enum Disposition { @@ -16,4 +17,5 @@ enum Disposition { drop }; -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/Fees.h b/include/xrpl/resource/Fees.h index 366b2d287f..ebda0e98db 100644 --- a/include/xrpl/resource/Fees.h +++ b/include/xrpl/resource/Fees.h @@ -2,7 +2,8 @@ #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { /** Schedule of fees charged for imposing load on the server. */ /** @{ */ @@ -29,4 +30,5 @@ extern Charge const feeWarning; // The cost of receiving a warning. extern Charge const feeDrop; // The cost of being dropped for excess load. /** @} */ -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/Gossip.h b/include/xrpl/resource/Gossip.h index e626af37c3..9a70309cc4 100644 --- a/include/xrpl/resource/Gossip.h +++ b/include/xrpl/resource/Gossip.h @@ -4,7 +4,8 @@ #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { /** Data format for exchanging consumption information across peers. */ struct Gossip @@ -23,4 +24,5 @@ struct Gossip std::vector items; }; -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/ResourceManager.h b/include/xrpl/resource/ResourceManager.h index 96e5255272..4aab017691 100644 --- a/include/xrpl/resource/ResourceManager.h +++ b/include/xrpl/resource/ResourceManager.h @@ -10,7 +10,8 @@ #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { /** Tracks load and resource consumption. */ class Manager : public beast::PropertyStream::Source @@ -19,7 +20,7 @@ protected: Manager(); public: - ~Manager() override = 0; + virtual ~Manager() = 0; /** Create a new endpoint keyed by inbound IP address or the forwarded * IP if proxied. */ @@ -61,4 +62,5 @@ public: std::unique_ptr make_Manager(beast::insight::Collector::ptr const& collector, beast::Journal journal); -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/detail/Entry.h b/include/xrpl/resource/detail/Entry.h index 5b2d8b1ba3..2a6414778c 100644 --- a/include/xrpl/resource/detail/Entry.h +++ b/include/xrpl/resource/detail/Entry.h @@ -7,7 +7,8 @@ #include #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { using clock_type = beast::abstract_clock; @@ -21,7 +22,7 @@ struct Entry : public beast::List::Node @param now Construction time of Entry. */ explicit Entry(clock_type::time_point const now) - : refcount(0), local_balance(now), remote_balance(0) + : refcount(0), local_balance(now), remote_balance(0), lastWarningTime(), whenExpires() { } @@ -86,4 +87,5 @@ operator<<(std::ostream& os, Entry const& v) return os; } -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/detail/Import.h b/include/xrpl/resource/detail/Import.h index 6e2a7b9e7c..bee90afbf0 100644 --- a/include/xrpl/resource/detail/Import.h +++ b/include/xrpl/resource/detail/Import.h @@ -3,7 +3,8 @@ #include #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { /** A set of imported consumer data from a gossip origin. */ struct Import @@ -17,7 +18,7 @@ struct Import }; // Dummy argument required for zero-copy construction - Import(int = 0) + Import(int = 0) : whenExpires() { } @@ -28,4 +29,5 @@ struct Import std::vector items; }; -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/detail/Key.h b/include/xrpl/resource/detail/Key.h index c9a233b634..0c5164a7d8 100644 --- a/include/xrpl/resource/detail/Key.h +++ b/include/xrpl/resource/detail/Key.h @@ -4,9 +4,8 @@ #include #include -#include - -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { // The consumer key struct Key @@ -16,7 +15,7 @@ struct Key Key() = delete; - Key(Kind k, beast::IP::Endpoint addr) : kind(k), address(std::move(addr)) + Key(Kind k, beast::IP::Endpoint const& addr) : kind(k), address(addr) { } @@ -46,4 +45,5 @@ struct Key }; }; -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/detail/Kind.h b/include/xrpl/resource/detail/Kind.h index 74115ba7f1..fbb6b65e25 100644 --- a/include/xrpl/resource/detail/Kind.h +++ b/include/xrpl/resource/detail/Kind.h @@ -1,6 +1,7 @@ #pragma once -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { /** * Kind of consumer. @@ -12,4 +13,5 @@ namespace xrpl::Resource { */ enum Kind { kindInbound, kindOutbound, kindUnlimited }; -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/detail/Logic.h b/include/xrpl/resource/detail/Logic.h index b775f0a965..66c47bc538 100644 --- a/include/xrpl/resource/detail/Logic.h +++ b/include/xrpl/resource/detail/Logic.h @@ -15,7 +15,8 @@ #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { class Logic { @@ -351,9 +352,7 @@ public: iter = importTable_.erase(iter); } else - { ++iter; - } } } @@ -507,7 +506,7 @@ public: //-------------------------------------------------------------------------- - static void + void writeList( clock_type::time_point const now, beast::PropertyStream::Set& items, @@ -554,4 +553,5 @@ public: } }; -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/resource/detail/Tuning.h b/include/xrpl/resource/detail/Tuning.h index 1c903d8cd4..d5be5cf0b6 100644 --- a/include/xrpl/resource/detail/Tuning.h +++ b/include/xrpl/resource/detail/Tuning.h @@ -2,7 +2,8 @@ #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { /** Tunable constants. */ enum { @@ -29,4 +30,5 @@ std::chrono::seconds constexpr secondsUntilExpiration{300}; // Number of seconds until imported gossip expires std::chrono::seconds constexpr gossipExpirationSeconds{30}; -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/include/xrpl/server/LoadFeeTrack.h b/include/xrpl/server/LoadFeeTrack.h index 6b9e96241c..226408dbde 100644 --- a/include/xrpl/server/LoadFeeTrack.h +++ b/include/xrpl/server/LoadFeeTrack.h @@ -60,8 +60,8 @@ public: return clusterTxnLoadFee_; } - static std::uint32_t - getLoadBase() + std::uint32_t + getLoadBase() const { return lftNormalFee; } diff --git a/include/xrpl/server/Manifest.h b/include/xrpl/server/Manifest.h index ce97c57260..2532a3c5bf 100644 --- a/include/xrpl/server/Manifest.h +++ b/include/xrpl/server/Manifest.h @@ -8,7 +8,6 @@ #include #include #include -#include namespace xrpl { @@ -81,16 +80,16 @@ struct Manifest Manifest() = delete; Manifest( - std::string serialized_, + std::string const& serialized_, PublicKey const& masterKey_, std::optional const& signingKey_, std::uint32_t seq, - std::string domain_) - : serialized(std::move(serialized_)) + std::string const& domain_) + : serialized(serialized_) , masterKey(masterKey_) , signingKey(signingKey_) , sequence(seq) - , domain(std::move(domain_)) + , domain(domain_) { } @@ -155,7 +154,7 @@ deserializeManifest( template < class T, - class = std::enable_if_t || std::is_same_v>> + class = std::enable_if_t::value || std::is_same::value>> std::optional deserializeManifest( std::vector const& v, diff --git a/include/xrpl/server/NetworkOPs.h b/include/xrpl/server/NetworkOPs.h index b8f50dcd42..16ec4a4ec0 100644 --- a/include/xrpl/server/NetworkOPs.h +++ b/include/xrpl/server/NetworkOPs.h @@ -73,7 +73,7 @@ public: using clock_type = beast::abstract_clock; enum class FailHard : unsigned char { no, yes }; - static FailHard + static inline FailHard doFailHard(bool noMeansDont) { return noMeansDont ? FailHard::yes : FailHard::no; diff --git a/include/xrpl/server/Port.h b/include/xrpl/server/Port.h index 93652d422a..c7acabbc85 100644 --- a/include/xrpl/server/Port.h +++ b/include/xrpl/server/Port.h @@ -15,9 +15,13 @@ #include #include -namespace boost::asio::ssl { +namespace boost { +namespace asio { +namespace ssl { class context; -} // namespace boost::asio::ssl +} // namespace ssl +} // namespace asio +} // namespace boost namespace xrpl { diff --git a/include/xrpl/server/SimpleWriter.h b/include/xrpl/server/SimpleWriter.h index 0c3b711187..87b94507a4 100644 --- a/include/xrpl/server/SimpleWriter.h +++ b/include/xrpl/server/SimpleWriter.h @@ -48,7 +48,7 @@ public: std::vector result; result.reserve(std::distance(buf.begin(), buf.end())); for (auto const b : buf) - result.emplace_back(b); + result.push_back(b); return result; } }; diff --git a/include/xrpl/server/detail/BaseHTTPPeer.h b/include/xrpl/server/detail/BaseHTTPPeer.h index a0f8e1f318..878f6a1ddf 100644 --- a/include/xrpl/server/detail/BaseHTTPPeer.h +++ b/include/xrpl/server/detail/BaseHTTPPeer.h @@ -23,7 +23,6 @@ #include #include #include -#include #include namespace xrpl { @@ -94,7 +93,7 @@ public: endpoint_type remote_address, ConstBufferSequence const& buffers); - ~BaseHTTPPeer() override; + virtual ~BaseHTTPPeer(); Session& session() @@ -196,7 +195,7 @@ BaseHTTPPeer::BaseHTTPPeer( , handler_(handler) , work_(boost::asio::make_work_guard(executor)) , strand_(boost::asio::make_strand(executor)) - , remote_address_(std::move(remote_address)) + , remote_address_(remote_address) , journal_(journal) { read_buf_.commit( @@ -220,12 +219,10 @@ void BaseHTTPPeer::close() { if (!strand_.running_in_this_thread()) - { return post( strand_, std::bind( (void (BaseHTTPPeer::*)(void))&BaseHTTPPeer::close, impl().shared_from_this())); - } boost::beast::get_lowest_layer(impl().stream_).close(); } @@ -401,12 +398,11 @@ BaseHTTPPeer::write(void const* buf, std::size_t bytes) }()) { if (!strand_.running_in_this_thread()) - { return post( strand_, std::bind(&BaseHTTPPeer::on_write, impl().shared_from_this(), error_code{}, 0)); - } - return on_write(error_code{}, 0); + else + return on_write(error_code{}, 0); } } @@ -440,10 +436,8 @@ void BaseHTTPPeer::complete() { if (!strand_.running_in_this_thread()) - { return post( strand_, std::bind(&BaseHTTPPeer::complete, impl().shared_from_this())); - } message_ = {}; complete_ = true; @@ -470,14 +464,12 @@ void BaseHTTPPeer::close(bool graceful) { if (!strand_.running_in_this_thread()) - { return post( strand_, std::bind( (void (BaseHTTPPeer::*)(bool))&BaseHTTPPeer::close, impl().shared_from_this(), graceful)); - } complete_ = true; if (graceful) diff --git a/include/xrpl/server/detail/BasePeer.h b/include/xrpl/server/detail/BasePeer.h index 5bde6924a5..afa1ceb993 100644 --- a/include/xrpl/server/detail/BasePeer.h +++ b/include/xrpl/server/detail/BasePeer.h @@ -11,7 +11,6 @@ #include #include #include -#include namespace xrpl { @@ -35,7 +34,6 @@ protected: boost::asio::strand strand_; public: - // NOLINTNEXTLINE(bugprone-crtp-constructor-accessibility) BasePeer( Port const& port, Handler& handler, @@ -65,7 +63,7 @@ BasePeer::BasePeer( beast::Journal journal) : port_(port) , handler_(handler) - , remote_address_(std::move(remote_address)) + , remote_address_(remote_address) , sink_( journal.sink(), [] { diff --git a/include/xrpl/server/detail/BaseWSPeer.h b/include/xrpl/server/detail/BaseWSPeer.h index 4251617262..9213a955f0 100644 --- a/include/xrpl/server/detail/BaseWSPeer.h +++ b/include/xrpl/server/detail/BaseWSPeer.h @@ -15,7 +15,6 @@ #include #include -#include #include #include @@ -286,7 +285,6 @@ BaseWSPeer::on_write(error_code const& ec) return; start_timer(); if (!result.first) - { impl().ws_.async_write_some( static_cast(result.first), result.second, @@ -294,9 +292,7 @@ BaseWSPeer::on_write(error_code const& ec) strand_, std::bind( &BaseWSPeer::on_write, impl().shared_from_this(), std::placeholders::_1))); - } else - { impl().ws_.async_write_some( static_cast(result.first), result.second, @@ -304,7 +300,6 @@ BaseWSPeer::on_write(error_code const& ec) strand_, std::bind( &BaseWSPeer::on_write_fin, impl().shared_from_this(), std::placeholders::_1))); - } } template @@ -324,9 +319,7 @@ BaseWSPeer::on_write_fin(error_code const& ec) &BaseWSPeer::on_close, impl().shared_from_this(), std::placeholders::_1))); } else if (!wq_.empty()) - { on_write({}); - } } template @@ -353,7 +346,7 @@ BaseWSPeer::on_read(error_code const& ec) auto const& data = rb_.data(); std::vector b; b.reserve(std::distance(data.begin(), data.end())); - std::ranges::copy(data, std::back_inserter(b)); + std::copy(data.begin(), data.end(), std::back_inserter(b)); this->handler_.onWSMessage(impl().shared_from_this(), b); rb_.consume(rb_.size()); } @@ -399,7 +392,7 @@ BaseWSPeer::cancel_timer() { timer_.cancel(); } - catch (boost::system::system_error const&) // NOLINT(bugprone-empty-catch) + catch (boost::system::system_error const&) { // ignored } diff --git a/include/xrpl/server/detail/Door.h b/include/xrpl/server/detail/Door.h index 346309f078..87baad42db 100644 --- a/include/xrpl/server/detail/Door.h +++ b/include/xrpl/server/detail/Door.h @@ -33,7 +33,6 @@ #include #include #include -#include namespace xrpl { @@ -94,7 +93,7 @@ private: port_.protocol.count("wss2") > 0 || port_.protocol.count("peer") > 0}; bool plain_{ port_.protocol.count("http") > 0 || port_.protocol.count("ws") > 0 || - (port_.protocol.count("ws2") != 0u)}; + port_.protocol.count("ws2")}; static constexpr std::chrono::milliseconds INITIAL_ACCEPT_DELAY{50}; static constexpr std::chrono::milliseconds MAX_ACCEPT_DELAY{2000}; std::chrono::milliseconds accept_delay_{INITIAL_ACCEPT_DELAY}; @@ -164,7 +163,7 @@ Door::Detector::Detector( , ioc_(ioc) , stream_(std::move(stream)) , socket_(stream_.socket()) - , remote_address_(std::move(remote_address)) + , remote_address_(remote_address) , strand_(boost::asio::make_strand(ioc_)) , j_(j) { @@ -298,10 +297,8 @@ void Door::close() { if (!strand_.running_in_this_thread()) - { return boost::asio::post( strand_, std::bind(&Door::close, this->shared_from_this())); - } backoff_timer_.cancel(); error_code ec; acceptor_.close(ec); @@ -435,7 +432,11 @@ Door::should_throttle_for_fds() auto const& s = *stats; auto const free = (s.limit > s.used) ? (s.limit - s.used) : 0ull; double const free_ratio = static_cast(free) / static_cast(s.limit); - return free_ratio < FREE_FD_THRESHOLD; + if (free_ratio < FREE_FD_THRESHOLD) + { + return true; + } + return false; #endif } diff --git a/include/xrpl/server/detail/ServerImpl.h b/include/xrpl/server/detail/ServerImpl.h index 14d2b56fe4..0b5d075d87 100644 --- a/include/xrpl/server/detail/ServerImpl.h +++ b/include/xrpl/server/detail/ServerImpl.h @@ -81,7 +81,7 @@ private: public: ServerImpl(Handler& handler, boost::asio::io_context& io_context, beast::Journal journal); - ~ServerImpl() override; + ~ServerImpl(); beast::Journal journal() override @@ -155,7 +155,7 @@ ServerImpl::ports(std::vector const& ports) list_.push_back(sp); auto ep = sp->get_endpoint(); - if (internalPort.port == 0u) + if (!internalPort.port) internalPort.port = ep.port(); eps.emplace(port.name, std::move(ep)); diff --git a/include/xrpl/server/detail/io_list.h b/include/xrpl/server/detail/io_list.h index ef11d3cea6..f1cc04f683 100644 --- a/include/xrpl/server/detail/io_list.h +++ b/include/xrpl/server/detail/io_list.h @@ -189,7 +189,7 @@ template std::shared_ptr io_list::emplace(Args&&... args) { - static_assert(std::is_base_of_v, "T must derive from io_list::work"); + static_assert(std::is_base_of::value, "T must derive from io_list::work"); if (closed_) return nullptr; auto sp = std::make_shared(std::forward(args)...); @@ -223,10 +223,8 @@ io_list::close(Finisher&& f) f_ = std::forward(f); lock.unlock(); for (auto const& p : map) - { if (auto sp = p.second.lock()) sp->close(); - } } else { diff --git a/include/xrpl/shamap/SHAMap.h b/include/xrpl/shamap/SHAMap.h index 43b2734d65..213e7ce0ce 100644 --- a/include/xrpl/shamap/SHAMap.h +++ b/include/xrpl/shamap/SHAMap.h @@ -94,10 +94,10 @@ private: public: /** Number of children each non-leaf node has (the 'radix tree' part of the * map) */ - static constexpr unsigned int branchFactor = SHAMapInnerNode::branchFactor; + static inline constexpr unsigned int branchFactor = SHAMapInnerNode::branchFactor; /** The depth of the hash map: data is only present in the leaves */ - static constexpr unsigned int leafDepth = 64; + static inline constexpr unsigned int leafDepth = 64; using DeltaItem = std::pair, boost::intrusive_ptr>; @@ -658,13 +658,9 @@ inline SHAMap::const_iterator& SHAMap::const_iterator::operator++() { if (auto temp = map_->peekNextItem(item_->key(), stack_)) - { item_ = temp->peekItem().get(); - } else - { item_ = nullptr; - } return *this; } diff --git a/include/xrpl/shamap/SHAMapAccountStateLeafNode.h b/include/xrpl/shamap/SHAMapAccountStateLeafNode.h index 2f71d10b0a..98ac9776c3 100644 --- a/include/xrpl/shamap/SHAMapAccountStateLeafNode.h +++ b/include/xrpl/shamap/SHAMapAccountStateLeafNode.h @@ -28,25 +28,25 @@ public: } intr_ptr::SharedPtr - clone(std::uint32_t cowid) const final + clone(std::uint32_t cowid) const final override { return intr_ptr::make_shared(item_, cowid, hash_); } SHAMapNodeType - getType() const final + getType() const final override { return SHAMapNodeType::tnACCOUNT_STATE; } void - updateHash() final + updateHash() final override { hash_ = SHAMapHash{sha512Half(HashPrefix::leafNode, item_->slice(), item_->key())}; } void - serializeForWire(Serializer& s) const final + serializeForWire(Serializer& s) const final override { s.addRaw(item_->slice()); s.addBitString(item_->key()); @@ -54,7 +54,7 @@ public: } void - serializeWithPrefix(Serializer& s) const final + serializeWithPrefix(Serializer& s) const final override { s.add32(HashPrefix::leafNode); s.addRaw(item_->slice()); diff --git a/include/xrpl/shamap/SHAMapInnerNode.h b/include/xrpl/shamap/SHAMapInnerNode.h index f2c34cbc1a..73d59cc1fe 100644 --- a/include/xrpl/shamap/SHAMapInnerNode.h +++ b/include/xrpl/shamap/SHAMapInnerNode.h @@ -15,7 +15,7 @@ class SHAMapInnerNode final : public SHAMapTreeNode, public CountedObject const& @@ -53,7 +53,7 @@ public: setItem(boost::intrusive_ptr i); std::string - getString(SHAMapNodeID const&) const final; + getString(SHAMapNodeID const&) const final override; }; } // namespace xrpl diff --git a/include/xrpl/shamap/SHAMapTreeNode.h b/include/xrpl/shamap/SHAMapTreeNode.h index 55b18a2d12..f837a8643b 100644 --- a/include/xrpl/shamap/SHAMapTreeNode.h +++ b/include/xrpl/shamap/SHAMapTreeNode.h @@ -40,6 +40,11 @@ protected: */ std::uint32_t cowid_; +protected: + SHAMapTreeNode(SHAMapTreeNode const&) = delete; + SHAMapTreeNode& + operator=(SHAMapTreeNode const&) = delete; + /** Construct a node @param cowid The identifier of a SHAMap. For more, see #cowid_ @@ -57,11 +62,7 @@ protected: /** @} */ public: - ~SHAMapTreeNode() noexcept override = default; - - SHAMapTreeNode(SHAMapTreeNode const&) = delete; - SHAMapTreeNode& - operator=(SHAMapTreeNode const&) = delete; + virtual ~SHAMapTreeNode() noexcept = default; // Needed to support weak intrusive pointers virtual void diff --git a/include/xrpl/shamap/SHAMapTxLeafNode.h b/include/xrpl/shamap/SHAMapTxLeafNode.h index 368aa2e21b..dcedb26881 100644 --- a/include/xrpl/shamap/SHAMapTxLeafNode.h +++ b/include/xrpl/shamap/SHAMapTxLeafNode.h @@ -27,32 +27,32 @@ public: } intr_ptr::SharedPtr - clone(std::uint32_t cowid) const final + clone(std::uint32_t cowid) const final override { return intr_ptr::make_shared(item_, cowid, hash_); } SHAMapNodeType - getType() const final + getType() const final override { return SHAMapNodeType::tnTRANSACTION_NM; } void - updateHash() final + updateHash() final override { hash_ = SHAMapHash{sha512Half(HashPrefix::transactionID, item_->slice())}; } void - serializeForWire(Serializer& s) const final + serializeForWire(Serializer& s) const final override { s.addRaw(item_->slice()); s.add8(wireTypeTransaction); } void - serializeWithPrefix(Serializer& s) const final + serializeWithPrefix(Serializer& s) const final override { s.add32(HashPrefix::transactionID); s.addRaw(item_->slice()); diff --git a/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h b/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h index 40be482ed9..60e645fccc 100644 --- a/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h +++ b/include/xrpl/shamap/SHAMapTxPlusMetaLeafNode.h @@ -40,13 +40,13 @@ public: } void - updateHash() final + updateHash() final override { hash_ = SHAMapHash{sha512Half(HashPrefix::txNode, item_->slice(), item_->key())}; } void - serializeForWire(Serializer& s) const final + serializeForWire(Serializer& s) const final override { s.addRaw(item_->slice()); s.addBitString(item_->key()); @@ -54,7 +54,7 @@ public: } void - serializeWithPrefix(Serializer& s) const final + serializeWithPrefix(Serializer& s) const final override { s.add32(HashPrefix::txNode); s.addRaw(item_->slice()); diff --git a/include/xrpl/tx/Transactor.h b/include/xrpl/tx/Transactor.h index a3b0af821e..287f785cd7 100644 --- a/include/xrpl/tx/Transactor.h +++ b/include/xrpl/tx/Transactor.h @@ -7,8 +7,6 @@ #include #include -#include - namespace xrpl { /** State information when preflighting a tx. */ @@ -26,12 +24,12 @@ public: ServiceRegistry& registry_, STTx const& tx_, uint256 parentBatchId_, - Rules rules_, + Rules const& rules_, ApplyFlags flags_, beast::Journal j_ = beast::Journal{beast::Journal::getNullSink()}) : registry(registry_) , tx(tx_) - , rules(std::move(rules_)) + , rules(rules_) , flags(flags_) , parentBatchId(parentBatchId_) , j(j_) @@ -42,10 +40,10 @@ public: PreflightContext( ServiceRegistry& registry_, STTx const& tx_, - Rules rules_, + Rules const& rules_, ApplyFlags flags_, beast::Journal j_ = beast::Journal{beast::Journal::getNullSink()}) - : registry(registry_), tx(tx_), rules(std::move(rules_)), flags(flags_), j(j_) + : registry(registry_), tx(tx_), rules(rules_), flags(flags_), j(j_) { XRPL_ASSERT((flags_ & tapBATCH) == 0, "Batch apply flag should not be set"); } @@ -118,13 +116,14 @@ protected: AccountID const account_; XRPAmount preFeeBalance_{}; // Balance before fees. -public: - virtual ~Transactor() = default; Transactor(Transactor const&) = delete; Transactor& operator=(Transactor const&) = delete; - enum ConsequencesFactoryType { Normal, Blocker, Custom }; +public: + virtual ~Transactor() = default; + + enum ConsequencesFactoryType { Normal, Blocker, Custom }; /** Process the transaction. */ ApplyResult operator()(); @@ -141,20 +140,6 @@ public: return ctx_.view(); } - /** Check all invariants for the current transaction. - * - * Runs transaction-specific invariants first (visitInvariantEntry + - * finalizeInvariants), then protocol-level invariants. Both layers - * always run; the worst failure code is returned. - * - * @param result the tentative TER from transaction processing. - * @param fee the fee consumed by the transaction. - * - * @return the final TER after all invariant checks. - */ - [[nodiscard]] TER - checkInvariants(TER result, XRPAmount fee); - ///////////////////////////////////////////////////// /* These static functions are called from invoke_preclaim @@ -245,52 +230,6 @@ protected: virtual TER doApply() = 0; - /** Inspect a single ledger entry modified by this transaction. - * - * Called once for every SLE created, modified, or deleted by the - * transaction, before finalizeInvariants. Implementations should - * accumulate whatever state they need to verify transaction-specific - * post-conditions. - * - * @param isDelete true if the entry was erased from the ledger. - * @param before the entry's state before the transaction (nullptr - * for newly created entries). - * @param after the entry's state as supplied by the apply logic - * for this transaction. For deletions, this is the - * SLE being erased and is not guaranteed to be null; - * callers must use isDelete rather than after == nullptr - * to detect deletions. - */ - virtual void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) = 0; - - /** Check transaction-specific post-conditions after all entries have - * been visited. - * - * Called once after every modified ledger entry has been passed to - * visitInvariantEntry. Returns true if all transaction-specific - * invariants hold, or false to fail the transaction with - * tecINVARIANT_FAILED. - * - * @param tx the transaction being applied. - * @param result the tentative TER result so far. - * @param fee the fee consumed by the transaction. - * @param view read-only view of the ledger after the transaction. - * @param j journal for logging invariant failures. - * - * @return true if all invariants pass; false otherwise. - */ - [[nodiscard]] virtual bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) = 0; - /** Compute the minimum fee required to process a transaction with a given baseFee based on the current server load. @@ -396,21 +335,6 @@ private: */ static NotTEC preflight2(PreflightContext const& ctx); - - /** Check transaction-specific invariants only. - * - * Walks every modified ledger entry via visitInvariantEntry, then - * calls finalizeInvariants on the derived transactor. Returns - * tecINVARIANT_FAILED if any transaction invariant is violated. - * - * @param result the tentative TER from transaction processing. - * @param fee the fee consumed by the transaction. - * - * @return the original result if all invariants pass, or - * tecINVARIANT_FAILED otherwise. - */ - [[nodiscard]] TER - checkTransactionInvariants(TER result, XRPAmount fee); }; inline bool diff --git a/include/xrpl/tx/applySteps.h b/include/xrpl/tx/applySteps.h index ee7faeebd3..9ce6dfb1e2 100644 --- a/include/xrpl/tx/applySteps.h +++ b/include/xrpl/tx/applySteps.h @@ -27,7 +27,7 @@ struct ApplyResult inline bool isTecClaimHardFail(TER ter, ApplyFlags flags) { - return isTecClaim(ter) && ((flags & tapRETRY) == 0u); + return isTecClaim(ter) && !(flags & tapRETRY); } /** Class describing the consequences to the account diff --git a/include/xrpl/tx/invariants/AMMInvariant.h b/include/xrpl/tx/invariants/AMMInvariant.h index b15b62cc93..e872c61f76 100644 --- a/include/xrpl/tx/invariants/AMMInvariant.h +++ b/include/xrpl/tx/invariants/AMMInvariant.h @@ -20,7 +20,9 @@ class ValidAMM public: enum class ZeroAllowed : bool { No = false, Yes = true }; - ValidAMM() = default; + ValidAMM() + { + } void visitEntry(bool, std::shared_ptr const&, std::shared_ptr const&); diff --git a/include/xrpl/tx/invariants/PermissionedDEXInvariant.h b/include/xrpl/tx/invariants/PermissionedDEXInvariant.h index da187779b2..b4e06cd212 100644 --- a/include/xrpl/tx/invariants/PermissionedDEXInvariant.h +++ b/include/xrpl/tx/invariants/PermissionedDEXInvariant.h @@ -11,8 +11,7 @@ namespace xrpl { class ValidPermissionedDEX { bool regularOffers_ = false; - bool badHybridsOld_ = false; // pre-fixSecurity3_1_3: missing field/domain or size > 1 - bool badHybrids_ = false; // post-fixSecurity3_1_3: also catches size == 0 (size != 1) + bool badHybrids_ = false; hash_set domains_; public: diff --git a/include/xrpl/tx/invariants/VaultInvariant.h b/include/xrpl/tx/invariants/VaultInvariant.h index b9b3bf746f..ded9e4618b 100644 --- a/include/xrpl/tx/invariants/VaultInvariant.h +++ b/include/xrpl/tx/invariants/VaultInvariant.h @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -40,9 +39,9 @@ class ValidVault struct Vault final { uint256 key = beast::zero; - Asset asset; - AccountID pseudoId; - AccountID owner; + Asset asset = {}; + AccountID pseudoId = {}; + AccountID owner = {}; uint192 shareMPTID = beast::zero; Number assetsTotal = 0; Number assetsAvailable = 0; @@ -54,30 +53,18 @@ class ValidVault struct Shares final { - MPTIssue share; + MPTIssue share = {}; std::uint64_t sharesTotal = 0; std::uint64_t sharesMaximum = 0; Shares static make(SLE const&); }; -public: - struct DeltaInfo final - { - Number delta = numZero; - std::optional scale; - - // Compute the delta between two Numbers, taking the coarsest scale - [[nodiscard]] static DeltaInfo - makeDelta(Number const& before, Number const& after, Asset const& asset); - }; - -private: - std::vector afterVault_; - std::vector afterMPTs_; - std::vector beforeVault_; - std::vector beforeMPTs_; - std::unordered_map deltas_; + std::vector afterVault_ = {}; + std::vector afterMPTs_ = {}; + std::vector beforeVault_ = {}; + std::vector beforeMPTs_ = {}; + std::unordered_map deltas_ = {}; public: void @@ -85,10 +72,6 @@ public: bool finalize(STTx const&, TER const, XRPAmount const, ReadView const&, beast::Journal const&); - - // Compute the coarsest scale required to represent all numbers - [[nodiscard]] static std::int32_t - computeCoarsestScale(std::vector const& numbers); }; } // namespace xrpl diff --git a/include/xrpl/tx/paths/Flow.h b/include/xrpl/tx/paths/Flow.h index c746249866..f37c9d56c3 100644 --- a/include/xrpl/tx/paths/Flow.h +++ b/include/xrpl/tx/paths/Flow.h @@ -6,9 +6,11 @@ namespace xrpl { -namespace path::detail { +namespace path { +namespace detail { struct FlowDebugInfo; -} // namespace path::detail +} // namespace detail +} // namespace path /** Make a payment from the src account to the dst account diff --git a/include/xrpl/tx/paths/Offer.h b/include/xrpl/tx/paths/Offer.h index f79f33658b..ae7a47061a 100644 --- a/include/xrpl/tx/paths/Offer.h +++ b/include/xrpl/tx/paths/Offer.h @@ -11,7 +11,6 @@ #include #include -#include namespace xrpl { @@ -32,7 +31,7 @@ private: public: TOffer() = default; - TOffer(SLE::pointer entry, Quality quality); + TOffer(SLE::pointer const& entry, Quality quality); /** Returns the quality of the offer. Conceptually, the quality is the ratio of output to input currency. @@ -158,8 +157,8 @@ public: }; template -TOffer::TOffer(SLE::pointer entry, Quality quality) - : m_entry(std::move(entry)), m_quality(quality), m_account(m_entry->getAccountID(sfAccount)) +TOffer::TOffer(SLE::pointer const& entry, Quality quality) + : m_entry(entry), m_quality(quality), m_account(m_entry->getAccountID(sfAccount)) { auto const tp = m_entry->getFieldAmount(sfTakerPays); auto const tg = m_entry->getFieldAmount(sfTakerGets); @@ -174,22 +173,14 @@ void TOffer::setFieldAmounts() { if constexpr (std::is_same_v) - { m_entry->setFieldAmount(sfTakerPays, toSTAmount(m_amounts.in)); - } else - { m_entry->setFieldAmount(sfTakerPays, toSTAmount(m_amounts.in, assetIn_)); - } if constexpr (std::is_same_v) - { m_entry->setFieldAmount(sfTakerGets, toSTAmount(m_amounts.out)); - } else - { m_entry->setFieldAmount(sfTakerGets, toSTAmount(m_amounts.out, assetOut_)); - } } template @@ -209,13 +200,11 @@ TOffer::limitIn(TAmounts const& offerAmount, TIn const& li { if (auto const& rules = getCurrentTransactionRules(); rules && rules->enabled(fixReducedOffersV2)) - { // It turns out that the ceil_in implementation has some slop in // it. ceil_in_strict removes that slop. But removing that slop // affects transaction outcomes, so the change must be made using // an amendment. return quality().ceil_in_strict(offerAmount, limit, roundUp); - } return m_quality.ceil_in(offerAmount, limit); } diff --git a/include/xrpl/tx/paths/detail/FlowDebugInfo.h b/include/xrpl/tx/paths/detail/FlowDebugInfo.h index dd7a0bb9c5..3a1f45fd02 100644 --- a/include/xrpl/tx/paths/detail/FlowDebugInfo.h +++ b/include/xrpl/tx/paths/detail/FlowDebugInfo.h @@ -11,7 +11,9 @@ #include #include -namespace xrpl::path::detail { +namespace xrpl { +namespace path { +namespace detail { // Track performance information of a single payment struct FlowDebugInfo { @@ -218,7 +220,6 @@ struct FlowDebugInfo write_list(amts, get_val, delim); }; auto writeIntList = [&write_list](std::vector const& vals, char delim = ';') { - // NOLINTNEXTLINE(bugprone-return-const-ref-from-parameter) auto get_val = [](size_t const& v) -> size_t const& { return v; }; write_list(vals, get_val); }; @@ -253,44 +254,28 @@ struct FlowDebugInfo ostr << ", in_pass: "; if (passInfo.nativeIn) - { writeXrpAmtList(passInfo.in); - } else - { writeIouAmtList(passInfo.in); - } ostr << ", out_pass: "; if (passInfo.nativeOut) - { writeXrpAmtList(passInfo.out); - } else - { writeIouAmtList(passInfo.out); - } ostr << ", num_active: "; writeIntList(passInfo.numActive); if (!passInfo.liquiditySrcIn.empty() && !passInfo.liquiditySrcIn.back().empty()) { ostr << ", l_src_in: "; if (passInfo.nativeIn) - { writeNestedXrpAmtList(passInfo.liquiditySrcIn); - } else - { writeNestedIouAmtList(passInfo.liquiditySrcIn); - } ostr << ", l_src_out: "; if (passInfo.nativeOut) - { writeNestedXrpAmtList(passInfo.liquiditySrcOut); - } else - { writeNestedIouAmtList(passInfo.liquiditySrcOut); - } } } @@ -350,4 +335,6 @@ balanceDiffsToString(std::optional const& bd) return ostr.str(); }; -} // namespace xrpl::path::detail +} // namespace detail +} // namespace path +} // namespace xrpl diff --git a/include/xrpl/tx/paths/detail/StepChecks.h b/include/xrpl/tx/paths/detail/StepChecks.h index a1e6490781..7ad9279c87 100644 --- a/include/xrpl/tx/paths/detail/StepChecks.h +++ b/include/xrpl/tx/paths/detail/StepChecks.h @@ -77,8 +77,8 @@ checkNoRipple( if (!sleIn || !sleOut) return terNO_LINE; - if ((((*sleIn)[sfFlags] & ((cur > prev) ? lsfHighNoRipple : lsfLowNoRipple)) != 0u) && - (((*sleOut)[sfFlags] & ((cur > next) ? lsfHighNoRipple : lsfLowNoRipple)) != 0u)) + if ((*sleIn)[sfFlags] & ((cur > prev) ? lsfHighNoRipple : lsfLowNoRipple) && + (*sleOut)[sfFlags] & ((cur > next) ? lsfHighNoRipple : lsfLowNoRipple)) { JLOG(j.info()) << "Path violates noRipple constraint between " << prev << ", " << cur << " and " << next; diff --git a/include/xrpl/tx/paths/detail/Steps.h b/include/xrpl/tx/paths/detail/Steps.h index c46cebca88..4fa3b09d07 100644 --- a/include/xrpl/tx/paths/detail/Steps.h +++ b/include/xrpl/tx/paths/detail/Steps.h @@ -288,10 +288,10 @@ private: inline std::pair, DebtDirection> Step::getQualityFunc(ReadView const& v, DebtDirection prevStepDir) const { - auto const res = qualityUpperBound(v, prevStepDir); - if (res.first) + if (auto const res = qualityUpperBound(v, prevStepDir); res.first) return {QualityFunction{*res.first, QualityFunction::CLOBLikeTag{}}, res.second}; - return {std::nullopt, res.second}; + else + return {std::nullopt, res.second}; } /// @cond INTERNAL @@ -317,10 +317,8 @@ operator==(Strand const& lhs, Strand const& rhs) if (lhs.size() != rhs.size()) return false; for (size_t i = 0, e = lhs.size(); i != e; ++i) - { if (*lhs[i] != *rhs[i]) return false; - } return true; } /// @endcond @@ -431,10 +429,8 @@ toStrands( template struct StepImp : public Step { -private: explicit StepImp() = default; -public: std::pair rev(PaymentSandbox& sb, ApplyView& afView, @@ -474,7 +470,6 @@ public: { return get(lhs) == get(rhs); } - friend TDerived; }; /// @endcond @@ -637,13 +632,9 @@ bool isDirectXrpToXrp(Strand const& strand) { if constexpr (std::is_same_v && std::is_same_v) - { return strand.size() == 2; - } else - { return false; - } } /// @endcond diff --git a/include/xrpl/tx/paths/detail/StrandFlow.h b/include/xrpl/tx/paths/detail/StrandFlow.h index 52b7d94484..9892facee3 100644 --- a/include/xrpl/tx/paths/detail/StrandFlow.h +++ b/include/xrpl/tx/paths/detail/StrandFlow.h @@ -327,13 +327,9 @@ qualityUpperBound(ReadView const& v, Strand const& strand) for (auto const& step : strand) { if (std::tie(stepQ, dir) = step->qualityUpperBound(v, dir); stepQ) - { q = composed_quality(q, *stepQ); - } else - { return std::nullopt; - } } return q; }; @@ -364,18 +360,12 @@ limitOut( if (std::tie(stepQualityFunc, dir) = step->getQualityFunc(v, dir); stepQualityFunc) { if (!qf) - { qf = stepQualityFunc; - } else - { qf->combine(*stepQualityFunc); - } } else - { return remainingOut; - } } // QualityFunction is constant @@ -383,25 +373,16 @@ limitOut( return remainingOut; auto const out = [&]() { - auto const out = qf->outFromAvgQ(limitQuality); - if (!out) + if (auto const out = qf->outFromAvgQ(limitQuality); !out) return remainingOut; - if constexpr (std::is_same_v) - { + else if constexpr (std::is_same_v) return XRPAmount{*out}; - } else if constexpr (std::is_same_v) - { return IOUAmount{*out}; - } else if constexpr (std::is_same_v) - { return MPTAmount{*out}; - } else - { return STAmount{remainingOut.asset(), out->mantissa(), out->exponent()}; - } }(); // A tiny difference could be due to the round off if (withinRelativeDistance(out, remainingOut, Number(1, -9))) @@ -451,7 +432,7 @@ public: { for (Strand const* strand : next_) { - if (strand == nullptr) + if (!strand) { // should not happen continue; @@ -468,14 +449,14 @@ public: // an unusual corner case. continue; } - strandQualities.emplace_back(*qual, strand); + strandQualities.push_back({*qual, strand}); } } // must stable sort for deterministic order across different c++ // standard library implementations - std::ranges::stable_sort( - strandQualities, - + std::stable_sort( + strandQualities.begin(), + strandQualities.end(), [](auto const& lhs, auto const& rhs) { // higher qualities first return std::get(lhs) > std::get(rhs); @@ -646,10 +627,8 @@ flow( // Limit only if one strand and limitQuality auto const limitRemainingOut = [&]() { if (activeStrands.size() == 1 && limitQuality) - { if (auto const strand = activeStrands.get(0)) return limitOut(sb, *strand, remainingOut, *limitQuality); - } return remainingOut; }(); auto const adjustedRemOut = limitRemainingOut != remainingOut; @@ -738,10 +717,8 @@ flow( remainingIn = *sendMax - sum(savedIns); if (flowDebugInfo) - { flowDebugInfo->pushPass( EitherAmount(best->in), EitherAmount(best->out), activeStrands.size()); - } JLOG(j.trace()) << "Best path: in: " << to_string(best->in) << " out: " << to_string(best->out) diff --git a/include/xrpl/tx/transactors/account/AccountDelete.h b/include/xrpl/tx/transactors/account/AccountDelete.h index 23fc55da48..81a11152ed 100644 --- a/include/xrpl/tx/transactors/account/AccountDelete.h +++ b/include/xrpl/tx/transactors/account/AccountDelete.h @@ -27,20 +27,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/account/AccountSet.h b/include/xrpl/tx/transactors/account/AccountSet.h index fd2106e20c..0940ab0739 100644 --- a/include/xrpl/tx/transactors/account/AccountSet.h +++ b/include/xrpl/tx/transactors/account/AccountSet.h @@ -31,20 +31,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/account/SetRegularKey.h b/include/xrpl/tx/transactors/account/SetRegularKey.h index 54e574939a..bb1dd48a68 100644 --- a/include/xrpl/tx/transactors/account/SetRegularKey.h +++ b/include/xrpl/tx/transactors/account/SetRegularKey.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/account/SignerListSet.h b/include/xrpl/tx/transactors/account/SignerListSet.h index 1f1a68ccc8..2529f0d36c 100644 --- a/include/xrpl/tx/transactors/account/SignerListSet.h +++ b/include/xrpl/tx/transactors/account/SignerListSet.h @@ -41,20 +41,6 @@ public: void preCompute() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - // Interface used by AccountDelete static TER removeFromLedger( diff --git a/include/xrpl/tx/transactors/bridge/XChainBridge.h b/include/xrpl/tx/transactors/bridge/XChainBridge.h index cd16c0b791..0a2fccc18b 100644 --- a/include/xrpl/tx/transactors/bridge/XChainBridge.h +++ b/include/xrpl/tx/transactors/bridge/XChainBridge.h @@ -26,20 +26,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; class BridgeModify : public Transactor @@ -62,20 +48,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; using XChainModifyBridge = BridgeModify; @@ -109,20 +81,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ @@ -150,20 +108,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ @@ -193,20 +137,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ @@ -236,20 +166,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; class XChainAddAccountCreateAttestation : public Transactor @@ -270,20 +186,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ @@ -328,20 +230,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; using XChainAccountCreateCommit = XChainCreateAccountCommit; diff --git a/include/xrpl/tx/transactors/check/CheckCancel.h b/include/xrpl/tx/transactors/check/CheckCancel.h index 14abeaa978..f16c6d2827 100644 --- a/include/xrpl/tx/transactors/check/CheckCancel.h +++ b/include/xrpl/tx/transactors/check/CheckCancel.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/check/CheckCash.h b/include/xrpl/tx/transactors/check/CheckCash.h index 312c5a983e..3b914d2024 100644 --- a/include/xrpl/tx/transactors/check/CheckCash.h +++ b/include/xrpl/tx/transactors/check/CheckCash.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/check/CheckCreate.h b/include/xrpl/tx/transactors/check/CheckCreate.h index ff24d36e2c..bcb9d16ea2 100644 --- a/include/xrpl/tx/transactors/check/CheckCreate.h +++ b/include/xrpl/tx/transactors/check/CheckCreate.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/credentials/CredentialAccept.h b/include/xrpl/tx/transactors/credentials/CredentialAccept.h index f3abc80666..1895e54589 100644 --- a/include/xrpl/tx/transactors/credentials/CredentialAccept.h +++ b/include/xrpl/tx/transactors/credentials/CredentialAccept.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/credentials/CredentialCreate.h b/include/xrpl/tx/transactors/credentials/CredentialCreate.h index 22247feb36..500b034a9c 100644 --- a/include/xrpl/tx/transactors/credentials/CredentialCreate.h +++ b/include/xrpl/tx/transactors/credentials/CredentialCreate.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/credentials/CredentialDelete.h b/include/xrpl/tx/transactors/credentials/CredentialDelete.h index 91ea4d05ad..26305232ce 100644 --- a/include/xrpl/tx/transactors/credentials/CredentialDelete.h +++ b/include/xrpl/tx/transactors/credentials/CredentialDelete.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/delegate/DelegateSet.h b/include/xrpl/tx/transactors/delegate/DelegateSet.h index 25cb21e9b5..cc3a8fe4cb 100644 --- a/include/xrpl/tx/transactors/delegate/DelegateSet.h +++ b/include/xrpl/tx/transactors/delegate/DelegateSet.h @@ -22,20 +22,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - // Interface used by AccountDelete static TER deleteDelegate( diff --git a/include/xrpl/tx/transactors/dex/AMMBid.h b/include/xrpl/tx/transactors/dex/AMMBid.h index e872c0d12d..b80bfe3bef 100644 --- a/include/xrpl/tx/transactors/dex/AMMBid.h +++ b/include/xrpl/tx/transactors/dex/AMMBid.h @@ -62,20 +62,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/dex/AMMClawback.h b/include/xrpl/tx/transactors/dex/AMMClawback.h index 4f44da60d2..dd455903a2 100644 --- a/include/xrpl/tx/transactors/dex/AMMClawback.h +++ b/include/xrpl/tx/transactors/dex/AMMClawback.h @@ -28,20 +28,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - private: TER applyGuts(Sandbox& view); diff --git a/include/xrpl/tx/transactors/dex/AMMCreate.h b/include/xrpl/tx/transactors/dex/AMMCreate.h index a3ee083b9a..5deaa129ed 100644 --- a/include/xrpl/tx/transactors/dex/AMMCreate.h +++ b/include/xrpl/tx/transactors/dex/AMMCreate.h @@ -58,20 +58,6 @@ public: /** Attempt to create the AMM instance. */ TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/dex/AMMDelete.h b/include/xrpl/tx/transactors/dex/AMMDelete.h index a1708eec88..1c0996f8a2 100644 --- a/include/xrpl/tx/transactors/dex/AMMDelete.h +++ b/include/xrpl/tx/transactors/dex/AMMDelete.h @@ -30,20 +30,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/dex/AMMDeposit.h b/include/xrpl/tx/transactors/dex/AMMDeposit.h index 87f2871d27..e2a19504ae 100644 --- a/include/xrpl/tx/transactors/dex/AMMDeposit.h +++ b/include/xrpl/tx/transactors/dex/AMMDeposit.h @@ -63,20 +63,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - private: std::pair applyGuts(Sandbox& view); diff --git a/include/xrpl/tx/transactors/dex/AMMVote.h b/include/xrpl/tx/transactors/dex/AMMVote.h index f83cdcfcd2..ab04b30993 100644 --- a/include/xrpl/tx/transactors/dex/AMMVote.h +++ b/include/xrpl/tx/transactors/dex/AMMVote.h @@ -47,20 +47,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/dex/AMMWithdraw.h b/include/xrpl/tx/transactors/dex/AMMWithdraw.h index a07cfca693..087fd3a14c 100644 --- a/include/xrpl/tx/transactors/dex/AMMWithdraw.h +++ b/include/xrpl/tx/transactors/dex/AMMWithdraw.h @@ -71,20 +71,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - /** Equal-asset withdrawal (LPTokens) of some AMM instance pools * shares represented by the number of LPTokens . * The trading fee is not charged. diff --git a/include/xrpl/tx/transactors/dex/OfferCancel.h b/include/xrpl/tx/transactors/dex/OfferCancel.h index d18808d236..c4c57ff3b4 100644 --- a/include/xrpl/tx/transactors/dex/OfferCancel.h +++ b/include/xrpl/tx/transactors/dex/OfferCancel.h @@ -22,20 +22,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/dex/OfferCreate.h b/include/xrpl/tx/transactors/dex/OfferCreate.h index 09c9c0dd6f..ad36f1b6e6 100644 --- a/include/xrpl/tx/transactors/dex/OfferCreate.h +++ b/include/xrpl/tx/transactors/dex/OfferCreate.h @@ -40,20 +40,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - private: std::pair applyGuts(Sandbox& view, Sandbox& view_cancel); diff --git a/include/xrpl/tx/transactors/did/DIDDelete.h b/include/xrpl/tx/transactors/did/DIDDelete.h index 47b4112762..037a57bb02 100644 --- a/include/xrpl/tx/transactors/did/DIDDelete.h +++ b/include/xrpl/tx/transactors/did/DIDDelete.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/did/DIDSet.h b/include/xrpl/tx/transactors/did/DIDSet.h index 2e88570065..fe1c476b47 100644 --- a/include/xrpl/tx/transactors/did/DIDSet.h +++ b/include/xrpl/tx/transactors/did/DIDSet.h @@ -18,20 +18,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/escrow/EscrowCancel.h b/include/xrpl/tx/transactors/escrow/EscrowCancel.h index 253d88613f..c8b97203f0 100644 --- a/include/xrpl/tx/transactors/escrow/EscrowCancel.h +++ b/include/xrpl/tx/transactors/escrow/EscrowCancel.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/escrow/EscrowCreate.h b/include/xrpl/tx/transactors/escrow/EscrowCreate.h index 3cbeb47fa1..221ffee070 100644 --- a/include/xrpl/tx/transactors/escrow/EscrowCreate.h +++ b/include/xrpl/tx/transactors/escrow/EscrowCreate.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/escrow/EscrowFinish.h b/include/xrpl/tx/transactors/escrow/EscrowFinish.h index 6279b3a9af..0917c35d93 100644 --- a/include/xrpl/tx/transactors/escrow/EscrowFinish.h +++ b/include/xrpl/tx/transactors/escrow/EscrowFinish.h @@ -30,20 +30,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/lending/LendingHelpers.h b/include/xrpl/tx/transactors/lending/LendingHelpers.h index 1c938bbc8a..897ca3995b 100644 --- a/include/xrpl/tx/transactors/lending/LendingHelpers.h +++ b/include/xrpl/tx/transactors/lending/LendingHelpers.h @@ -171,7 +171,7 @@ getAssetsTotalScale(SLE::const_ref vaultSle) { if (!vaultSle) return Number::minExponent - 1; // LCOV_EXCL_LINE - return scale(vaultSle->at(sfAssetsTotal), vaultSle->at(sfAsset)); + return STAmount{vaultSle->at(sfAsset), vaultSle->at(sfAssetsTotal)}.exponent(); } TER diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerCoverClawback.h b/include/xrpl/tx/transactors/lending/LoanBrokerCoverClawback.h index 9a028b6448..b1e539392f 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerCoverClawback.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerCoverClawback.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerCoverDeposit.h b/include/xrpl/tx/transactors/lending/LoanBrokerCoverDeposit.h index 9b0cd9b176..8dda417443 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerCoverDeposit.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerCoverDeposit.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.h b/include/xrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.h index 74c35d5667..52b14bfb67 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerDelete.h b/include/xrpl/tx/transactors/lending/LoanBrokerDelete.h index 3de0f6fec2..b9c9851c41 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerDelete.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerDelete.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/tx/transactors/lending/LoanBrokerSet.h b/include/xrpl/tx/transactors/lending/LoanBrokerSet.h index 519ccd6ce9..ce1e069791 100644 --- a/include/xrpl/tx/transactors/lending/LoanBrokerSet.h +++ b/include/xrpl/tx/transactors/lending/LoanBrokerSet.h @@ -27,20 +27,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/tx/transactors/lending/LoanDelete.h b/include/xrpl/tx/transactors/lending/LoanDelete.h index 5c6ec46d33..ff78d7db60 100644 --- a/include/xrpl/tx/transactors/lending/LoanDelete.h +++ b/include/xrpl/tx/transactors/lending/LoanDelete.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/tx/transactors/lending/LoanManage.h b/include/xrpl/tx/transactors/lending/LoanManage.h index 98b7e38ba6..810e9bbf65 100644 --- a/include/xrpl/tx/transactors/lending/LoanManage.h +++ b/include/xrpl/tx/transactors/lending/LoanManage.h @@ -58,20 +58,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/tx/transactors/lending/LoanPay.h b/include/xrpl/tx/transactors/lending/LoanPay.h index 83271cf4e7..2e3cce75ed 100644 --- a/include/xrpl/tx/transactors/lending/LoanPay.h +++ b/include/xrpl/tx/transactors/lending/LoanPay.h @@ -30,20 +30,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; //------------------------------------------------------------------------------ diff --git a/include/xrpl/tx/transactors/lending/LoanSet.h b/include/xrpl/tx/transactors/lending/LoanSet.h index c778582ab0..86101d0735 100644 --- a/include/xrpl/tx/transactors/lending/LoanSet.h +++ b/include/xrpl/tx/transactors/lending/LoanSet.h @@ -38,20 +38,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - public: static std::uint32_t constexpr minPaymentTotal = 1; static std::uint32_t constexpr defaultPaymentTotal = 1; diff --git a/include/xrpl/tx/transactors/nft/NFTokenAcceptOffer.h b/include/xrpl/tx/transactors/nft/NFTokenAcceptOffer.h index 7291db9a2e..60962fc9ca 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenAcceptOffer.h +++ b/include/xrpl/tx/transactors/nft/NFTokenAcceptOffer.h @@ -34,20 +34,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/nft/NFTokenBurn.h b/include/xrpl/tx/transactors/nft/NFTokenBurn.h index 2830b7c22a..8737997f03 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenBurn.h +++ b/include/xrpl/tx/transactors/nft/NFTokenBurn.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/nft/NFTokenCancelOffer.h b/include/xrpl/tx/transactors/nft/NFTokenCancelOffer.h index 540258b8d6..6d60a0bebd 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenCancelOffer.h +++ b/include/xrpl/tx/transactors/nft/NFTokenCancelOffer.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/nft/NFTokenCreateOffer.h b/include/xrpl/tx/transactors/nft/NFTokenCreateOffer.h index 532aa5c120..a48e53589d 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenCreateOffer.h +++ b/include/xrpl/tx/transactors/nft/NFTokenCreateOffer.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/nft/NFTokenMint.h b/include/xrpl/tx/transactors/nft/NFTokenMint.h index 6dcf8eaf12..d04f88ed3b 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenMint.h +++ b/include/xrpl/tx/transactors/nft/NFTokenMint.h @@ -30,20 +30,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - // Public to support unit tests. static uint256 createNFTokenID( diff --git a/include/xrpl/tx/transactors/nft/NFTokenModify.h b/include/xrpl/tx/transactors/nft/NFTokenModify.h index a1076a96a9..a64df65783 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenModify.h +++ b/include/xrpl/tx/transactors/nft/NFTokenModify.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/oracle/OracleDelete.h b/include/xrpl/tx/transactors/oracle/OracleDelete.h index 5de69e980f..9d1e6d3a44 100644 --- a/include/xrpl/tx/transactors/oracle/OracleDelete.h +++ b/include/xrpl/tx/transactors/oracle/OracleDelete.h @@ -31,20 +31,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - static TER deleteOracle( ApplyView& view, diff --git a/include/xrpl/tx/transactors/oracle/OracleSet.h b/include/xrpl/tx/transactors/oracle/OracleSet.h index 426f46c2b4..d879d14a84 100644 --- a/include/xrpl/tx/transactors/oracle/OracleSet.h +++ b/include/xrpl/tx/transactors/oracle/OracleSet.h @@ -30,20 +30,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/payment/DepositPreauth.h b/include/xrpl/tx/transactors/payment/DepositPreauth.h index f74be24c56..b397a81748 100644 --- a/include/xrpl/tx/transactors/payment/DepositPreauth.h +++ b/include/xrpl/tx/transactors/payment/DepositPreauth.h @@ -25,20 +25,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - // Interface used by AccountDelete static TER removeFromLedger(ApplyView& view, uint256 const& delIndex, beast::Journal j); diff --git a/include/xrpl/tx/transactors/payment/Payment.h b/include/xrpl/tx/transactors/payment/Payment.h index 3baf1fa55f..bc5bc4fee3 100644 --- a/include/xrpl/tx/transactors/payment/Payment.h +++ b/include/xrpl/tx/transactors/payment/Payment.h @@ -39,20 +39,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/payment_channel/PaymentChannelClaim.h b/include/xrpl/tx/transactors/payment_channel/PaymentChannelClaim.h index 6e9a269b8d..449e503bc4 100644 --- a/include/xrpl/tx/transactors/payment_channel/PaymentChannelClaim.h +++ b/include/xrpl/tx/transactors/payment_channel/PaymentChannelClaim.h @@ -27,20 +27,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/payment_channel/PaymentChannelCreate.h b/include/xrpl/tx/transactors/payment_channel/PaymentChannelCreate.h index cd0250713a..7fdacf9b3a 100644 --- a/include/xrpl/tx/transactors/payment_channel/PaymentChannelCreate.h +++ b/include/xrpl/tx/transactors/payment_channel/PaymentChannelCreate.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/payment_channel/PaymentChannelFund.h b/include/xrpl/tx/transactors/payment_channel/PaymentChannelFund.h index befe9ac951..69f74a4c53 100644 --- a/include/xrpl/tx/transactors/payment_channel/PaymentChannelFund.h +++ b/include/xrpl/tx/transactors/payment_channel/PaymentChannelFund.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h b/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h index 93879c55b2..b5c72413a2 100644 --- a/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h +++ b/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h @@ -22,20 +22,6 @@ public: /** Attempt to delete the Permissioned Domain. */ TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.h b/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.h index 3187be08e1..acf9194ee2 100644 --- a/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.h +++ b/include/xrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.h @@ -25,20 +25,6 @@ public: /** Attempt to create the Permissioned Domain. */ TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/system/Batch.h b/include/xrpl/tx/transactors/system/Batch.h index 1d9a66ec9a..5f7a6d04e2 100644 --- a/include/xrpl/tx/transactors/system/Batch.h +++ b/include/xrpl/tx/transactors/system/Batch.h @@ -33,37 +33,22 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - - static constexpr auto disabledTxTypes = std::to_array({ - ttVAULT_CREATE, - ttVAULT_SET, - ttVAULT_DELETE, - ttVAULT_DEPOSIT, - ttVAULT_WITHDRAW, - ttVAULT_CLAWBACK, - ttLOAN_BROKER_SET, - ttLOAN_BROKER_DELETE, - ttLOAN_BROKER_COVER_DEPOSIT, - ttLOAN_BROKER_COVER_WITHDRAW, - ttLOAN_BROKER_COVER_CLAWBACK, - ttLOAN_SET, - ttLOAN_DELETE, - ttLOAN_MANAGE, - ttLOAN_PAY, - }); + static constexpr auto disabledTxTypes = std::to_array( + {ttVAULT_CREATE, + ttVAULT_SET, + ttVAULT_DELETE, + ttVAULT_DEPOSIT, + ttVAULT_WITHDRAW, + ttVAULT_CLAWBACK, + ttLOAN_BROKER_SET, + ttLOAN_BROKER_DELETE, + ttLOAN_BROKER_COVER_DEPOSIT, + ttLOAN_BROKER_COVER_WITHDRAW, + ttLOAN_BROKER_COVER_CLAWBACK, + ttLOAN_SET, + ttLOAN_DELETE, + ttLOAN_MANAGE, + ttLOAN_PAY}); }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/system/Change.h b/include/xrpl/tx/transactors/system/Change.h index b966ef73ec..1bf63ff0db 100644 --- a/include/xrpl/tx/transactors/system/Change.h +++ b/include/xrpl/tx/transactors/system/Change.h @@ -18,20 +18,6 @@ public: void preCompute() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - static XRPAmount calculateBaseFee(ReadView const& view, STTx const& tx) { diff --git a/include/xrpl/tx/transactors/system/LedgerStateFix.h b/include/xrpl/tx/transactors/system/LedgerStateFix.h index a236a52c74..728f8c651d 100644 --- a/include/xrpl/tx/transactors/system/LedgerStateFix.h +++ b/include/xrpl/tx/transactors/system/LedgerStateFix.h @@ -28,20 +28,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/system/TicketCreate.h b/include/xrpl/tx/transactors/system/TicketCreate.h index 13b6e7eca5..88d83c37a7 100644 --- a/include/xrpl/tx/transactors/system/TicketCreate.h +++ b/include/xrpl/tx/transactors/system/TicketCreate.h @@ -59,20 +59,6 @@ public: /** Precondition: fee collection is likely. Attempt to create ticket(s). */ TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/Clawback.h b/include/xrpl/tx/transactors/token/Clawback.h index f7b77b872c..a795115f7a 100644 --- a/include/xrpl/tx/transactors/token/Clawback.h +++ b/include/xrpl/tx/transactors/token/Clawback.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTClawback.h b/include/xrpl/tx/transactors/token/ConfidentialMPTClawback.h index 867ad05d0a..779d372a48 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTClawback.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTClawback.h @@ -37,20 +37,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTConvert.h b/include/xrpl/tx/transactors/token/ConfidentialMPTConvert.h index dd54d181ef..1f939b9037 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTConvert.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTConvert.h @@ -39,20 +39,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTConvertBack.h b/include/xrpl/tx/transactors/token/ConfidentialMPTConvertBack.h index bc90858f4f..e0a59f78e5 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTConvertBack.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTConvertBack.h @@ -40,20 +40,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTMergeInbox.h b/include/xrpl/tx/transactors/token/ConfidentialMPTMergeInbox.h index 2b47ad8366..58ff9489cc 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTMergeInbox.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTMergeInbox.h @@ -41,20 +41,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/ConfidentialMPTSend.h b/include/xrpl/tx/transactors/token/ConfidentialMPTSend.h index 957cff5042..8dca8716d1 100644 --- a/include/xrpl/tx/transactors/token/ConfidentialMPTSend.h +++ b/include/xrpl/tx/transactors/token/ConfidentialMPTSend.h @@ -47,20 +47,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/MPTokenAuthorize.h b/include/xrpl/tx/transactors/token/MPTokenAuthorize.h index 0cbc683e91..3210608e73 100644 --- a/include/xrpl/tx/transactors/token/MPTokenAuthorize.h +++ b/include/xrpl/tx/transactors/token/MPTokenAuthorize.h @@ -10,7 +10,7 @@ struct MPTAuthorizeArgs MPTID const& mptIssuanceID; AccountID const& account; std::uint32_t flags{}; - std::optional holderID; + std::optional holderID{}; }; class MPTokenAuthorize : public Transactor @@ -33,20 +33,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h b/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h index 6718d28e4d..5ef12df282 100644 --- a/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h +++ b/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h @@ -12,16 +12,12 @@ struct MPTCreateArgs AccountID const& account; std::uint32_t sequence = 0; std::uint32_t flags = 0; - std::optional maxAmount = - std::nullopt; // NOLINT(readability-redundant-member-init) - std::optional assetScale = - std::nullopt; // NOLINT(readability-redundant-member-init) - std::optional transferFee = - std::nullopt; // NOLINT(readability-redundant-member-init) + std::optional maxAmount{}; + std::optional assetScale{}; + std::optional transferFee{}; std::optional const& metadata{}; - std::optional domainId = std::nullopt; // NOLINT(readability-redundant-member-init) - std::optional mutableFlags = - std::nullopt; // NOLINT(readability-redundant-member-init) + std::optional domainId{}; + std::optional mutableFlags{}; }; class MPTokenIssuanceCreate : public Transactor @@ -45,20 +41,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - static Expected create(ApplyView& view, beast::Journal journal, MPTCreateArgs const& args); }; diff --git a/include/xrpl/tx/transactors/token/MPTokenIssuanceDestroy.h b/include/xrpl/tx/transactors/token/MPTokenIssuanceDestroy.h index aaac508cf5..416708565a 100644 --- a/include/xrpl/tx/transactors/token/MPTokenIssuanceDestroy.h +++ b/include/xrpl/tx/transactors/token/MPTokenIssuanceDestroy.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/MPTokenIssuanceSet.h b/include/xrpl/tx/transactors/token/MPTokenIssuanceSet.h index 8dc423376a..dccd4e4cee 100644 --- a/include/xrpl/tx/transactors/token/MPTokenIssuanceSet.h +++ b/include/xrpl/tx/transactors/token/MPTokenIssuanceSet.h @@ -30,20 +30,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/token/TrustSet.h b/include/xrpl/tx/transactors/token/TrustSet.h index cf4f042515..2e67aaeded 100644 --- a/include/xrpl/tx/transactors/token/TrustSet.h +++ b/include/xrpl/tx/transactors/token/TrustSet.h @@ -28,20 +28,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/vault/VaultClawback.h b/include/xrpl/tx/transactors/vault/VaultClawback.h index 9c69c88f75..131a1d87e7 100644 --- a/include/xrpl/tx/transactors/vault/VaultClawback.h +++ b/include/xrpl/tx/transactors/vault/VaultClawback.h @@ -22,20 +22,6 @@ public: TER doApply() override; - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; - private: Expected, TER> assetsToClawback( diff --git a/include/xrpl/tx/transactors/vault/VaultCreate.h b/include/xrpl/tx/transactors/vault/VaultCreate.h index 6861c9d164..cc35cd765b 100644 --- a/include/xrpl/tx/transactors/vault/VaultCreate.h +++ b/include/xrpl/tx/transactors/vault/VaultCreate.h @@ -27,20 +27,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/vault/VaultDelete.h b/include/xrpl/tx/transactors/vault/VaultDelete.h index 33a86dd050..f881a692fd 100644 --- a/include/xrpl/tx/transactors/vault/VaultDelete.h +++ b/include/xrpl/tx/transactors/vault/VaultDelete.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/vault/VaultDeposit.h b/include/xrpl/tx/transactors/vault/VaultDeposit.h index 5a0c63a3b1..0943596f20 100644 --- a/include/xrpl/tx/transactors/vault/VaultDeposit.h +++ b/include/xrpl/tx/transactors/vault/VaultDeposit.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/vault/VaultSet.h b/include/xrpl/tx/transactors/vault/VaultSet.h index 6abbe80fec..fb69f132b1 100644 --- a/include/xrpl/tx/transactors/vault/VaultSet.h +++ b/include/xrpl/tx/transactors/vault/VaultSet.h @@ -24,20 +24,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/include/xrpl/tx/transactors/vault/VaultWithdraw.h b/include/xrpl/tx/transactors/vault/VaultWithdraw.h index b8604d039e..ffe14a7141 100644 --- a/include/xrpl/tx/transactors/vault/VaultWithdraw.h +++ b/include/xrpl/tx/transactors/vault/VaultWithdraw.h @@ -21,20 +21,6 @@ public: TER doApply() override; - - void - visitInvariantEntry( - bool isDelete, - std::shared_ptr const& before, - std::shared_ptr const& after) override; - - [[nodiscard]] bool - finalizeInvariants( - STTx const& tx, - TER result, - XRPAmount fee, - ReadView const& view, - beast::Journal const& j) override; }; } // namespace xrpl diff --git a/cmake/scripts/codegen/generate_ledger_classes.py b/scripts/generate_ledger_classes.py similarity index 92% rename from cmake/scripts/codegen/generate_ledger_classes.py rename to scripts/generate_ledger_classes.py index f5513655de..ad773ab9af 100644 --- a/cmake/scripts/codegen/generate_ledger_classes.py +++ b/scripts/generate_ledger_classes.py @@ -138,12 +138,28 @@ def main(): "--sfields-macro", help="Path to sfields.macro (default: auto-detect from macro_path)", ) - parser.add_argument("--venv-dir", help=argparse.SUPPRESS) + parser.add_argument( + "--list-outputs", + action="store_true", + help="List output files without generating (one per line)", + ) + args = parser.parse_args() # Parse the macro file to get ledger entry names entries = parse_macro_file(args.macro_path) + # If --list-outputs, just print the output file paths and exit + if args.list_outputs: + header_dir = Path(args.header_dir) + for entry in entries: + print(header_dir / f"{entry['name']}.h") + if args.test_dir: + test_dir = Path(args.test_dir) + for entry in entries: + print(test_dir / f"{entry['name']}Tests.cpp") + return + # Auto-detect sfields.macro path if not provided if args.sfields_macro: sfields_path = Path(args.sfields_macro) diff --git a/cmake/scripts/codegen/generate_tx_classes.py b/scripts/generate_tx_classes.py similarity index 92% rename from cmake/scripts/codegen/generate_tx_classes.py rename to scripts/generate_tx_classes.py index 07baefd8b6..f21b7101df 100644 --- a/cmake/scripts/codegen/generate_tx_classes.py +++ b/scripts/generate_tx_classes.py @@ -147,12 +147,28 @@ def main(): "--sfields-macro", help="Path to sfields.macro (default: auto-detect from macro_path)", ) - parser.add_argument("--venv-dir", help=argparse.SUPPRESS) + parser.add_argument( + "--list-outputs", + action="store_true", + help="List output files without generating (one per line)", + ) + args = parser.parse_args() # Parse the macro file to get transaction names transactions = parse_macro_file(args.macro_path) + # If --list-outputs, just print the output file paths and exit + if args.list_outputs: + header_dir = Path(args.header_dir) + for tx in transactions: + print(header_dir / f"{tx['name']}.h") + if args.test_dir: + test_dir = Path(args.test_dir) + for tx in transactions: + print(test_dir / f"{tx['name']}Tests.cpp") + return + # Auto-detect sfields.macro path if not provided if args.sfields_macro: sfields_path = Path(args.sfields_macro) diff --git a/cmake/scripts/codegen/macro_parser_common.py b/scripts/macro_parser_common.py similarity index 100% rename from cmake/scripts/codegen/macro_parser_common.py rename to scripts/macro_parser_common.py diff --git a/cmake/scripts/codegen/requirements.txt b/scripts/requirements.txt similarity index 100% rename from cmake/scripts/codegen/requirements.txt rename to scripts/requirements.txt diff --git a/cmake/scripts/codegen/templates/LedgerEntry.h.mako b/scripts/templates/LedgerEntry.h.mako similarity index 100% rename from cmake/scripts/codegen/templates/LedgerEntry.h.mako rename to scripts/templates/LedgerEntry.h.mako diff --git a/cmake/scripts/codegen/templates/LedgerEntryTests.cpp.mako b/scripts/templates/LedgerEntryTests.cpp.mako similarity index 100% rename from cmake/scripts/codegen/templates/LedgerEntryTests.cpp.mako rename to scripts/templates/LedgerEntryTests.cpp.mako diff --git a/cmake/scripts/codegen/templates/Transaction.h.mako b/scripts/templates/Transaction.h.mako similarity index 100% rename from cmake/scripts/codegen/templates/Transaction.h.mako rename to scripts/templates/Transaction.h.mako diff --git a/cmake/scripts/codegen/templates/TransactionTests.cpp.mako b/scripts/templates/TransactionTests.cpp.mako similarity index 100% rename from cmake/scripts/codegen/templates/TransactionTests.cpp.mako rename to scripts/templates/TransactionTests.cpp.mako diff --git a/src/libxrpl/basics/Archive.cpp b/src/libxrpl/basics/Archive.cpp index bba144ed04..e77dabcd68 100644 --- a/src/libxrpl/basics/Archive.cpp +++ b/src/libxrpl/basics/Archive.cpp @@ -1,5 +1,4 @@ #include - #include #include diff --git a/src/libxrpl/basics/BasicConfig.cpp b/src/libxrpl/basics/BasicConfig.cpp index 8fed7e5345..ba10a575d9 100644 --- a/src/libxrpl/basics/BasicConfig.cpp +++ b/src/libxrpl/basics/BasicConfig.cpp @@ -1,9 +1,9 @@ #include - #include #include #include +#include #include #include @@ -14,7 +14,7 @@ namespace xrpl { -Section::Section(std::string name) : name_(std::move(name)) +Section::Section(std::string const& name) : name_(name) { } diff --git a/src/libxrpl/basics/CountedObject.cpp b/src/libxrpl/basics/CountedObject.cpp index 8eb6ca9dc2..bcdca9dfa4 100644 --- a/src/libxrpl/basics/CountedObject.cpp +++ b/src/libxrpl/basics/CountedObject.cpp @@ -31,7 +31,7 @@ CountedObjects::getCounts(int minimumThreshold) const counts.emplace_back(ctr->getName(), ctr->getCount()); } - std::ranges::sort(counts); + std::sort(counts.begin(), counts.end()); return counts; } diff --git a/src/libxrpl/basics/FileUtilities.cpp b/src/libxrpl/basics/FileUtilities.cpp index 1a6e604724..96ec3fa3ba 100644 --- a/src/libxrpl/basics/FileUtilities.cpp +++ b/src/libxrpl/basics/FileUtilities.cpp @@ -1,5 +1,6 @@ #include +#include #include #include #include diff --git a/src/libxrpl/basics/Log.cpp b/src/libxrpl/basics/Log.cpp index 75398ca22d..0278aa6aed 100644 --- a/src/libxrpl/basics/Log.cpp +++ b/src/libxrpl/basics/Log.cpp @@ -1,5 +1,4 @@ #include - #include #include #include @@ -20,8 +19,8 @@ namespace xrpl { -Logs::Sink::Sink(std::string partition, beast::severities::Severity thresh, Logs& logs) - : beast::Journal::Sink(thresh, false), logs_(logs), partition_(std::move(partition)) +Logs::Sink::Sink(std::string const& partition, beast::severities::Severity thresh, Logs& logs) + : beast::Journal::Sink(thresh, false), logs_(logs), partition_(partition) { } diff --git a/src/libxrpl/basics/MallocTrim.cpp b/src/libxrpl/basics/MallocTrim.cpp index 07b5b9ffc5..ed20ac6c94 100644 --- a/src/libxrpl/basics/MallocTrim.cpp +++ b/src/libxrpl/basics/MallocTrim.cpp @@ -1,11 +1,13 @@ -#include - #include -#include +#include #include -#include +#include +#include +#include +#include +#include #if defined(__GLIBC__) && BOOST_OS_LINUX #include @@ -13,14 +15,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include - // Require RUSAGE_THREAD for thread-scoped page fault tracking #ifndef RUSAGE_THREAD #error "MallocTrim rusage instrumentation requires RUSAGE_THREAD on Linux/glibc" diff --git a/src/libxrpl/basics/Number.cpp b/src/libxrpl/basics/Number.cpp index 73ab8f6307..a8adabd5de 100644 --- a/src/libxrpl/basics/Number.cpp +++ b/src/libxrpl/basics/Number.cpp @@ -1,12 +1,11 @@ #include - +// Keep Number.h first to ensure it can build without hidden dependencies #include #include #include #include #include -#include #include #include #include diff --git a/src/libxrpl/basics/ResolverAsio.cpp b/src/libxrpl/basics/ResolverAsio.cpp index fc71666768..305bdb6451 100644 --- a/src/libxrpl/basics/ResolverAsio.cpp +++ b/src/libxrpl/basics/ResolverAsio.cpp @@ -1,19 +1,15 @@ -#include - #include #include +#include #include #include #include #include #include -#include #include #include #include -#include -#include #include #include @@ -26,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -126,7 +121,7 @@ public: HandlerType handler; template - Work(StringSequence const& names_, HandlerType handler_) : handler(std::move(handler_)) + Work(StringSequence const& names_, HandlerType const& handler_) : handler(handler_) { names.reserve(names_.size()); @@ -295,10 +290,9 @@ public: auto const find_whitespace = std::bind(&std::isspace, std::placeholders::_1, std::locale()); - auto host_first = std::ranges::find_if_not(str, find_whitespace); + auto host_first = std::find_if_not(str.begin(), str.end(), find_whitespace); - auto port_last = - std::ranges::find_if_not(std::ranges::reverse_view(str), find_whitespace).base(); + auto port_last = std::find_if_not(str.rbegin(), str.rend(), find_whitespace).base(); // This should only happen for all-whitespace strings if (host_first >= port_last) diff --git a/src/libxrpl/basics/StringUtilities.cpp b/src/libxrpl/basics/StringUtilities.cpp index 7bf4c8e743..5e3b100b26 100644 --- a/src/libxrpl/basics/StringUtilities.cpp +++ b/src/libxrpl/basics/StringUtilities.cpp @@ -1,6 +1,5 @@ -#include - #include +#include #include #include @@ -9,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/src/libxrpl/basics/contract.cpp b/src/libxrpl/basics/contract.cpp index 32628ac3d9..562d3a0944 100644 --- a/src/libxrpl/basics/contract.cpp +++ b/src/libxrpl/basics/contract.cpp @@ -1,6 +1,5 @@ -#include - #include +#include #include #include diff --git a/src/libxrpl/basics/make_SSLContext.cpp b/src/libxrpl/basics/make_SSLContext.cpp index aa04f22191..c5ff456d25 100644 --- a/src/libxrpl/basics/make_SSLContext.cpp +++ b/src/libxrpl/basics/make_SSLContext.cpp @@ -1,6 +1,5 @@ -#include - #include +#include #include #include @@ -9,9 +8,8 @@ #include #include -#include #include -#include // IWYU pragma: keep +#include #include #include #include @@ -27,8 +25,8 @@ #include namespace xrpl { - -namespace openssl::detail { +namespace openssl { +namespace detail { /** The default strength of self-signed RSA certificates. @@ -346,7 +344,8 @@ get_context(std::string cipherList) return c; } -} // namespace openssl::detail +} // namespace detail +} // namespace openssl //------------------------------------------------------------------------------ std::shared_ptr diff --git a/src/libxrpl/basics/mulDiv.cpp b/src/libxrpl/basics/mulDiv.cpp index 4abdcc0f75..d8988b474e 100644 --- a/src/libxrpl/basics/mulDiv.cpp +++ b/src/libxrpl/basics/mulDiv.cpp @@ -1,6 +1,8 @@ #include -#include // IWYU pragma: keep +#include +#include +#include #include #include diff --git a/src/libxrpl/beast/clock/basic_seconds_clock.cpp b/src/libxrpl/beast/clock/basic_seconds_clock.cpp index 2b7ce57742..c928c8c579 100644 --- a/src/libxrpl/beast/clock/basic_seconds_clock.cpp +++ b/src/libxrpl/beast/clock/basic_seconds_clock.cpp @@ -1,5 +1,4 @@ #include - #include #include diff --git a/src/libxrpl/beast/core/CurrentThreadName.cpp b/src/libxrpl/beast/core/CurrentThreadName.cpp index ccd3df5f74..6f22687dcc 100644 --- a/src/libxrpl/beast/core/CurrentThreadName.cpp +++ b/src/libxrpl/beast/core/CurrentThreadName.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -71,8 +72,7 @@ setCurrentThreadNameImpl(std::string_view name) #if BOOST_OS_LINUX #include -#include -#include // IWYU pragma: keep +#include namespace beast::detail { diff --git a/src/libxrpl/beast/core/SemanticVersion.cpp b/src/libxrpl/beast/core/SemanticVersion.cpp index 0cf4ac3113..0601690560 100644 --- a/src/libxrpl/beast/core/SemanticVersion.cpp +++ b/src/libxrpl/beast/core/SemanticVersion.cpp @@ -1,16 +1,13 @@ -#include - #include +#include #include #include #include #include #include -#include #include #include -#include namespace beast { @@ -61,8 +58,9 @@ chopUInt(int& value, int limit, std::string& input) if (input.empty()) return false; - auto left_iter = std::ranges::find_if_not( - input, [](std::string::value_type c) { return std::isdigit(c, std::locale::classic()); }); + auto left_iter = std::find_if_not(input.begin(), input.end(), [](std::string::value_type c) { + return std::isdigit(c, std::locale::classic()); + }); std::string const item(input.begin(), left_iter); @@ -150,13 +148,13 @@ bool SemanticVersion::parse(std::string_view input) { // May not have leading or trailing whitespace - auto left_iter = std::ranges::find_if_not( - input, [](std::string::value_type c) { return std::isspace(c, std::locale::classic()); }); + auto left_iter = std::find_if_not(input.begin(), input.end(), [](std::string::value_type c) { + return std::isspace(c, std::locale::classic()); + }); - auto right_iter = - std::ranges::find_if_not(std::ranges::reverse_view(input), [](std::string::value_type c) { - return std::isspace(c, std::locale::classic()); - }).base(); + auto right_iter = std::find_if_not(input.rbegin(), input.rend(), [](std::string::value_type c) { + return std::isspace(c, std::locale::classic()); + }).base(); // Must not be empty! if (left_iter >= right_iter) diff --git a/src/libxrpl/beast/insight/Collector.cpp b/src/libxrpl/beast/insight/Collector.cpp index 55abb27c21..d4a528473b 100644 --- a/src/libxrpl/beast/insight/Collector.cpp +++ b/src/libxrpl/beast/insight/Collector.cpp @@ -1,6 +1,8 @@ #include -namespace beast::insight { +namespace beast { +namespace insight { Collector::~Collector() = default; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/src/libxrpl/beast/insight/Groups.cpp b/src/libxrpl/beast/insight/Groups.cpp index c9e9453468..393deca101 100644 --- a/src/libxrpl/beast/insight/Groups.cpp +++ b/src/libxrpl/beast/insight/Groups.cpp @@ -1,11 +1,10 @@ -#include - #include #include #include #include #include #include +#include #include #include #include @@ -15,7 +14,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { namespace detail { @@ -25,12 +25,12 @@ public: std::string const m_name; Collector::ptr m_collector; - GroupImp(std::string name_, Collector::ptr collector) - : m_name(std::move(name_)), m_collector(std::move(collector)) + GroupImp(std::string const& name_, Collector::ptr const& collector) + : m_name(name_), m_collector(collector) { } - ~GroupImp() override = default; + ~GroupImp() = default; std::string const& name() const override @@ -74,8 +74,9 @@ public: return m_collector->make_meter(make_name(name)); } +private: GroupImp& - operator=(GroupImp const&) = delete; + operator=(GroupImp const&); }; //------------------------------------------------------------------------------ @@ -88,11 +89,11 @@ public: Collector::ptr m_collector; Items m_items; - explicit GroupsImp(Collector::ptr collector) : m_collector(std::move(collector)) + explicit GroupsImp(Collector::ptr const& collector) : m_collector(collector) { } - ~GroupsImp() override = default; + ~GroupsImp() = default; Group::ptr const& get(std::string const& name) override @@ -117,4 +118,5 @@ make_Groups(Collector::ptr const& collector) return std::make_unique(collector); } -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/src/libxrpl/beast/insight/Hook.cpp b/src/libxrpl/beast/insight/Hook.cpp index a20e33fad4..f74f3e8705 100644 --- a/src/libxrpl/beast/insight/Hook.cpp +++ b/src/libxrpl/beast/insight/Hook.cpp @@ -1,8 +1,9 @@ #include - #include -namespace beast::insight { +namespace beast { +namespace insight { HookImpl::~HookImpl() = default; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/src/libxrpl/beast/insight/Metric.cpp b/src/libxrpl/beast/insight/Metric.cpp index b9ac569259..fcad390576 100644 --- a/src/libxrpl/beast/insight/Metric.cpp +++ b/src/libxrpl/beast/insight/Metric.cpp @@ -3,7 +3,8 @@ #include #include -namespace beast::insight { +namespace beast { +namespace insight { CounterImpl::~CounterImpl() = default; @@ -12,4 +13,5 @@ EventImpl::~EventImpl() = default; GaugeImpl::~GaugeImpl() = default; MeterImpl::~MeterImpl() = default; -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/src/libxrpl/beast/insight/NullCollector.cpp b/src/libxrpl/beast/insight/NullCollector.cpp index f5bb44bdba..d8ba67a8e7 100644 --- a/src/libxrpl/beast/insight/NullCollector.cpp +++ b/src/libxrpl/beast/insight/NullCollector.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -11,11 +9,13 @@ #include #include #include +#include #include #include -namespace beast::insight { +namespace beast { +namespace insight { namespace detail { @@ -24,8 +24,9 @@ class NullHookImpl : public HookImpl public: explicit NullHookImpl() = default; +private: NullHookImpl& - operator=(NullHookImpl const&) = delete; + operator=(NullHookImpl const&); }; //------------------------------------------------------------------------------ @@ -40,8 +41,9 @@ public: { } +private: NullCounterImpl& - operator=(NullCounterImpl const&) = delete; + operator=(NullCounterImpl const&); }; //------------------------------------------------------------------------------ @@ -56,8 +58,9 @@ public: { } +private: NullEventImpl& - operator=(NullEventImpl const&) = delete; + operator=(NullEventImpl const&); }; //------------------------------------------------------------------------------ @@ -77,8 +80,9 @@ public: { } +private: NullGaugeImpl& - operator=(NullGaugeImpl const&) = delete; + operator=(NullGaugeImpl const&); }; //------------------------------------------------------------------------------ @@ -93,8 +97,9 @@ public: { } +private: NullMeterImpl& - operator=(NullMeterImpl const&) = delete; + operator=(NullMeterImpl const&); }; //------------------------------------------------------------------------------ @@ -105,7 +110,7 @@ private: public: NullCollectorImp() = default; - ~NullCollectorImp() override = default; + ~NullCollectorImp() = default; Hook make_hook(HookImpl::HandlerType const&) override @@ -148,4 +153,5 @@ NullCollector::New() return std::make_shared(); } -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/src/libxrpl/beast/insight/StatsDCollector.cpp b/src/libxrpl/beast/insight/StatsDCollector.cpp index d11e85830f..7d80e1a052 100644 --- a/src/libxrpl/beast/insight/StatsDCollector.cpp +++ b/src/libxrpl/beast/insight/StatsDCollector.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -7,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -14,14 +13,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include @@ -41,7 +38,8 @@ #define BEAST_STATSDCOLLECTOR_TRACING_ENABLED 0 #endif -namespace beast::insight { +namespace beast { +namespace insight { namespace detail { @@ -66,17 +64,17 @@ public: class StatsDHookImpl : public HookImpl, public StatsDMetricBase { public: - StatsDHookImpl(HandlerType handler, std::shared_ptr const& impl); + StatsDHookImpl(HandlerType const& handler, std::shared_ptr const& impl); ~StatsDHookImpl() override; void do_process() override; - StatsDHookImpl& - operator=(StatsDHookImpl const&) = delete; - private: + StatsDHookImpl& + operator=(StatsDHookImpl const&); + std::shared_ptr m_impl; HandlerType m_handler; }; @@ -86,7 +84,7 @@ private: class StatsDCounterImpl : public CounterImpl, public StatsDMetricBase { public: - StatsDCounterImpl(std::string name, std::shared_ptr const& impl); + StatsDCounterImpl(std::string const& name, std::shared_ptr const& impl); ~StatsDCounterImpl() override; @@ -100,10 +98,10 @@ public: void do_process() override; - StatsDCounterImpl& - operator=(StatsDCounterImpl const&) = delete; - private: + StatsDCounterImpl& + operator=(StatsDCounterImpl const&); + std::shared_ptr m_impl; std::string m_name; CounterImpl::value_type m_value{0}; @@ -115,9 +113,9 @@ private: class StatsDEventImpl : public EventImpl { public: - StatsDEventImpl(std::string name, std::shared_ptr const& impl); + StatsDEventImpl(std::string const& name, std::shared_ptr const& impl); - ~StatsDEventImpl() override = default; + ~StatsDEventImpl() = default; void notify(EventImpl::value_type const& value) override; @@ -140,7 +138,7 @@ private: class StatsDGaugeImpl : public GaugeImpl, public StatsDMetricBase { public: - StatsDGaugeImpl(std::string name, std::shared_ptr const& impl); + StatsDGaugeImpl(std::string const& name, std::shared_ptr const& impl); ~StatsDGaugeImpl() override; @@ -158,10 +156,10 @@ public: void do_process() override; - StatsDGaugeImpl& - operator=(StatsDGaugeImpl const&) = delete; - private: + StatsDGaugeImpl& + operator=(StatsDGaugeImpl const&); + std::shared_ptr m_impl; std::string m_name; GaugeImpl::value_type m_last_value{0}; @@ -174,7 +172,9 @@ private: class StatsDMeterImpl : public MeterImpl, public StatsDMetricBase { public: - explicit StatsDMeterImpl(std::string name, std::shared_ptr const& impl); + explicit StatsDMeterImpl( + std::string const& name, + std::shared_ptr const& impl); ~StatsDMeterImpl() override; @@ -188,10 +188,10 @@ public: void do_process() override; - StatsDMeterImpl& - operator=(StatsDMeterImpl const&) = delete; - private: + StatsDMeterImpl& + operator=(StatsDMeterImpl const&); + std::shared_ptr m_impl; std::string m_name; MeterImpl::value_type m_value{0}; @@ -231,10 +231,10 @@ private: } public: - StatsDCollectorImp(IP::Endpoint address, std::string prefix, Journal journal) + StatsDCollectorImp(IP::Endpoint const& address, std::string const& prefix, Journal journal) : m_journal(journal) - , m_address(std::move(address)) - , m_prefix(std::move(prefix)) + , m_address(address) + , m_prefix(prefix) , m_work(boost::asio::make_work_guard(m_io_context)) , m_strand(boost::asio::make_strand(m_io_context)) , m_timer(m_io_context) @@ -481,8 +481,10 @@ public: //------------------------------------------------------------------------------ -StatsDHookImpl::StatsDHookImpl(HandlerType handler, std::shared_ptr const& impl) - : m_impl(impl), m_handler(std::move(handler)) +StatsDHookImpl::StatsDHookImpl( + HandlerType const& handler, + std::shared_ptr const& impl) + : m_impl(impl), m_handler(handler) { m_impl->add(*this); } @@ -501,9 +503,9 @@ StatsDHookImpl::do_process() //------------------------------------------------------------------------------ StatsDCounterImpl::StatsDCounterImpl( - std::string name, + std::string const& name, std::shared_ptr const& impl) - : m_impl(impl), m_name(std::move(name)) + : m_impl(impl), m_name(name) { m_impl->add(*this); } @@ -553,8 +555,10 @@ StatsDCounterImpl::do_process() //------------------------------------------------------------------------------ -StatsDEventImpl::StatsDEventImpl(std::string name, std::shared_ptr const& impl) - : m_impl(impl), m_name(std::move(name)) +StatsDEventImpl::StatsDEventImpl( + std::string const& name, + std::shared_ptr const& impl) + : m_impl(impl), m_name(name) { } @@ -580,8 +584,10 @@ StatsDEventImpl::do_notify(EventImpl::value_type const& value) //------------------------------------------------------------------------------ -StatsDGaugeImpl::StatsDGaugeImpl(std::string name, std::shared_ptr const& impl) - : m_impl(impl), m_name(std::move(name)) +StatsDGaugeImpl::StatsDGaugeImpl( + std::string const& name, + std::shared_ptr const& impl) + : m_impl(impl), m_name(name) { m_impl->add(*this); } @@ -667,8 +673,10 @@ StatsDGaugeImpl::do_process() //------------------------------------------------------------------------------ -StatsDMeterImpl::StatsDMeterImpl(std::string name, std::shared_ptr const& impl) - : m_impl(impl), m_name(std::move(name)) +StatsDMeterImpl::StatsDMeterImpl( + std::string const& name, + std::shared_ptr const& impl) + : m_impl(impl), m_name(name) { m_impl->add(*this); } @@ -726,4 +734,5 @@ StatsDCollector::New(IP::Endpoint const& address, std::string const& prefix, Jou return std::make_shared(address, prefix, journal); } -} // namespace beast::insight +} // namespace insight +} // namespace beast diff --git a/src/libxrpl/beast/net/IPAddressConversion.cpp b/src/libxrpl/beast/net/IPAddressConversion.cpp index 14cb4bd44d..d34a973d8e 100644 --- a/src/libxrpl/beast/net/IPAddressConversion.cpp +++ b/src/libxrpl/beast/net/IPAddressConversion.cpp @@ -1,11 +1,11 @@ #include - #include #include #include -namespace beast::IP { +namespace beast { +namespace IP { Endpoint from_asio(boost::asio::ip::address const& address) @@ -31,4 +31,5 @@ to_asio_endpoint(Endpoint const& endpoint) return boost::asio::ip::tcp::endpoint{endpoint.address(), endpoint.port()}; } -} // namespace beast::IP +} // namespace IP +} // namespace beast diff --git a/src/libxrpl/beast/net/IPAddressV4.cpp b/src/libxrpl/beast/net/IPAddressV4.cpp index f39e511c4c..c65e6fcf89 100644 --- a/src/libxrpl/beast/net/IPAddressV4.cpp +++ b/src/libxrpl/beast/net/IPAddressV4.cpp @@ -1,6 +1,7 @@ #include -namespace beast::IP { +namespace beast { +namespace IP { bool is_private(AddressV4 const& addr) @@ -24,4 +25,5 @@ get_class(AddressV4 const& addr) return table[(addr.to_uint() & 0xE0000000) >> 29]; } -} // namespace beast::IP +} // namespace IP +} // namespace beast diff --git a/src/libxrpl/beast/net/IPAddressV6.cpp b/src/libxrpl/beast/net/IPAddressV6.cpp index 3dbadf9779..30e2eefb96 100644 --- a/src/libxrpl/beast/net/IPAddressV6.cpp +++ b/src/libxrpl/beast/net/IPAddressV6.cpp @@ -1,10 +1,10 @@ +#include #include -#include +#include -#include - -namespace beast::IP { +namespace beast { +namespace IP { bool is_private(AddressV6 const& addr) @@ -22,4 +22,5 @@ is_public(AddressV6 const& addr) return !is_private(addr) && !addr.is_multicast(); } -} // namespace beast::IP +} // namespace IP +} // namespace beast diff --git a/src/libxrpl/beast/net/IPEndpoint.cpp b/src/libxrpl/beast/net/IPEndpoint.cpp index e1c7394b42..7e2799b46c 100644 --- a/src/libxrpl/beast/net/IPEndpoint.cpp +++ b/src/libxrpl/beast/net/IPEndpoint.cpp @@ -1,9 +1,9 @@ -#include - #include +#include #include #include +#include #include #include @@ -12,15 +12,15 @@ #include #include #include -#include -namespace beast::IP { +namespace beast { +namespace IP { Endpoint::Endpoint() : m_port(0) { } -Endpoint::Endpoint(Address addr, Port port) : m_addr(std::move(addr)), m_port(port) +Endpoint::Endpoint(Address const& addr, Port port) : m_addr(addr), m_port(port) { } @@ -176,4 +176,5 @@ operator>>(std::istream& is, Endpoint& endpoint) return is; } -} // namespace beast::IP +} // namespace IP +} // namespace beast diff --git a/src/libxrpl/beast/utility/beast_PropertyStream.cpp b/src/libxrpl/beast/utility/beast_PropertyStream.cpp index ddfe075132..662d763ce0 100644 --- a/src/libxrpl/beast/utility/beast_PropertyStream.cpp +++ b/src/libxrpl/beast/utility/beast_PropertyStream.cpp @@ -1,4 +1,3 @@ -#include #include #include @@ -16,7 +15,7 @@ namespace beast { // //------------------------------------------------------------------------------ -PropertyStream::Item::Item(Source* source) : m_source(source) +PropertyStream::Item::Item(Source* source) : ListNode(), m_source(source) { } @@ -44,7 +43,7 @@ PropertyStream::Item::operator*() const // //------------------------------------------------------------------------------ -PropertyStream::Proxy::Proxy(Map const& map, std::string key) : m_map(&map), m_key(std::move(key)) +PropertyStream::Proxy::Proxy(Map const& map, std::string const& key) : m_map(&map), m_key(key) { } @@ -152,7 +151,7 @@ PropertyStream::Set::stream() const // //------------------------------------------------------------------------------ -PropertyStream::Source::Source(std::string name) : m_name(std::move(name)), item_(this) +PropertyStream::Source::Source(std::string const& name) : m_name(name), item_(this) { } diff --git a/src/libxrpl/conditions/Condition.cpp b/src/libxrpl/conditions/Condition.cpp index ce3b55a827..30beba3402 100644 --- a/src/libxrpl/conditions/Condition.cpp +++ b/src/libxrpl/conditions/Condition.cpp @@ -1,18 +1,9 @@ #include - -#include -#include #include -#include #include -#include -#include -#include -#include -#include - -namespace xrpl::cryptoconditions { +namespace xrpl { +namespace cryptoconditions { namespace detail { // The binary encoding of conditions differs based on their @@ -219,4 +210,5 @@ Condition::deserialize(Slice s, std::error_code& ec) return c; } -} // namespace xrpl::cryptoconditions +} // namespace cryptoconditions +} // namespace xrpl diff --git a/src/libxrpl/conditions/Fulfillment.cpp b/src/libxrpl/conditions/Fulfillment.cpp index d1f48bfd7c..11581a8705 100644 --- a/src/libxrpl/conditions/Fulfillment.cpp +++ b/src/libxrpl/conditions/Fulfillment.cpp @@ -1,16 +1,11 @@ -#include - -#include #include #include +#include #include -#include #include -#include -#include - -namespace xrpl::cryptoconditions { +namespace xrpl { +namespace cryptoconditions { bool match(Fulfillment const& f, Condition const& c) @@ -133,4 +128,5 @@ Fulfillment::deserialize(Slice s, std::error_code& ec) return f; } -} // namespace xrpl::cryptoconditions +} // namespace cryptoconditions +} // namespace xrpl diff --git a/src/libxrpl/conditions/error.cpp b/src/libxrpl/conditions/error.cpp index 15ac847118..9c9d4658e4 100644 --- a/src/libxrpl/conditions/error.cpp +++ b/src/libxrpl/conditions/error.cpp @@ -1,12 +1,10 @@ +#include #include -#include - #include -#include -#include -namespace xrpl::cryptoconditions { +namespace xrpl { +namespace cryptoconditions { namespace detail { class cryptoconditions_error_category : public std::error_category @@ -111,8 +109,9 @@ std::error_code make_error_code(error ev) { return std::error_code{ - safe_cast>(ev), + safe_cast::type>(ev), detail::get_cryptoconditions_error_category()}; } -} // namespace xrpl::cryptoconditions +} // namespace cryptoconditions +} // namespace xrpl diff --git a/src/libxrpl/core/HashRouter.cpp b/src/libxrpl/core/HashRouter.cpp index 4175d83340..f21daf84a2 100644 --- a/src/libxrpl/core/HashRouter.cpp +++ b/src/libxrpl/core/HashRouter.cpp @@ -1,17 +1,5 @@ #include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - namespace xrpl { auto diff --git a/src/libxrpl/core/detail/Job.cpp b/src/libxrpl/core/detail/Job.cpp index 069cc7f216..7e5ca274b3 100644 --- a/src/libxrpl/core/detail/Job.cpp +++ b/src/libxrpl/core/detail/Job.cpp @@ -1,13 +1,5 @@ -#include - #include -#include -#include - -#include -#include -#include -#include +#include namespace xrpl { diff --git a/src/libxrpl/core/detail/JobQueue.cpp b/src/libxrpl/core/detail/JobQueue.cpp index d55160f285..ddfc42c97e 100644 --- a/src/libxrpl/core/detail/JobQueue.cpp +++ b/src/libxrpl/core/detail/JobQueue.cpp @@ -1,23 +1,8 @@ -#include - -#include #include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include namespace xrpl { @@ -179,7 +164,9 @@ JobQueue::addLoadEvents(JobType t, int count, std::chrono::milliseconds elapsed) bool JobQueue::isOverloaded() { - return std::ranges::any_of(m_jobData, [](auto& entry) { return entry.second.load().isOver(); }); + return std::any_of(m_jobData.begin(), m_jobData.end(), [](auto& entry) { + return entry.second.load().isOver(); + }); } Json::Value diff --git a/src/libxrpl/core/detail/LoadEvent.cpp b/src/libxrpl/core/detail/LoadEvent.cpp index a2f8ee7620..1370e9089f 100644 --- a/src/libxrpl/core/detail/LoadEvent.cpp +++ b/src/libxrpl/core/detail/LoadEvent.cpp @@ -1,18 +1,13 @@ -#include - #include +#include #include -#include -#include -#include - namespace xrpl { -LoadEvent::LoadEvent(LoadMonitor& monitor, std::string name, bool shouldStart) +LoadEvent::LoadEvent(LoadMonitor& monitor, std::string const& name, bool shouldStart) : monitor_(monitor) , running_(shouldStart) - , name_(std::move(name)) + , name_(name) , mark_{std::chrono::steady_clock::now()} , timeWaiting_{} , timeRunning_{} diff --git a/src/libxrpl/core/detail/LoadMonitor.cpp b/src/libxrpl/core/detail/LoadMonitor.cpp index 2cf4e1f6ea..e613717ed8 100644 --- a/src/libxrpl/core/detail/LoadMonitor.cpp +++ b/src/libxrpl/core/detail/LoadMonitor.cpp @@ -1,12 +1,6 @@ -#include - #include #include -#include -#include - -#include -#include +#include namespace xrpl { diff --git a/src/libxrpl/core/detail/Workers.cpp b/src/libxrpl/core/detail/Workers.cpp index e7d63c0900..ed9d09d1e8 100644 --- a/src/libxrpl/core/detail/Workers.cpp +++ b/src/libxrpl/core/detail/Workers.cpp @@ -1,23 +1,17 @@ -#include - #include -#include #include - -#include -#include -#include +#include namespace xrpl { Workers::Workers( Callback& callback, perf::PerfLog* perfLog, - std::string threadNames, + std::string const& threadNames, int numberOfThreads) : m_callback(callback) , perfLog_(perfLog) - , m_threadNames(std::move(threadNames)) + , m_threadNames(threadNames) , m_semaphore(0) , m_activeCount(0) , m_pauseCount(0) @@ -141,8 +135,8 @@ Workers::deleteWorkers(beast::LockFreeStack& stack) //------------------------------------------------------------------------------ -Workers::Worker::Worker(Workers& workers, std::string threadName, int const instance) - : m_workers{workers}, threadName_{std::move(threadName)}, instance_{instance} +Workers::Worker::Worker(Workers& workers, std::string const& threadName, int const instance) + : m_workers{workers}, threadName_{threadName}, instance_{instance} { thread_ = std::thread{&Workers::Worker::run, this}; diff --git a/src/libxrpl/crypto/RFC1751.cpp b/src/libxrpl/crypto/RFC1751.cpp index 8ea4e7007c..f7098f3833 100644 --- a/src/libxrpl/crypto/RFC1751.cpp +++ b/src/libxrpl/crypto/RFC1751.cpp @@ -1,6 +1,5 @@ -#include - #include +#include #include #include diff --git a/src/libxrpl/crypto/csprng.cpp b/src/libxrpl/crypto/csprng.cpp index dc16c9ac64..343bed9be0 100644 --- a/src/libxrpl/crypto/csprng.cpp +++ b/src/libxrpl/crypto/csprng.cpp @@ -1,9 +1,8 @@ +#include #include -#include - -#include #include +#include #include #include diff --git a/src/libxrpl/git/Git.cpp b/src/libxrpl/git/Git.cpp index e13b2ef693..2992852632 100644 --- a/src/libxrpl/git/Git.cpp +++ b/src/libxrpl/git/Git.cpp @@ -1,4 +1,4 @@ -#include +#include "xrpl/git/Git.h" #include diff --git a/src/libxrpl/json/JsonPropertyStream.cpp b/src/libxrpl/json/JsonPropertyStream.cpp index ab94223956..fb5a7b32a4 100644 --- a/src/libxrpl/json/JsonPropertyStream.cpp +++ b/src/libxrpl/json/JsonPropertyStream.cpp @@ -1,5 +1,4 @@ #include - #include #include diff --git a/src/libxrpl/json/Output.cpp b/src/libxrpl/json/Output.cpp index e588d21d3c..626dbeb4b8 100644 --- a/src/libxrpl/json/Output.cpp +++ b/src/libxrpl/json/Output.cpp @@ -1,5 +1,4 @@ #include - #include #include diff --git a/src/libxrpl/json/Writer.cpp b/src/libxrpl/json/Writer.cpp index 75b5bc113c..ea7b4b51ae 100644 --- a/src/libxrpl/json/Writer.cpp +++ b/src/libxrpl/json/Writer.cpp @@ -1,12 +1,11 @@ -#include - #include #include +#include #include #include #include -#include // IWYU pragma: keep +#include #include #include #include @@ -63,7 +62,7 @@ lengthWithoutTrailingZeros(std::string const& s) class Writer::Impl { public: - explicit Impl(Output output) : output_(std::move(output)) + explicit Impl(Output const& output) : output_(output) { } ~Impl() = default; @@ -83,7 +82,8 @@ public: { char const ch = (ct == array) ? openBracket : openBrace; output({&ch, 1}); - stack_.emplace(Collection{.type = ct}); + stack_.push(Collection()); + stack_.top().type = ct; } void @@ -197,6 +197,8 @@ private: // JSON collections are either arrays, or objects. struct Collection { + explicit Collection() = default; + /** What type of collection are we in? */ Writer::CollectionType type = Writer::CollectionType::array; @@ -206,7 +208,7 @@ private: #ifndef NDEBUG /** What tags have we already seen in this collection? */ - std::set tags{}; // NOLINT(readability-redundant-member-init) + std::set tags; #endif }; diff --git a/src/libxrpl/json/json_reader.cpp b/src/libxrpl/json/json_reader.cpp index 1bb157afc3..71365ba6c1 100644 --- a/src/libxrpl/json/json_reader.cpp +++ b/src/libxrpl/json/json_reader.cpp @@ -1,6 +1,5 @@ -#include - #include +#include #include #include @@ -365,7 +364,8 @@ Reader::readNumber() { if (std::isdigit(static_cast(*current_)) == 0) { - auto ret = std::ranges::find(extended_tokens, *current_); + auto ret = + std::find(std::begin(extended_tokens), std::end(extended_tokens), *current_); if (ret == std::end(extended_tokens)) break; diff --git a/src/libxrpl/json/json_value.cpp b/src/libxrpl/json/json_value.cpp index 61e0a0c7ee..d4351b23ef 100644 --- a/src/libxrpl/json/json_value.cpp +++ b/src/libxrpl/json/json_value.cpp @@ -1,17 +1,13 @@ -#include - -#include #include #include #include #include +#include #include #include -#include #include #include -#include #include #include @@ -22,7 +18,7 @@ Value const Value::null; class DefaultValueAllocator : public ValueAllocator { public: - ~DefaultValueAllocator() override = default; + virtual ~DefaultValueAllocator() = default; char* makeMemberName(char const* memberName) override @@ -1054,7 +1050,7 @@ Value::getMemberNames() const ObjectValues::const_iterator const itEnd = value_.map_->end(); for (; it != itEnd; ++it) - members.emplace_back((*it).first.c_str()); + members.push_back(std::string((*it).first.c_str())); return members; } diff --git a/src/libxrpl/json/json_valueiterator.cpp b/src/libxrpl/json/json_valueiterator.cpp index 595835d9c0..b3cf7e6538 100644 --- a/src/libxrpl/json/json_valueiterator.cpp +++ b/src/libxrpl/json/json_valueiterator.cpp @@ -155,7 +155,9 @@ ValueIterator::ValueIterator(ValueConstIterator const& other) : ValueIteratorBas { } -ValueIterator::ValueIterator(ValueIterator const& other) = default; +ValueIterator::ValueIterator(ValueIterator const& other) : ValueIteratorBase(other) +{ +} ValueIterator& ValueIterator::operator=(SelfType const& other) diff --git a/src/libxrpl/json/json_writer.cpp b/src/libxrpl/json/json_writer.cpp index 7846ed6ce1..150a7fe2e5 100644 --- a/src/libxrpl/json/json_writer.cpp +++ b/src/libxrpl/json/json_writer.cpp @@ -1,8 +1,7 @@ -#include - #include #include #include +#include #include #include @@ -253,7 +252,9 @@ FastWriter::writeValue(Value const& value) // Class StyledWriter // ////////////////////////////////////////////////////////////////// -StyledWriter::StyledWriter() = default; +StyledWriter::StyledWriter() +{ +} std::string StyledWriter::write(Value const& root) @@ -485,8 +486,7 @@ StyledWriter::unindent() // Class StyledStreamWriter // ////////////////////////////////////////////////////////////////// -StyledStreamWriter::StyledStreamWriter(std::string indentation) - : indentation_(std::move(indentation)) +StyledStreamWriter::StyledStreamWriter(std::string indentation) : indentation_(indentation) { } diff --git a/src/libxrpl/json/to_string.cpp b/src/libxrpl/json/to_string.cpp index 1d1a609366..d3b35308a0 100644 --- a/src/libxrpl/json/to_string.cpp +++ b/src/libxrpl/json/to_string.cpp @@ -1,6 +1,5 @@ -#include - #include +#include #include diff --git a/src/libxrpl/ledger/AcceptedLedgerTx.cpp b/src/libxrpl/ledger/AcceptedLedgerTx.cpp index e609f5bdc8..70deb0139a 100644 --- a/src/libxrpl/ledger/AcceptedLedgerTx.cpp +++ b/src/libxrpl/ledger/AcceptedLedgerTx.cpp @@ -1,24 +1,11 @@ -#include - +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include - namespace xrpl { AcceptedLedgerTx::AcceptedLedgerTx( diff --git a/src/libxrpl/ledger/ApplyStateTable.cpp b/src/libxrpl/ledger/ApplyStateTable.cpp index d7cbcb06e8..9ebbca8ac5 100644 --- a/src/libxrpl/ledger/ApplyStateTable.cpp +++ b/src/libxrpl/ledger/ApplyStateTable.cpp @@ -1,38 +1,12 @@ -#include - #include -#include -#include -#include #include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::detail { +namespace xrpl { +namespace detail { void ApplyStateTable::apply(RawView& to) const @@ -400,14 +374,14 @@ ApplyStateTable::erase(ReadView const& base, std::shared_ptr const& sle) { auto const iter = items_.find(sle->key()); if (iter == items_.end()) - Throw("ApplyStateTable::erase: missing key"); + LogicError("ApplyStateTable::erase: missing key"); auto& item = iter->second; if (item.second != sle) - Throw("ApplyStateTable::erase: unknown SLE"); + LogicError("ApplyStateTable::erase: unknown SLE"); switch (item.first) { case Action::erase: - Throw("ApplyStateTable::erase: double erase"); + LogicError("ApplyStateTable::erase: double erase"); break; case Action::insert: items_.erase(iter); @@ -431,7 +405,7 @@ ApplyStateTable::rawErase(ReadView const& base, std::shared_ptr const& sle) switch (item.first) { case Action::erase: - Throw("ApplyStateTable::rawErase: double erase"); + LogicError("ApplyStateTable::rawErase: double erase"); break; case Action::insert: items_.erase(result.first); @@ -462,11 +436,11 @@ ApplyStateTable::insert(ReadView const& base, std::shared_ptr const& sle) switch (item.first) { case Action::cache: - Throw("ApplyStateTable::insert: already cached"); + LogicError("ApplyStateTable::insert: already cached"); case Action::insert: - Throw("ApplyStateTable::insert: already inserted"); + LogicError("ApplyStateTable::insert: already inserted"); case Action::modify: - Throw("ApplyStateTable::insert: already modified"); + LogicError("ApplyStateTable::insert: already modified"); case Action::erase: break; } @@ -492,7 +466,7 @@ ApplyStateTable::replace(ReadView const& base, std::shared_ptr const& sle) switch (item.first) { case Action::erase: - Throw("ApplyStateTable::replace: already erased"); + LogicError("ApplyStateTable::replace: already erased"); case Action::cache: item.first = Action::modify; break; @@ -508,14 +482,14 @@ ApplyStateTable::update(ReadView const& base, std::shared_ptr const& sle) { auto const iter = items_.find(sle->key()); if (iter == items_.end()) - Throw("ApplyStateTable::update: missing key"); + LogicError("ApplyStateTable::update: missing key"); auto& item = iter->second; if (item.second != sle) - Throw("ApplyStateTable::update: unknown SLE"); + LogicError("ApplyStateTable::update: unknown SLE"); switch (item.first) { case Action::erase: - Throw("ApplyStateTable::update: erased"); + LogicError("ApplyStateTable::update: erased"); break; case Action::cache: item.first = Action::modify; @@ -668,4 +642,5 @@ ApplyStateTable::threadOwners( } } -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/src/libxrpl/ledger/ApplyView.cpp b/src/libxrpl/ledger/ApplyView.cpp index a3b138dc63..476b635511 100644 --- a/src/libxrpl/ledger/ApplyView.cpp +++ b/src/libxrpl/ledger/ApplyView.cpp @@ -1,25 +1,9 @@ -#include - -#include #include #include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include #include namespace xrpl { @@ -56,9 +40,9 @@ findPreviousPage(ApplyView& view, Keylet const& directory, SLE::ref start) { node = view.peek(keylet::page(directory, page)); if (!node) - { - Throw( - "Directory chain: root back-pointer broken."); // LCOV_EXCL_LINE + { // LCOV_EXCL_START + LogicError("Directory chain: root back-pointer broken."); + // LCOV_EXCL_STOP } } @@ -77,21 +61,22 @@ insertKey( { if (preserveOrder) { - if (std::ranges::find(indexes, key) != indexes.end()) - Throw("dirInsert: double insertion"); // LCOV_EXCL_LINE + if (std::find(indexes.begin(), indexes.end(), key) != indexes.end()) + LogicError("dirInsert: double insertion"); // LCOV_EXCL_LINE indexes.push_back(key); } else { - // We can't be sure if this page is already sorted because it may be a - // legacy page we haven't yet touched. Take the time to sort it. - std::ranges::sort(indexes); + // We can't be sure if this page is already sorted because + // it may be a legacy page we haven't yet touched. Take + // the time to sort it. + std::sort(indexes.begin(), indexes.end()); - auto pos = std::ranges::lower_bound(indexes, key); + auto pos = std::lower_bound(indexes.begin(), indexes.end(), key); if (pos != indexes.end() && key == *pos) - Throw("dirInsert: double insertion"); // LCOV_EXCL_LINE + LogicError("dirInsert: double insertion"); // LCOV_EXCL_LINE indexes.insert(pos, key); } @@ -144,7 +129,8 @@ insertPage( node->setFieldH256(sfRootIndex, directory.key); node->setFieldV256(sfIndexes, indexes); - // Save some space by not specifying the value 0 since it's the default. + // Save some space by not specifying the value 0 since + // it's the default. if (page != 1) node->setFieldU64(sfIndexPrevious, page - 1); XRPL_ASSERT_PARTS(!nextPage, "xrpl::directory::insertPage", "nextPage has default value"); @@ -213,24 +199,28 @@ ApplyView::emptyDirDelete(Keylet const& directory) auto nextPage = node->getFieldU64(sfIndexNext); if (nextPage == rootPage && prevPage != rootPage) - Throw("Directory chain: fwd link broken"); // LCOV_EXCL_LINE + LogicError("Directory chain: fwd link broken"); // LCOV_EXCL_LINE if (prevPage == rootPage && nextPage != rootPage) - Throw("Directory chain: rev link broken"); // LCOV_EXCL_LINE + LogicError("Directory chain: rev link broken"); // LCOV_EXCL_LINE - // Older versions of the code would, in some cases, allow the last page to - // be empty. Remove such pages: + // Older versions of the code would, in some cases, allow the last + // page to be empty. Remove such pages: if (nextPage == prevPage && nextPage != rootPage) { auto last = peek(keylet::page(directory, nextPage)); if (!last) - Throw("Directory chain: fwd link broken."); // LCOV_EXCL_LINE + { // LCOV_EXCL_START + LogicError("Directory chain: fwd link broken."); + // LCOV_EXCL_STOP + } if (!last->getFieldV256(sfIndexes).empty()) return false; - // Update the first page's linked list and mark it as updated. + // Update the first page's linked list and + // mark it as updated. node->setFieldU64(sfIndexNext, rootPage); node->setFieldU64(sfIndexPrevious, rootPage); update(node); @@ -238,7 +228,8 @@ ApplyView::emptyDirDelete(Keylet const& directory) // And erase the empty last page: erase(last); - // Make sure our local values reflect the updated information: + // Make sure our local values reflect the + // updated information: nextPage = rootPage; prevPage = rootPage; } @@ -263,7 +254,7 @@ ApplyView::dirRemove(Keylet const& directory, std::uint64_t page, uint256 const& { auto entries = node->getFieldV256(sfIndexes); - auto it = std::ranges::find(entries, key); + auto it = std::find(entries.begin(), entries.end(), key); if (entries.end() == it) return false; @@ -278,33 +269,46 @@ ApplyView::dirRemove(Keylet const& directory, std::uint64_t page, uint256 const& return true; } - // The current page is now empty; check if it can be deleted, and, if so, - // whether the entire directory can now be removed. + // The current page is now empty; check if it can be + // deleted, and, if so, whether the entire directory + // can now be removed. auto prevPage = node->getFieldU64(sfIndexPrevious); auto nextPage = node->getFieldU64(sfIndexNext); - // The first page is the directory's root node and is treated specially: it - // can never be deleted even if it is empty, unless we plan on removing the - // entire directory. + // The first page is the directory's root node and is + // treated specially: it can never be deleted even if + // it is empty, unless we plan on removing the entire + // directory. if (page == rootPage) { if (nextPage == page && prevPage != page) - Throw("Directory chain: fwd link broken"); // LCOV_EXCL_LINE + { // LCOV_EXCL_START + LogicError("Directory chain: fwd link broken"); + // LCOV_EXCL_STOP + } if (prevPage == page && nextPage != page) - Throw("Directory chain: rev link broken"); // LCOV_EXCL_LINE + { // LCOV_EXCL_START + LogicError("Directory chain: rev link broken"); + // LCOV_EXCL_STOP + } - // Older versions of the code would, in some cases, allow the last page - // to be empty. Remove such pages if we stumble on them: + // Older versions of the code would, in some cases, + // allow the last page to be empty. Remove such + // pages if we stumble on them: if (nextPage == prevPage && nextPage != page) { auto last = peek(keylet::page(directory, nextPage)); if (!last) - Throw("Directory chain: fwd link broken."); // LCOV_EXCL_LINE + { // LCOV_EXCL_START + LogicError("Directory chain: fwd link broken."); + // LCOV_EXCL_STOP + } if (last->getFieldV256(sfIndexes).empty()) { - // Update the first page's linked list and mark it as updated. + // Update the first page's linked list and + // mark it as updated. node->setFieldU64(sfIndexNext, page); node->setFieldU64(sfIndexPrevious, page); update(node); @@ -312,7 +316,8 @@ ApplyView::dirRemove(Keylet const& directory, std::uint64_t page, uint256 const& // And erase the empty last page: erase(last); - // Make sure our local values reflect the updated information: + // Make sure our local values reflect the + // updated information: nextPage = page; prevPage = page; } @@ -330,24 +335,25 @@ ApplyView::dirRemove(Keylet const& directory, std::uint64_t page, uint256 const& // This can never happen for nodes other than the root: if (nextPage == page) - Throw("Directory chain: fwd link broken"); // LCOV_EXCL_LINE + LogicError("Directory chain: fwd link broken"); // LCOV_EXCL_LINE if (prevPage == page) - Throw("Directory chain: rev link broken"); // LCOV_EXCL_LINE + LogicError("Directory chain: rev link broken"); // LCOV_EXCL_LINE - // This node isn't the root, so it can either be in the middle of the list, - // or at the end. Unlink it first and then check if that leaves the list - // with only a root: + // This node isn't the root, so it can either be in the + // middle of the list, or at the end. Unlink it first + // and then check if that leaves the list with only a + // root: auto prev = peek(keylet::page(directory, prevPage)); if (!prev) - Throw("Directory chain: fwd link broken."); // LCOV_EXCL_LINE + LogicError("Directory chain: fwd link broken."); // LCOV_EXCL_LINE // Fix previous to point to its new next. prev->setFieldU64(sfIndexNext, nextPage); update(prev); auto next = peek(keylet::page(directory, nextPage)); if (!next) - Throw("Directory chain: rev link broken."); // LCOV_EXCL_LINE + LogicError("Directory chain: rev link broken."); // LCOV_EXCL_LINE // Fix next to point to its new previous. next->setFieldU64(sfIndexPrevious, prevPage); update(next); @@ -355,12 +361,13 @@ ApplyView::dirRemove(Keylet const& directory, std::uint64_t page, uint256 const& // The page is no longer linked. Delete it. erase(node); - // Check whether the next page is the last page and, if so, whether it's - // empty. If it is, delete it. + // Check whether the next page is the last page and, if + // so, whether it's empty. If it is, delete it. if (nextPage != rootPage && next->getFieldU64(sfIndexNext) == rootPage && next->getFieldV256(sfIndexes).empty()) { - // Since next doesn't point to the root, it can't be pointing to prev. + // Since next doesn't point to the root, it + // can't be pointing to prev. erase(next); // The previous page is now the last page: @@ -370,16 +377,18 @@ ApplyView::dirRemove(Keylet const& directory, std::uint64_t page, uint256 const& // And the root points to the last page: auto root = peek(keylet::page(directory, rootPage)); if (!root) - Throw("Directory chain: root link broken."); // LCOV_EXCL_LINE - + { // LCOV_EXCL_START + LogicError("Directory chain: root link broken."); + // LCOV_EXCL_STOP + } root->setFieldU64(sfIndexPrevious, prevPage); update(root); nextPage = rootPage; } - // If we're not keeping the root, then check to see if it's left empty. - // If so, delete it as well. + // If we're not keeping the root, then check to see if + // it's left empty. If so, delete it as well. if (!keepRoot && nextPage == rootPage && prevPage == rootPage) { if (prev->getFieldV256(sfIndexes).empty()) diff --git a/src/libxrpl/ledger/ApplyViewBase.cpp b/src/libxrpl/ledger/ApplyViewBase.cpp index d617279a80..a5bea68759 100644 --- a/src/libxrpl/ledger/ApplyViewBase.cpp +++ b/src/libxrpl/ledger/ApplyViewBase.cpp @@ -1,19 +1,7 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace xrpl::detail { +namespace xrpl { +namespace detail { ApplyViewBase::ApplyViewBase(ReadView const* base, ApplyFlags flags) : flags_(flags), base_(base) { @@ -164,4 +152,5 @@ ApplyViewBase::rawDestroyXRP(XRPAmount const& fee) items_.destroyXRP(fee); } -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/src/libxrpl/ledger/ApplyViewImpl.cpp b/src/libxrpl/ledger/ApplyViewImpl.cpp index 9650190a3e..eca9043db8 100644 --- a/src/libxrpl/ledger/ApplyViewImpl.cpp +++ b/src/libxrpl/ledger/ApplyViewImpl.cpp @@ -1,21 +1,5 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - namespace xrpl { ApplyViewImpl::ApplyViewImpl(ReadView const* base, ApplyFlags flags) : ApplyViewBase(base, flags) diff --git a/src/libxrpl/ledger/BookDirs.cpp b/src/libxrpl/ledger/BookDirs.cpp index cbe93a159b..2bdf6ac9a5 100644 --- a/src/libxrpl/ledger/BookDirs.cpp +++ b/src/libxrpl/ledger/BookDirs.cpp @@ -1,15 +1,8 @@ #include - -#include -#include -#include -#include +#include #include -#include #include -#include - namespace xrpl { BookDirs::BookDirs(ReadView const& view, Book const& book) diff --git a/src/libxrpl/ledger/BookListeners.cpp b/src/libxrpl/ledger/BookListeners.cpp index 36d02427bc..8699d891a0 100644 --- a/src/libxrpl/ledger/BookListeners.cpp +++ b/src/libxrpl/ledger/BookListeners.cpp @@ -1,13 +1,5 @@ #include -#include -#include -#include -#include - -#include -#include - namespace xrpl { void diff --git a/src/libxrpl/ledger/CachedView.cpp b/src/libxrpl/ledger/CachedView.cpp index 6bbe2d828b..aa075d69a4 100644 --- a/src/libxrpl/ledger/CachedView.cpp +++ b/src/libxrpl/ledger/CachedView.cpp @@ -1,17 +1,8 @@ +#include #include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include - -#include -#include -#include - -namespace xrpl::detail { +namespace xrpl { +namespace detail { bool CachedViewImpl::exists(Keylet const& k) const @@ -74,4 +65,5 @@ CachedViewImpl::read(Keylet const& k) const return sle; } -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/src/libxrpl/ledger/CanonicalTXSet.cpp b/src/libxrpl/ledger/CanonicalTXSet.cpp index be5006d33b..72f45731fb 100644 --- a/src/libxrpl/ledger/CanonicalTXSet.cpp +++ b/src/libxrpl/ledger/CanonicalTXSet.cpp @@ -1,15 +1,5 @@ #include -#include -#include -#include -#include -#include - -#include -#include -#include - namespace xrpl { bool diff --git a/src/libxrpl/ledger/Dir.cpp b/src/libxrpl/ledger/Dir.cpp index bf5eaf02fd..a27171fe12 100644 --- a/src/libxrpl/ledger/Dir.cpp +++ b/src/libxrpl/ledger/Dir.cpp @@ -1,16 +1,5 @@ #include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - namespace xrpl { using const_iterator = Dir::const_iterator; diff --git a/src/libxrpl/ledger/Ledger.cpp b/src/libxrpl/ledger/Ledger.cpp index ab09224914..299a82a1f2 100644 --- a/src/libxrpl/ledger/Ledger.cpp +++ b/src/libxrpl/ledger/Ledger.cpp @@ -1,49 +1,17 @@ -#include - #include -#include -#include -#include -#include #include -#include -#include #include +#include +#include #include -#include -#include #include -#include #include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include +#include -#include -#include -#include -#include -#include -#include #include #include @@ -150,7 +118,7 @@ public: Ledger::Ledger( create_genesis_t, - Rules rules, + Rules const& rules, Fees const& fees, std::vector const& amendments, Family& family) @@ -158,7 +126,7 @@ Ledger::Ledger( , txMap_(SHAMapType::TRANSACTION, family) , stateMap_(SHAMapType::STATE, family) , fees_(fees) - , rules_(std::move(rules)) + , rules_(rules) , j_(beast::Journal(beast::Journal::getNullSink())) { header_.seq = 1; @@ -185,7 +153,7 @@ Ledger::Ledger( { auto sle = std::make_shared(keylet::fees()); // Whether featureXRPFees is supported will depend on startup options. - if (std::ranges::find(amendments, featureXRPFees) != amendments.end()) + if (std::find(amendments.begin(), amendments.end(), featureXRPFees) != amendments.end()) { sle->at(sfBaseFeeDrops) = fees.base; sle->at(sfReserveBaseDrops) = fees.reserve; @@ -212,7 +180,7 @@ Ledger::Ledger( LedgerHeader const& info, bool& loaded, bool acquire, - Rules rules, + Rules const& rules, Fees const& fees, Family& family, beast::Journal j) @@ -220,7 +188,7 @@ Ledger::Ledger( , txMap_(SHAMapType::TRANSACTION, info.txHash, family) , stateMap_(SHAMapType::STATE, info.accountHash, family) , fees_(fees) - , rules_(std::move(rules)) + , rules_(rules) , header_(info) , j_(j) { @@ -281,11 +249,11 @@ Ledger::Ledger(Ledger const& prevLedger, NetClock::time_point closeTime) } } -Ledger::Ledger(LedgerHeader const& info, Rules rules, Family& family) +Ledger::Ledger(LedgerHeader const& info, Rules const& rules, Family& family) : mImmutable(true) , txMap_(SHAMapType::TRANSACTION, info.txHash, family) , stateMap_(SHAMapType::STATE, info.accountHash, family) - , rules_(std::move(rules)) + , rules_(rules) , header_(info) , j_(beast::Journal(beast::Journal::getNullSink())) { @@ -295,14 +263,14 @@ Ledger::Ledger(LedgerHeader const& info, Rules rules, Family& family) Ledger::Ledger( std::uint32_t ledgerSeq, NetClock::time_point closeTime, - Rules rules, + Rules const& rules, Fees const& fees, Family& family) : mImmutable(false) , txMap_(SHAMapType::TRANSACTION, family) , stateMap_(SHAMapType::STATE, family) , fees_(fees) - , rules_(std::move(rules)) + , rules_(rules) , j_(beast::Journal(beast::Journal::getNullSink())) { header_.seq = ledgerSeq; @@ -493,14 +461,14 @@ void Ledger::rawErase(std::shared_ptr const& sle) { if (!stateMap_.delItem(sle->key())) - Throw("Ledger::rawErase: key not found"); + LogicError("Ledger::rawErase: key not found"); } void Ledger::rawErase(uint256 const& key) { if (!stateMap_.delItem(key)) - Throw("Ledger::rawErase: key not found"); + LogicError("Ledger::rawErase: key not found"); } void @@ -510,7 +478,7 @@ Ledger::rawInsert(std::shared_ptr const& sle) sle->add(ss); if (!stateMap_.addGiveItem( SHAMapNodeType::tnACCOUNT_STATE, make_shamapitem(sle->key(), ss.slice()))) - Throw("Ledger::rawInsert: key already exists"); + LogicError("Ledger::rawInsert: key already exists"); } void @@ -520,7 +488,7 @@ Ledger::rawReplace(std::shared_ptr const& sle) sle->add(ss); if (!stateMap_.updateGiveItem( SHAMapNodeType::tnACCOUNT_STATE, make_shamapitem(sle->key(), ss.slice()))) - Throw("Ledger::rawReplace: key not found"); + LogicError("Ledger::rawReplace: key not found"); } void @@ -536,7 +504,7 @@ Ledger::rawTxInsert( s.addVL(txn->peekData()); s.addVL(metaData->peekData()); if (!txMap_.addGiveItem(SHAMapNodeType::tnTRANSACTION_MD, make_shamapitem(key, s.slice()))) - Throw("duplicate_tx: " + to_string(key)); + LogicError("duplicate_tx: " + to_string(key)); } uint256 @@ -554,7 +522,7 @@ Ledger::rawTxInsertWithHash( auto item = make_shamapitem(key, s.slice()); auto hash = sha512Half(HashPrefix::txNode, item->slice(), item->key()); if (!txMap_.addGiveItem(SHAMapNodeType::tnTRANSACTION_MD, std::move(item))) - Throw("duplicate_tx: " + to_string(key)); + LogicError("duplicate_tx: " + to_string(key)); return hash; } diff --git a/src/libxrpl/ledger/OpenView.cpp b/src/libxrpl/ledger/OpenView.cpp index 089788d90b..b5e358053c 100644 --- a/src/libxrpl/ledger/OpenView.cpp +++ b/src/libxrpl/ledger/OpenView.cpp @@ -1,26 +1,5 @@ -#include - -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -91,12 +70,12 @@ OpenView::OpenView(OpenView const& rhs) OpenView::OpenView( open_ledger_t, ReadView const* base, - Rules rules, + Rules const& rules, std::shared_ptr hold) : monotonic_resource_{ std::make_unique(initialBufferSize)} , txs_{monotonic_resource_.get()} - , rules_(std::move(rules)) + , rules_(rules) , header_(base->header()) , base_(base) , hold_(std::move(hold)) @@ -268,7 +247,7 @@ OpenView::rawTxInsert( auto const result = txs_.emplace( std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple(txn, metaData)); if (!result.second) - Throw("rawTxInsert: duplicate TX id: " + to_string(key)); + LogicError("rawTxInsert: duplicate TX id: " + to_string(key)); } } // namespace xrpl diff --git a/src/libxrpl/ledger/PaymentSandbox.cpp b/src/libxrpl/ledger/PaymentSandbox.cpp index e517beaab5..a46e22f404 100644 --- a/src/libxrpl/ledger/PaymentSandbox.cpp +++ b/src/libxrpl/ledger/PaymentSandbox.cpp @@ -1,25 +1,9 @@ -#include - -#include -#include #include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -176,7 +160,7 @@ void DeferredCredits::ownerCount(AccountID const& id, std::uint32_t cur, std::uint32_t next) { auto const v = std::max(cur, next); - auto r = ownerCounts_.emplace(id, v); + auto r = ownerCounts_.emplace(std::make_pair(id, v)); if (!r.second) { auto& mapVal = r.first->second; @@ -255,7 +239,7 @@ DeferredCredits::apply(DeferredCredits& to) toVal.selfDebit += fromVal.selfDebit; for (auto& [k, v] : fromVal.holders) { - if (!toVal.holders.contains(k)) + if (toVal.holders.find(k) == toVal.holders.end()) { toVal.holders[k] = v; } diff --git a/src/libxrpl/ledger/RawStateTable.cpp b/src/libxrpl/ledger/RawStateTable.cpp index f267d2f691..b411a25b00 100644 --- a/src/libxrpl/ledger/RawStateTable.cpp +++ b/src/libxrpl/ledger/RawStateTable.cpp @@ -1,21 +1,8 @@ +#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace xrpl::detail { +namespace xrpl { +namespace detail { class RawStateTable::sles_iter_impl : public ReadView::sles_type::iter_base { @@ -35,7 +22,7 @@ public: items_t::const_iterator end1, ReadView::sles_type::iterator iter0, ReadView::sles_type::iterator end0) - : iter0_(std::move(iter0)), end0_(std::move(end0)), iter1_(iter1), end1_(end1) + : iter0_(iter0), end0_(end0), iter1_(iter1), end1_(end1) { if (iter0_ != end0_) sle0_ = *iter0_; @@ -254,7 +241,7 @@ RawStateTable::erase(std::shared_ptr const& sle) switch (item.action) { case Action::erase: - Throw("RawStateTable::erase: already erased"); + LogicError("RawStateTable::erase: already erased"); break; case Action::insert: items_.erase(result.first); @@ -283,10 +270,10 @@ RawStateTable::insert(std::shared_ptr const& sle) item.sle = sle; break; case Action::insert: - Throw("RawStateTable::insert: already inserted"); + LogicError("RawStateTable::insert: already inserted"); break; case Action::replace: - Throw("RawStateTable::insert: already exists"); + LogicError("RawStateTable::insert: already exists"); break; } } @@ -304,7 +291,7 @@ RawStateTable::replace(std::shared_ptr const& sle) switch (item.action) { case Action::erase: - Throw("RawStateTable::replace: was erased"); + LogicError("RawStateTable::replace: was erased"); break; case Action::insert: case Action::replace: @@ -356,4 +343,5 @@ RawStateTable::slesUpperBound(ReadView const& base, uint256 const& key) const items_.upper_bound(key), items_.end(), base.sles.upper_bound(key), base.sles.end()); } -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/src/libxrpl/ledger/ReadView.cpp b/src/libxrpl/ledger/ReadView.cpp index 991dd95251..8e6763410c 100644 --- a/src/libxrpl/ledger/ReadView.cpp +++ b/src/libxrpl/ledger/ReadView.cpp @@ -1,16 +1,5 @@ #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - namespace xrpl { ReadView::sles_type::sles_type(ReadView const& view) : ReadViewFwdRange(view) diff --git a/src/libxrpl/ledger/View.cpp b/src/libxrpl/ledger/View.cpp index 55735ec0e6..c96940ec23 100644 --- a/src/libxrpl/ledger/View.cpp +++ b/src/libxrpl/ledger/View.cpp @@ -1,39 +1,26 @@ -#include - +#include #include -#include #include -#include -#include -#include #include -#include #include +#include #include #include #include #include -#include -#include -#include #include #include -#include -#include #include #include #include -#include -#include -#include -#include +#include #include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include namespace xrpl { diff --git a/src/libxrpl/ledger/helpers/AMMHelpers.cpp b/src/libxrpl/ledger/helpers/AMMHelpers.cpp index 94ca2469f7..631e4d0774 100644 --- a/src/libxrpl/ledger/helpers/AMMHelpers.cpp +++ b/src/libxrpl/ledger/helpers/AMMHelpers.cpp @@ -1,44 +1,6 @@ #include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +// #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/libxrpl/ledger/helpers/AccountRootHelpers.cpp b/src/libxrpl/ledger/helpers/AccountRootHelpers.cpp index 0663fde1f4..19c2a9d7a7 100644 --- a/src/libxrpl/ledger/helpers/AccountRootHelpers.cpp +++ b/src/libxrpl/ledger/helpers/AccountRootHelpers.cpp @@ -1,33 +1,13 @@ #include - -#include +// #include -#include -#include -#include -#include #include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include #include #include -#include #include -#include -#include -#include -#include -#include namespace xrpl { @@ -173,7 +153,7 @@ getPseudoAccountFields() if (!ar) { // LCOV_EXCL_START - Throw( + LogicError( "xrpl::getPseudoAccountFields : unable to find account root " "ledger format"); // LCOV_EXCL_STOP diff --git a/src/libxrpl/ledger/helpers/CredentialHelpers.cpp b/src/libxrpl/ledger/helpers/CredentialHelpers.cpp index 37f7db3677..32db285f1e 100644 --- a/src/libxrpl/ledger/helpers/CredentialHelpers.cpp +++ b/src/libxrpl/ledger/helpers/CredentialHelpers.cpp @@ -1,32 +1,11 @@ #include - -#include -#include -#include -#include -#include -#include -#include +// +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include #include -#include -#include namespace xrpl { namespace credentials { diff --git a/src/libxrpl/ledger/helpers/DirectoryHelpers.cpp b/src/libxrpl/ledger/helpers/DirectoryHelpers.cpp index 8b4eeae7b7..dba71e0acd 100644 --- a/src/libxrpl/ledger/helpers/DirectoryHelpers.cpp +++ b/src/libxrpl/ledger/helpers/DirectoryHelpers.cpp @@ -1,19 +1,6 @@ #include - -#include -#include -#include -#include -#include -#include -#include +// #include -#include -#include - -#include -#include -#include namespace xrpl { diff --git a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp index 08cfc547f4..53f5fabafb 100644 --- a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp @@ -1,40 +1,15 @@ #include - +// #include -#include -#include -#include -#include -#include -#include #include #include #include #include -#include -#include #include #include -#include #include -#include -#include -#include #include -#include -#include -#include #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/libxrpl/ledger/helpers/NFTokenHelpers.cpp b/src/libxrpl/ledger/helpers/NFTokenHelpers.cpp index f57294a855..4652bccca8 100644 --- a/src/libxrpl/ledger/helpers/NFTokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/NFTokenHelpers.cpp @@ -1,44 +1,23 @@ -#include - #include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include +#include #include #include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include #include -#include -#include -#include #include -#include #include -#include -#include -#include -namespace xrpl::nft { +namespace xrpl { + +namespace nft { static std::shared_ptr locatePage(ReadView const& view, AccountID const& owner, uint256 const& id) @@ -128,7 +107,7 @@ getPageForToken( // place to make the split. if (splitIter == narr.end()) { - splitIter = std::ranges::find_if(narr, [&cmp](STObject const& obj) { + splitIter = std::find_if(narr.begin(), narr.end(), [&cmp](STObject const& obj) { return (obj.getFieldH256(sfNFTokenID) & nft::pageMask) == cmp; }); } @@ -238,8 +217,9 @@ changeTokenURI( // Locate the NFT in the page STArray& arr = page->peekFieldArray(sfNFTokens); - auto const nftIter = std::ranges::find_if( - arr, [&nftokenID](STObject const& obj) { return (obj[sfNFTokenID] == nftokenID); }); + auto const nftIter = std::find_if(arr.begin(), arr.end(), [&nftokenID](STObject const& obj) { + return (obj[sfNFTokenID] == nftokenID); + }); if (nftIter == arr.end()) return tecINTERNAL; // LCOV_EXCL_LINE @@ -318,8 +298,13 @@ mergePages(ApplyView& view, std::shared_ptr const& p1, std::shared_ptr STArray x(p1arr.size() + p2arr.size()); - std::ranges::merge( - p1arr, p2arr, std::back_inserter(x), [](STObject const& a, STObject const& b) { + std::merge( + p1arr.begin(), + p1arr.end(), + p2arr.begin(), + p2arr.end(), + std::back_inserter(x), + [](STObject const& a, STObject const& b) { return compareTokens(a.getFieldH256(sfNFTokenID), b.getFieldH256(sfNFTokenID)); }); @@ -375,8 +360,9 @@ removeToken( auto arr = curr->getFieldArray(sfNFTokens); { - auto x = std::ranges::find_if( - arr, [&nftokenID](STObject const& obj) { return (obj[sfNFTokenID] == nftokenID); }); + auto x = std::find_if(arr.begin(), arr.end(), [&nftokenID](STObject const& obj) { + return (obj[sfNFTokenID] == nftokenID); + }); if (x == arr.end()) return tecNO_ENTRY; @@ -621,6 +607,33 @@ removeTokenOffersWithLimit(ApplyView& view, Keylet const& directory, std::size_t return deletedOffersCount; } +TER +notTooManyOffers(ReadView const& view, uint256 const& nftokenID) +{ + std::size_t totalOffers = 0; + + { + Dir const buys(view, keylet::nft_buys(nftokenID)); + for (auto iter = buys.begin(); iter != buys.end(); iter.next_page()) + { + totalOffers += iter.page_size(); + if (totalOffers > maxDeletableTokenOfferEntries) + return tefTOO_BIG; + } + } + + { + Dir const sells(view, keylet::nft_sells(nftokenID)); + for (auto iter = sells.begin(); iter != sells.end(); iter.next_page()) + { + totalOffers += iter.page_size(); + if (totalOffers > maxDeletableTokenOfferEntries) + return tefTOO_BIG; + } + } + return tesSUCCESS; +} + bool deleteTokenOffer(ApplyView& view, std::shared_ptr const& offer) { @@ -1094,4 +1107,5 @@ checkTrustlineDeepFrozen( return tesSUCCESS; } -} // namespace xrpl::nft +} // namespace nft +} // namespace xrpl diff --git a/src/libxrpl/ledger/helpers/OfferHelpers.cpp b/src/libxrpl/ledger/helpers/OfferHelpers.cpp index d57066cfe2..3d63240fd0 100644 --- a/src/libxrpl/ledger/helpers/OfferHelpers.cpp +++ b/src/libxrpl/ledger/helpers/OfferHelpers.cpp @@ -1,17 +1,9 @@ #include - -#include -#include -#include -#include +// #include #include -#include -#include // IWYU pragma: keep -#include -#include - -#include +#include +#include namespace xrpl { diff --git a/src/libxrpl/ledger/helpers/PaymentChannelHelpers.cpp b/src/libxrpl/ledger/helpers/PaymentChannelHelpers.cpp index 31c206d85b..a9fab07194 100644 --- a/src/libxrpl/ledger/helpers/PaymentChannelHelpers.cpp +++ b/src/libxrpl/ledger/helpers/PaymentChannelHelpers.cpp @@ -1,18 +1,8 @@ -#include - #include -#include -#include -#include -#include +#include #include -#include +#include #include -#include -#include -#include - -#include namespace xrpl { diff --git a/src/libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp b/src/libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp index d65462f0cd..4b2bde19f8 100644 --- a/src/libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp +++ b/src/libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp @@ -1,20 +1,8 @@ +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace xrpl::permissioned_dex { +namespace xrpl { +namespace permissioned_dex { bool accountInDomain(ReadView const& view, AccountID const& account, Domain const& domainID) @@ -29,14 +17,15 @@ accountInDomain(ReadView const& view, AccountID const& account, Domain const& do auto const& credentials = sleDomain->getFieldArray(sfAcceptedCredentials); - bool const inDomain = std::ranges::any_of(credentials, [&](auto const& credential) { - auto const sleCred = view.read( - keylet::credential(account, credential[sfIssuer], credential[sfCredentialType])); - if (!sleCred || !sleCred->isFlag(lsfAccepted)) - return false; + bool const inDomain = + std::any_of(credentials.begin(), credentials.end(), [&](auto const& credential) { + auto const sleCred = view.read( + keylet::credential(account, credential[sfIssuer], credential[sfCredentialType])); + if (!sleCred || !sleCred->isFlag(lsfAccepted)) + return false; - return !credentials::checkExpired(sleCred, view.header().parentCloseTime); - }); + return !credentials::checkExpired(sleCred, view.header().parentCloseTime); + }); return inDomain; } @@ -60,29 +49,15 @@ offerInDomain( if (sleOffer->getFieldH256(sfDomainID) != domainID) return false; // LCOV_EXCL_LINE - if (view.rules().enabled(fixSecurity3_1_3)) + if (sleOffer->isFlag(lsfHybrid) && !sleOffer->isFieldPresent(sfAdditionalBooks)) { - // post-fixSecurity3_1_3: also catches empty sfAdditionalBooks (size == 0) - if (sleOffer->isFlag(lsfHybrid) && - (!sleOffer->isFieldPresent(sfAdditionalBooks) || - sleOffer->getFieldArray(sfAdditionalBooks).size() != 1)) - { - JLOG(j.error()) << "Hybrid offer " << offerID - << " missing or malformed AdditionalBooks field"; - return false; // LCOV_EXCL_LINE - } - } - else - { - // pre-fixSecurity3_1_3: only check for missing sfAdditionalBooks - if (sleOffer->isFlag(lsfHybrid) && !sleOffer->isFieldPresent(sfAdditionalBooks)) - { - JLOG(j.error()) << "Hybrid offer " << offerID << " missing AdditionalBooks field"; - return false; // LCOV_EXCL_LINE - } + JLOG(j.error()) << "Hybrid offer " << offerID << " missing AdditionalBooks field"; + return false; // LCOV_EXCL_LINE } return accountInDomain(view, sleOffer->getAccountID(sfAccount), domainID); } -} // namespace xrpl::permissioned_dex +} // namespace permissioned_dex + +} // namespace xrpl diff --git a/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp b/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp index f5a5c01060..2c676f14af 100644 --- a/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp +++ b/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp @@ -1,34 +1,15 @@ #include - +// #include -#include -#include -#include -#include #include #include #include #include -#include -#include #include #include -#include #include -#include #include #include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include namespace xrpl { diff --git a/src/libxrpl/ledger/helpers/TokenHelpers.cpp b/src/libxrpl/ledger/helpers/TokenHelpers.cpp index 91eaa8a95b..962ac10e56 100644 --- a/src/libxrpl/ledger/helpers/TokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/TokenHelpers.cpp @@ -1,34 +1,19 @@ #include - +// #include -#include -#include #include -#include -#include #include #include #include -#include -#include -#include #include #include -#include #include -#include #include -#include -#include -#include -#include +#include #include -#include -#include +#include -#include -#include -#include +#include #include namespace xrpl { diff --git a/src/libxrpl/ledger/helpers/VaultHelpers.cpp b/src/libxrpl/ledger/helpers/VaultHelpers.cpp index 99500b36bf..83a1b9fc4f 100644 --- a/src/libxrpl/ledger/helpers/VaultHelpers.cpp +++ b/src/libxrpl/ledger/helpers/VaultHelpers.cpp @@ -1,14 +1,8 @@ #include - +// #include -#include -#include -#include -#include -#include // IWYU pragma: keep - -#include -#include +#include +#include namespace xrpl { diff --git a/src/libxrpl/net/HTTPClient.cpp b/src/libxrpl/net/HTTPClient.cpp index b39a605313..5cb01cb54b 100644 --- a/src/libxrpl/net/HTTPClient.cpp +++ b/src/libxrpl/net/HTTPClient.cpp @@ -1,35 +1,16 @@ -#include - #include #include -#include #include +#include #include -#include -#include -#include -#include -#include +#include #include #include -#include -#include -#include -#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include namespace xrpl { @@ -203,7 +184,7 @@ public: JLOG(j_.trace()) << "Deadline error: " << mDeqSites[0] << ": " << ecResult.message(); // Can't do anything sound. - std::abort(); + abort(); } else { diff --git a/src/libxrpl/net/RegisterSSLCerts.cpp b/src/libxrpl/net/RegisterSSLCerts.cpp index ff59b5971e..1f21a76ddb 100644 --- a/src/libxrpl/net/RegisterSSLCerts.cpp +++ b/src/libxrpl/net/RegisterSSLCerts.cpp @@ -1,10 +1,5 @@ #include -#include - -#include -#include - #if BOOST_OS_WINDOWS #include #include diff --git a/src/libxrpl/nodestore/BatchWriter.cpp b/src/libxrpl/nodestore/BatchWriter.cpp index 9da6f504a9..75b9a8dcde 100644 --- a/src/libxrpl/nodestore/BatchWriter.cpp +++ b/src/libxrpl/nodestore/BatchWriter.cpp @@ -1,17 +1,7 @@ #include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { BatchWriter::BatchWriter(Callback& callback, Scheduler& scheduler) : m_callback(callback), m_scheduler(scheduler) @@ -107,4 +97,5 @@ BatchWriter::waitForWriting() mWriteCondition.wait(sl); } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/Database.cpp b/src/libxrpl/nodestore/Database.cpp index ee8d2f56aa..5d9d153f57 100644 --- a/src/libxrpl/nodestore/Database.cpp +++ b/src/libxrpl/nodestore/Database.cpp @@ -1,35 +1,14 @@ -#include - -#include -#include -#include -#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { Database::Database( Scheduler& scheduler, @@ -275,4 +254,5 @@ Database::getCountsJson(Json::Value& obj) obj[jss::node_reads_duration_us] = std::to_string(fetchDurationUs_); } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/DatabaseNodeImp.cpp b/src/libxrpl/nodestore/DatabaseNodeImp.cpp index 7722f711bb..a24379aea9 100644 --- a/src/libxrpl/nodestore/DatabaseNodeImp.cpp +++ b/src/libxrpl/nodestore/DatabaseNodeImp.cpp @@ -1,26 +1,7 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { void DatabaseNodeImp::store(NodeObjectType type, Blob&& data, uint256 const& hash, std::uint32_t) @@ -110,4 +91,5 @@ DatabaseNodeImp::fetchBatch(std::vector const& hashes) return results; } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/DatabaseRotatingImp.cpp b/src/libxrpl/nodestore/DatabaseRotatingImp.cpp index ef7431f5a3..aa04b17b33 100644 --- a/src/libxrpl/nodestore/DatabaseRotatingImp.cpp +++ b/src/libxrpl/nodestore/DatabaseRotatingImp.cpp @@ -1,27 +1,7 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { DatabaseRotatingImp::DatabaseRotatingImp( Scheduler& scheduler, @@ -198,4 +178,5 @@ DatabaseRotatingImp::for_each(std::function)> f archive->for_each(f); } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/DecodedBlob.cpp b/src/libxrpl/nodestore/DecodedBlob.cpp index 1d60f2af86..ad704cb84e 100644 --- a/src/libxrpl/nodestore/DecodedBlob.cpp +++ b/src/libxrpl/nodestore/DecodedBlob.cpp @@ -1,16 +1,11 @@ -#include - -#include -#include #include #include -#include +#include #include -#include -#include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { DecodedBlob::DecodedBlob(void const* key, void const* value, int valueBytes) { @@ -73,4 +68,5 @@ DecodedBlob::createObject() return object; } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/DummyScheduler.cpp b/src/libxrpl/nodestore/DummyScheduler.cpp index 1f93ed3d0f..21c1b5c92e 100644 --- a/src/libxrpl/nodestore/DummyScheduler.cpp +++ b/src/libxrpl/nodestore/DummyScheduler.cpp @@ -1,9 +1,7 @@ #include -#include -#include - -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { void DummyScheduler::scheduleTask(Task& task) @@ -22,4 +20,5 @@ DummyScheduler::onBatchWrite(BatchWriteReport const& report) { } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/ManagerImp.cpp b/src/libxrpl/nodestore/ManagerImp.cpp index 40a48f0875..7925ccdb91 100644 --- a/src/libxrpl/nodestore/ManagerImp.cpp +++ b/src/libxrpl/nodestore/ManagerImp.cpp @@ -1,27 +1,11 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include #include -#include -#include -#include -#include -#include -#include -#include +namespace xrpl { -namespace xrpl::NodeStore { +namespace NodeStore { ManagerImp& ManagerImp::instance() @@ -104,8 +88,8 @@ void ManagerImp::erase(Factory& factory) { std::lock_guard const _(mutex_); - auto const iter = - std::ranges::find_if(list_, [&factory](Factory* other) { return other == &factory; }); + auto const iter = std::find_if( + list_.begin(), list_.end(), [&factory](Factory* other) { return other == &factory; }); XRPL_ASSERT(iter != list_.end(), "xrpl::NodeStore::ManagerImp::erase : valid input"); list_.erase(iter); } @@ -114,8 +98,9 @@ Factory* ManagerImp::find(std::string const& name) { std::lock_guard const _(mutex_); - auto const iter = std::ranges::find_if( - list_, [&name](Factory* other) { return boost::iequals(name, other->getName()); }); + auto const iter = std::find_if(list_.begin(), list_.end(), [&name](Factory* other) { + return boost::iequals(name, other->getName()); + }); if (iter == list_.end()) return nullptr; return *iter; @@ -129,4 +114,5 @@ Manager::instance() return ManagerImp::instance(); } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/NodeObject.cpp b/src/libxrpl/nodestore/NodeObject.cpp index b19d5d625a..2e40989e7c 100644 --- a/src/libxrpl/nodestore/NodeObject.cpp +++ b/src/libxrpl/nodestore/NodeObject.cpp @@ -1,10 +1,6 @@ #include -#include -#include - #include -#include namespace xrpl { diff --git a/src/libxrpl/nodestore/backend/MemoryFactory.cpp b/src/libxrpl/nodestore/backend/MemoryFactory.cpp index 2f94783b8b..a245af3030 100644 --- a/src/libxrpl/nodestore/backend/MemoryFactory.cpp +++ b/src/libxrpl/nodestore/backend/MemoryFactory.cpp @@ -1,30 +1,16 @@ -#include -#include #include -#include -#include -#include #include #include -#include -#include -#include #include #include -#include -#include #include #include #include -#include -#include -#include -#include -#include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { struct MemoryDB { @@ -238,4 +224,5 @@ MemoryFactory::createInstance( return std::make_unique(keyBytes, keyValues, journal); } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/backend/NuDBFactory.cpp b/src/libxrpl/nodestore/backend/NuDBFactory.cpp index 7fb3aec843..424778f280 100644 --- a/src/libxrpl/nodestore/backend/NuDBFactory.cpp +++ b/src/libxrpl/nodestore/backend/NuDBFactory.cpp @@ -1,50 +1,24 @@ -#include -#include -#include #include #include -#include #include -#include #include #include -#include -#include -#include #include #include #include -#include -#include -#include +#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include +#include -#include #include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { class NuDBBackend : public Backend { @@ -463,4 +437,5 @@ registerNuDBFactory(Manager& manager) static NuDBFactory const instance{manager}; } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/backend/NullFactory.cpp b/src/libxrpl/nodestore/backend/NullFactory.cpp index 94cd71bd11..617dfd893d 100644 --- a/src/libxrpl/nodestore/backend/NullFactory.cpp +++ b/src/libxrpl/nodestore/backend/NullFactory.cpp @@ -1,28 +1,17 @@ -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { class NullBackend : public Backend { public: NullBackend() = default; - ~NullBackend() override = default; + ~NullBackend() = default; std::string getName() override @@ -131,4 +120,5 @@ registerNullFactory(Manager& manager) static NullFactory const instance{manager}; } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/libxrpl/nodestore/backend/RocksDBFactory.cpp b/src/libxrpl/nodestore/backend/RocksDBFactory.cpp index 3e0957edea..4ce7c3f10c 100644 --- a/src/libxrpl/nodestore/backend/RocksDBFactory.cpp +++ b/src/libxrpl/nodestore/backend/RocksDBFactory.cpp @@ -1,36 +1,4 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include #if XRPL_ROCKSDB_AVAILABLE #include @@ -46,7 +14,8 @@ #include #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { class RocksDBEnv : public rocksdb::EnvWrapper { @@ -489,6 +458,7 @@ registerRocksDBFactory(Manager& manager) static RocksDBFactory const instance{manager}; } -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl #endif diff --git a/src/libxrpl/protocol/AMMCore.cpp b/src/libxrpl/protocol/AMMCore.cpp index 41303e6a22..e7a5daf6c1 100644 --- a/src/libxrpl/protocol/AMMCore.cpp +++ b/src/libxrpl/protocol/AMMCore.cpp @@ -1,14 +1,10 @@ -#include - #include #include #include +#include #include -#include -#include #include #include -#include #include #include #include @@ -21,7 +17,6 @@ #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/protocol/AccountID.cpp b/src/libxrpl/protocol/AccountID.cpp index a89dc8fd11..2c64457c87 100644 --- a/src/libxrpl/protocol/AccountID.cpp +++ b/src/libxrpl/protocol/AccountID.cpp @@ -1,9 +1,8 @@ -#include - #include #include #include #include +#include #include #include #include diff --git a/src/libxrpl/protocol/Asset.cpp b/src/libxrpl/protocol/Asset.cpp index 3d163c5c6a..a01ff2bbda 100644 --- a/src/libxrpl/protocol/Asset.cpp +++ b/src/libxrpl/protocol/Asset.cpp @@ -1,16 +1,12 @@ -#include - -#include #include #include #include -#include +#include #include #include #include #include -#include #include #include #include diff --git a/src/libxrpl/protocol/Book.cpp b/src/libxrpl/protocol/Book.cpp index f71800b786..59ad739c11 100644 --- a/src/libxrpl/protocol/Book.cpp +++ b/src/libxrpl/protocol/Book.cpp @@ -1,6 +1,5 @@ #include - -#include +#include #include #include diff --git a/src/libxrpl/protocol/BuildInfo.cpp b/src/libxrpl/protocol/BuildInfo.cpp index c732e95a87..543da615cf 100644 --- a/src/libxrpl/protocol/BuildInfo.cpp +++ b/src/libxrpl/protocol/BuildInfo.cpp @@ -1,19 +1,20 @@ -#include - #include #include #include -#include // IWYU pragma: keep +#include +#include #include -#include // IWYU pragma: keep +#include #include #include #include #include -namespace xrpl::BuildInfo { +namespace xrpl { + +namespace BuildInfo { namespace { @@ -121,7 +122,7 @@ encodeSoftwareVersion(std::string_view versionStr) std::uint8_t hik) -> std::uint8_t { std::uint8_t ret = 0; - if (!identifier.starts_with(prefix)) + if (prefix != identifier.substr(0, prefix.length())) return 0; if (!beast::lexicalCastChecked( @@ -172,4 +173,6 @@ isNewerVersion(std::uint64_t version) return false; } -} // namespace xrpl::BuildInfo +} // namespace BuildInfo + +} // namespace xrpl diff --git a/src/libxrpl/protocol/ConfidentialTransfer.cpp b/src/libxrpl/protocol/ConfidentialTransfer.cpp index a8003b1a55..4acb9d5fe2 100644 --- a/src/libxrpl/protocol/ConfidentialTransfer.cpp +++ b/src/libxrpl/protocol/ConfidentialTransfer.cpp @@ -1,30 +1,11 @@ #include - -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include #include -#include #include -#include -#include -#include -#include -#include -#include - namespace xrpl { /** diff --git a/src/libxrpl/protocol/ErrorCodes.cpp b/src/libxrpl/protocol/ErrorCodes.cpp index 4e928deb75..407e1ab3f3 100644 --- a/src/libxrpl/protocol/ErrorCodes.cpp +++ b/src/libxrpl/protocol/ErrorCodes.cpp @@ -1,7 +1,6 @@ -#include - #include #include +#include #include #include diff --git a/src/libxrpl/protocol/Feature.cpp b/src/libxrpl/protocol/Feature.cpp index 1686d0e52a..1762d7d22d 100644 --- a/src/libxrpl/protocol/Feature.cpp +++ b/src/libxrpl/protocol/Feature.cpp @@ -1,9 +1,8 @@ -#include - #include #include #include #include +#include #include #include @@ -71,8 +70,8 @@ class FeatureCollections uint256 feature; Feature() = delete; - explicit Feature(std::string name_, uint256 const& feature_) - : name(std::move(name_)), feature(feature_) + explicit Feature(std::string const& name_, uint256 const& feature_) + : name(name_), feature(feature_) { } @@ -429,8 +428,6 @@ enforceValidFeatureName(auto fn) -> char const* #include -#include - #undef XRPL_RETIRE_FEATURE #pragma pop_macro("XRPL_RETIRE_FEATURE") #undef XRPL_RETIRE_FIX diff --git a/src/libxrpl/protocol/IOUAmount.cpp b/src/libxrpl/protocol/IOUAmount.cpp index 69b763dbab..338f2c2760 100644 --- a/src/libxrpl/protocol/IOUAmount.cpp +++ b/src/libxrpl/protocol/IOUAmount.cpp @@ -1,18 +1,20 @@ #include - +// Do not remove. Forces IOUAmount.h to stay first, to verify it can compile +// without any hidden dependencies #include #include #include #include #include +#include + #include #include #include #include #include #include -#include #include namespace xrpl { @@ -207,7 +209,7 @@ mulRatio(IOUAmount const& amt, std::uint32_t num, std::uint32_t den, bool roundU static auto log10Floor = [](uint128_t const& v) { // Find the index of the first element >= the requested element, the // index is the log of the element in the log table. - auto const l = std::ranges::lower_bound(powerTable, v); + auto const l = std::lower_bound(powerTable.begin(), powerTable.end(), v); int index = std::distance(powerTable.begin(), l); // If we're not equal, subtract to get the floor if (*l != v) @@ -219,7 +221,7 @@ mulRatio(IOUAmount const& amt, std::uint32_t num, std::uint32_t den, bool roundU static auto log10Ceil = [](uint128_t const& v) { // Find the index of the first element >= the requested element, the // index is the log of the element in the log table. - auto const l = std::ranges::lower_bound(powerTable, v); + auto const l = std::lower_bound(powerTable.begin(), powerTable.end(), v); return int(std::distance(powerTable.begin(), l)); }; diff --git a/src/libxrpl/protocol/Indexes.cpp b/src/libxrpl/protocol/Indexes.cpp index 4bbf2d6f1f..7c771423a8 100644 --- a/src/libxrpl/protocol/Indexes.cpp +++ b/src/libxrpl/protocol/Indexes.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -7,10 +5,8 @@ #include #include #include -#include -#include +#include #include -#include #include #include #include @@ -27,7 +23,6 @@ #include #include #include -#include #include namespace xrpl { diff --git a/src/libxrpl/protocol/InnerObjectFormats.cpp b/src/libxrpl/protocol/InnerObjectFormats.cpp index f4a88ec171..8429c51aea 100644 --- a/src/libxrpl/protocol/InnerObjectFormats.cpp +++ b/src/libxrpl/protocol/InnerObjectFormats.cpp @@ -1,5 +1,4 @@ #include - #include #include diff --git a/src/libxrpl/protocol/Issue.cpp b/src/libxrpl/protocol/Issue.cpp index d5896bbd57..c73c6c8513 100644 --- a/src/libxrpl/protocol/Issue.cpp +++ b/src/libxrpl/protocol/Issue.cpp @@ -1,9 +1,8 @@ -#include - #include #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/Keylet.cpp b/src/libxrpl/protocol/Keylet.cpp index 26bc98c1d6..6f9656c4ea 100644 --- a/src/libxrpl/protocol/Keylet.cpp +++ b/src/libxrpl/protocol/Keylet.cpp @@ -1,6 +1,5 @@ -#include - #include +#include #include #include diff --git a/src/libxrpl/protocol/LedgerFormats.cpp b/src/libxrpl/protocol/LedgerFormats.cpp index 7826435e51..9f8bd6a2ba 100644 --- a/src/libxrpl/protocol/LedgerFormats.cpp +++ b/src/libxrpl/protocol/LedgerFormats.cpp @@ -1,8 +1,7 @@ #include - #include #include -#include // IWYU pragma: keep +#include #include diff --git a/src/libxrpl/protocol/LedgerHeader.cpp b/src/libxrpl/protocol/LedgerHeader.cpp index f6a99be28a..38e7a7f6dd 100644 --- a/src/libxrpl/protocol/LedgerHeader.cpp +++ b/src/libxrpl/protocol/LedgerHeader.cpp @@ -1,13 +1,10 @@ -#include - #include #include #include +#include #include #include -#include - namespace xrpl { void diff --git a/src/libxrpl/protocol/MPTIssue.cpp b/src/libxrpl/protocol/MPTIssue.cpp index dac2f4e5fe..70fb9dc8e7 100644 --- a/src/libxrpl/protocol/MPTIssue.cpp +++ b/src/libxrpl/protocol/MPTIssue.cpp @@ -1,16 +1,12 @@ -#include - #include #include #include #include -#include #include -#include +#include #include #include -#include #include #include diff --git a/src/libxrpl/protocol/NFTSyntheticSerializer.cpp b/src/libxrpl/protocol/NFTSyntheticSerializer.cpp index 9982f05b0f..e4ce3b7611 100644 --- a/src/libxrpl/protocol/NFTSyntheticSerializer.cpp +++ b/src/libxrpl/protocol/NFTSyntheticSerializer.cpp @@ -1,6 +1,5 @@ -#include - #include +#include #include #include #include @@ -9,7 +8,8 @@ #include -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { void insertNFTSyntheticInJson( @@ -21,4 +21,5 @@ insertNFTSyntheticInJson( insertNFTokenOfferID(response[jss::meta], transaction, transactionMeta); } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/libxrpl/protocol/NFTokenID.cpp b/src/libxrpl/protocol/NFTokenID.cpp index fc32a7b4e8..f77a6f67df 100644 --- a/src/libxrpl/protocol/NFTokenID.cpp +++ b/src/libxrpl/protocol/NFTokenID.cpp @@ -1,8 +1,7 @@ -#include - #include #include #include +#include #include #include #include @@ -56,10 +55,11 @@ getNFTokenIDFromPage(TxMeta const& transactionMeta) { STArray const& toAddPrevNFTs = node.peekAtField(sfNewFields).downcast().getFieldArray(sfNFTokens); - std::ranges::transform( - toAddPrevNFTs, std::back_inserter(finalIDs), [](STObject const& nft) { - return nft.getFieldH256(sfNFTokenID); - }); + std::transform( + toAddPrevNFTs.begin(), + toAddPrevNFTs.end(), + std::back_inserter(finalIDs), + [](STObject const& nft) { return nft.getFieldH256(sfNFTokenID); }); } else if (fName == sfModifiedNode) { @@ -78,17 +78,19 @@ getNFTokenIDFromPage(TxMeta const& transactionMeta) continue; STArray const& toAddPrevNFTs = previousFields.getFieldArray(sfNFTokens); - std::ranges::transform( - toAddPrevNFTs, std::back_inserter(prevIDs), [](STObject const& nft) { - return nft.getFieldH256(sfNFTokenID); - }); + std::transform( + toAddPrevNFTs.begin(), + toAddPrevNFTs.end(), + std::back_inserter(prevIDs), + [](STObject const& nft) { return nft.getFieldH256(sfNFTokenID); }); STArray const& toAddFinalNFTs = node.peekAtField(sfFinalFields).downcast().getFieldArray(sfNFTokens); - std::ranges::transform( - toAddFinalNFTs, std::back_inserter(finalIDs), [](STObject const& nft) { - return nft.getFieldH256(sfNFTokenID); - }); + std::transform( + toAddFinalNFTs.begin(), + toAddFinalNFTs.end(), + std::back_inserter(finalIDs), + [](STObject const& nft) { return nft.getFieldH256(sfNFTokenID); }); } } @@ -99,14 +101,15 @@ getNFTokenIDFromPage(TxMeta const& transactionMeta) // Find the first NFT ID that doesn't match. We're looking for an // added NFT, so the one we want will be the mismatch in finalIDs. - auto const diff = std::ranges::mismatch(finalIDs, prevIDs); + auto const diff = + std::mismatch(finalIDs.begin(), finalIDs.end(), prevIDs.begin(), prevIDs.end()); // There should always be a difference so the returned finalIDs // iterator should never be end(). But better safe than sorry. - if (diff.in1 == finalIDs.end()) + if (diff.first == finalIDs.end()) return std::nullopt; - return *diff.in1; + return *diff.first; } std::vector @@ -126,9 +129,8 @@ getNFTokenIDFromDeletedOffer(TxMeta const& transactionMeta) // Deduplicate the NFT IDs because multiple offers could affect the same NFT // and hence we would get duplicate NFT IDs - std::ranges::sort(tokenIDResult); - auto const uniq = std::ranges::unique(tokenIDResult); - tokenIDResult.erase(uniq.begin(), uniq.end()); + sort(tokenIDResult.begin(), tokenIDResult.end()); + tokenIDResult.erase(unique(tokenIDResult.begin(), tokenIDResult.end()), tokenIDResult.end()); return tokenIDResult; } diff --git a/src/libxrpl/protocol/NFTokenOfferID.cpp b/src/libxrpl/protocol/NFTokenOfferID.cpp index c1d426eef0..4af589a4e9 100644 --- a/src/libxrpl/protocol/NFTokenOfferID.cpp +++ b/src/libxrpl/protocol/NFTokenOfferID.cpp @@ -1,8 +1,7 @@ -#include - #include #include #include +#include #include #include #include diff --git a/src/libxrpl/protocol/PathAsset.cpp b/src/libxrpl/protocol/PathAsset.cpp index 97011129e5..063b1fdd33 100644 --- a/src/libxrpl/protocol/PathAsset.cpp +++ b/src/libxrpl/protocol/PathAsset.cpp @@ -1,9 +1,6 @@ +#include #include -#include -#include -#include - namespace xrpl { std::string diff --git a/src/libxrpl/protocol/Permissions.cpp b/src/libxrpl/protocol/Permissions.cpp index 21efe7a8cf..686b6376c1 100644 --- a/src/libxrpl/protocol/Permissions.cpp +++ b/src/libxrpl/protocol/Permissions.cpp @@ -1,15 +1,7 @@ -#include - -#include #include -#include // IWYU pragma: keep -#include -#include - -#include -#include -#include -#include +#include +#include +#include namespace xrpl { diff --git a/src/libxrpl/protocol/PublicKey.cpp b/src/libxrpl/protocol/PublicKey.cpp index cef65f765e..9e61e9cbac 100644 --- a/src/libxrpl/protocol/PublicKey.cpp +++ b/src/libxrpl/protocol/PublicKey.cpp @@ -1,20 +1,19 @@ -#include - #include #include #include #include #include #include +#include #include #include #include #include +#include #include #include -#include #include #include diff --git a/src/libxrpl/protocol/Quality.cpp b/src/libxrpl/protocol/Quality.cpp index 5f38f2219b..ba9807318a 100644 --- a/src/libxrpl/protocol/Quality.cpp +++ b/src/libxrpl/protocol/Quality.cpp @@ -1,10 +1,11 @@ -#include - +#include #include #include +#include #include #include +#include namespace xrpl { diff --git a/src/libxrpl/protocol/QualityFunction.cpp b/src/libxrpl/protocol/QualityFunction.cpp index b460eb212f..1774603a61 100644 --- a/src/libxrpl/protocol/QualityFunction.cpp +++ b/src/libxrpl/protocol/QualityFunction.cpp @@ -1,9 +1,8 @@ -#include - #include #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/RPCErr.cpp b/src/libxrpl/protocol/RPCErr.cpp index 99836f5e0f..e25b5e574b 100644 --- a/src/libxrpl/protocol/RPCErr.cpp +++ b/src/libxrpl/protocol/RPCErr.cpp @@ -1,7 +1,6 @@ -#include - #include #include +#include #include namespace xrpl { diff --git a/src/libxrpl/protocol/Rules.cpp b/src/libxrpl/protocol/Rules.cpp index a09afa96d8..fd54a1eff2 100644 --- a/src/libxrpl/protocol/Rules.cpp +++ b/src/libxrpl/protocol/Rules.cpp @@ -1,5 +1,6 @@ #include - +// Do not remove. Forces Rules.h to stay first, to verify it can compile +// without any hidden dependencies #include #include #include diff --git a/src/libxrpl/protocol/SField.cpp b/src/libxrpl/protocol/SField.cpp index fd6d39bbb0..8015b34e73 100644 --- a/src/libxrpl/protocol/SField.cpp +++ b/src/libxrpl/protocol/SField.cpp @@ -1,9 +1,8 @@ +#include #include -#include - +#include #include -#include namespace xrpl { diff --git a/src/libxrpl/protocol/SOTemplate.cpp b/src/libxrpl/protocol/SOTemplate.cpp index 708fd465e2..b90bff6192 100644 --- a/src/libxrpl/protocol/SOTemplate.cpp +++ b/src/libxrpl/protocol/SOTemplate.cpp @@ -1,14 +1,12 @@ -#include - #include #include +#include #include #include #include #include #include -#include #include namespace xrpl { diff --git a/src/libxrpl/protocol/STAccount.cpp b/src/libxrpl/protocol/STAccount.cpp index 4266b55c98..2dc83cb591 100644 --- a/src/libxrpl/protocol/STAccount.cpp +++ b/src/libxrpl/protocol/STAccount.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -7,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/STAmount.cpp b/src/libxrpl/protocol/STAmount.cpp index 89992b823c..6fe5eed498 100644 --- a/src/libxrpl/protocol/STAmount.cpp +++ b/src/libxrpl/protocol/STAmount.cpp @@ -1,16 +1,16 @@ -#include - +#include #include #include +#include #include #include +#include #include #include #include #include #include #include -#include #include #include #include @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include @@ -38,11 +44,9 @@ #include #include #include -#include #include #include #include -#include #include namespace xrpl { diff --git a/src/libxrpl/protocol/STArray.cpp b/src/libxrpl/protocol/STArray.cpp index 8e841c1fbb..91acc9ddd3 100644 --- a/src/libxrpl/protocol/STArray.cpp +++ b/src/libxrpl/protocol/STArray.cpp @@ -1,9 +1,8 @@ -#include - #include #include #include #include +#include #include #include @@ -175,7 +174,7 @@ STArray::isDefault() const void STArray::sort(bool (*compare)(STObject const&, STObject const&)) { - std::ranges::sort(v_, compare); + std::sort(v_.begin(), v_.end(), compare); } } // namespace xrpl diff --git a/src/libxrpl/protocol/STBase.cpp b/src/libxrpl/protocol/STBase.cpp index b3558e1b08..3c5c34ae4e 100644 --- a/src/libxrpl/protocol/STBase.cpp +++ b/src/libxrpl/protocol/STBase.cpp @@ -1,8 +1,7 @@ -#include - #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/STBlob.cpp b/src/libxrpl/protocol/STBlob.cpp index 3f44c9b529..e7d45a698d 100644 --- a/src/libxrpl/protocol/STBlob.cpp +++ b/src/libxrpl/protocol/STBlob.cpp @@ -1,9 +1,8 @@ -#include - #include #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/STCurrency.cpp b/src/libxrpl/protocol/STCurrency.cpp index dc47624402..3ca7b60d6b 100644 --- a/src/libxrpl/protocol/STCurrency.cpp +++ b/src/libxrpl/protocol/STCurrency.cpp @@ -1,9 +1,8 @@ -#include - #include #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/STInteger.cpp b/src/libxrpl/protocol/STInteger.cpp index 0530a784d9..1fccee2285 100644 --- a/src/libxrpl/protocol/STInteger.cpp +++ b/src/libxrpl/protocol/STInteger.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -8,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -16,6 +15,7 @@ #include #include #include +#include namespace xrpl { diff --git a/src/libxrpl/protocol/STIssue.cpp b/src/libxrpl/protocol/STIssue.cpp index 10f0ff4c32..f73bad4b0d 100644 --- a/src/libxrpl/protocol/STIssue.cpp +++ b/src/libxrpl/protocol/STIssue.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -8,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/STLedgerEntry.cpp b/src/libxrpl/protocol/STLedgerEntry.cpp index 1f4d9acfd4..5a80559c98 100644 --- a/src/libxrpl/protocol/STLedgerEntry.cpp +++ b/src/libxrpl/protocol/STLedgerEntry.cpp @@ -1,12 +1,9 @@ -#include - #include #include #include #include #include -#include -#include // IWYU pragma: keep +#include #include #include #include @@ -14,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libxrpl/protocol/STNumber.cpp b/src/libxrpl/protocol/STNumber.cpp index 25aa9eaa05..8899a76a35 100644 --- a/src/libxrpl/protocol/STNumber.cpp +++ b/src/libxrpl/protocol/STNumber.cpp @@ -1,26 +1,20 @@ #include - +// Do not remove. Keep STNumber.h first #include -#include +#include #include -#include -#include +#include #include #include #include -#include +#include #include #include -#include -#include -#include +#include #include -#include -#include #include -#include #include #include @@ -213,7 +207,7 @@ partsFromString(std::string const& number) } } - return {.mantissa = mantissa, .exponent = exponent, .negative = negative}; + return {mantissa, exponent, negative}; } STNumber diff --git a/src/libxrpl/protocol/STObject.cpp b/src/libxrpl/protocol/STObject.cpp index baece3ca56..be257d2c57 100644 --- a/src/libxrpl/protocol/STObject.cpp +++ b/src/libxrpl/protocol/STObject.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -24,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -167,8 +166,9 @@ STObject::applyTemplate(SOTemplate const& type) v.reserve(type.size()); for (auto const& e : type) { - auto const iter = std::ranges::find_if( - v_, [&](detail::STVar const& b) { return b.get().getFName() == e.sField(); }); + auto const iter = std::find_if(v_.begin(), v_.end(), [&](detail::STVar const& b) { + return b.get().getFName() == e.sField(); + }); if (iter != v_.end()) { if ((e.style() == soeDEFAULT) && iter->get().isDefault()) @@ -260,9 +260,10 @@ STObject::set(SerialIter& sit, int depth) // duplicate fields. This is a key invariant: auto const sf = getSortedFields(*this, withAllFields); - auto const dup = std::ranges::adjacent_find(sf, [](STBase const* lhs, STBase const* rhs) { - return lhs->getFName() == rhs->getFName(); - }); + auto const dup = + std::adjacent_find(sf.cbegin(), sf.cend(), [](STBase const* lhs, STBase const* rhs) { + return lhs->getFName() == rhs->getFName(); + }); if (dup != sf.cend()) Throw("Duplicate field detected"); @@ -347,7 +348,7 @@ STObject::isEquivalent(STBase const& t) const if (mType != nullptr && v->mType == mType) { - return std::ranges::equal( + return std::equal( begin(), end(), v->begin(), v->end(), [](STBase const& st1, STBase const& st2) { return (st1.getSType() == st2.getSType()) && st1.isEquivalent(st2); }); @@ -356,9 +357,10 @@ STObject::isEquivalent(STBase const& t) const auto const sf1 = getSortedFields(*this, withAllFields); auto const sf2 = getSortedFields(*v, withAllFields); - return std::ranges::equal(sf1, sf2, [](STBase const* st1, STBase const* st2) { - return (st1->getSType() == st2->getSType()) && st1->isEquivalent(*st2); - }); + return std::equal( + sf1.begin(), sf1.end(), sf2.begin(), sf2.end(), [](STBase const* st1, STBase const* st2) { + return (st1->getSType() == st2->getSType()) && st1->isEquivalent(*st2); + }); } uint256 @@ -926,7 +928,7 @@ STObject::getSortedFields(STObject const& objToSort, WhichFields whichFields) } // Sort the fields by fieldCode. - std::ranges::sort(sf, [](STBase const* lhs, STBase const* rhs) { + std::sort(sf.begin(), sf.end(), [](STBase const* lhs, STBase const* rhs) { return lhs->getFName().fieldCode < rhs->getFName().fieldCode; }); diff --git a/src/libxrpl/protocol/STParsedJSON.cpp b/src/libxrpl/protocol/STParsedJSON.cpp index 01a52c88ec..5eba36b9e1 100644 --- a/src/libxrpl/protocol/STParsedJSON.cpp +++ b/src/libxrpl/protocol/STParsedJSON.cpp @@ -1,18 +1,13 @@ -#include - #include #include #include #include #include -#include #include #include #include #include #include -#include -#include #include #include #include @@ -24,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +27,6 @@ #include #include #include -#include #include #include @@ -50,7 +45,7 @@ namespace xrpl { namespace STParsedJSONDetail { template -constexpr std::enable_if_t && std::is_signed_v, U> +constexpr std::enable_if_t::value && std::is_signed::value, U> to_unsigned(S value) { if (value < 0 || std::numeric_limits::max() < value) @@ -59,7 +54,7 @@ to_unsigned(S value) } template -constexpr std::enable_if_t && std::is_unsigned_v, U1> +constexpr std::enable_if_t::value && std::is_unsigned::value, U1> to_unsigned(U2 value) { if (std::numeric_limits::max() < value) diff --git a/src/libxrpl/protocol/STPathSet.cpp b/src/libxrpl/protocol/STPathSet.cpp index 04c8d3c8da..39c1d8b29e 100644 --- a/src/libxrpl/protocol/STPathSet.cpp +++ b/src/libxrpl/protocol/STPathSet.cpp @@ -1,14 +1,11 @@ -#include - #include -#include #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/src/libxrpl/protocol/STTakesAsset.cpp b/src/libxrpl/protocol/STTakesAsset.cpp index 1d37c65fc1..fcf4ad749c 100644 --- a/src/libxrpl/protocol/STTakesAsset.cpp +++ b/src/libxrpl/protocol/STTakesAsset.cpp @@ -1,10 +1,5 @@ #include - -#include -#include -#include -#include -#include +// Do not remove. Force STTakesAsset.h first #include namespace xrpl { diff --git a/src/libxrpl/protocol/STTx.cpp b/src/libxrpl/protocol/STTx.cpp index 6da0d61b57..f8600e167f 100644 --- a/src/libxrpl/protocol/STTx.cpp +++ b/src/libxrpl/protocol/STTx.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -26,14 +24,18 @@ #include #include #include +#include +#include #include #include #include #include +#include #include #include #include +#include #include #include @@ -48,7 +50,6 @@ #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/protocol/STValidation.cpp b/src/libxrpl/protocol/STValidation.cpp index 14349d3f85..f4042844f4 100644 --- a/src/libxrpl/protocol/STValidation.cpp +++ b/src/libxrpl/protocol/STValidation.cpp @@ -1,16 +1,16 @@ -#include - #include #include #include #include #include #include +#include #include #include #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/STVar.cpp b/src/libxrpl/protocol/STVar.cpp index 652328f613..8b76d8a322 100644 --- a/src/libxrpl/protocol/STVar.cpp +++ b/src/libxrpl/protocol/STVar.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -18,12 +16,14 @@ #include #include #include +#include #include #include #include -namespace xrpl::detail { +namespace xrpl { +namespace detail { defaultObject_t defaultObject; nonPresentObject_t nonPresentObject; @@ -227,4 +227,5 @@ STVar::constructST(SerializedTypeID id, int depth, Args&&... args) } } -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/src/libxrpl/protocol/STVector256.cpp b/src/libxrpl/protocol/STVector256.cpp index 038f88c226..2a70dd1e05 100644 --- a/src/libxrpl/protocol/STVector256.cpp +++ b/src/libxrpl/protocol/STVector256.cpp @@ -1,11 +1,10 @@ -#include - #include #include #include #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/STXChainBridge.cpp b/src/libxrpl/protocol/STXChainBridge.cpp index a29bf3b6f9..428e4655ff 100644 --- a/src/libxrpl/protocol/STXChainBridge.cpp +++ b/src/libxrpl/protocol/STXChainBridge.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -8,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/SecretKey.cpp b/src/libxrpl/protocol/SecretKey.cpp index 01d3c29f9e..f58bb81a88 100644 --- a/src/libxrpl/protocol/SecretKey.cpp +++ b/src/libxrpl/protocol/SecretKey.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -10,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -18,7 +17,6 @@ #include #include -#include #include #include @@ -77,7 +75,7 @@ deriveDeterministicRootKey(Seed const& seed) // | seed | seq| std::array buf{}; - std::ranges::copy(seed, buf.begin()); + std::copy(seed.begin(), seed.end(), buf.begin()); // The odds that this loop executes more than once are negligible // but *just* in case someone managed to generate a key that required @@ -136,7 +134,7 @@ private: // | generator | seq| cnt| std::array buf{}; - std::ranges::copy(generator_, buf.begin()); + std::copy(generator_.begin(), generator_.end(), buf.begin()); copy_uint32(buf.data() + 33, seq); // The odds that this loop executes more than once are negligible diff --git a/src/libxrpl/protocol/Seed.cpp b/src/libxrpl/protocol/Seed.cpp index 0fe525a613..6d33013f2f 100644 --- a/src/libxrpl/protocol/Seed.cpp +++ b/src/libxrpl/protocol/Seed.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -11,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/src/libxrpl/protocol/Serializer.cpp b/src/libxrpl/protocol/Serializer.cpp index 576e3f3e5f..4e6a49f572 100644 --- a/src/libxrpl/protocol/Serializer.cpp +++ b/src/libxrpl/protocol/Serializer.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -7,6 +5,7 @@ #include #include #include +#include #include #include @@ -443,7 +442,7 @@ template T SerialIter::getRawHelper(int size) { - static_assert(std::is_same_v || std::is_same_v, ""); + static_assert(std::is_same::value || std::is_same::value, ""); if (remain_ < size) Throw("invalid SerialIter getRaw"); T result(size); diff --git a/src/libxrpl/protocol/Sign.cpp b/src/libxrpl/protocol/Sign.cpp index bee034d60e..9105be8294 100644 --- a/src/libxrpl/protocol/Sign.cpp +++ b/src/libxrpl/protocol/Sign.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -9,6 +7,7 @@ #include #include #include +#include namespace xrpl { diff --git a/src/libxrpl/protocol/TxFormats.cpp b/src/libxrpl/protocol/TxFormats.cpp index a2a7c5facf..4492ae271b 100644 --- a/src/libxrpl/protocol/TxFormats.cpp +++ b/src/libxrpl/protocol/TxFormats.cpp @@ -1,9 +1,7 @@ -#include - -#include // IWYU pragma: keep #include #include -#include // IWYU pragma: keep +#include +#include #include diff --git a/src/libxrpl/protocol/TxMeta.cpp b/src/libxrpl/protocol/TxMeta.cpp index 08069ca83d..3c797a7c8c 100644 --- a/src/libxrpl/protocol/TxMeta.cpp +++ b/src/libxrpl/protocol/TxMeta.cpp @@ -1,7 +1,4 @@ -#include - #include -#include #include #include #include @@ -13,12 +10,13 @@ #include #include #include +#include #include #include -#include #include +#include namespace xrpl { diff --git a/src/libxrpl/protocol/UintTypes.cpp b/src/libxrpl/protocol/UintTypes.cpp index 4206ec8cf5..5ace6c29d6 100644 --- a/src/libxrpl/protocol/UintTypes.cpp +++ b/src/libxrpl/protocol/UintTypes.cpp @@ -1,8 +1,7 @@ -#include - #include #include #include +#include #include #include @@ -78,7 +77,7 @@ to_currency(Currency& currency, std::string const& code) currency = beast::zero; - std::ranges::copy(code, currency.begin() + detail::isoCodeOffset); + std::copy(code.begin(), code.end(), currency.begin() + detail::isoCodeOffset); return true; } diff --git a/src/libxrpl/protocol/XChainAttestations.cpp b/src/libxrpl/protocol/XChainAttestations.cpp index 8d3e62b31e..c255f743e3 100644 --- a/src/libxrpl/protocol/XChainAttestations.cpp +++ b/src/libxrpl/protocol/XChainAttestations.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -13,6 +11,7 @@ #include #include #include +#include #include #include @@ -31,14 +30,14 @@ AttestationBase::AttestationBase( PublicKey const& publicKey_, Buffer signature_, AccountID const& sendingAccount_, - STAmount sendingAmount_, + STAmount const& sendingAmount_, AccountID const& rewardAccount_, bool wasLockingChainSend_) : attestationSignerAccount{attestationSignerAccount_} , publicKey{publicKey_} , signature{std::move(signature_)} , sendingAccount{sendingAccount_} - , sendingAmount{std::move(sendingAmount_)} + , sendingAmount{sendingAmount_} , rewardAccount{rewardAccount_} , wasLockingChainSend{wasLockingChainSend_} { @@ -261,7 +260,7 @@ AttestationCreateAccount::AttestationCreateAccount( Buffer signature_, AccountID const& sendingAccount_, STAmount const& sendingAmount_, - STAmount rewardAmount_, + STAmount const& rewardAmount_, AccountID const& rewardAccount_, bool wasLockingChainSend_, std::uint64_t createCount_, @@ -276,7 +275,7 @@ AttestationCreateAccount::AttestationCreateAccount( wasLockingChainSend_) , createCount{createCount_} , toCreate{toCreate_} - , rewardAmount{std::move(rewardAmount_)} + , rewardAmount{rewardAmount_} { } diff --git a/src/libxrpl/protocol/tokens.cpp b/src/libxrpl/protocol/tokens.cpp index 3cb0e3f3dd..e2a77fbf10 100644 --- a/src/libxrpl/protocol/tokens.cpp +++ b/src/libxrpl/protocol/tokens.cpp @@ -7,14 +7,13 @@ * file COPYING or http://www.opensource.org/licenses/mit-license.php. */ -#include - #include #include #include #include #include #include +#include #include #include @@ -282,7 +281,7 @@ decodeBase58(std::string const& s) --remain; } // Skip leading zeroes in b256. - auto iter = std::ranges::find_if(b256, [](unsigned char c) { return c != 0; }); + auto iter = std::find_if(b256.begin(), b256.end(), [](unsigned char c) { return c != 0; }); std::string result; result.reserve(zeroes + (b256.end() - iter)); result.assign(zeroes, 0x00); diff --git a/src/libxrpl/protocol_autogen/placeholder.cpp b/src/libxrpl/protocol_autogen/placeholder.cpp index efc30fd904..b48581e5b8 100644 --- a/src/libxrpl/protocol_autogen/placeholder.cpp +++ b/src/libxrpl/protocol_autogen/placeholder.cpp @@ -1 +1,5 @@ // This file is a placeholder to ensure the protocol_autogen module can be built. +#include +#include +#include +#include diff --git a/src/libxrpl/rdb/DatabaseCon.cpp b/src/libxrpl/rdb/DatabaseCon.cpp index 5f4594b630..bca14f9bfa 100644 --- a/src/libxrpl/rdb/DatabaseCon.cpp +++ b/src/libxrpl/rdb/DatabaseCon.cpp @@ -1,18 +1,13 @@ -#include - #include #include +#include #include -#include -#include +#include +#include + #include -#include -#include -#include -#include #include -#include namespace xrpl { diff --git a/src/libxrpl/rdb/SociDB.cpp b/src/libxrpl/rdb/SociDB.cpp index c6e40ae90b..780e05854f 100644 --- a/src/libxrpl/rdb/SociDB.cpp +++ b/src/libxrpl/rdb/SociDB.cpp @@ -1,21 +1,3 @@ -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated" @@ -26,7 +8,9 @@ #include #include -#include // IWYU pragma: keep +#include + +#include #include @@ -66,7 +50,7 @@ getSociInit(BasicConfig const& config, std::string const& dbName) } // namespace detail -DBConfig::DBConfig(std::string dbPath) : connectionString_(std::move(dbPath)) +DBConfig::DBConfig(std::string const& dbPath) : connectionString_(dbPath) { } @@ -272,10 +256,10 @@ public: return; int log = 0, ckpt = 0; - int const ret = sqlite_api::sqlite3_wal_checkpoint_v2( - conn, nullptr, SQLITE_CHECKPOINT_PASSIVE, &log, &ckpt); + int const ret = + sqlite3_wal_checkpoint_v2(conn, nullptr, SQLITE_CHECKPOINT_PASSIVE, &log, &ckpt); - auto fname = sqlite_api::sqlite3_db_filename(conn, "main"); + auto fname = sqlite3_db_filename(conn, "main"); if (ret != SQLITE_OK) { auto jm = (ret == SQLITE_LOCKED) ? j_.trace() : j_.warn(); diff --git a/src/libxrpl/resource/Charge.cpp b/src/libxrpl/resource/Charge.cpp index 8626115c4c..eece5355f0 100644 --- a/src/libxrpl/resource/Charge.cpp +++ b/src/libxrpl/resource/Charge.cpp @@ -4,11 +4,11 @@ #include #include #include -#include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { -Charge::Charge(value_type cost, std::string label) : m_cost(cost), m_label(std::move(label)) +Charge::Charge(value_type cost, std::string const& label) : m_cost(cost), m_label(label) { } @@ -57,4 +57,5 @@ Charge::operator*(value_type m) const return Charge(m_cost * m, m_label); } -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/src/libxrpl/resource/Consumer.cpp b/src/libxrpl/resource/Consumer.cpp index 3d03fa05db..c1cb9d4367 100644 --- a/src/libxrpl/resource/Consumer.cpp +++ b/src/libxrpl/resource/Consumer.cpp @@ -1,10 +1,8 @@ -#include - #include #include #include -#include #include +#include #include #include #include @@ -12,7 +10,8 @@ #include #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { Consumer::Consumer(Logic& logic, Entry& entry) : m_logic(&logic), m_entry(&entry) { @@ -142,4 +141,5 @@ operator<<(std::ostream& os, Consumer const& v) return os; } -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/src/libxrpl/resource/Fees.cpp b/src/libxrpl/resource/Fees.cpp index e9f47b3e7d..d5999458b7 100644 --- a/src/libxrpl/resource/Fees.cpp +++ b/src/libxrpl/resource/Fees.cpp @@ -1,8 +1,8 @@ +#include #include -#include - -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { Charge const feeMalformedRequest(200, "malformed request"); Charge const feeRequestNoReply(10, "unsatisfiable request"); @@ -25,4 +25,5 @@ Charge const feeDrop(6000, "dropped"); // See also Resource::Logic::charge for log level cutoff values -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/src/libxrpl/resource/ResourceManager.cpp b/src/libxrpl/resource/ResourceManager.cpp index 6652c1a66b..d0e45d4c0e 100644 --- a/src/libxrpl/resource/ResourceManager.cpp +++ b/src/libxrpl/resource/ResourceManager.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -10,6 +8,7 @@ #include #include #include +#include #include #include @@ -23,7 +22,8 @@ #include #include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { class ManagerImp : public Manager { @@ -164,4 +164,5 @@ make_Manager(beast::insight::Collector::ptr const& collector, beast::Journal jou return std::make_unique(collector, journal); } -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/src/libxrpl/server/InfoSub.cpp b/src/libxrpl/server/InfoSub.cpp index 30686dfe7e..ea70dc3a83 100644 --- a/src/libxrpl/server/InfoSub.cpp +++ b/src/libxrpl/server/InfoSub.cpp @@ -1,13 +1,5 @@ #include -#include -#include -#include - -#include -#include -#include - namespace xrpl { // This is the primary interface into the "client" portion of the program. diff --git a/src/libxrpl/server/JSONRPCUtil.cpp b/src/libxrpl/server/JSONRPCUtil.cpp index 280aeeeebc..db2ea450a2 100644 --- a/src/libxrpl/server/JSONRPCUtil.cpp +++ b/src/libxrpl/server/JSONRPCUtil.cpp @@ -1,10 +1,9 @@ -#include - #include #include #include #include #include +#include #include #include diff --git a/src/libxrpl/server/LoadFeeTrack.cpp b/src/libxrpl/server/LoadFeeTrack.cpp index 53fbb8cb84..d698e2420e 100644 --- a/src/libxrpl/server/LoadFeeTrack.cpp +++ b/src/libxrpl/server/LoadFeeTrack.cpp @@ -1,15 +1,11 @@ -#include - #include #include #include #include -#include +#include #include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/server/Manifest.cpp b/src/libxrpl/server/Manifest.cpp index d2d7bd2e38..f4634982d0 100644 --- a/src/libxrpl/server/Manifest.cpp +++ b/src/libxrpl/server/Manifest.cpp @@ -1,43 +1,17 @@ -#include - -#include #include -#include #include #include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include #include -#include #include +#include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include namespace xrpl { @@ -289,10 +263,7 @@ loadValidatorToken(std::vector const& blob, beast::Journal journal) auto const key = strUnHex(k.asString()); if (key && key->size() == 32) - { - return ValidatorToken{ - .manifest = m.asString(), .validationSecret = makeSlice(*key)}; - } + return ValidatorToken{m.asString(), makeSlice(*key)}; } } diff --git a/src/libxrpl/server/Port.cpp b/src/libxrpl/server/Port.cpp index 99466446d6..2d0b4ec257 100644 --- a/src/libxrpl/server/Port.cpp +++ b/src/libxrpl/server/Port.cpp @@ -1,11 +1,10 @@ -#include - #include #include #include #include #include #include +#include #include #include @@ -18,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/src/libxrpl/server/State.cpp b/src/libxrpl/server/State.cpp index 3d2ed37e98..a7c0c0fca2 100644 --- a/src/libxrpl/server/State.cpp +++ b/src/libxrpl/server/State.cpp @@ -1,20 +1,5 @@ #include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include - namespace xrpl { void diff --git a/src/libxrpl/server/Vacuum.cpp b/src/libxrpl/server/Vacuum.cpp index d0e430ead9..80de45cf66 100644 --- a/src/libxrpl/server/Vacuum.cpp +++ b/src/libxrpl/server/Vacuum.cpp @@ -1,19 +1,8 @@ #include -#include -#include -#include -#include +#include -#include -#include -#include // IWYU pragma: keep - -#include - -#include #include -#include namespace xrpl { diff --git a/src/libxrpl/server/Wallet.cpp b/src/libxrpl/server/Wallet.cpp index 7906867654..8da934a921 100644 --- a/src/libxrpl/server/Wallet.cpp +++ b/src/libxrpl/server/Wallet.cpp @@ -1,37 +1,7 @@ +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -198,7 +168,7 @@ getPeerReservationTable(soci::session& session, beast::Journal j) JLOG(j.warn()) << "load: not a public key: " << valPubKey; continue; } - table.insert(PeerReservation{.nodeId = *optNodeId, .description = *valDesc}); + table.insert(PeerReservation{*optNodeId, *valDesc}); } return table; diff --git a/src/libxrpl/shamap/SHAMap.cpp b/src/libxrpl/shamap/SHAMap.cpp index b638efc383..505d20651e 100644 --- a/src/libxrpl/shamap/SHAMap.cpp +++ b/src/libxrpl/shamap/SHAMap.cpp @@ -1,43 +1,13 @@ -#include - -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include -#include -#include -#include // IWYU pragma: keep -#include +#include #include #include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include #include #include -#include #include #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { [[nodiscard]] intr_ptr::SharedPtr @@ -140,7 +110,7 @@ SHAMap::walkTowardsKey(uint256 const& id, SharedPtrNodeStack* stack) const while (inNode->isInner()) { if (stack != nullptr) - stack->emplace(inNode, nodeID); + stack->push({inNode, nodeID}); auto const inner = intr_ptr::static_pointer_cast(inNode); auto const branch = selectBranch(nodeID, id); @@ -152,7 +122,7 @@ SHAMap::walkTowardsKey(uint256 const& id, SharedPtrNodeStack* stack) const } if (stack != nullptr) - stack->emplace(inNode, nodeID); + stack->push({inNode, nodeID}); return safe_downcast(inNode.get()); } @@ -449,11 +419,11 @@ SHAMap::belowHelper( auto inner = intr_ptr::static_pointer_cast(node); if (stack.empty()) { - stack.emplace(inner, SHAMapNodeID{}); + stack.push({inner, SHAMapNodeID{}}); } else { - stack.emplace(inner, stack.top().second.getChildNodeID(branch)); + stack.push({inner, stack.top().second.getChildNodeID(branch)}); } for (int i = init; cmp(i);) { @@ -468,7 +438,7 @@ SHAMap::belowHelper( return n.get(); } inner = intr_ptr::static_pointer_cast(node); - stack.emplace(inner, stack.top().second.getChildNodeID(branch)); + stack.push({inner, stack.top().second.getChildNodeID(branch)}); i = init; // descend and reset loop } else @@ -813,7 +783,7 @@ SHAMap::addGiveItem(SHAMapNodeType type, boost::intrusive_ptr while ((b1 = selectBranch(nodeID, tag)) == (b2 = selectBranch(nodeID, otherItem->key()))) { - stack.emplace(node, nodeID); + stack.push({node, nodeID}); // we need a new inner node, since both go on same branch at this // level @@ -1115,7 +1085,7 @@ SHAMap::dump(bool hash) const JLOG(journal_.info()) << " MAP Contains"; std::stack> stack; - stack.emplace(root_.get(), SHAMapNodeID()); + stack.push({root_.get(), SHAMapNodeID()}); do { @@ -1141,7 +1111,7 @@ SHAMap::dump(bool hash) const XRPL_ASSERT( child->getHash() == inner->getChildHash(i), "xrpl::SHAMap::dump : child hash do match"); - stack.emplace(child, nodeID.getChildNodeID(i)); + stack.push({child, nodeID.getChildNodeID(i)}); } } } diff --git a/src/libxrpl/shamap/SHAMapDelta.cpp b/src/libxrpl/shamap/SHAMapDelta.cpp index d8162710be..ded57760f1 100644 --- a/src/libxrpl/shamap/SHAMapDelta.cpp +++ b/src/libxrpl/shamap/SHAMapDelta.cpp @@ -1,23 +1,10 @@ -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include +#include #include #include -#include #include -#include -#include -#include -#include - -#include #include -#include -#include #include -#include -#include #include namespace xrpl { @@ -143,7 +130,7 @@ SHAMap::compare(SHAMap const& otherMap, Delta& differences, int maxCount) const using StackEntry = std::pair; std::stack> nodeStack; // track nodes we've pushed - nodeStack.emplace(root_.get(), otherMap.root_.get()); + nodeStack.push({root_.get(), otherMap.root_.get()}); while (!nodeStack.empty()) { auto [ourNode, otherNode] = nodeStack.top(); @@ -225,7 +212,7 @@ SHAMap::compare(SHAMap const& otherMap, Delta& differences, int maxCount) const } else { // The two trees have different non-empty branches - nodeStack.emplace(descendThrow(ours, i), otherMap.descendThrow(other, i)); + nodeStack.push({descendThrow(ours, i), otherMap.descendThrow(other, i)}); } } } @@ -315,50 +302,52 @@ SHAMap::walkMapParallel(std::vector& missingNodes, int maxMis nodeStacks[rootChildIndex].push(intr_ptr::static_pointer_cast(child)); JLOG(journal_.debug()) << "starting worker " << rootChildIndex; - workers.emplace_back( - [&m, &missingNodes, &maxMissing, &exceptions, this]( - std::stack> nodeStack) { - try - { - while (!nodeStack.empty()) + workers.push_back( + std::thread( + [&m, &missingNodes, &maxMissing, &exceptions, this]( + std::stack> nodeStack) { + try { - intr_ptr::SharedPtr const node = - std::move(nodeStack.top()); - XRPL_ASSERT(node, "xrpl::SHAMap::walkMapParallel : non-null node"); - nodeStack.pop(); - - for (int i = 0; i < 16; ++i) + while (!nodeStack.empty()) { - if (node->isEmptyBranch(i)) - continue; - intr_ptr::SharedPtr const nextNode = - descendNoStore(*node, i); + intr_ptr::SharedPtr const node = + std::move(nodeStack.top()); + XRPL_ASSERT(node, "xrpl::SHAMap::walkMapParallel : non-null node"); + nodeStack.pop(); - if (nextNode) + for (int i = 0; i < 16; ++i) { - if (nextNode->isInner()) + if (node->isEmptyBranch(i)) + continue; + intr_ptr::SharedPtr const nextNode = + descendNoStore(*node, i); + + if (nextNode) { - nodeStack.push( - intr_ptr::static_pointer_cast(nextNode)); + if (nextNode->isInner()) + { + nodeStack.push( + intr_ptr::static_pointer_cast( + nextNode)); + } + } + else + { + std::lock_guard const l{m}; + missingNodes.emplace_back(type_, node->getChildHash(i)); + if (--maxMissing <= 0) + return; } - } - else - { - std::lock_guard const l{m}; - missingNodes.emplace_back(type_, node->getChildHash(i)); - if (--maxMissing <= 0) - return; } } } - } - catch (SHAMapMissingNode const& e) - { - std::lock_guard const l(m); - exceptions.push_back(e); - } - }, - std::move(nodeStacks[rootChildIndex])); + catch (SHAMapMissingNode const& e) + { + std::lock_guard const l(m); + exceptions.push_back(e); + } + }, + std::move(nodeStacks[rootChildIndex]))); } for (std::thread& worker : workers) diff --git a/src/libxrpl/shamap/SHAMapInnerNode.cpp b/src/libxrpl/shamap/SHAMapInnerNode.cpp index e501561ee4..91249d139e 100644 --- a/src/libxrpl/shamap/SHAMapInnerNode.cpp +++ b/src/libxrpl/shamap/SHAMapInnerNode.cpp @@ -1,30 +1,13 @@ -#include - -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include +#include #include -#include #include #include -#include #include -#include #include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { SHAMapInnerNode::SHAMapInnerNode(std::uint32_t cowid, std::uint8_t numAllocatedChildren) diff --git a/src/libxrpl/shamap/SHAMapLeafNode.cpp b/src/libxrpl/shamap/SHAMapLeafNode.cpp index 58646503aa..3776de3a35 100644 --- a/src/libxrpl/shamap/SHAMapLeafNode.cpp +++ b/src/libxrpl/shamap/SHAMapLeafNode.cpp @@ -1,18 +1,5 @@ #include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - namespace xrpl { SHAMapLeafNode::SHAMapLeafNode(boost::intrusive_ptr item, std::uint32_t cowid) diff --git a/src/libxrpl/shamap/SHAMapNodeID.cpp b/src/libxrpl/shamap/SHAMapNodeID.cpp index c2d93f20ee..e5dbebc871 100644 --- a/src/libxrpl/shamap/SHAMapNodeID.cpp +++ b/src/libxrpl/shamap/SHAMapNodeID.cpp @@ -1,15 +1,8 @@ -#include - -#include -#include +#include #include #include #include - -#include -#include -#include -#include +#include namespace xrpl { diff --git a/src/libxrpl/shamap/SHAMapSync.cpp b/src/libxrpl/shamap/SHAMapSync.cpp index e7f3447642..2074b43cb4 100644 --- a/src/libxrpl/shamap/SHAMapSync.cpp +++ b/src/libxrpl/shamap/SHAMapSync.cpp @@ -1,33 +1,8 @@ -#include -#include -#include -#include -#include #include #include -#include -#include #include -#include -#include -#include #include -#include #include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -83,7 +58,7 @@ SHAMap::visitNodes(std::function const& function) const if (pos != 15) { // save next position to resume at - stack.emplace(pos + 1, std::move(node)); + stack.push(std::make_pair(pos + 1, std::move(node))); } // descend to the child's first position @@ -132,7 +107,7 @@ SHAMap::visitDifferences( using StackEntry = std::pair; std::stack> stack; - stack.emplace(safe_downcast(root_.get()), SHAMapNodeID{}); + stack.push({safe_downcast(root_.get()), SHAMapNodeID{}}); while (!stack.empty()) { @@ -155,7 +130,7 @@ SHAMap::visitDifferences( if (next->isInner()) { if ((have == nullptr) || !have->hasInnerNode(childID, childHash)) - stack.emplace(safe_downcast(next), childID); + stack.push({safe_downcast(next), childID}); } else if ( (have == nullptr) || @@ -387,7 +362,7 @@ SHAMap::getMissingNodes(int max, SHAMapSyncFilter* filter) for (auto const& [innerNode, nodeId] : mn.resumes_) { if (!innerNode->isFullBelow(mn.generation_)) - mn.stack_.emplace(innerNode, nodeId, rand_int(255), 0, true); + mn.stack_.push(std::make_tuple(innerNode, nodeId, rand_int(255), 0, true)); } mn.resumes_.clear(); @@ -463,7 +438,7 @@ SHAMap::getNodeFat( // Add this node to the reply s.erase(); node->serializeForWire(s); - data.emplace_back(nodeID, s.getData()); + data.emplace_back(std::make_pair(nodeID, s.getData())); if (node->isInner()) { @@ -493,7 +468,7 @@ SHAMap::getNodeFat( // Just include this node s.erase(); childNode->serializeForWire(s); - data.emplace_back(childID, s.getData()); + data.emplace_back(std::make_pair(childID, s.getData())); } } } @@ -661,7 +636,7 @@ SHAMap::deepCompare(SHAMap& other) const // Intended for debug/test only std::stack> stack; - stack.emplace(root_.get(), other.root_.get()); + stack.push({root_.get(), other.root_.get()}); while (!stack.empty()) { @@ -715,7 +690,7 @@ SHAMap::deepCompare(SHAMap& other) const JLOG(journal_.warn()) << "unable to fetch inner node"; return false; } - stack.emplace(next, otherNext); + stack.push({next, otherNext}); } } } diff --git a/src/libxrpl/shamap/SHAMapTreeNode.cpp b/src/libxrpl/shamap/SHAMapTreeNode.cpp index 6fc7bd81e4..9497b4dc54 100644 --- a/src/libxrpl/shamap/SHAMapTreeNode.cpp +++ b/src/libxrpl/shamap/SHAMapTreeNode.cpp @@ -1,28 +1,15 @@ -#include - -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include +#include #include -#include #include #include #include -#include #include #include #include -#include -#include +#include #include #include -#include -#include -#include -#include -#include - namespace xrpl { intr_ptr::SharedPtr diff --git a/src/libxrpl/tx/ApplyContext.cpp b/src/libxrpl/tx/ApplyContext.cpp index fa17574616..d503643662 100644 --- a/src/libxrpl/tx/ApplyContext.cpp +++ b/src/libxrpl/tx/ApplyContext.cpp @@ -1,28 +1,10 @@ #include - +// #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { ApplyContext::ApplyContext( @@ -122,7 +104,7 @@ ApplyContext::checkInvariantsHelper( // call each check's finalizer to see that it passes if (!std::all_of(finalizers.cbegin(), finalizers.cend(), [](auto const& b) { return b; })) { - JLOG(journal.fatal()) << "Transaction has failed one or more global invariants: " + JLOG(journal.fatal()) << "Transaction has failed one or more invariants: " << to_string(tx.getJson(JsonOptions::none)); return failInvariantCheck(result); @@ -130,7 +112,7 @@ ApplyContext::checkInvariantsHelper( } catch (std::exception const& ex) { - JLOG(journal.fatal()) << "Transaction caused an exception in a global invariant" + JLOG(journal.fatal()) << "Transaction caused an exception in an invariant" << ", ex: " << ex.what() << ", tx: " << to_string(tx.getJson(JsonOptions::none)); @@ -148,7 +130,7 @@ ApplyContext::checkInvariants(TER const result, XRPAmount const fee) "xrpl::ApplyContext::checkInvariants : is tesSUCCESS or tecCLAIM"); return checkInvariantsHelper( - result, fee, std::make_index_sequence>{}); + result, fee, std::make_index_sequence::value>{}); } } // namespace xrpl diff --git a/src/libxrpl/tx/SignerEntries.cpp b/src/libxrpl/tx/SignerEntries.cpp index a1883024d9..75659a7f04 100644 --- a/src/libxrpl/tx/SignerEntries.cpp +++ b/src/libxrpl/tx/SignerEntries.cpp @@ -1,20 +1,11 @@ -#include - -#include #include -#include -#include -#include -#include #include #include #include -#include +#include #include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/Transactor.cpp b/src/libxrpl/tx/Transactor.cpp index 9791ee4c9b..5010763afd 100644 --- a/src/libxrpl/tx/Transactor.cpp +++ b/src/libxrpl/tx/Transactor.cpp @@ -1,54 +1,23 @@ -#include - -#include -#include -#include -#include #include -#include -#include #include -#include -#include // IWYU pragma: keep -#include -#include +#include +#include #include #include #include #include #include #include -#include #include -#include #include -#include #include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep #include -#include #include -#include -#include +#include #include -#include #include +#include #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -1119,59 +1088,6 @@ Transactor::trapTransaction(uint256 txHash) const JLOG(j_.debug()) << "Transaction trapped: " << txHash; } -[[nodiscard]] TER -Transactor::checkTransactionInvariants(TER result, XRPAmount fee) -{ - try - { - // Phase 1: visit modified entries - ctx_.visit( - [this](uint256 const&, bool isDelete, SLE::const_ref before, SLE::const_ref after) { - this->visitInvariantEntry(isDelete, before, after); - }); - - // Phase 2: finalize - if (!this->finalizeInvariants(ctx_.tx, result, fee, ctx_.view(), ctx_.journal)) - { - JLOG(ctx_.journal.fatal()) << // - "Transaction has failed one or more transaction invariants, tx: " << // - to_string(ctx_.tx.getJson(JsonOptions::none)); - return tecINVARIANT_FAILED; - } - } - catch (std::exception const& ex) - { - JLOG(ctx_.journal.fatal()) << // - "Exception while checking transaction invariants: " << // - ex.what() << // - ", tx: " << // - to_string(ctx_.tx.getJson(JsonOptions::none)); - - return tecINVARIANT_FAILED; - } - - return result; -} - -[[nodiscard]] TER -Transactor::checkInvariants(TER result, XRPAmount fee) -{ - // Transaction invariants first (more specific). These check post-conditions of the specific - // transaction. If these fail, the transaction's core logic is wrong. - auto const txResult = checkTransactionInvariants(result, fee); - - // Protocol invariants second (broader). These check properties that must hold regardless of - // transaction type. - auto const protoResult = ctx_.checkInvariants(result, fee); - - // Fail if either check failed. tef (fatal) takes priority over tec. - if (protoResult == tefINVARIANT_FAILED) - return tefINVARIANT_FAILED; - if (txResult == tecINVARIANT_FAILED || protoResult == tecINVARIANT_FAILED) - return tecINVARIANT_FAILED; - - return result; -} //------------------------------------------------------------------------------ ApplyResult Transactor::operator()() @@ -1348,20 +1264,20 @@ Transactor::operator()() { // Check invariants: if `tecINVARIANT_FAILED` is not returned, we can // proceed to apply the tx - result = checkInvariants(result, fee); + result = ctx_.checkInvariants(result, fee); + if (result == tecINVARIANT_FAILED) { - // Reset to fee-claim only + // if invariants checking failed again, reset the context and + // attempt to only claim a fee. auto const resetResult = reset(fee); if (!isTesSuccess(resetResult.first)) result = resetResult.first; fee = resetResult.second; - // Check invariants again to ensure the fee claiming doesn't violate - // invariants. After reset, only protocol invariants are re-checked. - // Transaction invariants are not meaningful here — the transaction's - // effects have been rolled back. + // Check invariants again to ensure the fee claiming doesn't + // violate invariants. if (isTesSuccess(result) || isTecClaim(result)) result = ctx_.checkInvariants(result, fee); } diff --git a/src/libxrpl/tx/apply.cpp b/src/libxrpl/tx/apply.cpp index 65c9649035..c8016002c2 100644 --- a/src/libxrpl/tx/apply.cpp +++ b/src/libxrpl/tx/apply.cpp @@ -1,28 +1,11 @@ -#include - #include -#include -#include -#include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include +#include #include -#include -#include -#include - namespace xrpl { // These are the same flags defined as HashRouterFlags::PRIVATE1-4 in diff --git a/src/libxrpl/tx/applySteps.cpp b/src/libxrpl/tx/applySteps.cpp index eb058e5ca6..b688377541 100644 --- a/src/libxrpl/tx/applySteps.cpp +++ b/src/libxrpl/tx/applySteps.cpp @@ -1,27 +1,4 @@ #include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include #pragma push_macro("TRANSACTION") #undef TRANSACTION @@ -40,6 +17,8 @@ #include #include +#include + namespace xrpl { namespace { @@ -313,18 +292,6 @@ invoke_apply(ApplyContext& ctx) } } -// Test-only factory — not part of the public API. -// The returned Transactor holds a raw reference to ctx; the caller must ensure -// the ApplyContext outlives the Transactor. -std::unique_ptr -makeTransactor(ApplyContext& ctx) -{ - return with_txn_type( - ctx.view().rules(), ctx.tx.getTxnType(), [&]() -> std::unique_ptr { - return std::make_unique(ctx); - }); -} - PreflightResult preflight( ServiceRegistry& registry, diff --git a/src/libxrpl/tx/invariants/AMMInvariant.cpp b/src/libxrpl/tx/invariants/AMMInvariant.cpp index 3cc888dea2..35fd356918 100644 --- a/src/libxrpl/tx/invariants/AMMInvariant.cpp +++ b/src/libxrpl/tx/invariants/AMMInvariant.cpp @@ -1,26 +1,9 @@ #include - +// #include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include - -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/invariants/FreezeInvariant.cpp b/src/libxrpl/tx/invariants/FreezeInvariant.cpp index bf9ef81396..e6be7c5e82 100644 --- a/src/libxrpl/tx/invariants/FreezeInvariant.cpp +++ b/src/libxrpl/tx/invariants/FreezeInvariant.cpp @@ -1,24 +1,11 @@ #include - +// #include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include - namespace xrpl { void @@ -188,14 +175,10 @@ TransfersNotFrozen::recordBalanceChanges( auto const currency = after->at(sfBalance).get().currency; // Change from low account's perspective, which is trust line default - recordBalance( - {currency, after->at(sfHighLimit).getIssuer()}, - {.line = after, .balanceChangeSign = balanceChangeSign}); + recordBalance({currency, after->at(sfHighLimit).getIssuer()}, {after, balanceChangeSign}); // Change from high account's perspective, which reverses the sign. - recordBalance( - {currency, after->at(sfLowLimit).getIssuer()}, - {.line = after, .balanceChangeSign = -balanceChangeSign}); + recordBalance({currency, after->at(sfLowLimit).getIssuer()}, {after, -balanceChangeSign}); } std::shared_ptr diff --git a/src/libxrpl/tx/invariants/InvariantCheck.cpp b/src/libxrpl/tx/invariants/InvariantCheck.cpp index f2570d14e8..1d6756eaca 100644 --- a/src/libxrpl/tx/invariants/InvariantCheck.cpp +++ b/src/libxrpl/tx/invariants/InvariantCheck.cpp @@ -1,40 +1,22 @@ #include - +// #include -#include -#include -#include #include -#include +#include #include -#include -#include +#include #include #include -#include -#include #include -#include -#include #include #include -#include -#include // IWYU pragma: keep -#include +#include #include -#include #include -#include -#include #include -#include #include -#include -#include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/invariants/LoanBrokerInvariant.cpp b/src/libxrpl/tx/invariants/LoanBrokerInvariant.cpp index b72f821f50..8ee0a0deb8 100644 --- a/src/libxrpl/tx/invariants/LoanBrokerInvariant.cpp +++ b/src/libxrpl/tx/invariants/LoanBrokerInvariant.cpp @@ -1,21 +1,13 @@ #include - +// #include -#include -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include // IWYU pragma: keep -#include -#include +#include #include -#include - -#include namespace xrpl { diff --git a/src/libxrpl/tx/invariants/LoanInvariant.cpp b/src/libxrpl/tx/invariants/LoanInvariant.cpp index 7aea36296e..6ce1261612 100644 --- a/src/libxrpl/tx/invariants/LoanInvariant.cpp +++ b/src/libxrpl/tx/invariants/LoanInvariant.cpp @@ -1,18 +1,9 @@ #include - +// #include -#include -#include -#include +#include #include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include - -#include +#include namespace xrpl { diff --git a/src/libxrpl/tx/invariants/MPTInvariant.cpp b/src/libxrpl/tx/invariants/MPTInvariant.cpp index 229f5572c0..29a9204d7d 100644 --- a/src/libxrpl/tx/invariants/MPTInvariant.cpp +++ b/src/libxrpl/tx/invariants/MPTInvariant.cpp @@ -1,29 +1,16 @@ #include - +// #include -#include -#include -#include #include -#include #include #include #include -#include #include -#include -#include -#include -#include -#include #include -#include #include #include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/invariants/NFTInvariant.cpp b/src/libxrpl/tx/invariants/NFTInvariant.cpp index 90511b6d04..e37e55e709 100644 --- a/src/libxrpl/tx/invariants/NFTInvariant.cpp +++ b/src/libxrpl/tx/invariants/NFTInvariant.cpp @@ -1,28 +1,14 @@ #include - +// #include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include #include +#include #include -#include -#include -#include - namespace xrpl { void diff --git a/src/libxrpl/tx/invariants/PermissionedDEXInvariant.cpp b/src/libxrpl/tx/invariants/PermissionedDEXInvariant.cpp index 6466812743..e932a6ba09 100644 --- a/src/libxrpl/tx/invariants/PermissionedDEXInvariant.cpp +++ b/src/libxrpl/tx/invariants/PermissionedDEXInvariant.cpp @@ -1,20 +1,11 @@ #include - +// #include -#include -#include -#include +#include #include #include -#include #include -#include -#include -#include #include -#include - -#include namespace xrpl { @@ -41,17 +32,11 @@ ValidPermissionedDEX::visitEntry( regularOffers_ = true; } - // pre-fixSecurity3_1_3: hybrid offer missing domain, missing - // sfAdditionalBooks, or sfAdditionalBooks has more than one entry + // if a hybrid offer is missing domain or additional book, there's + // something wrong if (after->isFlag(lsfHybrid) && (!after->isFieldPresent(sfDomainID) || !after->isFieldPresent(sfAdditionalBooks) || after->getFieldArray(sfAdditionalBooks).size() > 1)) - badHybridsOld_ = true; - - // post-fixSecurity3_1_3: same as above but also catches size == 0 - if (after->isFlag(lsfHybrid) && - (!after->isFieldPresent(sfDomainID) || !after->isFieldPresent(sfAdditionalBooks) || - after->getFieldArray(sfAdditionalBooks).size() != 1)) badHybrids_ = true; } } @@ -70,8 +55,7 @@ ValidPermissionedDEX::finalize( // For each offercreate transaction, check if // permissioned offers are valid - bool const isMalformed = view.rules().enabled(fixSecurity3_1_3) ? badHybrids_ : badHybridsOld_; - if (txType == ttOFFER_CREATE && isMalformed) + if (txType == ttOFFER_CREATE && badHybrids_) { JLOG(j.fatal()) << "Invariant failed: hybrid offer is malformed"; return false; diff --git a/src/libxrpl/tx/invariants/PermissionedDomainInvariant.cpp b/src/libxrpl/tx/invariants/PermissionedDomainInvariant.cpp index 3c6f67a8d6..7365fc7b1a 100644 --- a/src/libxrpl/tx/invariants/PermissionedDomainInvariant.cpp +++ b/src/libxrpl/tx/invariants/PermissionedDomainInvariant.cpp @@ -1,22 +1,10 @@ #include - -#include -#include -#include +// +#include #include #include -#include -#include -#include #include -#include -#include -#include #include -#include - -#include -#include namespace xrpl { @@ -35,11 +23,7 @@ ValidPermissionedDomain::visitEntry( auto const& credentials = sle->getFieldArray(sfAcceptedCredentials); auto const sorted = credentials::makeSorted(credentials); - SleStatus ss{ - .credentialsSize_ = credentials.size(), - .isSorted_ = false, - .isUnique_ = !sorted.empty(), - .isDelete_ = isDel}; + SleStatus ss{credentials.size(), false, !sorted.empty(), isDel}; // If array have duplicates then all the other checks are invalid if (ss.isUnique_) diff --git a/src/libxrpl/tx/invariants/VaultInvariant.cpp b/src/libxrpl/tx/invariants/VaultInvariant.cpp index c0d082e14e..c6b3295569 100644 --- a/src/libxrpl/tx/invariants/VaultInvariant.cpp +++ b/src/libxrpl/tx/invariants/VaultInvariant.cpp @@ -1,33 +1,18 @@ #include - +// #include -#include -#include #include -#include +#include #include #include #include -#include #include #include #include -#include -#include -#include // IWYU pragma: keep -#include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include - namespace xrpl { ValidVault::Vault @@ -76,12 +61,10 @@ ValidVault::visitEntry( "xrpl::ValidVault::visitEntry : some object is available"); // Number balanceDelta will capture the difference (delta) between "before" - // state (zero if created) and "after" state (zero if destroyed), and - // preserves value scale (exponent) to round values to the same scale during - // validation. It is used to validate that the change in account - // balances matches the change in vault balances, stored to deltas_ at the - // end of this function. - DeltaInfo balanceDelta{.delta = numZero, .scale = std::nullopt}; + // state (zero if created) and "after" state (zero if destroyed), so the + // invariants can validate that the change in account balances matches the + // change in vault balances, stored to deltas_ at the end of this function. + Number balanceDelta{}; std::int8_t sign = 0; if (before) @@ -95,34 +78,18 @@ ValidVault::visitEntry( // At this moment we have no way of telling if this object holds // vault shares or something else. Save it for finalize. beforeMPTs_.push_back(Shares::make(*before)); - balanceDelta.delta = - static_cast(before->getFieldU64(sfOutstandingAmount)); - // MPTs are ints, so the scale is always 0. - balanceDelta.scale = 0; + balanceDelta = static_cast(before->getFieldU64(sfOutstandingAmount)); sign = 1; break; case ltMPTOKEN: - balanceDelta.delta = static_cast(before->getFieldU64(sfMPTAmount)); - // MPTs are ints, so the scale is always 0. - balanceDelta.scale = 0; + balanceDelta = static_cast(before->getFieldU64(sfMPTAmount)); sign = -1; break; case ltACCOUNT_ROOT: - balanceDelta.delta = before->getFieldAmount(sfBalance); - // Account balance is XRP, which is an int, so the scale is - // always 0. - balanceDelta.scale = 0; + case ltRIPPLE_STATE: + balanceDelta = before->getFieldAmount(sfBalance); sign = -1; break; - case ltRIPPLE_STATE: { - auto const amount = before->getFieldAmount(sfBalance); - balanceDelta.delta = amount; - // Trust Line balances are STAmounts, so we can use the exponent - // directly to get the scale. - balanceDelta.scale = amount.exponent(); - sign = -1; - break; - } default:; } } @@ -138,36 +105,19 @@ ValidVault::visitEntry( // At this moment we have no way of telling if this object holds // vault shares or something else. Save it for finalize. afterMPTs_.push_back(Shares::make(*after)); - balanceDelta.delta -= + balanceDelta -= Number(static_cast(after->getFieldU64(sfOutstandingAmount))); - // MPTs are ints, so the scale is always 0. - balanceDelta.scale = 0; sign = 1; break; case ltMPTOKEN: - balanceDelta.delta -= - Number(static_cast(after->getFieldU64(sfMPTAmount))); - // MPTs are ints, so the scale is always 0. - balanceDelta.scale = 0; + balanceDelta -= Number(static_cast(after->getFieldU64(sfMPTAmount))); sign = -1; break; case ltACCOUNT_ROOT: - balanceDelta.delta -= Number(after->getFieldAmount(sfBalance)); - // Account balance is XRP, which is an int, so the scale is - // always 0. - balanceDelta.scale = 0; + case ltRIPPLE_STATE: + balanceDelta -= Number(after->getFieldAmount(sfBalance)); sign = -1; break; - case ltRIPPLE_STATE: { - auto const amount = after->getFieldAmount(sfBalance); - balanceDelta.delta -= Number(amount); - // Trust Line balances are STAmounts, so we can use the exponent - // directly to get the scale. - if (amount.exponent() > balanceDelta.scale) - balanceDelta.scale = amount.exponent(); - sign = -1; - break; - } default:; } } @@ -179,11 +129,7 @@ ValidVault::visitEntry( // transferred to the account. We intentionally do not compare balanceDelta // against zero, to avoid missing such updates. if (sign != 0) - { - XRPL_ASSERT_PARTS(balanceDelta.scale, "xrpl::ValidVault::visitEntry", "scale initialized"); - balanceDelta.delta *= sign; - deltas_[key] = balanceDelta; - } + deltas_[key] = balanceDelta * sign; } bool @@ -445,13 +391,13 @@ ValidVault::finalize( } auto const& vaultAsset = afterVault.asset; - auto const deltaAssets = [&](AccountID const& id) -> std::optional { + auto const deltaAssets = [&](AccountID const& id) -> std::optional { auto const get = // - [&](auto const& it, std::int8_t sign = 1) -> std::optional { + [&](auto const& it, std::int8_t sign = 1) -> std::optional { if (it == deltas_.end()) return std::nullopt; - return DeltaInfo{it->second.delta * sign, it->second.scale}; + return it->second * sign; }; return std::visit( @@ -470,7 +416,7 @@ ValidVault::finalize( }, vaultAsset.value()); }; - auto const deltaAssetsTxAccount = [&]() -> std::optional { + auto const deltaAssetsTxAccount = [&]() -> std::optional { auto ret = deltaAssets(tx[sfAccount]); // Nothing returned or not XRP transaction if (!ret.has_value() || !vaultAsset.native()) @@ -481,20 +427,20 @@ ValidVault::finalize( delegate.has_value() && *delegate != tx[sfAccount]) return ret; - ret->delta += fee.drops(); - if (ret->delta == zero) + *ret += fee.drops(); + if (*ret == zero) return std::nullopt; return ret; }; - auto const deltaShares = [&](AccountID const& id) -> std::optional { + auto const deltaShares = [&](AccountID const& id) -> std::optional { auto const it = [&]() { if (id == afterVault.pseudoId) return deltas_.find(keylet::mptIssuance(afterVault.shareMPTID).key); return deltas_.find(keylet::mptoken(afterVault.shareMPTID, id).key); }(); - return it != deltas_.end() ? std::optional(it->second) : std::nullopt; + return it != deltas_.end() ? std::optional(it->second) : std::nullopt; }; auto const vaultHoldsNoAssets = [&](Vault const& vault) { @@ -621,30 +567,16 @@ ValidVault::finalize( !beforeVault_.empty(), "xrpl::ValidVault::finalize : deposit updated a vault"); auto const& beforeVault = beforeVault_[0]; - auto const maybeVaultDeltaAssets = deltaAssets(afterVault.pseudoId); - if (!maybeVaultDeltaAssets) + auto const vaultDeltaAssets = deltaAssets(afterVault.pseudoId); + + if (!vaultDeltaAssets) { JLOG(j.fatal()) << // "Invariant failed: deposit must change vault balance"; return false; // That's all we can do } - // Get the coarsest scale to round calculations to - auto const totalDelta = DeltaInfo::makeDelta( - beforeVault.assetsTotal, afterVault.assetsTotal, vaultAsset); - auto const availableDelta = DeltaInfo::makeDelta( - beforeVault.assetsAvailable, afterVault.assetsAvailable, vaultAsset); - auto const minScale = computeCoarsestScale({ - *maybeVaultDeltaAssets, - totalDelta, - availableDelta, - }); - - auto const vaultDeltaAssets = - roundToAsset(vaultAsset, maybeVaultDeltaAssets->delta, minScale); - auto const txAmount = roundToAsset(vaultAsset, tx[sfAmount], minScale); - - if (vaultDeltaAssets > txAmount) + if (*vaultDeltaAssets > tx[sfAmount]) { JLOG(j.fatal()) << // "Invariant failed: deposit must not change vault " @@ -652,7 +584,7 @@ ValidVault::finalize( result = false; } - if (vaultDeltaAssets <= zero) + if (*vaultDeltaAssets <= zero) { JLOG(j.fatal()) << // "Invariant failed: deposit must increase vault balance"; @@ -669,23 +601,16 @@ ValidVault::finalize( if (!issuerDeposit) { - auto const maybeAccDeltaAssets = deltaAssetsTxAccount(); - if (!maybeAccDeltaAssets) + auto const accountDeltaAssets = deltaAssetsTxAccount(); + if (!accountDeltaAssets) { JLOG(j.fatal()) << // "Invariant failed: deposit must change depositor " "balance"; return false; } - auto const localMinScale = - std::max(minScale, computeCoarsestScale({*maybeAccDeltaAssets})); - auto const accountDeltaAssets = - roundToAsset(vaultAsset, maybeAccDeltaAssets->delta, localMinScale); - auto const localVaultDeltaAssets = - roundToAsset(vaultAsset, vaultDeltaAssets, localMinScale); - - if (accountDeltaAssets >= zero) + if (*accountDeltaAssets >= zero) { JLOG(j.fatal()) << // "Invariant failed: deposit must decrease depositor " @@ -693,7 +618,7 @@ ValidVault::finalize( result = false; } - if (localVaultDeltaAssets * -1 != accountDeltaAssets) + if (*accountDeltaAssets * -1 != *vaultDeltaAssets) { JLOG(j.fatal()) << // "Invariant failed: deposit must change vault and " @@ -711,17 +636,16 @@ ValidVault::finalize( result = false; } - auto const maybeAccDeltaShares = deltaShares(tx[sfAccount]); - if (!maybeAccDeltaShares) + auto const accountDeltaShares = deltaShares(tx[sfAccount]); + if (!accountDeltaShares) { JLOG(j.fatal()) << // "Invariant failed: deposit must change depositor " "shares"; return false; // That's all we can do } - // We don't need to round shares, they are integral MPT - auto const& accountDeltaShares = *maybeAccDeltaShares; - if (accountDeltaShares.delta <= zero) + + if (*accountDeltaShares <= zero) { JLOG(j.fatal()) << // "Invariant failed: deposit must increase depositor " @@ -729,17 +653,15 @@ ValidVault::finalize( result = false; } - auto const maybeVaultDeltaShares = deltaShares(afterVault.pseudoId); - if (!maybeVaultDeltaShares || maybeVaultDeltaShares->delta == zero) + auto const vaultDeltaShares = deltaShares(afterVault.pseudoId); + if (!vaultDeltaShares || *vaultDeltaShares == zero) { JLOG(j.fatal()) << // "Invariant failed: deposit must change vault shares"; return false; // That's all we can do } - // We don't need to round shares, they are integral MPT - auto const& vaultDeltaShares = *maybeVaultDeltaShares; - if (vaultDeltaShares.delta * -1 != accountDeltaShares.delta) + if (*vaultDeltaShares * -1 != *accountDeltaShares) { JLOG(j.fatal()) << // "Invariant failed: deposit must change depositor and " @@ -747,18 +669,13 @@ ValidVault::finalize( result = false; } - auto const assetTotalDelta = roundToAsset( - vaultAsset, afterVault.assetsTotal - beforeVault.assetsTotal, minScale); - if (assetTotalDelta != vaultDeltaAssets) + if (beforeVault.assetsTotal + *vaultDeltaAssets != afterVault.assetsTotal) { JLOG(j.fatal()) << "Invariant failed: deposit and assets " "outstanding must add up"; result = false; } - - auto const assetAvailableDelta = roundToAsset( - vaultAsset, afterVault.assetsAvailable - beforeVault.assetsAvailable, minScale); - if (assetAvailableDelta != vaultDeltaAssets) + if (beforeVault.assetsAvailable + *vaultDeltaAssets != afterVault.assetsAvailable) { JLOG(j.fatal()) << "Invariant failed: deposit and assets " "available must add up"; @@ -776,27 +693,16 @@ ValidVault::finalize( "vault"); auto const& beforeVault = beforeVault_[0]; - auto const maybeVaultDeltaAssets = deltaAssets(afterVault.pseudoId); + auto const vaultDeltaAssets = deltaAssets(afterVault.pseudoId); - if (!maybeVaultDeltaAssets) + if (!vaultDeltaAssets) { JLOG(j.fatal()) << "Invariant failed: withdrawal must " "change vault balance"; return false; // That's all we can do } - // Get the most coarse scale to round calculations to - auto const totalDelta = DeltaInfo::makeDelta( - beforeVault.assetsTotal, afterVault.assetsTotal, vaultAsset); - auto const availableDelta = DeltaInfo::makeDelta( - beforeVault.assetsAvailable, afterVault.assetsAvailable, vaultAsset); - auto const minScale = - computeCoarsestScale({*maybeVaultDeltaAssets, totalDelta, availableDelta}); - - auto const vaultPseudoDeltaAssets = - roundToAsset(vaultAsset, maybeVaultDeltaAssets->delta, minScale); - - if (vaultPseudoDeltaAssets >= zero) + if (*vaultDeltaAssets >= zero) { JLOG(j.fatal()) << "Invariant failed: withdrawal must " "decrease vault balance"; @@ -814,15 +720,15 @@ ValidVault::finalize( if (!issuerWithdrawal) { - auto const maybeAccDelta = deltaAssetsTxAccount(); - auto const maybeOtherAccDelta = [&]() -> std::optional { + auto const accountDeltaAssets = deltaAssetsTxAccount(); + auto const otherAccountDelta = [&]() -> std::optional { if (auto const destination = tx[~sfDestination]; destination && *destination != tx[sfAccount]) return deltaAssets(*destination); return std::nullopt; }(); - if (maybeAccDelta.has_value() == maybeOtherAccDelta.has_value()) + if (accountDeltaAssets.has_value() == otherAccountDelta.has_value()) { JLOG(j.fatal()) << // "Invariant failed: withdrawal must change one " @@ -831,17 +737,9 @@ ValidVault::finalize( } auto const destinationDelta = // - maybeAccDelta ? *maybeAccDelta : *maybeOtherAccDelta; + accountDeltaAssets ? *accountDeltaAssets : *otherAccountDelta; - // the scale of destinationDelta can be coarser than - // minScale, so we take that into account when rounding - auto const localMinScale = - std::max(minScale, computeCoarsestScale({destinationDelta})); - - auto const roundedDestinationDelta = - roundToAsset(vaultAsset, destinationDelta.delta, localMinScale); - - if (roundedDestinationDelta <= zero) + if (destinationDelta <= zero) { JLOG(j.fatal()) << // "Invariant failed: withdrawal must increase " @@ -849,9 +747,7 @@ ValidVault::finalize( result = false; } - auto const localPseudoDeltaAssets = - roundToAsset(vaultAsset, vaultPseudoDeltaAssets, localMinScale); - if (localPseudoDeltaAssets * -1 != roundedDestinationDelta) + if (*vaultDeltaAssets * -1 != destinationDelta) { JLOG(j.fatal()) << // "Invariant failed: withdrawal must change vault " @@ -860,7 +756,6 @@ ValidVault::finalize( } } - // We don't need to round shares, they are integral MPT auto const accountDeltaShares = deltaShares(tx[sfAccount]); if (!accountDeltaShares) { @@ -870,7 +765,7 @@ ValidVault::finalize( return false; } - if (accountDeltaShares->delta >= zero) + if (*accountDeltaShares >= zero) { JLOG(j.fatal()) << // "Invariant failed: withdrawal must decrease depositor " @@ -878,16 +773,15 @@ ValidVault::finalize( result = false; } - // We don't need to round shares, they are integral MPT auto const vaultDeltaShares = deltaShares(afterVault.pseudoId); - if (!vaultDeltaShares || vaultDeltaShares->delta == zero) + if (!vaultDeltaShares || *vaultDeltaShares == zero) { JLOG(j.fatal()) << // "Invariant failed: withdrawal must change vault shares"; return false; // That's all we can do } - if (vaultDeltaShares->delta * -1 != accountDeltaShares->delta) + if (*vaultDeltaShares * -1 != *accountDeltaShares) { JLOG(j.fatal()) << // "Invariant failed: withdrawal must change depositor " @@ -895,20 +789,15 @@ ValidVault::finalize( result = false; } - auto const assetTotalDelta = roundToAsset( - vaultAsset, afterVault.assetsTotal - beforeVault.assetsTotal, minScale); // Note, vaultBalance is negative (see check above) - if (assetTotalDelta != vaultPseudoDeltaAssets) + if (beforeVault.assetsTotal + *vaultDeltaAssets != afterVault.assetsTotal) { JLOG(j.fatal()) << "Invariant failed: withdrawal and " "assets outstanding must add up"; result = false; } - auto const assetAvailableDelta = roundToAsset( - vaultAsset, afterVault.assetsAvailable - beforeVault.assetsAvailable, minScale); - - if (assetAvailableDelta != vaultPseudoDeltaAssets) + if (beforeVault.assetsAvailable + *vaultDeltaAssets != afterVault.assetsAvailable) { JLOG(j.fatal()) << "Invariant failed: withdrawal and " "assets available must add up"; @@ -939,18 +828,10 @@ ValidVault::finalize( } } - auto const maybeVaultDeltaAssets = deltaAssets(afterVault.pseudoId); - if (maybeVaultDeltaAssets) + auto const vaultDeltaAssets = deltaAssets(afterVault.pseudoId); + if (vaultDeltaAssets) { - auto const totalDelta = DeltaInfo::makeDelta( - beforeVault.assetsTotal, afterVault.assetsTotal, vaultAsset); - auto const availableDelta = DeltaInfo::makeDelta( - beforeVault.assetsAvailable, afterVault.assetsAvailable, vaultAsset); - auto const minScale = - computeCoarsestScale({*maybeVaultDeltaAssets, totalDelta, availableDelta}); - auto const vaultDeltaAssets = - roundToAsset(vaultAsset, maybeVaultDeltaAssets->delta, minScale); - if (vaultDeltaAssets >= zero) + if (*vaultDeltaAssets >= zero) { JLOG(j.fatal()) << // "Invariant failed: clawback must decrease vault " @@ -958,9 +839,7 @@ ValidVault::finalize( result = false; } - auto const assetsTotalDelta = roundToAsset( - vaultAsset, afterVault.assetsTotal - beforeVault.assetsTotal, minScale); - if (assetsTotalDelta != vaultDeltaAssets) + if (beforeVault.assetsTotal + *vaultDeltaAssets != afterVault.assetsTotal) { JLOG(j.fatal()) << // "Invariant failed: clawback and assets outstanding " @@ -968,11 +847,8 @@ ValidVault::finalize( result = false; } - auto const assetAvailableDelta = roundToAsset( - vaultAsset, - afterVault.assetsAvailable - beforeVault.assetsAvailable, - minScale); - if (assetAvailableDelta != vaultDeltaAssets) + if (beforeVault.assetsAvailable + *vaultDeltaAssets != + afterVault.assetsAvailable) { JLOG(j.fatal()) << // "Invariant failed: clawback and assets available " @@ -987,15 +863,15 @@ ValidVault::finalize( return false; // That's all we can do } - // We don't need to round shares, they are integral MPT - auto const maybeAccountDeltaShares = deltaShares(tx[sfHolder]); - if (!maybeAccountDeltaShares) + auto const accountDeltaShares = deltaShares(tx[sfHolder]); + if (!accountDeltaShares) { JLOG(j.fatal()) << // "Invariant failed: clawback must change holder shares"; return false; // That's all we can do } - if (maybeAccountDeltaShares->delta >= zero) + + if (*accountDeltaShares >= zero) { JLOG(j.fatal()) << // "Invariant failed: clawback must decrease holder " @@ -1003,16 +879,15 @@ ValidVault::finalize( result = false; } - // We don't need to round shares, they are integral MPT auto const vaultDeltaShares = deltaShares(afterVault.pseudoId); - if (!vaultDeltaShares || vaultDeltaShares->delta == zero) + if (!vaultDeltaShares || *vaultDeltaShares == zero) { JLOG(j.fatal()) << // "Invariant failed: clawback must change vault shares"; return false; // That's all we can do } - if (vaultDeltaShares->delta * -1 != maybeAccountDeltaShares->delta) + if (*vaultDeltaShares * -1 != *accountDeltaShares) { JLOG(j.fatal()) << // "Invariant failed: clawback must change holder and " @@ -1049,25 +924,4 @@ ValidVault::finalize( return true; } -[[nodiscard]] ValidVault::DeltaInfo -ValidVault::DeltaInfo::makeDelta(Number const& before, Number const& after, Asset const& asset) -{ - return { - .delta = after - before, - .scale = std::max(xrpl::scale(after, asset), xrpl::scale(before, asset))}; -} - -[[nodiscard]] std::int32_t -ValidVault::computeCoarsestScale(std::vector const& numbers) -{ - if (numbers.empty()) - return 0; - - auto const max = std::ranges::max_element( - numbers, [](auto const& a, auto const& b) -> bool { return a.scale < b.scale; }); - XRPL_ASSERT_PARTS( - max->scale, "xrpl::ValidVault::computeCoarsestScale", "scale set for destinationDelta"); - return max->scale.value_or(STAmount::cMaxOffset); -} - } // namespace xrpl diff --git a/src/libxrpl/tx/paths/AMMLiquidity.cpp b/src/libxrpl/tx/paths/AMMLiquidity.cpp index 0a4cfadb69..29fcc3d4da 100644 --- a/src/libxrpl/tx/paths/AMMLiquidity.cpp +++ b/src/libxrpl/tx/paths/AMMLiquidity.cpp @@ -1,30 +1,5 @@ #include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include - -#include -#include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/paths/AMMOffer.cpp b/src/libxrpl/tx/paths/AMMOffer.cpp index 0a41411492..c147e9197f 100644 --- a/src/libxrpl/tx/paths/AMMOffer.cpp +++ b/src/libxrpl/tx/paths/AMMOffer.cpp @@ -1,24 +1,6 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include - -#include +#include namespace xrpl { diff --git a/src/libxrpl/tx/paths/BookStep.cpp b/src/libxrpl/tx/paths/BookStep.cpp index f05460df61..ab2efcf39a 100644 --- a/src/libxrpl/tx/paths/BookStep.cpp +++ b/src/libxrpl/tx/paths/BookStep.cpp @@ -1,53 +1,26 @@ #include -#include #include -#include -#include #include -#include #include -#include #include #include #include -#include -#include -#include #include -#include #include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include #include #include -#include #include -#include #include #include +#include #include -#include -#include #include -#include #include -#include -#include -#include -#include namespace xrpl { @@ -1454,22 +1427,18 @@ equalHelper(Step const& step, xrpl::Book const& book) bool bookStepEqual(Step const& step, xrpl::Book const& book) { + if (isXRP(book.in) && isXRP(book.out)) + { + // LCOV_EXCL_START + UNREACHABLE("xrpl::test::bookStepEqual : no XRP to XRP book step"); + return false; // no such thing as xrp/xrp book step + // LCOV_EXCL_STOP + } return std::visit( [&](TIn const&, TOut const&) { using TIn_ = typename TIn::amount_type; using TOut_ = typename TOut::amount_type; - - if constexpr (ValidTaker) - { - return equalHelper>(step, book); - } - else - { - // LCOV_EXCL_START - UNREACHABLE("xrpl::bookStepEqual : invalid book step"); - return false; - // LCOV_EXCL_STOP - } + return equalHelper>(step, book); }, book.in.getAmountType(), book.out.getAmountType()); diff --git a/src/libxrpl/tx/paths/BookTip.cpp b/src/libxrpl/tx/paths/BookTip.cpp index 7c6dd85ee3..f9b700b7af 100644 --- a/src/libxrpl/tx/paths/BookTip.cpp +++ b/src/libxrpl/tx/paths/BookTip.cpp @@ -1,14 +1,6 @@ -#include - -#include -#include #include #include -#include -#include -#include - -#include +#include namespace xrpl { diff --git a/src/libxrpl/tx/paths/DirectStep.cpp b/src/libxrpl/tx/paths/DirectStep.cpp index c4b2c51934..6bf76e9002 100644 --- a/src/libxrpl/tx/paths/DirectStep.cpp +++ b/src/libxrpl/tx/paths/DirectStep.cpp @@ -1,36 +1,17 @@ #include -#include -#include -#include -#include #include #include #include -#include -#include -#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include #include #include -#include -#include -#include +#include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/paths/Flow.cpp b/src/libxrpl/tx/paths/Flow.cpp index 413c160c7f..6226e550b7 100644 --- a/src/libxrpl/tx/paths/Flow.cpp +++ b/src/libxrpl/tx/paths/Flow.cpp @@ -1,23 +1,13 @@ +#include +#include +#include +#include #include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include #include -#include -#include - namespace xrpl { template diff --git a/src/libxrpl/tx/paths/MPTEndpointStep.cpp b/src/libxrpl/tx/paths/MPTEndpointStep.cpp index 7b063a39d3..8944df953d 100644 --- a/src/libxrpl/tx/paths/MPTEndpointStep.cpp +++ b/src/libxrpl/tx/paths/MPTEndpointStep.cpp @@ -1,34 +1,16 @@ #include -#include -#include -#include -#include -#include -#include #include +#include #include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include #include +#include #include #include -#include -#include -#include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/paths/OfferStream.cpp b/src/libxrpl/tx/paths/OfferStream.cpp index c7e81ba203..929140cd61 100644 --- a/src/libxrpl/tx/paths/OfferStream.cpp +++ b/src/libxrpl/tx/paths/OfferStream.cpp @@ -1,34 +1,12 @@ -#include - #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include +#include +#include namespace xrpl { @@ -83,7 +61,7 @@ TOfferStreamBase::erase(ApplyView& view) } auto v(p->getFieldV256(sfIndexes)); - auto it(std::ranges::find(v, tip_.index())); + auto it(std::find(v.begin(), v.end(), tip_.index())); if (it == v.end()) { diff --git a/src/libxrpl/tx/paths/PaySteps.cpp b/src/libxrpl/tx/paths/PaySteps.cpp index d3fe366616..5a68228708 100644 --- a/src/libxrpl/tx/paths/PaySteps.cpp +++ b/src/libxrpl/tx/paths/PaySteps.cpp @@ -1,33 +1,11 @@ -#include -#include -#include #include -#include -#include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include #include -#include - #include -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -292,7 +270,7 @@ toStrand( // even if all that is changing is the Issue.account. Note // that MPTIssue can't change the account. STPathElement const& lastAsset = - *std::ranges::find_if(std::ranges::reverse_view(normPath), hasAsset); + *std::find_if(normPath.rbegin(), normPath.rend(), hasAsset); if (lastAsset.getPathAsset() != deliver || (offerCrossing != OfferCrossing::no && lastAsset.getIssuerID() != deliver.getIssuer())) @@ -592,7 +570,7 @@ toStrands( result.reserve(1 + paths.size()); // Insert the strand into result if it is not already part of the vector auto insert = [&](Strand s) { - bool const hasStrand = std::ranges::find(result, s) != result.end(); + bool const hasStrand = std::find(result.begin(), result.end(), s) != result.end(); if (!hasStrand) result.emplace_back(std::move(s)); diff --git a/src/libxrpl/tx/paths/RippleCalc.cpp b/src/libxrpl/tx/paths/RippleCalc.cpp index 773a9bac3d..e1f1cb272c 100644 --- a/src/libxrpl/tx/paths/RippleCalc.cpp +++ b/src/libxrpl/tx/paths/RippleCalc.cpp @@ -1,23 +1,11 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include -#include +#include +#include -#include -#include - -namespace xrpl::path { +namespace xrpl { +namespace path { RippleCalc::Output RippleCalc::rippleCalculate( @@ -112,4 +100,5 @@ RippleCalc::rippleCalculate( return flowOut; } -} // namespace xrpl::path +} // namespace path +} // namespace xrpl diff --git a/src/libxrpl/tx/paths/XRPEndpointStep.cpp b/src/libxrpl/tx/paths/XRPEndpointStep.cpp index 6356eb8ded..4b9b934daf 100644 --- a/src/libxrpl/tx/paths/XRPEndpointStep.cpp +++ b/src/libxrpl/tx/paths/XRPEndpointStep.cpp @@ -1,34 +1,18 @@ #include -#include -#include -#include -#include #include #include -#include -#include +#include +#include #include -#include -#include -#include #include -#include -#include -#include #include #include -#include #include #include #include -#include -#include -#include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/account/AccountDelete.cpp b/src/libxrpl/tx/transactors/account/AccountDelete.cpp index 596a8a1560..c7f71a6cf4 100644 --- a/src/libxrpl/tx/transactors/account/AccountDelete.cpp +++ b/src/libxrpl/tx/transactors/account/AccountDelete.cpp @@ -1,40 +1,22 @@ -#include - #include -#include -#include -#include #include -#include -#include -#include #include #include #include #include #include -#include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include #include #include #include -#include -#include -#include - namespace xrpl { bool @@ -416,23 +398,4 @@ AccountDelete::doApply() return tesSUCCESS; } -void -AccountDelete::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -AccountDelete::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/account/AccountSet.cpp b/src/libxrpl/tx/transactors/account/AccountSet.cpp index a892bd045c..093019766c 100644 --- a/src/libxrpl/tx/transactors/account/AccountSet.cpp +++ b/src/libxrpl/tx/transactors/account/AccountSet.cpp @@ -1,33 +1,13 @@ -#include - -#include #include -#include -#include -#include -#include +#include #include #include #include #include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include +#include namespace xrpl { @@ -657,18 +637,4 @@ AccountSet::doApply() return tesSUCCESS; } -void -AccountSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -AccountSet::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/account/SetRegularKey.cpp b/src/libxrpl/tx/transactors/account/SetRegularKey.cpp index bc59ed4fc1..471da26c88 100644 --- a/src/libxrpl/tx/transactors/account/SetRegularKey.cpp +++ b/src/libxrpl/tx/transactors/account/SetRegularKey.cpp @@ -1,20 +1,8 @@ +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - namespace xrpl { XRPAmount @@ -80,23 +68,4 @@ SetRegularKey::doApply() return tesSUCCESS; } -void -SetRegularKey::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -SetRegularKey::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/account/SignerListSet.cpp b/src/libxrpl/tx/transactors/account/SignerListSet.cpp index 7e236af21b..90ab8daf6f 100644 --- a/src/libxrpl/tx/transactors/account/SignerListSet.cpp +++ b/src/libxrpl/tx/transactors/account/SignerListSet.cpp @@ -1,36 +1,16 @@ -#include - -#include -#include -#include -#include #include -#include #include #include -#include #include #include -#include -#include -#include #include -#include #include #include -#include #include -#include -#include -#include +#include #include -#include #include -#include -#include -#include -#include namespace xrpl { @@ -257,14 +237,11 @@ SignerListSet::validateQuorumAndSignerEntries( } // Make sure there are no duplicate signers. - // SignerEntry only defines operator< and operator==, not the full - // std::totally_ordered set required by std::ranges::less, so the - // ranges version does not compile. NOLINTNEXTLINE(modernize-use-ranges) XRPL_ASSERT( std::is_sorted(signers.begin(), signers.end()), "xrpl::SignerListSet::validateQuorumAndSignerEntries : sorted " "signers"); - if (std::ranges::adjacent_find(signers) != signers.end()) + if (std::adjacent_find(signers.begin(), signers.end()) != signers.end()) { JLOG(j.trace()) << "Duplicate signers in signer list"; return temBAD_SIGNER; @@ -408,23 +385,4 @@ SignerListSet::writeSignersToSLE(SLE::pointer const& ledgerEntry, std::uint32_t ledgerEntry->setFieldArray(sfSignerEntries, toLedger); } -void -SignerListSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -SignerListSet::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/bridge/XChainBridge.cpp b/src/libxrpl/tx/transactors/bridge/XChainBridge.cpp index 166e42560f..bec17b010a 100644 --- a/src/libxrpl/tx/transactors/bridge/XChainBridge.cpp +++ b/src/libxrpl/tx/transactors/bridge/XChainBridge.cpp @@ -1,52 +1,31 @@ -#include - -#include #include #include +#include #include -#include #include -#include #include #include -#include -#include #include #include #include #include #include -#include -#include -#include -#include #include #include #include -#include #include -#include #include -#include -#include #include #include #include #include -#include #include #include #include -#include +#include -#include -#include -#include -#include -#include #include -#include -#include +#include namespace xrpl { @@ -329,7 +308,7 @@ onNewAttestations( j); if (!r.has_value()) - return {.rewardAccounts = std::nullopt, .changed = changed}; + return {std::nullopt, changed}; return {std::move(r.value()), changed}; }; @@ -1779,11 +1758,11 @@ XChainClaim::doApply() return Unexpected(claimR.error()); return ScopeResult{ - .rewardAccounts = claimR.value(), - .rewardPoolSrc = (*sleClaimID)[sfAccount], - .sendingAmount = sendingAmount, - .srcChain = srcChain, - .signatureReward = (*sleClaimID)[sfSignatureReward], + claimR.value(), + (*sleClaimID)[sfAccount], + sendingAmount, + srcChain, + (*sleClaimID)[sfSignatureReward], }; }(); @@ -1920,9 +1899,7 @@ XChainCommit::doApply() // Support dipping into reserves to pay the fee TransferHelperSubmittingAccountInfo submittingAccountInfo{ - .account = account_, - .preFeeBalance_ = preFeeBalance_, - .postFeeBalance = (*sleAccount)[sfBalance]}; + account_, preFeeBalance_, (*sleAccount)[sfBalance]}; auto const thTer = transferHelper( psb, @@ -2197,7 +2174,7 @@ XChainCreateAccountCommit::doApply() // Support dipping into reserves to pay the fee TransferHelperSubmittingAccountInfo submittingAccountInfo{ - .account = account_, .preFeeBalance_ = preFeeBalance_, .postFeeBalance = (*sle)[sfBalance]}; + account_, preFeeBalance_, (*sle)[sfBalance]}; STAmount const toTransfer = amount + reward; auto const thTer = transferHelper( psb, @@ -2222,151 +2199,4 @@ XChainCreateAccountCommit::doApply() return tesSUCCESS; } -void -XChainCreateBridge::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -XChainCreateBridge::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - -void -BridgeModify::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -BridgeModify::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - -void -XChainClaim::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -XChainClaim::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - -void -XChainCommit::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -XChainCommit::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - -void -XChainCreateClaimID::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -XChainCreateClaimID::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - -void -XChainAddClaimAttestation::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -XChainAddClaimAttestation::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - -void -XChainAddAccountCreateAttestation::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -XChainAddAccountCreateAttestation::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - -void -XChainCreateAccountCommit::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -XChainCreateAccountCommit::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/check/CheckCancel.cpp b/src/libxrpl/tx/transactors/check/CheckCancel.cpp index c30c116e58..be3b434fb6 100644 --- a/src/libxrpl/tx/transactors/check/CheckCancel.cpp +++ b/src/libxrpl/tx/transactors/check/CheckCancel.cpp @@ -1,20 +1,11 @@ -#include - -#include #include #include #include -#include +#include #include -#include -#include -#include #include -#include -#include - -#include -#include +#include +#include namespace xrpl { @@ -101,18 +92,4 @@ CheckCancel::doApply() return tesSUCCESS; } -void -CheckCancel::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -CheckCancel::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/check/CheckCash.cpp b/src/libxrpl/tx/transactors/check/CheckCash.cpp index 4498a3cd8e..14fbc80f15 100644 --- a/src/libxrpl/tx/transactors/check/CheckCash.cpp +++ b/src/libxrpl/tx/transactors/check/CheckCash.cpp @@ -1,38 +1,16 @@ -#include - -#include #include -#include -#include #include #include #include #include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include +#include +#include #include -#include -#include -#include namespace xrpl { @@ -586,18 +564,4 @@ CheckCash::doApply() return tesSUCCESS; } -void -CheckCash::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -CheckCash::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/check/CheckCreate.cpp b/src/libxrpl/tx/transactors/check/CheckCreate.cpp index 6a13819615..70dddd7338 100644 --- a/src/libxrpl/tx/transactors/check/CheckCreate.cpp +++ b/src/libxrpl/tx/transactors/check/CheckCreate.cpp @@ -1,32 +1,13 @@ -#include - -#include -#include -#include #include #include #include #include -#include -#include -#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include - -#include -#include -#include +#include +#include namespace xrpl { @@ -247,18 +228,4 @@ CheckCreate::doApply() return tesSUCCESS; } -void -CheckCreate::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -CheckCreate::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/credentials/CredentialAccept.cpp b/src/libxrpl/tx/transactors/credentials/CredentialAccept.cpp index 4f1bd80f26..9c0018a647 100644 --- a/src/libxrpl/tx/transactors/credentials/CredentialAccept.cpp +++ b/src/libxrpl/tx/transactors/credentials/CredentialAccept.cpp @@ -1,26 +1,13 @@ -#include - #include #include #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include -#include -#include +#include namespace xrpl { @@ -123,22 +110,4 @@ CredentialAccept::doApply() return tesSUCCESS; } -void -CredentialAccept::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -CredentialAccept::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/credentials/CredentialCreate.cpp b/src/libxrpl/tx/transactors/credentials/CredentialCreate.cpp index 402bddcfdd..f8f0f01b63 100644 --- a/src/libxrpl/tx/transactors/credentials/CredentialCreate.cpp +++ b/src/libxrpl/tx/transactors/credentials/CredentialCreate.cpp @@ -1,29 +1,14 @@ -#include - #include -#include -#include #include #include -#include // IWYU pragma: keep +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include -#include -#include namespace xrpl { @@ -178,22 +163,4 @@ CredentialCreate::doApply() return tesSUCCESS; } -void -CredentialCreate::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -CredentialCreate::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/credentials/CredentialDelete.cpp b/src/libxrpl/tx/transactors/credentials/CredentialDelete.cpp index acff3c6aa0..5f78ba6757 100644 --- a/src/libxrpl/tx/transactors/credentials/CredentialDelete.cpp +++ b/src/libxrpl/tx/transactors/credentials/CredentialDelete.cpp @@ -1,22 +1,13 @@ -#include - #include #include +#include #include -#include #include #include -#include -#include -#include -#include -#include #include -#include -#include +#include -#include -#include +#include namespace xrpl { @@ -96,22 +87,4 @@ CredentialDelete::doApply() return deleteSLE(view(), sleCred, j_); } -void -CredentialDelete::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -CredentialDelete::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/delegate/DelegateSet.cpp b/src/libxrpl/tx/transactors/delegate/DelegateSet.cpp index 5a73bb3561..9fb17c4d1f 100644 --- a/src/libxrpl/tx/transactors/delegate/DelegateSet.cpp +++ b/src/libxrpl/tx/transactors/delegate/DelegateSet.cpp @@ -1,23 +1,11 @@ -#include - #include -#include +#include #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include +#include namespace xrpl { @@ -147,18 +135,4 @@ DelegateSet::deleteDelegate( return tesSUCCESS; } -void -DelegateSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -DelegateSet::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/delegate/DelegateUtils.cpp b/src/libxrpl/tx/transactors/delegate/DelegateUtils.cpp index 4d3d97e443..f5e92bf06d 100644 --- a/src/libxrpl/tx/transactors/delegate/DelegateUtils.cpp +++ b/src/libxrpl/tx/transactors/delegate/DelegateUtils.cpp @@ -1,14 +1,5 @@ #include -#include -#include #include -#include -#include -#include -#include - -#include -#include namespace xrpl { NotTEC diff --git a/src/libxrpl/tx/transactors/dex/AMMBid.cpp b/src/libxrpl/tx/transactors/dex/AMMBid.cpp index e878585d4c..3fed28e3c2 100644 --- a/src/libxrpl/tx/transactors/dex/AMMBid.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMBid.cpp @@ -1,36 +1,11 @@ -#include - -#include -#include -#include -#include -#include #include +#include #include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include +#include namespace xrpl { @@ -380,18 +355,4 @@ AMMBid::doApply() return result.first; } -void -AMMBid::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -AMMBid::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/dex/AMMClawback.cpp b/src/libxrpl/tx/transactors/dex/AMMClawback.cpp index 20ec184670..e437da3e70 100644 --- a/src/libxrpl/tx/transactors/dex/AMMClawback.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMClawback.cpp @@ -1,34 +1,13 @@ -#include - -#include -#include -#include -#include #include +#include #include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include +#include #include -#include -#include -#include #include namespace xrpl { @@ -126,9 +105,7 @@ AMMClawback::preclaim(PreclaimContext const& ctx) // permission if (((issuerFlagsIn & lsfAllowTrustLineClawback) == 0u) || ((issuerFlagsIn & lsfNoFreeze) != 0u)) - { - return tecNO_PERMISSION; - } + return tesSUCCESS; } auto const checkClawAsset = [&](Asset const asset) -> bool { @@ -387,18 +364,4 @@ AMMClawback::equalWithdrawMatchingOneAmount( ctx_.journal); } -void -AMMClawback::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -AMMClawback::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/dex/AMMCreate.cpp b/src/libxrpl/tx/transactors/dex/AMMCreate.cpp index 47363531d4..6f16b818e1 100644 --- a/src/libxrpl/tx/transactors/dex/AMMCreate.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMCreate.cpp @@ -1,41 +1,15 @@ -#include - -#include -#include -#include #include -#include #include #include #include #include #include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include +#include +#include namespace xrpl { @@ -392,18 +366,4 @@ AMMCreate::doApply() return result.first; } -void -AMMCreate::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -AMMCreate::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/dex/AMMDelete.cpp b/src/libxrpl/tx/transactors/dex/AMMDelete.cpp index 6d2c7b07c3..f601a360d4 100644 --- a/src/libxrpl/tx/transactors/dex/AMMDelete.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMDelete.cpp @@ -1,21 +1,9 @@ -#include - -#include -#include #include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include - -#include +#include +#include namespace xrpl { @@ -66,18 +54,4 @@ AMMDelete::doApply() return ter; } -void -AMMDelete::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -AMMDelete::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/dex/AMMDeposit.cpp b/src/libxrpl/tx/transactors/dex/AMMDeposit.cpp index 344e3535da..0371388d29 100644 --- a/src/libxrpl/tx/transactors/dex/AMMDeposit.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMDeposit.cpp @@ -1,36 +1,12 @@ -#include - -#include -#include -#include -#include #include +#include #include #include #include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -1007,18 +983,4 @@ AMMDeposit::equalDepositInEmptyState( tfee); } -void -AMMDeposit::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -AMMDeposit::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/dex/AMMVote.cpp b/src/libxrpl/tx/transactors/dex/AMMVote.cpp index 1287c8c428..42b339a65e 100644 --- a/src/libxrpl/tx/transactors/dex/AMMVote.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMVote.cpp @@ -1,30 +1,9 @@ -#include - -#include -#include -#include -#include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include +#include namespace xrpl { @@ -245,18 +224,4 @@ AMMVote::doApply() return result.first; } -void -AMMVote::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -AMMVote::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp b/src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp index 6ab78f9cb9..29043582b1 100644 --- a/src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp @@ -1,43 +1,12 @@ -#include - -#include #include -#include -#include -#include #include #include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include namespace xrpl { @@ -1145,18 +1114,4 @@ AMMWithdraw::isWithdrawAll(STTx const& tx) return WithdrawAll::Yes; return WithdrawAll::No; } -void -AMMWithdraw::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -AMMWithdraw::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/dex/OfferCancel.cpp b/src/libxrpl/tx/transactors/dex/OfferCancel.cpp index 72682149a3..f8164401b7 100644 --- a/src/libxrpl/tx/transactors/dex/OfferCancel.cpp +++ b/src/libxrpl/tx/transactors/dex/OfferCancel.cpp @@ -1,16 +1,7 @@ -#include - -#include +#include #include -#include -#include -#include -#include -#include -#include -#include - -#include +#include +#include namespace xrpl { @@ -69,18 +60,4 @@ OfferCancel::doApply() return tesSUCCESS; } -void -OfferCancel::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -OfferCancel::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/dex/OfferCreate.cpp b/src/libxrpl/tx/transactors/dex/OfferCreate.cpp index 2d21cebbe3..2568806f51 100644 --- a/src/libxrpl/tx/transactors/dex/OfferCreate.cpp +++ b/src/libxrpl/tx/transactors/dex/OfferCreate.cpp @@ -1,55 +1,18 @@ -#include - -#include #include -#include -#include -#include -#include #include #include -#include #include #include #include #include #include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include #include #include -#include -#include -#include -#include #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { TxConsequences @@ -594,7 +557,7 @@ OfferCreate::applyGuts(Sandbox& sb, Sandbox& sbCancel) auto const cancelSequence = ctx_.tx[~sfOfferSequence]; - // Note that we use the value from the sequence or ticket as the + // Note that we we use the value from the sequence or ticket as the // offer sequence. For more explanation see comments in SeqProxy.h. auto const offerSequence = ctx_.tx.getSeqValue(); @@ -956,18 +919,4 @@ OfferCreate::doApply() return result.first; } -void -OfferCreate::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -OfferCreate::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/did/DIDDelete.cpp b/src/libxrpl/tx/transactors/did/DIDDelete.cpp index a323822b9c..0d5b63635f 100644 --- a/src/libxrpl/tx/transactors/did/DIDDelete.cpp +++ b/src/libxrpl/tx/transactors/did/DIDDelete.cpp @@ -1,22 +1,8 @@ -#include - #include -#include #include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include namespace xrpl { @@ -70,17 +56,4 @@ DIDDelete::doApply() return deleteSLE(ctx_, keylet::did(account_), account_); } -void -DIDDelete::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -DIDDelete::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/did/DIDSet.cpp b/src/libxrpl/tx/transactors/did/DIDSet.cpp index 3aa9966570..cd5c9bbc96 100644 --- a/src/libxrpl/tx/transactors/did/DIDSet.cpp +++ b/src/libxrpl/tx/transactors/did/DIDSet.cpp @@ -1,25 +1,11 @@ -#include - -#include +#include #include -#include #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include +#include namespace xrpl { @@ -149,18 +135,4 @@ DIDSet::doApply() return addSLE(ctx_, sleDID, account_); } -void -DIDSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -DIDSet::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/escrow/EscrowCancel.cpp b/src/libxrpl/tx/transactors/escrow/EscrowCancel.cpp index edc07fa0f7..faa862b424 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowCancel.cpp +++ b/src/libxrpl/tx/transactors/escrow/EscrowCancel.cpp @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -7,24 +5,10 @@ #include #include #include -#include -#include -#include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include namespace xrpl { @@ -219,22 +203,4 @@ EscrowCancel::doApply() return tesSUCCESS; } -void -EscrowCancel::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -EscrowCancel::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp b/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp index 9d16d41914..789ca8ab1a 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp +++ b/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp @@ -1,40 +1,19 @@ -#include - #include #include -#include #include -#include #include #include #include #include #include #include -#include -#include -#include #include #include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include - -#include -#include -#include +#include namespace xrpl { @@ -441,7 +420,7 @@ EscrowCreate::doApply() return tecDST_TAG_NEEDED; } - // Create escrow in ledger. Note that we use the value from the + // Create escrow in ledger. Note that we we use the value from the // sequence or ticket. For more explanation see comments in SeqProxy.h. Keylet const escrowKeylet = keylet::escrow(account_, ctx_.tx.getSeqValue()); auto const slep = std::make_shared(escrowKeylet); @@ -525,22 +504,4 @@ EscrowCreate::doApply() return tesSUCCESS; } -void -EscrowCreate::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -EscrowCreate::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/escrow/EscrowFinish.cpp b/src/libxrpl/tx/transactors/escrow/EscrowFinish.cpp index c8697fbaa8..8714bab5ff 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowFinish.cpp +++ b/src/libxrpl/tx/transactors/escrow/EscrowFinish.cpp @@ -1,38 +1,20 @@ -#include - #include -#include #include #include #include #include #include -#include #include -#include #include #include #include #include -#include -#include -#include #include #include -#include -#include #include -#include -#include -#include -#include -#include +#include #include -#include - -#include -#include -#include +#include namespace xrpl { @@ -399,22 +381,4 @@ EscrowFinish::doApply() return tesSUCCESS; } -void -EscrowFinish::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -EscrowFinish::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/lending/LendingHelpers.cpp b/src/libxrpl/tx/transactors/lending/LendingHelpers.cpp index dea8dbbd34..bad55e9222 100644 --- a/src/libxrpl/tx/transactors/lending/LendingHelpers.cpp +++ b/src/libxrpl/tx/transactors/lending/LendingHelpers.cpp @@ -1,30 +1,7 @@ #include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +// DO NOT REMOVE forces header file include to sort first #include -#include -#include -#include -#include - namespace xrpl { bool diff --git a/src/libxrpl/tx/transactors/lending/LoanBrokerCoverClawback.cpp b/src/libxrpl/tx/transactors/lending/LoanBrokerCoverClawback.cpp index 16f95dd357..c7493a71cd 100644 --- a/src/libxrpl/tx/transactors/lending/LoanBrokerCoverClawback.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanBrokerCoverClawback.cpp @@ -1,36 +1,9 @@ #include - -#include -#include -#include -#include -#include -#include -#include +// #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include - namespace xrpl { bool @@ -355,25 +328,6 @@ LoanBrokerCoverClawback::doApply() return accountSend(view(), brokerPseudoID, account, clawAmount, j_, WaiveTransferFee::Yes); } -void -LoanBrokerCoverClawback::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LoanBrokerCoverClawback::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - //------------------------------------------------------------------------------ } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/lending/LoanBrokerCoverDeposit.cpp b/src/libxrpl/tx/transactors/lending/LoanBrokerCoverDeposit.cpp index 36b5cab618..4630e6a360 100644 --- a/src/libxrpl/tx/transactors/lending/LoanBrokerCoverDeposit.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanBrokerCoverDeposit.cpp @@ -1,21 +1,9 @@ #include - -#include -#include +// #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include -#include - namespace xrpl { bool @@ -133,25 +121,6 @@ LoanBrokerCoverDeposit::doApply() return tesSUCCESS; } -void -LoanBrokerCoverDeposit::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LoanBrokerCoverDeposit::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - //------------------------------------------------------------------------------ } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.cpp b/src/libxrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.cpp index c8479e941d..d03edad0a2 100644 --- a/src/libxrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.cpp @@ -1,25 +1,11 @@ #include - -#include -#include -#include -#include +// #include +#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include - -#include +#include namespace xrpl { @@ -137,7 +123,7 @@ LoanBrokerCoverWithdraw::preclaim(PreclaimContext const& ctx) return roundToAsset( vaultAsset, tenthBipsOfValue(currentDebtTotal, TenthBips32(sleBroker->at(sfCoverRateMinimum))), - scale(currentDebtTotal, vaultAsset)); + currentDebtTotal.exponent()); }(); if (coverAvail < amount) return tecINSUFFICIENT_FUNDS; @@ -186,25 +172,6 @@ LoanBrokerCoverWithdraw::doApply() return doWithdraw(view(), tx, account_, dstAcct, brokerPseudoID, preFeeBalance_, amount, j_); } -void -LoanBrokerCoverWithdraw::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LoanBrokerCoverWithdraw::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - //------------------------------------------------------------------------------ } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/lending/LoanBrokerDelete.cpp b/src/libxrpl/tx/transactors/lending/LoanBrokerDelete.cpp index 6f774eaeae..a755db7942 100644 --- a/src/libxrpl/tx/transactors/lending/LoanBrokerDelete.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanBrokerDelete.cpp @@ -1,24 +1,10 @@ #include - -#include -#include -#include +// #include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include #include -#include - namespace xrpl { bool @@ -190,25 +176,6 @@ LoanBrokerDelete::doApply() return tesSUCCESS; } -void -LoanBrokerDelete::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LoanBrokerDelete::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - //------------------------------------------------------------------------------ } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp b/src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp index 3322df9fe3..f8813ddbef 100644 --- a/src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp @@ -1,28 +1,10 @@ #include - -#include -#include -#include -#include -#include +// #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include #include -#include -#include - namespace xrpl { bool @@ -278,25 +260,6 @@ LoanBrokerSet::doApply() return tesSUCCESS; } -void -LoanBrokerSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LoanBrokerSet::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - //------------------------------------------------------------------------------ } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/lending/LoanDelete.cpp b/src/libxrpl/tx/transactors/lending/LoanDelete.cpp index 28948a4139..39b28f5110 100644 --- a/src/libxrpl/tx/transactors/lending/LoanDelete.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanDelete.cpp @@ -1,23 +1,9 @@ #include - -#include -#include // IWYU pragma: keep -#include -#include +// #include -#include -#include -#include // IWYU pragma: keep -#include #include -#include -#include -#include -#include #include -#include - namespace xrpl { bool @@ -141,20 +127,6 @@ LoanDelete::doApply() return tesSUCCESS; } -void -LoanDelete::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LoanDelete::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - //------------------------------------------------------------------------------ } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/lending/LoanManage.cpp b/src/libxrpl/tx/transactors/lending/LoanManage.cpp index 1b87421e71..8c3e625963 100644 --- a/src/libxrpl/tx/transactors/lending/LoanManage.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanManage.cpp @@ -1,33 +1,10 @@ #include - -#include -#include -#include -#include -#include -#include +// #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include #include -#include -#include -#include - namespace xrpl { bool @@ -434,20 +411,6 @@ LoanManage::doApply() return result; } -void -LoanManage::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LoanManage::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - //------------------------------------------------------------------------------ } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/lending/LoanPay.cpp b/src/libxrpl/tx/transactors/lending/LoanPay.cpp index 8360303fd8..d400fb3630 100644 --- a/src/libxrpl/tx/transactors/lending/LoanPay.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanPay.cpp @@ -1,35 +1,14 @@ #include - -#include -#include -#include -#include -#include +// #include -#include -#include #include -#include -#include -#include #include -#include -#include -#include #include -#include -#include #include -#include -#include -#include #include #include -#include #include -#include -#include namespace xrpl { @@ -645,20 +624,6 @@ LoanPay::doApply() return tesSUCCESS; } -void -LoanPay::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LoanPay::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - //------------------------------------------------------------------------------ } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/lending/LoanSet.cpp b/src/libxrpl/tx/transactors/lending/LoanSet.cpp index 1027fdea9f..9cc4042365 100644 --- a/src/libxrpl/tx/transactors/lending/LoanSet.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanSet.cpp @@ -1,40 +1,11 @@ #include - -#include -#include -#include -#include -#include -#include +// #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { bool @@ -646,20 +617,6 @@ LoanSet::doApply() return tesSUCCESS; } -void -LoanSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LoanSet::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - //------------------------------------------------------------------------------ } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/nft/NFTokenAcceptOffer.cpp b/src/libxrpl/tx/transactors/nft/NFTokenAcceptOffer.cpp index 296020ff95..95955bd0bd 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenAcceptOffer.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenAcceptOffer.cpp @@ -1,29 +1,10 @@ -#include - -#include -#include -#include -#include #include #include #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include +#include namespace xrpl { @@ -569,23 +550,4 @@ NFTokenAcceptOffer::doApply() return tecINTERNAL; // LCOV_EXCL_LINE } -void -NFTokenAcceptOffer::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -NFTokenAcceptOffer::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/nft/NFTokenBurn.cpp b/src/libxrpl/tx/transactors/nft/NFTokenBurn.cpp index a0d10ca07d..1653da3ea4 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenBurn.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenBurn.cpp @@ -1,19 +1,8 @@ -#include - -#include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include +#include namespace xrpl { @@ -94,18 +83,4 @@ NFTokenBurn::doApply() return tesSUCCESS; } -void -NFTokenBurn::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -NFTokenBurn::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/nft/NFTokenCancelOffer.cpp b/src/libxrpl/tx/transactors/nft/NFTokenCancelOffer.cpp index 9d25a7335f..699714e0ac 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenCancelOffer.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenCancelOffer.cpp @@ -1,22 +1,10 @@ -#include - -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include -#include -#include +#include namespace xrpl { @@ -30,8 +18,8 @@ NFTokenCancelOffer::preflight(PreflightContext const& ctx) // In order to prevent unnecessarily overlarge transactions, we // disallow duplicates in the list of offers to cancel. STVector256 ids = ctx.tx.getFieldV256(sfNFTokenOffers); - std::ranges::sort(ids); - if (std::ranges::adjacent_find(ids) != ids.end()) + std::sort(ids.begin(), ids.end()); + if (std::adjacent_find(ids.begin(), ids.end()) != ids.end()) return temMALFORMED; return tesSUCCESS; @@ -44,7 +32,7 @@ NFTokenCancelOffer::preclaim(PreclaimContext const& ctx) auto const& ids = ctx.tx[sfNFTokenOffers]; - auto ret = std::ranges::find_if(ids, [&ctx, &account](uint256 const& id) { + auto ret = std::find_if(ids.begin(), ids.end(), [&ctx, &account](uint256 const& id) { auto const offer = ctx.view.read(keylet::child(id)); // If id is not in the ledger we assume the offer was consumed @@ -97,23 +85,4 @@ NFTokenCancelOffer::doApply() return tesSUCCESS; } -void -NFTokenCancelOffer::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -NFTokenCancelOffer::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp b/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp index 9ca5220a8c..19bf34c560 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp @@ -1,20 +1,8 @@ -#include - -#include -#include #include #include -#include -#include -#include -#include +#include #include -#include -#include -#include - -#include -#include +#include namespace xrpl { @@ -91,23 +79,4 @@ NFTokenCreateOffer::doApply() ctx_.tx.getFlags()); } -void -NFTokenCreateOffer::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -NFTokenCreateOffer::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/nft/NFTokenMint.cpp b/src/libxrpl/tx/transactors/nft/NFTokenMint.cpp index b8150c3261..7bebbd0070 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenMint.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenMint.cpp @@ -1,33 +1,14 @@ -#include - #include -#include -#include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include +#include #include #include -#include -#include -#include // IWYU pragma: keep -#include -#include namespace xrpl { @@ -342,18 +323,4 @@ NFTokenMint::doApply() return tesSUCCESS; } -void -NFTokenMint::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -NFTokenMint::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/nft/NFTokenModify.cpp b/src/libxrpl/tx/transactors/nft/NFTokenModify.cpp index 392d928f02..79c019de96 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenModify.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenModify.cpp @@ -1,20 +1,7 @@ -#include - -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include namespace xrpl { @@ -68,23 +55,4 @@ NFTokenModify::doApply() return nft::changeTokenURI(view(), owner, nftokenID, ctx_.tx[~sfURI]); } -void -NFTokenModify::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -NFTokenModify::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/oracle/OracleDelete.cpp b/src/libxrpl/tx/transactors/oracle/OracleDelete.cpp index c6896b78d4..bde403f821 100644 --- a/src/libxrpl/tx/transactors/oracle/OracleDelete.cpp +++ b/src/libxrpl/tx/transactors/oracle/OracleDelete.cpp @@ -1,19 +1,9 @@ -#include - -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include +#include namespace xrpl { @@ -88,23 +78,4 @@ OracleDelete::doApply() return tecINTERNAL; // LCOV_EXCL_LINE } -void -OracleDelete::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -OracleDelete::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/oracle/OracleSet.cpp b/src/libxrpl/tx/transactors/oracle/OracleSet.cpp index 4304427646..772756ad6d 100644 --- a/src/libxrpl/tx/transactors/oracle/OracleSet.cpp +++ b/src/libxrpl/tx/transactors/oracle/OracleSet.cpp @@ -1,31 +1,12 @@ -#include - -#include -#include +#include +#include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include namespace xrpl { @@ -327,18 +308,4 @@ OracleSet::doApply() return tesSUCCESS; } -void -OracleSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -OracleSet::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/payment/DepositPreauth.cpp b/src/libxrpl/tx/transactors/payment/DepositPreauth.cpp index f8dca6bb58..0f4681a3ad 100644 --- a/src/libxrpl/tx/transactors/payment/DepositPreauth.cpp +++ b/src/libxrpl/tx/transactors/payment/DepositPreauth.cpp @@ -1,31 +1,14 @@ -#include - #include -#include -#include -#include +#include #include #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include -#include -#include #include -#include -#include namespace xrpl { @@ -296,23 +279,4 @@ DepositPreauth::removeFromLedger(ApplyView& view, uint256 const& preauthIndex, b return tesSUCCESS; } -void -DepositPreauth::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -DepositPreauth::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/payment/Payment.cpp b/src/libxrpl/tx/transactors/payment/Payment.cpp index 644d5210c0..3a64b5c739 100644 --- a/src/libxrpl/tx/transactors/payment/Payment.cpp +++ b/src/libxrpl/tx/transactors/payment/Payment.cpp @@ -1,47 +1,17 @@ -#include - -#include -#include -#include -#include -#include -#include +#include #include #include #include #include #include #include -#include -#include #include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include #include - -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -376,7 +346,8 @@ Payment::preclaim(PreclaimContext const& ctx) { STPathSet const& paths = ctx.tx.getFieldPathSet(sfPaths); - if (paths.size() > MaxPathSize || std::ranges::any_of(paths, [](STPath const& path) { + if (paths.size() > MaxPathSize || + std::any_of(paths.begin(), paths.end(), [](STPath const& path) { return path.size() > MaxPathLength; })) { @@ -677,18 +648,4 @@ Payment::doApply() return tesSUCCESS; } -void -Payment::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -Payment::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelClaim.cpp b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelClaim.cpp index 256d1e87ca..e53e32c844 100644 --- a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelClaim.cpp +++ b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelClaim.cpp @@ -1,30 +1,13 @@ -#include - -#include -#include #include +#include #include #include -#include #include #include -#include -#include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include - -#include -#include -#include +#include namespace xrpl { @@ -201,22 +184,4 @@ PaymentChannelClaim::doApply() return tesSUCCESS; } -void -PaymentChannelClaim::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -PaymentChannelClaim::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp index 4ced2d10bc..c12169fc0e 100644 --- a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp +++ b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp @@ -1,27 +1,13 @@ -#include - #include -#include -#include #include #include #include #include #include #include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include - -#include +#include namespace xrpl { @@ -137,7 +123,7 @@ PaymentChannelCreate::doApply() // Create PayChan in ledger. // - // Note that we use the value from the sequence or ticket as the + // Note that we we use the value from the sequence or ticket as the // payChan sequence. For more explanation see comments in SeqProxy.h. Keylet const payChanKeylet = keylet::payChan(account, dst, ctx_.tx.getSeqValue()); auto const slep = std::make_shared(payChanKeylet); @@ -186,22 +172,4 @@ PaymentChannelCreate::doApply() return tesSUCCESS; } -void -PaymentChannelCreate::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -PaymentChannelCreate::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelFund.cpp b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelFund.cpp index 4e588eda1e..f8e2399bb1 100644 --- a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelFund.cpp +++ b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelFund.cpp @@ -1,24 +1,8 @@ -#include - -#include -#include #include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include namespace xrpl { @@ -106,22 +90,4 @@ PaymentChannelFund::doApply() return tesSUCCESS; } -void -PaymentChannelFund::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -PaymentChannelFund::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.cpp b/src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.cpp index 87794b8dc2..565631b3fd 100644 --- a/src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.cpp +++ b/src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.cpp @@ -1,18 +1,7 @@ -#include - -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include - -#include +#include +#include namespace xrpl { @@ -73,23 +62,4 @@ PermissionedDomainDelete::doApply() return tesSUCCESS; } -void -PermissionedDomainDelete::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -PermissionedDomainDelete::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.cpp b/src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.cpp index e7853b529b..30f24241aa 100644 --- a/src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.cpp +++ b/src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.cpp @@ -1,24 +1,11 @@ #include - -#include -#include +// +#include #include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include - -#include -#include +#include namespace xrpl { @@ -131,23 +118,4 @@ PermissionedDomainSet::doApply() return tesSUCCESS; } -void -PermissionedDomainSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -PermissionedDomainSet::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/system/Batch.cpp b/src/libxrpl/tx/transactors/system/Batch.cpp index 1218f0d59f..cd3ac9a16c 100644 --- a/src/libxrpl/tx/transactors/system/Batch.cpp +++ b/src/libxrpl/tx/transactors/system/Batch.cpp @@ -1,32 +1,13 @@ -#include - #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include namespace xrpl { @@ -281,8 +262,10 @@ Batch::preflight(PreflightContext const& ctx) return temINVALID; } - if (std::ranges::any_of( - disabledTxTypes, [txType](auto const& disabled) { return txType == disabled; })) + if (std::any_of( + disabledTxTypes.begin(), disabledTxTypes.end(), [txType](auto const& disabled) { + return txType == disabled; + })) { return temINVALID_INNER_BATCH; } @@ -517,18 +500,4 @@ Batch::doApply() return tesSUCCESS; } -void -Batch::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -Batch::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/system/Change.cpp b/src/libxrpl/tx/transactors/system/Change.cpp index 60dbb06a17..a1d9183ca4 100644 --- a/src/libxrpl/tx/transactors/system/Change.cpp +++ b/src/libxrpl/tx/transactors/system/Change.cpp @@ -1,31 +1,13 @@ -#include - #include -#include -#include -#include -#include -#include -#include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include +#include -#include -#include +#include namespace xrpl { @@ -174,7 +156,7 @@ Change::applyAmendment() STVector256 amendments = amendmentObject->getFieldV256(sfAmendments); - if (std::ranges::find(amendments, amendment) != amendments.end()) + if (std::find(amendments.begin(), amendments.end(), amendment) != amendments.end()) return tefALREADY; auto flags = ctx_.tx.getFlags(); @@ -410,18 +392,4 @@ Change::applyUNLModify() return tesSUCCESS; } -void -Change::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -Change::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/system/LedgerStateFix.cpp b/src/libxrpl/tx/transactors/system/LedgerStateFix.cpp index 27cbad2e88..321e472aa5 100644 --- a/src/libxrpl/tx/transactors/system/LedgerStateFix.cpp +++ b/src/libxrpl/tx/transactors/system/LedgerStateFix.cpp @@ -1,18 +1,9 @@ -#include - -#include -#include +#include #include -#include +#include #include -#include -#include -#include -#include -#include -#include - -#include +#include +#include namespace xrpl { @@ -72,23 +63,4 @@ LedgerStateFix::doApply() return tecINTERNAL; // LCOV_EXCL_LINE } -void -LedgerStateFix::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -LedgerStateFix::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/system/TicketCreate.cpp b/src/libxrpl/tx/transactors/system/TicketCreate.cpp index fd6b947c5e..c4e281c357 100644 --- a/src/libxrpl/tx/transactors/system/TicketCreate.cpp +++ b/src/libxrpl/tx/transactors/system/TicketCreate.cpp @@ -1,23 +1,10 @@ -#include - -#include -#include -#include -#include +#include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include +#include namespace xrpl { @@ -134,23 +121,4 @@ TicketCreate::doApply() return tesSUCCESS; } -void -TicketCreate::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -TicketCreate::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/Clawback.cpp b/src/libxrpl/tx/transactors/token/Clawback.cpp index c9e6d32f6c..18c631b5f2 100644 --- a/src/libxrpl/tx/transactors/token/Clawback.cpp +++ b/src/libxrpl/tx/transactors/token/Clawback.cpp @@ -1,31 +1,12 @@ -#include - -#include -#include +#include #include #include -#include -#include #include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include +#include namespace xrpl { @@ -270,18 +251,4 @@ Clawback::doApply() ctx_.tx[sfAmount].asset().value()); } -void -Clawback::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -Clawback::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/ConfidentialMPTClawback.cpp b/src/libxrpl/tx/transactors/token/ConfidentialMPTClawback.cpp index 22fa2e6ff7..80347924c4 100644 --- a/src/libxrpl/tx/transactors/token/ConfidentialMPTClawback.cpp +++ b/src/libxrpl/tx/transactors/token/ConfidentialMPTClawback.cpp @@ -1,19 +1,11 @@ -#include - -#include +#include #include #include #include #include -#include -#include -#include #include -#include -#include - -#include -#include +#include +#include namespace xrpl { @@ -173,24 +165,4 @@ ConfidentialMPTClawback::doApply() return tesSUCCESS; } - -void -ConfidentialMPTClawback::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -ConfidentialMPTClawback::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/ConfidentialMPTConvert.cpp b/src/libxrpl/tx/transactors/token/ConfidentialMPTConvert.cpp index 9c051fbd00..2227354f4c 100644 --- a/src/libxrpl/tx/transactors/token/ConfidentialMPTConvert.cpp +++ b/src/libxrpl/tx/transactors/token/ConfidentialMPTConvert.cpp @@ -1,23 +1,12 @@ -#include - -#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include #include -#include -#include - -#include -#include -#include +#include +#include namespace xrpl { @@ -167,17 +156,15 @@ ConfidentialMPTConvert::preclaim(PreclaimContext const& ctx) { auditor.emplace( ConfidentialRecipient{ - .publicKey = (*sleIssuance)[sfAuditorEncryptionKey], - .encryptedAmount = ctx.tx[sfAuditorEncryptedAmount]}); + (*sleIssuance)[sfAuditorEncryptionKey], ctx.tx[sfAuditorEncryptedAmount]}); } auto const blindingFactor = ctx.tx[sfBlindingFactor]; if (auto const ter = verifyRevealedAmount( amount, Slice(blindingFactor.data(), blindingFactor.size()), - {.publicKey = holderPubKey, .encryptedAmount = ctx.tx[sfHolderEncryptedAmount]}, - {.publicKey = (*sleIssuance)[sfIssuerEncryptionKey], - .encryptedAmount = ctx.tx[sfIssuerEncryptedAmount]}, + {holderPubKey, ctx.tx[sfHolderEncryptedAmount]}, + {(*sleIssuance)[sfIssuerEncryptionKey], ctx.tx[sfIssuerEncryptedAmount]}, auditor); !isTesSuccess(ter)) { @@ -292,23 +279,4 @@ ConfidentialMPTConvert::doApply() return tesSUCCESS; } -void -ConfidentialMPTConvert::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -ConfidentialMPTConvert::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/ConfidentialMPTConvertBack.cpp b/src/libxrpl/tx/transactors/token/ConfidentialMPTConvertBack.cpp index f51ec3fb64..1071995264 100644 --- a/src/libxrpl/tx/transactors/token/ConfidentialMPTConvertBack.cpp +++ b/src/libxrpl/tx/transactors/token/ConfidentialMPTConvertBack.cpp @@ -1,24 +1,14 @@ -#include - -#include -#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include #include -#include -#include +#include +#include -#include -#include -#include +#include namespace xrpl { @@ -91,8 +81,7 @@ verifyProofs( { auditor.emplace( ConfidentialRecipient{ - .publicKey = (*issuance)[sfAuditorEncryptionKey], - .encryptedAmount = tx[sfAuditorEncryptedAmount]}); + (*issuance)[sfAuditorEncryptionKey], tx[sfAuditorEncryptedAmount]}); } // Run all verifications before returning any error to prevent timing attacks @@ -102,9 +91,8 @@ verifyProofs( if (auto const ter = verifyRevealedAmount( amount, Slice(blindingFactor.data(), blindingFactor.size()), - {.publicKey = holderPubKey, .encryptedAmount = tx[sfHolderEncryptedAmount]}, - {.publicKey = (*issuance)[sfIssuerEncryptionKey], - .encryptedAmount = tx[sfIssuerEncryptedAmount]}, + {holderPubKey, tx[sfHolderEncryptedAmount]}, + {(*issuance)[sfIssuerEncryptionKey], tx[sfIssuerEncryptedAmount]}, auditor); !isTesSuccess(ter)) { @@ -254,23 +242,4 @@ ConfidentialMPTConvertBack::doApply() return tesSUCCESS; } -void -ConfidentialMPTConvertBack::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -ConfidentialMPTConvertBack::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/ConfidentialMPTMergeInbox.cpp b/src/libxrpl/tx/transactors/token/ConfidentialMPTMergeInbox.cpp index 87889ff020..1cebca7010 100644 --- a/src/libxrpl/tx/transactors/token/ConfidentialMPTMergeInbox.cpp +++ b/src/libxrpl/tx/transactors/token/ConfidentialMPTMergeInbox.cpp @@ -1,21 +1,12 @@ -#include - -#include +#include #include #include #include #include #include -#include -#include -#include -#include #include -#include -#include - -#include -#include +#include +#include namespace xrpl { @@ -114,23 +105,4 @@ ConfidentialMPTMergeInbox::doApply() return tesSUCCESS; } -void -ConfidentialMPTMergeInbox::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -ConfidentialMPTMergeInbox::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/ConfidentialMPTSend.cpp b/src/libxrpl/tx/transactors/token/ConfidentialMPTSend.cpp index c68fc14219..13c7a3eea7 100644 --- a/src/libxrpl/tx/transactors/token/ConfidentialMPTSend.cpp +++ b/src/libxrpl/tx/transactors/token/ConfidentialMPTSend.cpp @@ -1,22 +1,13 @@ -#include - +#include #include #include #include #include #include #include -#include -#include -#include -#include #include -#include -#include - -#include -#include -#include +#include +#include namespace xrpl { @@ -94,12 +85,9 @@ verifySendProofs( std::optional auditor; if (hasAuditor) - { auditor.emplace( ConfidentialRecipient{ - .publicKey = (*sleIssuance)[sfAuditorEncryptionKey], - .encryptedAmount = ctx.tx[sfAuditorEncryptedAmount]}); - } + (*sleIssuance)[sfAuditorEncryptionKey], ctx.tx[sfAuditorEncryptedAmount]}); auto const contextHash = getSendContextHash( ctx.tx[sfAccount], @@ -110,12 +98,9 @@ verifySendProofs( return verifySendProof( ctx.tx[sfZKProof], - {.publicKey = (*sleSenderMPToken)[sfHolderEncryptionKey], - .encryptedAmount = ctx.tx[sfSenderEncryptedAmount]}, - {.publicKey = (*sleDestinationMPToken)[sfHolderEncryptionKey], - .encryptedAmount = ctx.tx[sfDestinationEncryptedAmount]}, - {.publicKey = (*sleIssuance)[sfIssuerEncryptionKey], - .encryptedAmount = ctx.tx[sfIssuerEncryptedAmount]}, + {(*sleSenderMPToken)[sfHolderEncryptionKey], ctx.tx[sfSenderEncryptedAmount]}, + {(*sleDestinationMPToken)[sfHolderEncryptionKey], ctx.tx[sfDestinationEncryptedAmount]}, + {(*sleIssuance)[sfIssuerEncryptionKey], ctx.tx[sfIssuerEncryptedAmount]}, auditor, (*sleSenderMPToken)[sfConfidentialBalanceSpending], ctx.tx[sfAmountCommitment], @@ -326,23 +311,4 @@ ConfidentialMPTSend::doApply() return tesSUCCESS; } -void -ConfidentialMPTSend::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -ConfidentialMPTSend::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/MPTokenAuthorize.cpp b/src/libxrpl/tx/transactors/token/MPTokenAuthorize.cpp index fe521d2886..195df60de4 100644 --- a/src/libxrpl/tx/transactors/token/MPTokenAuthorize.cpp +++ b/src/libxrpl/tx/transactors/token/MPTokenAuthorize.cpp @@ -1,21 +1,11 @@ -#include - -#include +#include #include +#include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include - -#include -#include +#include +#include namespace xrpl { @@ -175,23 +165,4 @@ MPTokenAuthorize::doApply() tx[~sfHolder]); } -void -MPTokenAuthorize::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -MPTokenAuthorize::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp b/src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp index 435e763a3e..c90d1f8f1c 100644 --- a/src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp +++ b/src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp @@ -1,27 +1,9 @@ -#include - -#include -#include -#include -#include -#include -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include - -#include -#include +#include namespace xrpl { @@ -42,8 +24,9 @@ MPTokenIssuanceCreate::checkExtraFeatures(PreflightContext const& ctx) // can not set tmfMPTCannotMutateCanConfidentialAmount without featureConfidentialTransfer auto const mutableFlags = ctx.tx[~sfMutableFlags]; - if (mutableFlags && (*mutableFlags & tmfMPTCannotMutateCanConfidentialAmount) != 0) - return ctx.rules.enabled(featureConfidentialTransfer); + if (mutableFlags && (*mutableFlags & tmfMPTCannotMutateCanConfidentialAmount) && + !ctx.rules.enabled(featureConfidentialTransfer)) + return false; return true; } @@ -181,23 +164,4 @@ MPTokenIssuanceCreate::doApply() return result ? tesSUCCESS : result.error(); } -void -MPTokenIssuanceCreate::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -MPTokenIssuanceCreate::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/MPTokenIssuanceDestroy.cpp b/src/libxrpl/tx/transactors/token/MPTokenIssuanceDestroy.cpp index 80b185641a..8ec1f37886 100644 --- a/src/libxrpl/tx/transactors/token/MPTokenIssuanceDestroy.cpp +++ b/src/libxrpl/tx/transactors/token/MPTokenIssuanceDestroy.cpp @@ -1,15 +1,8 @@ -#include - +#include #include -#include -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include namespace xrpl { @@ -58,23 +51,4 @@ MPTokenIssuanceDestroy::doApply() return tesSUCCESS; } -void -MPTokenIssuanceDestroy::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -MPTokenIssuanceDestroy::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/MPTokenIssuanceSet.cpp b/src/libxrpl/tx/transactors/token/MPTokenIssuanceSet.cpp index 504db0b6fc..d3988133ac 100644 --- a/src/libxrpl/tx/transactors/token/MPTokenIssuanceSet.cpp +++ b/src/libxrpl/tx/transactors/token/MPTokenIssuanceSet.cpp @@ -1,31 +1,9 @@ -#include - -#include -#include -#include -#include -#include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include - -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -56,35 +34,17 @@ struct MPTMutabilityFlags }; static constexpr std::array mptMutabilityFlags = { - {{.setFlag = tmfMPTSetCanLock, - .clearFlag = tmfMPTClearCanLock, - .mutabilityFlag = lsmfMPTCanMutateCanLock, - .targetFlag = lsfMPTCanLock}, - {.setFlag = tmfMPTSetRequireAuth, - .clearFlag = tmfMPTClearRequireAuth, - .mutabilityFlag = lsmfMPTCanMutateRequireAuth, - .targetFlag = lsfMPTRequireAuth}, - {.setFlag = tmfMPTSetCanEscrow, - .clearFlag = tmfMPTClearCanEscrow, - .mutabilityFlag = lsmfMPTCanMutateCanEscrow, - .targetFlag = lsfMPTCanEscrow}, - {.setFlag = tmfMPTSetCanTrade, - .clearFlag = tmfMPTClearCanTrade, - .mutabilityFlag = lsmfMPTCanMutateCanTrade, - .targetFlag = lsfMPTCanTrade}, - {.setFlag = tmfMPTSetCanTransfer, - .clearFlag = tmfMPTClearCanTransfer, - .mutabilityFlag = lsmfMPTCanMutateCanTransfer, - .targetFlag = lsfMPTCanTransfer}, - {.setFlag = tmfMPTSetCanClawback, - .clearFlag = tmfMPTClearCanClawback, - .mutabilityFlag = lsmfMPTCanMutateCanClawback, - .targetFlag = lsfMPTCanClawback}, - {.setFlag = tmfMPTSetCanConfidentialAmount, - .clearFlag = tmfMPTClearCanConfidentialAmount, - .mutabilityFlag = lsmfMPTCannotMutateCanConfidentialAmount, - .targetFlag = lsfMPTCanConfidentialAmount, - .isCannotMutate = true}}}; + {{tmfMPTSetCanLock, tmfMPTClearCanLock, lsmfMPTCanMutateCanLock, lsfMPTCanLock}, + {tmfMPTSetRequireAuth, tmfMPTClearRequireAuth, lsmfMPTCanMutateRequireAuth, lsfMPTRequireAuth}, + {tmfMPTSetCanEscrow, tmfMPTClearCanEscrow, lsmfMPTCanMutateCanEscrow, lsfMPTCanEscrow}, + {tmfMPTSetCanTrade, tmfMPTClearCanTrade, lsmfMPTCanMutateCanTrade, lsfMPTCanTrade}, + {tmfMPTSetCanTransfer, tmfMPTClearCanTransfer, lsmfMPTCanMutateCanTransfer, lsfMPTCanTransfer}, + {tmfMPTSetCanClawback, tmfMPTClearCanClawback, lsmfMPTCanMutateCanClawback, lsfMPTCanClawback}, + {tmfMPTSetCanConfidentialAmount, + tmfMPTClearCanConfidentialAmount, + lsmfMPTCannotMutateCanConfidentialAmount, + lsfMPTCanConfidentialAmount, + true}}}; NotTEC MPTokenIssuanceSet::preflight(PreflightContext const& ctx) @@ -98,8 +58,7 @@ MPTokenIssuanceSet::preflight(PreflightContext const& ctx) auto const txFlags = ctx.tx.getFlags(); auto const mutatePrivacy = mutableFlags && - ((*mutableFlags & (tmfMPTSetCanConfidentialAmount | tmfMPTClearCanConfidentialAmount)) != - 0u); + ((*mutableFlags & (tmfMPTSetCanConfidentialAmount | tmfMPTClearCanConfidentialAmount))); auto const hasDomain = ctx.tx.isFieldPresent(sfDomainID); auto const hasHolder = ctx.tx.isFieldPresent(sfHolder); @@ -157,9 +116,12 @@ MPTokenIssuanceSet::preflight(PreflightContext const& ctx) return temINVALID_FLAG; // Can not set and clear the same flag - if (std::ranges::any_of(mptMutabilityFlags, [mutableFlags](auto const& f) { - return (*mutableFlags & f.setFlag) && (*mutableFlags & f.clearFlag); - })) + if (std::any_of( + mptMutabilityFlags.begin(), + mptMutabilityFlags.end(), + [mutableFlags](auto const& f) { + return (*mutableFlags & f.setFlag) && (*mutableFlags & f.clearFlag); + })) return temINVALID_FLAG; // Trying to set a non-zero TransferFee and clear MPTCanTransfer @@ -177,7 +139,7 @@ MPTokenIssuanceSet::preflight(PreflightContext const& ctx) // Cannot set keys while clearing confidential amount if ((hasIssuerElGamalKey || hasAuditorElGamalKey) && mutableFlags && - (*mutableFlags & tmfMPTClearCanConfidentialAmount) != 0u) + (*mutableFlags & tmfMPTClearCanConfidentialAmount)) return temINVALID_FLAG; if (hasIssuerElGamalKey && !isValidCompressedECPoint(ctx.tx[sfIssuerEncryptionKey])) @@ -285,21 +247,18 @@ MPTokenIssuanceSet::preclaim(PreclaimContext const& ctx) auto const mutableFlags = ctx.tx[~sfMutableFlags]; if (mutableFlags) { - if (std::ranges::any_of(mptMutabilityFlags, [mutableFlags, &isMutableFlag](auto const& f) { - bool const canMutate = f.isCannotMutate ? isMutableFlag(f.mutabilityFlag) - : !isMutableFlag(f.mutabilityFlag); - return canMutate && (*mutableFlags & (f.setFlag | f.clearFlag)); - })) + if (std::any_of( + mptMutabilityFlags.begin(), + mptMutabilityFlags.end(), + [mutableFlags, &isMutableFlag](auto const& f) { + bool const canMutate = f.isCannotMutate ? isMutableFlag(f.mutabilityFlag) + : !isMutableFlag(f.mutabilityFlag); + return canMutate && (*mutableFlags & (f.setFlag | f.clearFlag)); + })) return tecNO_PERMISSION; - // Clearing lsfMPTRequireAuth is invalid when the issuance already has - // a DomainID set, because a DomainID requires RequireAuth to be active. - if ((*mutableFlags & tmfMPTClearRequireAuth) != 0u && - sleMptIssuance->isFieldPresent(sfDomainID)) - return tecNO_PERMISSION; - - if ((*mutableFlags & tmfMPTSetCanConfidentialAmount) != 0u || - (*mutableFlags & tmfMPTClearCanConfidentialAmount) != 0u) + if ((*mutableFlags & tmfMPTSetCanConfidentialAmount) || + (*mutableFlags & tmfMPTClearCanConfidentialAmount)) { std::uint64_t const confidentialOA = (*sleMptIssuance)[~sfConfidentialOutstandingAmount].value_or(0); @@ -343,7 +302,7 @@ MPTokenIssuanceSet::preclaim(PreclaimContext const& ctx) // Check if the transaction is enabling confidential amounts bool const enablesConfidentialAmount = - mutableFlags && (*mutableFlags & tmfMPTSetCanConfidentialAmount) != 0u; + mutableFlags && (*mutableFlags & tmfMPTSetCanConfidentialAmount); // Encryption keys can only be set if confidential amounts are already // enabled on the issuance OR if the transaction is enabling it @@ -499,23 +458,4 @@ MPTokenIssuanceSet::doApply() return tesSUCCESS; } -void -MPTokenIssuanceSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -MPTokenIssuanceSet::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/token/TrustSet.cpp b/src/libxrpl/tx/transactors/token/TrustSet.cpp index 1610b2e5b9..13c444af8b 100644 --- a/src/libxrpl/tx/transactors/token/TrustSet.cpp +++ b/src/libxrpl/tx/transactors/token/TrustSet.cpp @@ -1,34 +1,14 @@ -#include - -#include -#include -#include -#include -#include +#include #include #include #include #include -#include #include #include -#include -#include #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include - -#include -#include -#include +#include namespace { @@ -675,18 +655,4 @@ TrustSet::doApply() return terResult; } -void -TrustSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -TrustSet::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/vault/VaultClawback.cpp b/src/libxrpl/tx/transactors/vault/VaultClawback.cpp index da22b82578..095b44e072 100644 --- a/src/libxrpl/tx/transactors/vault/VaultClawback.cpp +++ b/src/libxrpl/tx/transactors/vault/VaultClawback.cpp @@ -1,35 +1,18 @@ -#include - -#include -#include -#include -#include -#include #include -#include +#include #include #include #include -#include -#include -#include -#include -#include #include #include #include -#include -#include // IWYU pragma: keep +#include #include -#include #include -#include -#include +#include +#include -#include -#include #include -#include #include namespace xrpl { @@ -470,23 +453,4 @@ VaultClawback::doApply() return tesSUCCESS; } -void -VaultClawback::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -VaultClawback::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/vault/VaultCreate.cpp b/src/libxrpl/tx/transactors/vault/VaultCreate.cpp index cc28abfe65..02f8ecb57b 100644 --- a/src/libxrpl/tx/transactors/vault/VaultCreate.cpp +++ b/src/libxrpl/tx/transactors/vault/VaultCreate.cpp @@ -1,8 +1,3 @@ -#include - -#include -#include -#include #include #include #include @@ -11,23 +6,16 @@ #include #include #include -#include #include #include #include -#include -#include // IWYU pragma: keep +#include #include -#include #include #include -#include -#include +#include #include - -#include -#include -#include +#include namespace xrpl { @@ -193,10 +181,8 @@ VaultCreate::doApply() .sequence = 1, .flags = mptFlags, .assetScale = scale, - .transferFee = std::nullopt, .metadata = tx[~sfMPTokenMetadata], .domainId = tx[~sfDomainID], - .mutableFlags = std::nullopt, }); if (!maybeShare) return maybeShare.error(); // LCOV_EXCL_LINE @@ -249,18 +235,4 @@ VaultCreate::doApply() return tesSUCCESS; } -void -VaultCreate::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -VaultCreate::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/vault/VaultDelete.cpp b/src/libxrpl/tx/transactors/vault/VaultDelete.cpp index e4542d524f..5a60c0032c 100644 --- a/src/libxrpl/tx/transactors/vault/VaultDelete.cpp +++ b/src/libxrpl/tx/transactors/vault/VaultDelete.cpp @@ -1,23 +1,14 @@ -#include - -#include -#include -#include +#include #include #include #include -#include -#include +#include #include -#include -#include -#include // IWYU pragma: keep -#include +#include +#include #include -#include -#include - -#include +#include +#include namespace xrpl { @@ -212,18 +203,4 @@ VaultDelete::doApply() return tesSUCCESS; } -void -VaultDelete::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -VaultDelete::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/vault/VaultDeposit.cpp b/src/libxrpl/tx/transactors/vault/VaultDeposit.cpp index fbb8908ddb..04b249d211 100644 --- a/src/libxrpl/tx/transactors/vault/VaultDeposit.cpp +++ b/src/libxrpl/tx/transactors/vault/VaultDeposit.cpp @@ -1,27 +1,19 @@ -#include - -#include -#include -#include +#include #include #include #include #include +#include #include -#include #include #include #include -#include -#include // IWYU pragma: keep +#include #include -#include #include -#include -#include - -#include -#include +#include +#include +#include namespace xrpl { @@ -278,23 +270,4 @@ VaultDeposit::doApply() return tesSUCCESS; } -void -VaultDeposit::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -VaultDeposit::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/vault/VaultSet.cpp b/src/libxrpl/tx/transactors/vault/VaultSet.cpp index a5b0b20699..b54389bcde 100644 --- a/src/libxrpl/tx/transactors/vault/VaultSet.cpp +++ b/src/libxrpl/tx/transactors/vault/VaultSet.cpp @@ -1,21 +1,13 @@ -#include - -#include -#include +#include +#include #include #include -#include -#include #include -#include -#include // IWYU pragma: keep +#include #include -#include #include -#include -#include - -#include +#include +#include namespace xrpl { @@ -179,18 +171,4 @@ VaultSet::doApply() return tesSUCCESS; } -void -VaultSet::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -VaultSet::finalizeInvariants(STTx const&, TER, XRPAmount, ReadView const&, beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/vault/VaultWithdraw.cpp b/src/libxrpl/tx/transactors/vault/VaultWithdraw.cpp index 3e608733b6..b3d2864380 100644 --- a/src/libxrpl/tx/transactors/vault/VaultWithdraw.cpp +++ b/src/libxrpl/tx/transactors/vault/VaultWithdraw.cpp @@ -1,28 +1,15 @@ -#include - -#include -#include -#include -#include #include +#include #include #include #include #include -#include -#include -#include #include -#include -#include // IWYU pragma: keep +#include #include -#include #include -#include -#include - -#include -#include +#include +#include namespace xrpl { @@ -295,23 +282,4 @@ VaultWithdraw::doApply() view(), ctx_.tx, account_, dstAcct, vaultAccount, preFeeBalance_, assetsWithdrawn, j_); } -void -VaultWithdraw::visitInvariantEntry( - bool, - std::shared_ptr const&, - std::shared_ptr const&) -{ -} - -bool -VaultWithdraw::finalizeInvariants( - STTx const&, - TER, - XRPAmount, - ReadView const&, - beast::Journal const&) -{ - return true; -} - } // namespace xrpl diff --git a/src/test/app/AMMCalc_test.cpp b/src/test/app/AMMCalc_test.cpp index 6c32c6118d..029a3121fe 100644 --- a/src/test/app/AMMCalc_test.cpp +++ b/src/test/app/AMMCalc_test.cpp @@ -1,35 +1,13 @@ +#include -#include -#include -#include - -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { /** AMM Calculator. Uses AMM formulas to simulate the payment engine * expected results. Assuming the formulas are correct some unit-tests can @@ -457,4 +435,5 @@ class AMMCalc_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE_MANUAL(AMMCalc, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/AMMClawbackMPT_test.cpp b/src/test/app/AMMClawbackMPT_test.cpp index 393c0b062c..c1da7aab9c 100644 --- a/src/test/app/AMMClawbackMPT_test.cpp +++ b/src/test/app/AMMClawbackMPT_test.cpp @@ -1,32 +1,12 @@ +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class AMMClawbackMPT_test : public beast::unit_test::suite { void @@ -1837,4 +1817,5 @@ class AMMClawbackMPT_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(AMMClawbackMPT, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/AMMClawback_test.cpp b/src/test/app/AMMClawback_test.cpp index bf08b57bf3..5803d1a0d3 100644 --- a/src/test/app/AMMClawback_test.cpp +++ b/src/test/app/AMMClawback_test.cpp @@ -1,41 +1,23 @@ +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class AMMClawback_test : public beast::unit_test::suite { void - testInvalidRequest(FeatureBitset features) + testInvalidRequest() { testcase("test invalid request"); using namespace jtx; // Test if holder does not exist. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(100000), gw, alice); @@ -60,7 +42,7 @@ class AMMClawback_test : public beast::unit_test::suite // Test if asset pair provided does not exist. This should // return terNO_AMM error. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(100000), gw, alice); @@ -92,7 +74,7 @@ class AMMClawback_test : public beast::unit_test::suite // Test if the issuer field and holder field is the same. This should // return temMALFORMED error. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(10000), gw, alice); @@ -120,7 +102,7 @@ class AMMClawback_test : public beast::unit_test::suite // Test if the Asset field matches the Account field. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(10000), gw, alice); @@ -148,7 +130,7 @@ class AMMClawback_test : public beast::unit_test::suite // Test if the Amount field matches the Asset field. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(10000), gw, alice); @@ -177,7 +159,7 @@ class AMMClawback_test : public beast::unit_test::suite // Test if the Amount is invalid, which is less than zero. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(10000), gw, alice); @@ -210,7 +192,7 @@ class AMMClawback_test : public beast::unit_test::suite // Test if the issuer did not set asfAllowTrustLineClawback, AMMClawback // transaction is prohibited. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(10000), gw, alice); @@ -234,7 +216,7 @@ class AMMClawback_test : public beast::unit_test::suite // Test invalid flag. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(10000), gw, alice); @@ -262,7 +244,7 @@ class AMMClawback_test : public beast::unit_test::suite // Test if tfClawTwoAssets is set when the two assets in the AMM pool // are not issued by the same issuer. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(10000), gw, alice); @@ -293,7 +275,7 @@ class AMMClawback_test : public beast::unit_test::suite // Test clawing back XRP is being prohibited. { - Env env(*this, features); + Env env(*this); Account const gw{"gateway"}; Account const alice{"alice"}; env.fund(XRP(1000000), gw, alice); @@ -2509,14 +2491,10 @@ class AMMClawback_test : public beast::unit_test::suite FeatureBitset const all = jtx::testable_amendments() - featureSingleAssetVault - featureLendingProtocol; - testInvalidRequest(all); - testInvalidRequest(all - featureMPTokensV2); + testInvalidRequest(); testFeatureDisabled(all - featureAMMClawback); for (auto const& features : - {all - fixAMMv1_3 - fixAMMClawbackRounding - featureMPTokensV2, - all - fixAMMClawbackRounding - featureMPTokensV2, - all - featureMPTokensV2, - all}) + {all - fixAMMv1_3 - fixAMMClawbackRounding, all - fixAMMClawbackRounding, all}) { testAMMClawbackSpecificAmount(features); testAMMClawbackExceedBalance(features); @@ -2532,4 +2510,5 @@ class AMMClawback_test : public beast::unit_test::suite } }; BEAST_DEFINE_TESTSUITE(AMMClawback, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/AMMExtendedMPT_test.cpp b/src/test/app/AMMExtendedMPT_test.cpp index 44ced2edc2..9ef71dec8c 100644 --- a/src/test/app/AMMExtendedMPT_test.cpp +++ b/src/test/app/AMMExtendedMPT_test.cpp @@ -1,59 +1,16 @@ +#include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { /** * Tests of AMM MPT that use offers. @@ -3658,4 +3615,5 @@ private: BEAST_DEFINE_TESTSUITE_PRIO(AMMExtendedMPT, app, xrpl, 1); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/AMMExtended_test.cpp b/src/test/app/AMMExtended_test.cpp index c94f0f405f..4b9f00bdd1 100644 --- a/src/test/app/AMMExtended_test.cpp +++ b/src/test/app/AMMExtended_test.cpp @@ -1,66 +1,24 @@ +#include #include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include -#include +#include +#include -#include -#include -#include -#include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { /** * Tests of AMM that use offers too. @@ -3585,4 +3543,5 @@ private: BEAST_DEFINE_TESTSUITE_PRIO(AMMExtended, app, xrpl, 1); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/AMMMPT_test.cpp b/src/test/app/AMMMPT_test.cpp index 9884645836..69de309383 100644 --- a/src/test/app/AMMMPT_test.cpp +++ b/src/test/app/AMMMPT_test.cpp @@ -1,59 +1,14 @@ +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { /** * Basic tests of AMM functionality involving MPT assets, excluding those that @@ -7083,4 +7038,5 @@ private: BEAST_DEFINE_TESTSUITE_PRIO(AMMMPT, app, xrpl, 1); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/AMM_test.cpp b/src/test/app/AMM_test.cpp index d2d7fbf2c7..a434eb96c7 100644 --- a/src/test/app/AMM_test.cpp +++ b/src/test/app/AMM_test.cpp @@ -1,70 +1,27 @@ +#include #include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include #include +#include -#include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { /** * Basic tests of AMM that do not use offers. @@ -5975,7 +5932,6 @@ private: } void - // NOLINTNEXTLINE(readability-convert-member-functions-to-static) testFixOverflowOffer(FeatureBitset featuresInitial) { using namespace jtx; @@ -7135,4 +7091,5 @@ private: BEAST_DEFINE_TESTSUITE_PRIO(AMM, app, xrpl, 1); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/AccountDelete_test.cpp b/src/test/app/AccountDelete_test.cpp index c2ecb91a84..4382fb27c7 100644 --- a/src/test/app/AccountDelete_test.cpp +++ b/src/test/app/AccountDelete_test.cpp @@ -1,50 +1,10 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class AccountDelete_test : public beast::unit_test::suite { @@ -1090,4 +1050,5 @@ public: BEAST_DEFINE_TESTSUITE_PRIO(AccountDelete, app, xrpl, 2); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/AccountSet_test.cpp b/src/test/app/AccountSet_test.cpp index 15012abe36..246f18c445 100644 --- a/src/test/app/AccountSet_test.cpp +++ b/src/test/app/AccountSet_test.cpp @@ -1,54 +1,13 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include -#include -#include #include #include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { class AccountSet_test : public beast::unit_test::suite @@ -125,7 +84,7 @@ public: continue; } - if (std::ranges::find(goodFlags, flag) != goodFlags.end()) + if (std::find(goodFlags.begin(), goodFlags.end(), flag) != goodFlags.end()) { // Good flag env.require(nflags(alice, flag)); @@ -361,13 +320,13 @@ public: doTests( testable_amendments(), - {{.set = 1.0, .code = tesSUCCESS, .get = 1.0}, - {.set = 1.1, .code = tesSUCCESS, .get = 1.1}, - {.set = 2.0, .code = tesSUCCESS, .get = 2.0}, - {.set = 2.1, .code = temBAD_TRANSFER_RATE, .get = 2.0}, - {.set = 0.0, .code = tesSUCCESS, .get = 1.0}, - {.set = 2.0, .code = tesSUCCESS, .get = 2.0}, - {.set = 0.9, .code = temBAD_TRANSFER_RATE, .get = 2.0}}); + {{1.0, tesSUCCESS, 1.0}, + {1.1, tesSUCCESS, 1.1}, + {2.0, tesSUCCESS, 2.0}, + {2.1, temBAD_TRANSFER_RATE, 2.0}, + {0.0, tesSUCCESS, 1.0}, + {2.0, tesSUCCESS, 2.0}, + {0.9, temBAD_TRANSFER_RATE, 2.0}}); } void diff --git a/src/test/app/AccountTxPaging_test.cpp b/src/test/app/AccountTxPaging_test.cpp index d5c299b782..1f2e909927 100644 --- a/src/test/app/AccountTxPaging_test.cpp +++ b/src/test/app/AccountTxPaging_test.cpp @@ -1,13 +1,7 @@ +#include +#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include #include #include diff --git a/src/test/app/AmendmentTable_test.cpp b/src/test/app/AmendmentTable_test.cpp index 7edaef3821..007715f9d1 100644 --- a/src/test/app/AmendmentTable_test.cpp +++ b/src/test/app/AmendmentTable_test.cpp @@ -1,44 +1,21 @@ #include -#include #include -#include -#include #include #include -#include -#include +#include #include -#include -#include -#include +#include #include -#include #include -#include #include -#include -#include #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { class AmendmentTable_test final : public beast::unit_test::suite @@ -442,7 +419,7 @@ public: BEAST_EXPECT(table->unVeto(unvetoedID)); std::vector const desired = table->getDesired(); - BEAST_EXPECT(std::ranges::find(desired, unvetoedID) != desired.end()); + BEAST_EXPECT(std::find(desired.begin(), desired.end(), unvetoedID) != desired.end()); } // Veto all supported amendments. Now desired should be empty. @@ -977,9 +954,10 @@ public: // We need a hash_set to pass to trustChanged. hash_set trustedValidators; trustedValidators.reserve(validators.size()); - std::ranges::for_each(validators, [&trustedValidators](auto const& val) { - trustedValidators.insert(val.first); - }); + std::for_each( + validators.begin(), validators.end(), [&trustedValidators](auto const& val) { + trustedValidators.insert(val.first); + }); // Tell the AmendmentTable that the UNL changed. table->trustChanged(trustedValidators); @@ -1173,8 +1151,9 @@ public: BEAST_EXPECT(table->needValidatedLedger(1)); std::set enabled; - std::ranges::for_each( - unsupported_, [&enabled](auto const& s) { enabled.insert(amendmentId(s)); }); + std::for_each(unsupported_.begin(), unsupported_.end(), [&enabled](auto const& s) { + enabled.insert(amendmentId(s)); + }); majorityAmendments_t majority; table->doValidatedLedger(1, enabled, majority); @@ -1182,9 +1161,12 @@ public: BEAST_EXPECT(!table->firstUnsupportedExpected()); NetClock::duration t{1000s}; - std::ranges::for_each(unsupportedMajority_, [&majority, &t](auto const& s) { - majority[amendmentId(s)] = NetClock::time_point{--t}; - }); + std::for_each( + unsupportedMajority_.begin(), + unsupportedMajority_.end(), + [&majority, &t](auto const& s) { + majority[amendmentId(s)] = NetClock::time_point{--t}; + }); table->doValidatedLedger(1, enabled, majority); BEAST_EXPECT(table->hasUnsupportedEnabled()); diff --git a/src/test/app/Batch_test.cpp b/src/test/app/Batch_test.cpp index 6d8e1f2de3..0bc2157b9d 100644 --- a/src/test/app/Batch_test.cpp +++ b/src/test/app/Batch_test.cpp @@ -1,78 +1,22 @@ -#include -#include +#include #include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class Batch_test : public beast::unit_test::suite { @@ -2657,9 +2601,10 @@ class Batch_test : public beast::unit_test::suite { testcase("loan"); - bool const lendingBatchEnabled = !std::ranges::any_of( - Batch::disabledTxTypes, - [](auto const& disabled) { return disabled == ttLOAN_BROKER_SET; }); + bool const lendingBatchEnabled = !std::any_of( + Batch::disabledTxTypes.begin(), Batch::disabledTxTypes.end(), [](auto const& disabled) { + return disabled == ttLOAN_BROKER_SET; + }); using namespace test::jtx; @@ -4422,4 +4367,5 @@ public: BEAST_DEFINE_TESTSUITE(Batch, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/CheckMPT_test.cpp b/src/test/app/CheckMPT_test.cpp index fb9d413e6e..a1f35d0507 100644 --- a/src/test/app/CheckMPT_test.cpp +++ b/src/test/app/CheckMPT_test.cpp @@ -1,54 +1,9 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { class CheckMPT_test : public beast::unit_test::suite @@ -1380,14 +1335,10 @@ class CheckMPT_test : public beast::unit_test::suite AccountOwns( beast::unit_test::suite& s, Env& e, - Account a, + Account const& a, bool isIssuer_, bool requireAuth_ = false) - : suite(s) - , env(e) - , acct(std::move(a)) - , isIssuer(isIssuer_) - , requireAuth(requireAuth_) + : suite(s), env(e), acct(a), isIssuer(isIssuer_), requireAuth(requireAuth_) { } diff --git a/src/test/app/Check_test.cpp b/src/test/app/Check_test.cpp index f2c7ab3a38..e062bd8e72 100644 --- a/src/test/app/Check_test.cpp +++ b/src/test/app/Check_test.cpp @@ -1,52 +1,9 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include - namespace xrpl { class Check_test : public beast::unit_test::suite @@ -1881,8 +1838,8 @@ class Check_test : public beast::unit_test::suite } }; - AccountOwns alice{.suite = *this, .env = env, .acct = "alice", .owners = 0}; - AccountOwns bob{.suite = *this, .env = env, .acct = "bob", .owners = 0}; + AccountOwns alice{*this, env, "alice", 0}; + AccountOwns bob{*this, env, "bob", 0}; // Fund with noripple so the accounts do not have any flags set. env.fund(XRP(5000), noripple(alice, bob)); @@ -1891,7 +1848,7 @@ class Check_test : public beast::unit_test::suite // Automatic trust line creation should fail if the check destination // can't afford the reserve for the trust line. { - AccountOwns const gw1{.suite = *this, .env = env, .acct = "gw1", .owners = 0}; + AccountOwns const gw1{*this, env, "gw1", 0}; // Fund gw1 with noripple (even though that's atypical for a // gateway) so it does not have any flags set. We'll set flags @@ -2011,7 +1968,7 @@ class Check_test : public beast::unit_test::suite { // No account root flags on any participant. // Automatic trust line from issuer to destination. - AccountOwns const gw1{.suite = *this, .env = env, .acct = "gw1", .owners = 0}; + AccountOwns const gw1{*this, env, "gw1", 0}; BEAST_EXPECT((*env.le(gw1))[sfFlags] == 0); BEAST_EXPECT((*env.le(alice))[sfFlags] == 0); @@ -2064,7 +2021,7 @@ class Check_test : public beast::unit_test::suite // Transfer of assets using offers does not require rippling. // So bob's offer is successfully crossed which creates the // trust line. - AccountOwns const gw1{.suite = *this, .env = env, .acct = "gw1", .owners = 0}; + AccountOwns const gw1{*this, env, "gw1", 0}; IOU const OF1 = gw1["OF1"]; env(offer(alice, XRP(97), OF1(97))); env.close(); @@ -2113,7 +2070,7 @@ class Check_test : public beast::unit_test::suite { // gw1 enables rippling. // Automatic trust line from issuer to non-issuer should still work. - AccountOwns const gw1{.suite = *this, .env = env, .acct = "gw1", .owners = 0}; + AccountOwns const gw1{*this, env, "gw1", 0}; env(fset(gw1, asfDefaultRipple)); env.close(); @@ -2161,7 +2118,7 @@ class Check_test : public beast::unit_test::suite // to non-issuer should work. // Use offers to automatically create the trust line. - AccountOwns const gw1{.suite = *this, .env = env, .acct = "gw1", .owners = 0}; + AccountOwns const gw1{*this, env, "gw1", 0}; IOU const OF2 = gw1["OF2"]; env(offer(alice, XRP(95), OF2(95))); env.close(); @@ -2202,7 +2159,7 @@ class Check_test : public beast::unit_test::suite // change any outcomes. // // Automatic trust line from issuer to non-issuer should still work. - AccountOwns const gw1{.suite = *this, .env = env, .acct = "gw1", .owners = 0}; + AccountOwns const gw1{*this, env, "gw1", 0}; env(fset(gw1, asfDepositAuth)); env(fset(alice, asfDepositAuth)); env(fset(bob, asfDepositAuth)); @@ -2252,7 +2209,7 @@ class Check_test : public beast::unit_test::suite // automatic trust line creation. // Use offers to automatically create the trust line. - AccountOwns const gw1{.suite = *this, .env = env, .acct = "gw1", .owners = 0}; + AccountOwns const gw1{*this, env, "gw1", 0}; IOU const OF3 = gw1["OF3"]; env(offer(alice, XRP(93), OF3(93))); env.close(); @@ -2289,7 +2246,7 @@ class Check_test : public beast::unit_test::suite { // Set lsfGlobalFreeze on gw1. That should stop any automatic // trust lines from being created. - AccountOwns const gw1{.suite = *this, .env = env, .acct = "gw1", .owners = 0}; + AccountOwns const gw1{*this, env, "gw1", 0}; env(fset(gw1, asfGlobalFreeze)); env.close(); @@ -2331,7 +2288,7 @@ class Check_test : public beast::unit_test::suite // no automatic trust line creation between non-issuers. // Use offers to automatically create the trust line. - AccountOwns const gw1{.suite = *this, .env = env, .acct = "gw1", .owners = 0}; + AccountOwns const gw1{*this, env, "gw1", 0}; IOU const OF4 = gw1["OF4"]; env(offer(alice, XRP(91), OF4(91)), ter(tecFROZEN)); env.close(); @@ -2370,7 +2327,7 @@ class Check_test : public beast::unit_test::suite // flag on an account that already has trust lines. So we'll fund // a new gateway and use that. { - AccountOwns gw2{.suite = *this, .env = env, .acct = "gw2", .owners = 0}; + AccountOwns gw2{*this, env, "gw2", 0}; env.fund(XRP(5000), gw2); env.close(); @@ -2434,7 +2391,7 @@ class Check_test : public beast::unit_test::suite // no automatic trust line creation between non-issuers. // Use offers to automatically create the trust line. - AccountOwns const gw2{.suite = *this, .env = env, .acct = "gw2", .owners = 0}; + AccountOwns const gw2{*this, env, "gw2", 0}; IOU const OF5 = gw2["OF5"]; env(offer(alice, XRP(91), OF5(91)), ter(tecUNFUNDED_OFFER)); env.close(); diff --git a/src/test/app/Clawback_test.cpp b/src/test/app/Clawback_test.cpp index 8efcece295..902acf3222 100644 --- a/src/test/app/Clawback_test.cpp +++ b/src/test/app/Clawback_test.cpp @@ -1,28 +1,7 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include - -#include -#include -#include namespace xrpl { diff --git a/src/test/app/ConfidentialTransfer_test.cpp b/src/test/app/ConfidentialTransfer_test.cpp index 43a2ea8f46..321464167f 100644 --- a/src/test/app/ConfidentialTransfer_test.cpp +++ b/src/test/app/ConfidentialTransfer_test.cpp @@ -1,44 +1,12 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -102,7 +70,7 @@ class ConfidentialTransfer_test : public beast::unit_test::suite return trivialCommitment; } - static std::string + std::string getTrivialSendProofHex() { Buffer buf(ecSendProofLength); @@ -5415,14 +5383,12 @@ class ConfidentialTransfer_test : public beast::unit_test::suite auto holderPubKeySet = false; auto verifyToggle = [&](TER expectedResult, uint64_t amt) { if (!holderPubKeySet) - { mptAlice.convert({ .account = bob, .amt = amt, .holderPubKey = mptAlice.getPubKey(bob), .err = expectedResult, }); - } else { mptAlice.convert({ @@ -7388,7 +7354,7 @@ class ConfidentialTransfer_test : public beast::unit_test::suite // alice is issuer; bob has 'bobAmt' in confidential spending; carol has // 'carolAmt' in confidential spending; dave is initialised with pubkey but // zero spending/inbox. - static void + void setupBatchEnv( test::jtx::MPTTester& mpt, test::jtx::Account const& alice, diff --git a/src/test/app/Credentials_test.cpp b/src/test/app/Credentials_test.cpp index 3c9a658aca..317fd47b2b 100644 --- a/src/test/app/Credentials_test.cpp +++ b/src/test/app/Credentials_test.cpp @@ -1,38 +1,18 @@ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include #include #include -#include #include #include -#include #include -#include -#include #include #include -#include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { struct Credentials_test : public beast::unit_test::suite { @@ -1048,4 +1028,5 @@ struct Credentials_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(Credentials, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/CrossingLimitsMPT_test.cpp b/src/test/app/CrossingLimitsMPT_test.cpp index 8efacaae21..6e977a6e68 100644 --- a/src/test/app/CrossingLimitsMPT_test.cpp +++ b/src/test/app/CrossingLimitsMPT_test.cpp @@ -1,22 +1,10 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include #include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class CrossingLimitsMPT_test : public beast::unit_test::suite { @@ -439,4 +427,5 @@ public: BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(CrossingLimitsMPT, tx, xrpl, 10); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/CrossingLimits_test.cpp b/src/test/app/CrossingLimits_test.cpp index 0cbe57a464..a0e0a95437 100644 --- a/src/test/app/CrossingLimits_test.cpp +++ b/src/test/app/CrossingLimits_test.cpp @@ -1,20 +1,10 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class CrossingLimits_test : public beast::unit_test::suite { @@ -408,4 +398,5 @@ public: BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(CrossingLimits, app, xrpl, 10); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/DID_test.cpp b/src/test/app/DID_test.cpp index bd3ea59971..20c367d64f 100644 --- a/src/test/app/DID_test.cpp +++ b/src/test/app/DID_test.cpp @@ -1,21 +1,12 @@ +#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include - -#include #include #include -#include -#include -namespace xrpl::test { +#include + +namespace xrpl { +namespace test { struct DID_test : public beast::unit_test::suite { @@ -378,4 +369,5 @@ struct DID_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(DID, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/DNS_test.cpp b/src/test/app/DNS_test.cpp index 3997da60db..2273a77e09 100644 --- a/src/test/app/DNS_test.cpp +++ b/src/test/app/DNS_test.cpp @@ -1,22 +1,14 @@ +#include -#include - -#include #include #include -#include - -#include -#include #include -#include #include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class DNS_test : public beast::unit_test::suite { @@ -119,4 +111,5 @@ public: BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(DNS, app, xrpl, 20); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Delegate_test.cpp b/src/test/app/Delegate_test.cpp index d43f264cb7..0710ddf2d1 100644 --- a/src/test/app/Delegate_test.cpp +++ b/src/test/app/Delegate_test.cpp @@ -1,56 +1,13 @@ -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class Delegate_test : public beast::unit_test::suite { void @@ -1944,4 +1901,5 @@ class Delegate_test : public beast::unit_test::suite } }; BEAST_DEFINE_TESTSUITE(Delegate, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/DeliverMin_test.cpp b/src/test/app/DeliverMin_test.cpp index 4b3b6d34ad..fe044353b7 100644 --- a/src/test/app/DeliverMin_test.cpp +++ b/src/test/app/DeliverMin_test.cpp @@ -1,22 +1,10 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include #include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class DeliverMin_test : public beast::unit_test::suite { @@ -140,4 +128,5 @@ public: BEAST_DEFINE_TESTSUITE(DeliverMin, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/DepositAuth_test.cpp b/src/test/app/DepositAuth_test.cpp index c9773cba8b..9b5dca3ca2 100644 --- a/src/test/app/DepositAuth_test.cpp +++ b/src/test/app/DepositAuth_test.cpp @@ -1,50 +1,11 @@ +#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { // Helper function that returns the reserve on an account based on // the passed in number of owners. @@ -1408,4 +1369,5 @@ struct DepositPreauth_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(DepositAuth, app, xrpl); BEAST_DEFINE_TESTSUITE(DepositPreauth, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Discrepancy_test.cpp b/src/test/app/Discrepancy_test.cpp index b01b11aa11..d8c14df64e 100644 --- a/src/test/app/Discrepancy_test.cpp +++ b/src/test/app/Discrepancy_test.cpp @@ -1,25 +1,13 @@ -#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include +#include #include #include -#include #include -#include - namespace xrpl { class Discrepancy_test : public beast::unit_test::suite diff --git a/src/test/app/EscrowToken_test.cpp b/src/test/app/EscrowToken_test.cpp index d77043a624..6e08c3eddf 100644 --- a/src/test/app/EscrowToken_test.cpp +++ b/src/test/app/EscrowToken_test.cpp @@ -1,47 +1,19 @@ +#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include #include -#include #include -#include #include #include -#include -#include -#include -#include #include -#include #include -#include #include +#include #include -#include -#include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { struct EscrowToken_test : public beast::unit_test::suite { @@ -1013,17 +985,13 @@ struct EscrowToken_test : public beast::unit_test::suite { xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), aa) != aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) != aod.end()); } { xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 4); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), aa) != iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), aa) != iod.end()); } env(escrow::create(bob, bob, USD(1'000)), @@ -1038,17 +1006,13 @@ struct EscrowToken_test : public beast::unit_test::suite { xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bb) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end()); } { xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 5); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), bb) != iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), bb) != iod.end()); } env.close(5s); @@ -1060,21 +1024,15 @@ struct EscrowToken_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), aa) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) == aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bb) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end()); xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 4); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), bb) != iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), bb) != iod.end()); } env.close(5s); @@ -1086,15 +1044,11 @@ struct EscrowToken_test : public beast::unit_test::suite xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bb) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) == bod.end()); xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 3); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), bb) == iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), bb) == iod.end()); } } { @@ -1133,33 +1087,21 @@ struct EscrowToken_test : public beast::unit_test::suite { xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ab) != aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) != aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 3); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), ab) != bod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bc) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(cod.begin(), cod.end(), bc) != cod.end()); + BEAST_EXPECT(std::find(cod.begin(), cod.end(), bc) != cod.end()); xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 5); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), ab) != iod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), bc) != iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), ab) != iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), bc) != iod.end()); } env.close(5s); @@ -1170,30 +1112,20 @@ struct EscrowToken_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ab) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), ab) == bod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bc) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2); xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 4); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), ab) == iod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), bc) != iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), ab) == iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), bc) != iod.end()); } env.close(5s); @@ -1204,30 +1136,20 @@ struct EscrowToken_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ab) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), ab) == bod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bc) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) == bod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 3); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), ab) == iod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), bc) == iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), ab) == iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), bc) == iod.end()); } } @@ -1262,18 +1184,14 @@ struct EscrowToken_test : public beast::unit_test::suite { xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ag) != aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ag) != aod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 3); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), ag) != iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), ag) != iod.end()); } env.close(5s); @@ -1283,18 +1201,14 @@ struct EscrowToken_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ag) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ag) == aod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), ag) == iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), ag) == iod.end()); } } } @@ -1317,53 +1231,21 @@ struct EscrowToken_test : public beast::unit_test::suite std::array const tests = {{ // src > dst && src > issuer && dst no trustline - {.src = Account("alice2"), - .dst = Account("bob0"), - .gw = Account{"gw0"}, - .hasTrustline = false, - .negative = true}, + {Account("alice2"), Account("bob0"), Account{"gw0"}, false, true}, // src < dst && src < issuer && dst no trustline - {.src = Account("carol0"), - .dst = Account("dan1"), - .gw = Account{"gw1"}, - .hasTrustline = false, - .negative = false}, + {Account("carol0"), Account("dan1"), Account{"gw1"}, false, false}, // dst > src && dst > issuer && dst no trustline - {.src = Account("dan1"), - .dst = Account("alice2"), - .gw = Account{"gw0"}, - .hasTrustline = false, - .negative = true}, + {Account("dan1"), Account("alice2"), Account{"gw0"}, false, true}, // dst < src && dst < issuer && dst no trustline - {.src = Account("bob0"), - .dst = Account("carol0"), - .gw = Account{"gw1"}, - .hasTrustline = false, - .negative = false}, + {Account("bob0"), Account("carol0"), Account{"gw1"}, false, false}, // src > dst && src > issuer && dst has trustline - {.src = Account("alice2"), - .dst = Account("bob0"), - .gw = Account{"gw0"}, - .hasTrustline = true, - .negative = true}, + {Account("alice2"), Account("bob0"), Account{"gw0"}, true, true}, // src < dst && src < issuer && dst has trustline - {.src = Account("carol0"), - .dst = Account("dan1"), - .gw = Account{"gw1"}, - .hasTrustline = true, - .negative = false}, + {Account("carol0"), Account("dan1"), Account{"gw1"}, true, false}, // dst > src && dst > issuer && dst has trustline - {.src = Account("dan1"), - .dst = Account("alice2"), - .gw = Account{"gw0"}, - .hasTrustline = true, - .negative = true}, + {Account("dan1"), Account("alice2"), Account{"gw0"}, true, true}, // dst < src && dst < issuer && dst has trustline - {.src = Account("bob0"), - .dst = Account("carol0"), - .gw = Account{"gw1"}, - .hasTrustline = true, - .negative = false}, + {Account("bob0"), Account("carol0"), Account{"gw1"}, true, false}, }}; for (auto const& t : tests) @@ -1455,13 +1337,13 @@ struct EscrowToken_test : public beast::unit_test::suite std::array const gwDstTests = {{ // src > dst && src > issuer && dst has trustline - {.src = Account("alice2"), .dst = Account{"gw0"}, .hasTrustline = true}, + {Account("alice2"), Account{"gw0"}, true}, // src < dst && src < issuer && dst has trustline - {.src = Account("carol0"), .dst = Account{"gw1"}, .hasTrustline = true}, + {Account("carol0"), Account{"gw1"}, true}, // dst > src && dst > issuer && dst has trustline - {.src = Account("dan1"), .dst = Account{"gw0"}, .hasTrustline = true}, + {Account("dan1"), Account{"gw0"}, true}, // dst < src && dst < issuer && dst has trustline - {.src = Account("bob0"), .dst = Account{"gw1"}, .hasTrustline = true}, + {Account("bob0"), Account{"gw1"}, true}, }}; // issuer is destination @@ -3220,17 +3102,13 @@ struct EscrowToken_test : public beast::unit_test::suite { xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), aa) != aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) != aod.end()); } { xrpl::Dir const iod(*env.current(), keylet::ownerDir(gw.id())); BEAST_EXPECT(std::distance(iod.begin(), iod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(iod.begin(), iod.end(), aa) == iod.end()); + BEAST_EXPECT(std::find(iod.begin(), iod.end(), aa) == iod.end()); } env(escrow::create(bob, bob, MPT(1'000)), @@ -3245,9 +3123,7 @@ struct EscrowToken_test : public beast::unit_test::suite { xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bb) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end()); } env.close(5s); @@ -3259,15 +3135,11 @@ struct EscrowToken_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), aa) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) == aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bb) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end()); } env.close(5s); @@ -3279,9 +3151,7 @@ struct EscrowToken_test : public beast::unit_test::suite xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bb) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) == bod.end()); } } @@ -3323,24 +3193,16 @@ struct EscrowToken_test : public beast::unit_test::suite { xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ab) != aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) != aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 3); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), ab) != bod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bc) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(cod.begin(), cod.end(), bc) != cod.end()); + BEAST_EXPECT(std::find(cod.begin(), cod.end(), bc) != cod.end()); } env.close(5s); @@ -3351,18 +3213,12 @@ struct EscrowToken_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ab) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), ab) == bod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bc) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 2); @@ -3376,18 +3232,12 @@ struct EscrowToken_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ab) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bob.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), ab) == bod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bc) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) == bod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); @@ -3936,4 +3786,5 @@ public: BEAST_DEFINE_TESTSUITE(EscrowToken, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Escrow_test.cpp b/src/test/app/Escrow_test.cpp index 77d51f2758..05640cde01 100644 --- a/src/test/app/Escrow_test.cpp +++ b/src/test/app/Escrow_test.cpp @@ -1,38 +1,17 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include #include #include #include -#include -#include #include #include #include #include -#include -#include -#include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { struct Escrow_test : public beast::unit_test::suite { @@ -1123,9 +1102,7 @@ struct Escrow_test : public beast::unit_test::suite { xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), aa) != aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) != aod.end()); } env(escrow::create(bruce, bruce, XRP(1000)), @@ -1140,9 +1117,7 @@ struct Escrow_test : public beast::unit_test::suite { xrpl::Dir const bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bb) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end()); } env.close(5s); @@ -1154,15 +1129,11 @@ struct Escrow_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 0); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), aa) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), aa) == aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bb) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) != bod.end()); } env.close(5s); @@ -1174,9 +1145,7 @@ struct Escrow_test : public beast::unit_test::suite xrpl::Dir const bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 0); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bb) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bb) == bod.end()); } } { @@ -1207,24 +1176,16 @@ struct Escrow_test : public beast::unit_test::suite { xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ab) != aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) != aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 2); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), ab) != bod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bc) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(cod.begin(), cod.end(), bc) != cod.end()); + BEAST_EXPECT(std::find(cod.begin(), cod.end(), bc) != cod.end()); } env.close(5s); @@ -1235,18 +1196,12 @@ struct Escrow_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 0); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ab) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 1); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), ab) == bod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bc) != bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) != bod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 1); @@ -1260,18 +1215,12 @@ struct Escrow_test : public beast::unit_test::suite xrpl::Dir const aod(*env.current(), keylet::ownerDir(alice.id())); BEAST_EXPECT(std::distance(aod.begin(), aod.end()) == 0); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(aod.begin(), aod.end(), ab) == aod.end()); + BEAST_EXPECT(std::find(aod.begin(), aod.end(), ab) == aod.end()); xrpl::Dir const bod(*env.current(), keylet::ownerDir(bruce.id())); BEAST_EXPECT(std::distance(bod.begin(), bod.end()) == 0); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), ab) == bod.end()); - BEAST_EXPECT( - // NOLINTNEXTLINE(modernize-use-ranges) - std::find(bod.begin(), bod.end(), bc) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), ab) == bod.end()); + BEAST_EXPECT(std::find(bod.begin(), bod.end(), bc) == bod.end()); xrpl::Dir const cod(*env.current(), keylet::ownerDir(carol.id())); BEAST_EXPECT(std::distance(cod.begin(), cod.end()) == 0); @@ -1642,4 +1591,5 @@ public: BEAST_DEFINE_TESTSUITE(Escrow, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/FeeVote_test.cpp b/src/test/app/FeeVote_test.cpp index e24b54c82a..62f1058de5 100644 --- a/src/test/app/FeeVote_test.cpp +++ b/src/test/app/FeeVote_test.cpp @@ -1,40 +1,18 @@ - -#include +#include #include -#include #include -#include -#include -#include -#include #include #include #include -#include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { struct FeeSettingsFields { @@ -198,7 +176,7 @@ getTxs(std::shared_ptr const& txSet) { auto const data = i->slice(); auto serialIter = SerialIter(data); - txs.emplace_back(serialIter); + txs.push_back(STTx(serialIter)); } return txs; }; @@ -747,4 +725,5 @@ class FeeVote_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(FeeVote, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/FixNFTokenPageLinks_test.cpp b/src/test/app/FixNFTokenPageLinks_test.cpp index 56484bb396..e5ecdf2639 100644 --- a/src/test/app/FixNFTokenPageLinks_test.cpp +++ b/src/test/app/FixNFTokenPageLinks_test.cpp @@ -1,32 +1,9 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include #include -#include - -#include -#include -#include +#include namespace xrpl { @@ -94,7 +71,7 @@ class FixNFTokenPageLinks_test : public beast::unit_test::suite // Sort the NFTs so they are listed in storage order, not // creation order. - std::ranges::sort(nfts); + std::sort(nfts.begin(), nfts.end()); // Verify that the owner does indeed have exactly three pages // of NFTs with 32 entries in each page. diff --git a/src/test/app/FlowMPT_test.cpp b/src/test/app/FlowMPT_test.cpp index eabd239550..004bb6eee4 100644 --- a/src/test/app/FlowMPT_test.cpp +++ b/src/test/app/FlowMPT_test.cpp @@ -1,49 +1,17 @@ -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + #include #include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { struct FlowMPT_test : public beast::unit_test::suite { @@ -856,8 +824,7 @@ struct FlowMPT_test : public beast::unit_test::suite // available. Consequently, the entire offer is crossed. // Note remaining takerGets is 541 rather than 540 due to integral // rounding. XRP has a similar result. - return TokenData{ - .gets = EUR, .pays = USD, .remTakerGets = EUR(541), .remTakerPays = USD(450)}; + return TokenData{EUR, USD, EUR(541), USD(450)}; }; auto initXRP = [&](Env& env) { @@ -869,11 +836,7 @@ struct FlowMPT_test : public beast::unit_test::suite // available. Consequently, the entire offer is crossed. // Note remaining takerGets is 540.000001 rather than 540 due to // integral rounding. - return TokenData{ - .gets = XRP, - .pays = USD, - .remTakerGets = XRP(540.000001), - .remTakerPays = USD(450)}; + return TokenData{XRP, USD, XRP(540.000001), USD(450)}; }; auto initIOU = [&](Env& env) { @@ -885,8 +848,7 @@ struct FlowMPT_test : public beast::unit_test::suite // Payment's engine last step is limited by alice's // trustline - 606. Therefore, only 6EUR is delivered // and the offer is partially crossed. - return TokenData{ - .gets = EUR, .pays = USD, .remTakerGets = EUR(594), .remTakerPays = USD(495)}; + return TokenData{EUR, USD, EUR(594), USD(495)}; }; auto initIOU1 = [&](Env& env) { @@ -898,8 +860,7 @@ struct FlowMPT_test : public beast::unit_test::suite // Payment's engine last step is not limited by alice's // trustline. Therefore, the entire offer is crossed. // This the same result as with MPT. - return TokenData{ - .gets = EUR, .pays = USD, .remTakerGets = EUR(540), .remTakerPays = USD(450)}; + return TokenData{EUR, USD, EUR(540), USD(450)}; }; auto test = [&](auto&& initToken) { @@ -2146,4 +2107,5 @@ struct FlowMPT_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE_PRIO(FlowMPT, app, xrpl, 2); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Flow_test.cpp b/src/test/app/Flow_test.cpp index 8f096a970f..218f6fe03a 100644 --- a/src/test/app/Flow_test.cpp +++ b/src/test/app/Flow_test.cpp @@ -1,55 +1,18 @@ -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + #include -#include -#include -#include -#include #include #include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { bool getNoRippleFlag( @@ -1323,4 +1286,5 @@ struct Flow_manual_test : public Flow_test BEAST_DEFINE_TESTSUITE_PRIO(Flow, app, xrpl, 2); BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Flow_manual, app, xrpl, 4); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Freeze_test.cpp b/src/test/app/Freeze_test.cpp index 29127ec8e1..ed5ee47578 100644 --- a/src/test/app/Freeze_test.cpp +++ b/src/test/app/Freeze_test.cpp @@ -1,38 +1,12 @@ +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include #include -#include #include -#include #include -#include -#include -#include -#include - namespace xrpl { class Freeze_test : public beast::unit_test::suite diff --git a/src/test/app/GRPCServerTLS_test.cpp b/src/test/app/GRPCServerTLS_test.cpp deleted file mode 100644 index a421f981f7..0000000000 --- a/src/test/app/GRPCServerTLS_test.cpp +++ /dev/null @@ -1,849 +0,0 @@ -#include -#include - -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace { - -constexpr std::string_view kCA_CERT_CONTENT = - "-----BEGIN CERTIFICATE-----\n" - "MIIFhjCCA26gAwIBAgIJAL9P70zX30oiMA0GCSqGSIb3DQEBCwUAMFcxCzAJBgNV\n" - "BAYTAlVTMQ0wCwYDVQQIDARUZXN0MQ0wCwYDVQQHDARUZXN0MRgwFgYDVQQKDA9S\n" - "aXBwbGVkIFRlc3QgQ0ExEDAOBgNVBAMMB1Rlc3QgQ0EwIBcNMjYwNDA5MTMyNTA2\n" - "WhgPMjEyNjAzMTYxMzI1MDZaMFcxCzAJBgNVBAYTAlVTMQ0wCwYDVQQIDARUZXN0\n" - "MQ0wCwYDVQQHDARUZXN0MRgwFgYDVQQKDA9SaXBwbGVkIFRlc3QgQ0ExEDAOBgNV\n" - "BAMMB1Rlc3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCzOJ5s\n" - "dy1O0GN/kmbeWf5DmFbQBSS9FRKxh6/o9V9BqRBQfECrVK9T5Y4FYrGGtmUW3YEV\n" - "uMDZ5q6rvBT2zrrzPXnWA5Pb4I4mKqC/yk5L7Mm8A9xQsNoRzgTyl/NuHiXKn+yQ\n" - "FuidA6U36qwIAcDR7gLqrJ1ud/ng9f9Q4k6+IItY/XGhcz4nKlQq9jpzmfdSlBkU\n" - "hXsIsdNtC+UGlQMCMX2jwysIFfjjCOMlH7KFQ3dKodhsW+Ym6AsPwyRGCgNXO/zd\n" - "Fqt1MIMs1F7r40DtfVO3R7w4/2SblcceZlsDrYQUbJnH+sEPWO0SGGo6Y7Ohs09+\n" - "aJSOAGGQVgTSLuAcFtR4BXD0GLn39+10PDvHGOsMJKL1de1f96s8kPlifQ5AGWuc\n" - "xy6XsupGSa0F8LozwQmKD7hVkyladUTWFPknz5tsPEVApTO0U8Vuknuhyovo6+mx\n" - "qBoSD32NwHveFz3jWqfj0CGX9BwL9AOpMabDhROVQfyM5GrLeLOOdgOnsBXJYYdW\n" - "MeJwz6BH30q9yvEd9Ti26jSk3fM8WPuEkZzNNp8STEMyDrfhaKOe5fGPWLnqMQAf\n" - "yMCDLwB1WqIN1Q6gOELb3rxyYDVH/5x6/JXosdUe1qx/tzvRoSWxxssRRd2Em+e+\n" - "MUFLXz+9D6kZ9XCuP/mLyRGW6LEiwwQkGKMnzwIDAQABo1MwUTAPBgNVHRMBAf8E\n" - "BTADAQH/MB0GA1UdDgQWBBQPK5hXxLdTj3QqfVzGpfTga6IF3zAfBgNVHSMEGDAW\n" - "gBQPK5hXxLdTj3QqfVzGpfTga6IF3zANBgkqhkiG9w0BAQsFAAOCAgEAa06whkqv\n" - "KmdT1HVhkV7AkWEAeHMWPLLaaFbcwble7a1Vizh6GjCyNpLtoN+mtwqwiOdsIlRE\n" - "42pWILc6CuuX0ae0nHSrcQS5mq8ZKSMr1xTo9RSfBq7CDfdyquxzG83HhpdApViZ\n" - "87Bjy3WoRuomM+YiONfUVdCbC5ZmXW/z+xrXJ+JqIXrtv66sZxpQIR0+ShnWT0DE\n" - "w9jB5fxjydPFwEudYi4z9XjEZaZJ1f8VNWDuUvi3yTJtTlNaWnKveudtDZBw/fA+\n" - "MBFd9ccYVhGQPxOs6S0Ev6q5IjcnzGeEBNZOjgjQk9aFrAs2Iiy018AbYQj5XD64\n" - "hHyiNgyPjl/VgXJE1Xl3lXGpiiJlXctgnCd3UGMfKznhBIpDT13i2CmHFyR3uk7o\n" - "UOZUXCnbnmgthejmFxB35Wf5TmGaYubtRMfCPHGNbQD+7Kg2+8eel3J3JSuG6RQ8\n" - "hwNyHHQnaPVUSANItJ4cMe5DutM0vUCMkJbajL+fjC5SdsTcGfR2VmAFqulNDXjH\n" - "sGWBiWVNsgddax63m6kL9UOeE+8pu8yStKZ4mVn2EjE9eJk4vyZt4BaI6sDUMlke\n" - "S9OjcI5iYlxXNgbRQBtwK70+c3D3JoRPREkTRPPwC4NiAFed7UwXSMh5nWbpt/dq\n" - "fAbAYqu0rfMFHUYjzIVnu8WRCC56qYHO5tU=\n" - "-----END CERTIFICATE-----\n"; - -constexpr std::string_view kSERVER_CERT_CONTENT = - "-----BEGIN CERTIFICATE-----\n" - "MIIFizCCA3OgAwIBAgIJAIErcpMflkrRMA0GCSqGSIb3DQEBCwUAMFcxCzAJBgNV\n" - "BAYTAlVTMQ0wCwYDVQQIDARUZXN0MQ0wCwYDVQQHDARUZXN0MRgwFgYDVQQKDA9S\n" - "aXBwbGVkIFRlc3QgQ0ExEDAOBgNVBAMMB1Rlc3QgQ0EwIBcNMjYwNDA5MTMyNTA3\n" - "WhgPMjEyNjAzMTYxMzI1MDdaMFExCzAJBgNVBAYTAlVTMQ0wCwYDVQQIDARUZXN0\n" - "MQ0wCwYDVQQHDARUZXN0MRAwDgYDVQQKDAdSaXBwbGVkMRIwEAYDVQQDDAlsb2Nh\n" - "bGhvc3QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCv+Lj9LJfPuSOE\n" - "yZqTn2gmG5tJt02ywnuIQet7N5tduxnNs50yXQ00Jeb40dth0HwI5I+AsEVNPIG3\n" - "7tJ9RtCwwTyltaZ4bXuL9ujEVr6TAKY6rlU9bL+Zmr62Lm8B0SLouxfPtyzKhBv6\n" - "7bGUrdIX7o9DbTQ3/2mQTc7KjPCJTEutmpVyD3dABN1qDM9Qzac0NtK1nixvYGd4\n" - "SpbK95BRXby3X9um0dVXoUMbc2gDV9uUZw1xLSjuKDJtQ/rleqe0mmS6JSoagwbb\n" - "DmPX/GbIf21IWUsg3m7AyIwYf9FtIJArB/j3iVBsY9lTB0mXSLxiyN6KM822+QjH\n" - "/VeHKDUWdQB6N3smmi1OLQasukRpSUTmTsoucn30dUqS6qdTtkHzvqGEN+CXBWgG\n" - "i1AS2CacOjYSVHRppC10r/3kEChYY/9rqYBz7GedFRJ6VzQzrwFYZleLJvX6GWfe\n" - "4gNvgwLfo/q2Af1HkCY2aHO+19eAghVsy1MRUDnm/GbZAhHSrX10iEfRjs+GhfxY\n" - "v0xMrvGBCm/2CiJ8RAvdRPpNkM/3u9fjOmqdKvE9NTqDOX1HUBoqa/UguIzi6o/k\n" - "BlBtohfaeL6ZeYXl6MefIIs2pipR7S1VQ1RY9OSdnN5nIJidyn1l85P9vLn49QVw\n" - "2OAT+TcEZnxyaiHCKU6nWtusuMt3wQIDAQABo14wXDAaBgNVHREEEzARgglsb2Nh\n" - "bGhvc3SHBH8AAAEwHQYDVR0OBBYEFO9bPc31jmMlMVNhOd+eXgZPD/+pMB8GA1Ud\n" - "IwQYMBaAFA8rmFfEt1OPdCp9XMal9OBrogXfMA0GCSqGSIb3DQEBCwUAA4ICAQCm\n" - "+hnvRdr9N9a260yOD53b/Gs0c4viAOU3WmxAa89upLHnpPEi7/GlKlw+ed6SwYoX\n" - "CSopDw8AG2Ub/oHM3uIrONjfdHBwUl/SUS8wNhiELuQjKm0qGjkh/n/FHY903flc\n" - "0VP2ciLnqhSS2NY+KH0O8uny3yR4FVH7Byqtk648Z7LfIhe02TjTIjhXDrGwn5dS\n" - "tuTKEAGaxxPJuINCR1BZlwfk+10ipJK59rSpCW//P1YJVr16sdnyh3YJXoAJ5qxP\n" - "P8QWHiRIl2ZGs7KB5SU9fX1dVEU5gwrl/KF3oP+iS01wfNZGvnR+eHMPJsl/IwoC\n" - "SOZAMjgkTZh06cprfEXne8bcidiHvETbF9szMAofA91PbXi0lcwMqpkHG2AElOXI\n" - "by4ejjs9RZJF2Ef38qZPb8RuT+gLORFH5SuPQUwXKlszjpzpxkQ6IKYjFJY+j8CS\n" - "XlXhdkzK5h18cf7J2i5SQdIzE1btQqdcaMb9DzX+drCqqD8JZd1Vczua7Q5tbZ/g\n" - "Bq19Zzo1KQL0xXPdomWv+sP6eUMiW+3J5oFN2hJpilKuFSCAhDmgcmLooFy5t6rR\n" - "kW0n1P3iTWvgQHNzB/3msanvC4/hHyrHHOVGQtAjhxuoRioBJ+hg4RKDptSUcHJX\n" - "YSyd81wvumIpP+I7BDkQLgTb+NzMmoBIjRg3aVvXSg==\n" - "-----END CERTIFICATE-----\n"; - -constexpr std::string_view kSERVER_KEY_CONTENT = - "-----BEGIN PRIVATE KEY-----\n" - "MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCv+Lj9LJfPuSOE\n" - "yZqTn2gmG5tJt02ywnuIQet7N5tduxnNs50yXQ00Jeb40dth0HwI5I+AsEVNPIG3\n" - "7tJ9RtCwwTyltaZ4bXuL9ujEVr6TAKY6rlU9bL+Zmr62Lm8B0SLouxfPtyzKhBv6\n" - "7bGUrdIX7o9DbTQ3/2mQTc7KjPCJTEutmpVyD3dABN1qDM9Qzac0NtK1nixvYGd4\n" - "SpbK95BRXby3X9um0dVXoUMbc2gDV9uUZw1xLSjuKDJtQ/rleqe0mmS6JSoagwbb\n" - "DmPX/GbIf21IWUsg3m7AyIwYf9FtIJArB/j3iVBsY9lTB0mXSLxiyN6KM822+QjH\n" - "/VeHKDUWdQB6N3smmi1OLQasukRpSUTmTsoucn30dUqS6qdTtkHzvqGEN+CXBWgG\n" - "i1AS2CacOjYSVHRppC10r/3kEChYY/9rqYBz7GedFRJ6VzQzrwFYZleLJvX6GWfe\n" - "4gNvgwLfo/q2Af1HkCY2aHO+19eAghVsy1MRUDnm/GbZAhHSrX10iEfRjs+GhfxY\n" - "v0xMrvGBCm/2CiJ8RAvdRPpNkM/3u9fjOmqdKvE9NTqDOX1HUBoqa/UguIzi6o/k\n" - "BlBtohfaeL6ZeYXl6MefIIs2pipR7S1VQ1RY9OSdnN5nIJidyn1l85P9vLn49QVw\n" - "2OAT+TcEZnxyaiHCKU6nWtusuMt3wQIDAQABAoICAQCZilzm0uT3Y2RBdaMBUaKP\n" - "NaFONbl+00D0SAhOr9tJcnp2SFVN33Eo4jVhP8K62y2OmNc5gxRE6xmIQsK4enSW\n" - "9VSUhiXliCm3m03IGqQYIgXox7oqaVvYi/QBhAxpunBKPwzsubhET/cWABXlU7Ew\n" - "HoA0ZfGdNqeGOM3JYCZ0tfSGWo4xQptbaaND6D9wErDk1z0NKSE+YRCHHhXqrQ3o\n" - "YPDL08EVEpui5VtndU/5Msyt9Sj+alf/TWWKfzlIx7fS1rAy10Cgd1khA7JMf7ez\n" - "E7Rn3zm1ST+7yICs08IJBNOmKEOswMxCdvDmCELG1LlDPF8omUDSeQKXdU7M6GFA\n" - "b5PQ11Ik6xZVw1NUESf4d9g0VhEJRXSdGwA3KepAkwRejkB5jI56C8z9dB0LWdWH\n" - "2r3dX2ZpbJv0XVNxAELRgKwyfqWxYrF3caGLrxxWAiyPFvD9FgZJB1ftBU3D+HZZ\n" - "bltdfHJBgZe3pwoCr3X2JPhcA6ecITsset14dvsXHSi9IAXTHbeXxjrHCRcXs6xV\n" - "v4ZSL5r43dv6qk7XiFONCmV8diIwJOxcaSvoBgeeCykX4RKGSk/6Atlo4C9hXb47\n" - "BAuXu3Y+SkS98EljsdeNKCr013Tvt0p4H2QfeoDTKuzC+j3hu9fCkEP3oak2nWFl\n" - "bOkrYMJCc6yxu20G58vzrQKCAQEA1y93gNuNa7Z+VrZCSEcJX2BZl1mTyhLEa9mN\n" - "QOmKlW10VrfCsJxLu+dTGWccy0c6Q8wk6uGjgYJHsdyFPIdSroPR2ysJKSP/5Vzu\n" - "xNymgbeLPnWoivC9TctovWY/15fdboYNUO54jOpFheCC1wq9ZP6CyJmw5O96Y7tJ\n" - "1l5Dq7Fe4iQbIQHPt54wVVHsm7G1ZNywgSbt0HXHeP43YN3mRawJ51++MaEksCXv\n" - "rW+vOxPdiW8djE0tqcK0tqFMhI6p+WcUu8128aRHd0iHlKsVsFU4OLLZr10zwy9i\n" - "COHoF4Fh53pGp05jv+5eMtuEiem87ZUmpJn7whHZt8sKSE71AwKCAQEA0Vkwr4KA\n" - "kRRCUPvor5mdNil05N1mLrYgr/4UAHg3tbeTGxOjSX65KnJWi5dsDmZUdGTL4StD\n" - "8H6uLzzjX88gQkpKvtRYPYKBFtTRsI+ItOvIIo8czK/Kv8dwC2WXZbZBjsCAhrCm\n" - "0fKL2jx7rgdjaqvQeqSRtcHiyiYJG/jC7Iqwm4CyPr+nkVUWKZUWXopw0QXZXHWp\n" - "Glz9TXreEI7Xb/R+RXYU21exBqg0SfHq9pA//aNTQWxWGlNVwqO/KUao9HZupKHb\n" - "mA73oxFJTKhVNNNdC5cC91pxDeDTUzpIEjCGeLI3Aa35CD0WFqEbELJphr5HGkGo\n" - "VkYod6P79+Ta6wKCAQAadFpzvAop2Ni1XljNu/X6BMVe5wNVT3NYcvl7pnqEHl20\n" - "H4lO3xgsdKbxs4yFrS8LkLhlK/JHBLY9toemxlgy3j/ZevP4W9Wk5ATyrNHHlsIG\n" - "nr5mvmv3eW9aAY0Nuzzczpwqe/bUFCUR7WUIfOiF1whLEyH9MzfPtQHB2frly7uH\n" - "f7raFvfrcgYtJxI4neNYEA2fAyMvgptQU6iJPx6FKD5bdJjUTyRMh41svBNF5w5Q\n" - "TBnM2twnR6mh3jii/0sEP1j8MalS0ch7cK5CZ7oV4JQ13D8I4SNw9o1N3EAFS8G2\n" - "jIDNJsT6npp0FCq6LcMtTi3fBJM/66PhhZOxCgvzAoIBAH1LnE/vE3PBZE+D9afj\n" - "kKwx87xmphme98FdmCsPyIgB7xFtl3UNW1WESTgS0KFtrW5cRYnmkysFJssu7gcR\n" - "uIT0YfgErythSFGZ3kaGIZPm6kmEzf/T1s0hWHX5v7soceQ2YrY6VB2jxQBA4uUt\n" - "ltrpKkW86ViXSl0ilqEfKcrY1wq64/OaUXgyLKmGiXTb9tmjXoxv/12/+fq9ZtsS\n" - "Iu7mrgx0t9bvjQwm7+Sx3abkfugXMGUfqgjnh5SO3IKfv89QcrgmB3/itWPrnKs8\n" - "tIKBXlbpcuUIRFHCFbjiUPBSCqmCQFnI/htoNCgnFEPSBEaY64VTdqTsKJwykUO0\n" - "vTECggEAEAB8vyHHk7fpU+IOwD8TP7MCMHwoJzoHQp35So7TlhmO7oDranNhg3nl\n" - "jhTOeISLG2dmPkT49vhsO30tal4CgSXVZo1bPbOK83UvgeLH5Rhji44Dmah+ohKy\n" - "wCuVLuF6YSSp5rD7VIrahhegBFXEYdW5+ZBFbDpE5EXp0WeHc7IRPwWvm+ixr1m8\n" - "VqLeeh1xkMG5WdTTwGjgKWIFXZQ3bOIdVK7uya8wFDAtftkswXiBxAlb9L6Id+Dp\n" - "bKfMAHNouU1TQn5duFgPnCbSU1Js74HkkC0NEEIjQX8k2UCPrhV0VfLfViPuPFax\n" - "S/RYUSUkZ4VvqFUfo7wT8x18urb87w==\n" - "-----END PRIVATE KEY-----\n"; - -constexpr std::string_view kCLIENT_CERT_CONTENT = - "-----BEGIN CERTIFICATE-----\n" - "MIIFeDCCA2CgAwIBAgIJAIErcpMflkrSMA0GCSqGSIb3DQEBCwUAMFcxCzAJBgNV\n" - "BAYTAlVTMQ0wCwYDVQQIDARUZXN0MQ0wCwYDVQQHDARUZXN0MRgwFgYDVQQKDA9S\n" - "aXBwbGVkIFRlc3QgQ0ExEDAOBgNVBAMMB1Rlc3QgQ0EwIBcNMjYwNDA5MTMyNTA3\n" - "WhgPMjEyNjAzMTYxMzI1MDdaMFoxCzAJBgNVBAYTAlVTMQ0wCwYDVQQIDARUZXN0\n" - "MQ0wCwYDVQQHDARUZXN0MRcwFQYDVQQKDA5SaXBwbGVkIENsaWVudDEUMBIGA1UE\n" - "AwwLdGVzdC1jbGllbnQwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDP\n" - "QHttw3TLjOqYS3VkLF3KMRaP2ZtO6A1mXfTbqbKvD41Fazf/cM/v9lPMAlRd2SEY\n" - "3MeE8KVddKJwsbF0kNgDkKB5D5V42WrTw5biFNMOeHAZMR/oWChIvZbbGbDxIdIO\n" - "2+W3X0kjpa2eKcK9qBk8xoyIeilyXtleGWuWvHxiZP9iGHxaTWB+wIKUIK6vrEOb\n" - "iO3P/9XPpHzsBt0HdTDh4V7fwnr2UndVeQyBwUwLn6pd73sTKBfA26YppRwDjPIj\n" - "6NYtF3I28lRCUo+47TAVZM97gjN9oEwyHIVtOc7fnZPwtN26M5v5083SGXU1k/PN\n" - "3xGAlDUiCF3RSMbBRylGgUVtsAD57i8tI2SqCr+ZG233VFiOdwTRKKVNTyMC9TCJ\n" - "dCFFEDFDHTTSimKRQKy0Cm2qoL6JBkziAIiu/0Zzv9YjAAnRoJ2cweMXQ/9z1oWe\n" - "EUZBLRsggYQ8FbM13FOkOs8IlzacSuhwrYKOq8LsMX4cH2mnn783FtXXqrL/xfL7\n" - "11KhzGpZNrz187ilJ+ZsmP9D6vCBP/tR7V52dgtB6I291o8zxdH8GheIGenEFaZa\n" - "oAwyN2FuJgXZqx9319I9gYerZ/BbUzA2MuOxFd0ywtdcTPqKiyAQ9rxQVCVQyYWj\n" - "kfBEYRzWxjfj3XhNprxdm3cauz01NAoTDiz52dZhGQIDAQABo0IwQDAdBgNVHQ4E\n" - "FgQUXVKwiGRrXC1sjK2D86jsjMVV0XgwHwYDVR0jBBgwFoAUDyuYV8S3U490Kn1c\n" - "xqX04GuiBd8wDQYJKoZIhvcNAQELBQADggIBACpHTm9GZMZ7OPhqVo4VltVOW9a9\n" - "LLDsVYmvpAF9+yjZGims6+p3f7eY+o+TRdUE4HEBCmH0UiFVODXCZSoqXo6y9xq7\n" - "TS1dmXll1Sajbfi7YXsM8CAUb+cSsHtmT57JtbGicDiVXAqIOlT65yXkuujdcEa0\n" - "OAw45vJDkWk/6nneFJKdTs7aT3fvIGTlMAxgMJngVsA8BRsX8TWoo05Lum8ClNgi\n" - "s6mtl+nUvjOaM0omFL/K9kqLy7OJAbmE5xuhkC9q6Kn0pHBL4u0YSWaWTpyrvAX7\n" - "BuOE0G1JezcCAcqJvXbKFvhnOSHTvzdlMgXhteGW8Uwgf8cGKtVLSwh6YTjI1XaL\n" - "DkNZfJabAyH7BsGGbAd9Jts4h+4auPqHgcpEz16280oCgZdcfLSP0UKrfwYuXOar\n" - "8KWlVRFl2NBpEJwRf2KjZFQUqYoX1MmfX0gyy+kk0ZP12L7oGNqAxkaWySfb4PSv\n" - "Hsnb8iD6sIJQjZvZ/2wLV8xwFTbFjvGbmSx+XLnMUVV8cVAMUpZz5X2R9pBvpVi4\n" - "KfUccTvIVA0p1wFSdWYQ0+QNxHxZGX1rin6KVUdV1z8K6J3FgGlRqzfz4bruGpXs\n" - "6vX5vqF9KTFpwLTOxDU+kAoIfHowHeu/LQX1l+rk1ww2UZQ1zvgKb6fxWMtviq3F\n" - "cTe8jkzRqYdUfAoV\n" - "-----END CERTIFICATE-----\n"; - -constexpr std::string_view kCLIENT_KEY_CONTENT = - "-----BEGIN PRIVATE KEY-----\n" - "MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDPQHttw3TLjOqY\n" - "S3VkLF3KMRaP2ZtO6A1mXfTbqbKvD41Fazf/cM/v9lPMAlRd2SEY3MeE8KVddKJw\n" - "sbF0kNgDkKB5D5V42WrTw5biFNMOeHAZMR/oWChIvZbbGbDxIdIO2+W3X0kjpa2e\n" - "KcK9qBk8xoyIeilyXtleGWuWvHxiZP9iGHxaTWB+wIKUIK6vrEObiO3P/9XPpHzs\n" - "Bt0HdTDh4V7fwnr2UndVeQyBwUwLn6pd73sTKBfA26YppRwDjPIj6NYtF3I28lRC\n" - "Uo+47TAVZM97gjN9oEwyHIVtOc7fnZPwtN26M5v5083SGXU1k/PN3xGAlDUiCF3R\n" - "SMbBRylGgUVtsAD57i8tI2SqCr+ZG233VFiOdwTRKKVNTyMC9TCJdCFFEDFDHTTS\n" - "imKRQKy0Cm2qoL6JBkziAIiu/0Zzv9YjAAnRoJ2cweMXQ/9z1oWeEUZBLRsggYQ8\n" - "FbM13FOkOs8IlzacSuhwrYKOq8LsMX4cH2mnn783FtXXqrL/xfL711KhzGpZNrz1\n" - "87ilJ+ZsmP9D6vCBP/tR7V52dgtB6I291o8zxdH8GheIGenEFaZaoAwyN2FuJgXZ\n" - "qx9319I9gYerZ/BbUzA2MuOxFd0ywtdcTPqKiyAQ9rxQVCVQyYWjkfBEYRzWxjfj\n" - "3XhNprxdm3cauz01NAoTDiz52dZhGQIDAQABAoICADTppZmUeVEunQZc3Y/BtABX\n" - "IAeB6yDuJd2ox0b9wFzpf4vln9pblvsQzLwdLCT5tnV+iIHsXovJp19WPpQgFsZy\n" - "OkYuMF82Qwvlt7Po1Smwng4QeLD9MOvBW658lKw7kkGw6qkybp3nQrhKuSlqrWbS\n" - "2jZN2h8VEDHyE4HchXUpi/ojfjwf3S7/P1dKMM8xD+G5x91+17u3px0rc2rgBKbm\n" - "vy4pnPMegtETopnOG/grv3dUGPv/FHFsorOnL8vIRFnerC+++K4GmHSGV6NDCy+r\n" - "GT3TNAoyzsFMftQwGh0FQiwGQUW0v3G9HaMyVLZlG63H8dP+AsK5mBpCllvqKyMb\n" - "TQcS8mTBYAvBgiKqZBy6cwbnLaN5hYftDTg4zS62LVZzNlaMeTFGGYINDrth2S6X\n" - "+qH2GcXAUqd8aYIz/BLimCGhZMFQ0hAFCcq72Lh8UJsvvf9ng8Di/6oiZFJeN4nf\n" - "/LHUjlOyBqj8prTh0UCBjM0hdzzs96K+e3eBGjFHdVrdK5QytKZh1KTBSu0t64b2\n" - "0MSW5+2vFbdaQT5jed2lyh9YMmtGJV07T+5LKjWQGcJcc53DLA6uQ8lQuckQReE4\n" - "VzTWoG0eKEvk8ahltbl+0Gk7+fQlsMD5VizbET7EDOoiFPT3SpA/5dybXglNSuH4\n" - "9T65s7Xj2/zD8khLb3CxAoIBAQDwV3OQ66kqIC554Emz7F9ZNInMx4Vjuatd4wxe\n" - "WMT1Vlyg0ZeNSgdfggPmfntDW56NZ/h7q9F9feGfF3OogfZXVv2NzsynAOS4DR1c\n" - "0JR8/y7NG8vxHmDkNVJ3YkHfNYqK3x+sMCoXF0jDdaILXaP0nzAdcnLrRLyU9F3r\n" - "RVJpyaMWt9mtnRzlf1PTlc9WQ99MYuMfqxFj/zBFddnNFiI0FaG3/3Xdg6EH9x42\n" - "/2GXT/TlSUQo4e6Dh9mGhupUYzJt+AqjCnFA2n+D68QIdVq8ykOqGvnpwmfF94qt\n" - "8xfrKhI4zskj4N0X/xwByfEBOkU8nI8zP8PdVqKCbCRG1Z93AoIBAQDcwSRpPD5J\n" - "dmfXY2MGHvGQiJme/3YGPhcA15fQVRzWuZtn1PHULlI2V62NintzTUhjmv6SkGyX\n" - "6ze4RSCxrRFJumJwev5HtohQ7DH/nDtg+Y9Ewn32ehSEotycz1HUskOtgtLOQjwY\n" - "m66gTx6OzG4T6G2YRHcK8hFk9eLR0t2fIqPtu6APfRuo5OowiuYVzRKOplzh2J05\n" - "Q1TCJ4QL6geJQ/MzxVx33yopXWfRxZekG7ri4OJTIv8zj1Ocrytgz4hxAc8xJEf5\n" - "Z50k4JaWGBy+O/mKZ9sOGsolNv/FMUauE2EjSeNWNgvCFFvh4hDUciIakPzEeslp\n" - "hZdZCG9IV8fvAoIBAQDoDbfSbAc4Wjwlhq4C362sJrMKGnarNADGtMsjaRg6PTlQ\n" - "OS3XyGtYBuOXL/X5skNjCsj7N4kcXmdywST1xQ3BhIdp3QryEEXFgzwfenB0Q7q/\n" - "ZSBDXW51yRonlKI/TqXGseoVyadKBjxGJJTh3nbIYM8HD5Lvn71pIIxx9cu9wmcK\n" - "L1cobvMQjyCzwQigpQW77hqXYAd5glHsLv6tKrq5iU1Mp4X46/eWBj6RIYDrpNKy\n" - "c0wxIPu22XrojelAs0pkrUIv64wv7weBqyjqdcy3TZ+JZWR5FDA4D2tByt4EO+m+\n" - "GcJRNvKiEbnL7FwbMFTbUdpdxCpr0hM0VA+uqOG/AoIBAB24JuXABYawWSSHLdKq\n" - "Ic1ahowASmxmuYQUgky62KoTzNc6tN/i6JCGV0gh56LLOb6nJDSpGuWM9jBpphAl\n" - "g5lQbWZFOKyA53M1iTmnV9sjXeVc5cZkAxUkM90skBC5eyEF5sl740lQ1D6iyDNj\n" - "VEJ73R1NwlUH582WyNWEtO9yo20jAFZ1el7PirPET1uKA0CPJxwEpI4MAYIt/bn4\n" - "5NDXBAvpOxysP6nX+F0mY9blINDgg7e7k23mktQaRRXAetbz7mfoQYRTLbXEQqGs\n" - "V1pJCrxWZQhOFP7Tm7V5f9F5rG8qyF9X4VdclE4huDBRuUOoV09AVJNPN+P1nb24\n" - "i6MCggEBAIHUb8G0QKM4LPfdUmv575YmbnYY+Y3O982+jjRg4uAkYHnEkNfL6FKE\n" - "6ot7vcwDTN2Ccw6UKZU8GvyAQOGotmj6Nkgny2wFnEfoTzJaENjhPlnCHD9LDCps\n" - "w/tuoCHOUyyEb/Ygc+4xTsc0W3y2dbaYcg1qvLeIFuVZBNvY1XNlVf40/sVoiyet\n" - "Abh2yPwqOgOu8FpK4gcM8iSwL/xhEJJgT2wE+1MyHOd8KKklFHR7dF2WX1dF0Sif\n" - "cerPwqKXCvWh7og0RIJXe24fymMxtIsURBer9a3bPzUPVQoOXki4/u/kdEGH66GH\n" - "+6f4hsbp29hg+BUZ+UPdk7QyCKpZD1A=\n" - "-----END PRIVATE KEY-----\n"; - -/** - * RAII helper for managing temporary TLS certificates in tests. - * - * Creates a temporary directory and writes test certificates to it. - * Automatically cleans up the directory when destroyed. - */ -class TemporaryTLSCertificates -{ -public: - static constexpr std::string_view kCA_CERT_FILENAME = "ca.pem"; - static constexpr std::string_view kSERVER_CERT_FILENAME = "server_cert.pem"; - static constexpr std::string_view kSERVER_KEY_FILENAME = "server_key.pem"; - static constexpr std::string_view kCLIENT_CERT_FILENAME = "client_cert.pem"; - static constexpr std::string_view kCLIENT_KEY_FILENAME = "client_key.pem"; - static constexpr std::string_view kCERTS_DIR_PREFIX = "grpc_tls_test_"; - - TemporaryTLSCertificates() - { - auto tmpDir = std::filesystem::temp_directory_path(); - auto uniqueDirName = - boost::filesystem::unique_path(std::string(kCERTS_DIR_PREFIX) + "%%%%%%%%"); - tempDir_ = tmpDir / uniqueDirName.string(); - std::filesystem::create_directories(tempDir_); - - writeFile(tempDir_ / kCA_CERT_FILENAME, kCA_CERT_CONTENT); - writeFile(tempDir_ / kSERVER_CERT_FILENAME, kSERVER_CERT_CONTENT); - writeFile(tempDir_ / kSERVER_KEY_FILENAME, kSERVER_KEY_CONTENT); - writeFile(tempDir_ / kCLIENT_CERT_FILENAME, kCLIENT_CERT_CONTENT); - writeFile(tempDir_ / kCLIENT_KEY_FILENAME, kCLIENT_KEY_CONTENT); - } - - virtual ~TemporaryTLSCertificates() - { - std::error_code ec; - std::filesystem::remove_all(tempDir_, ec); - } - - TemporaryTLSCertificates(TemporaryTLSCertificates const&) = delete; - TemporaryTLSCertificates& - operator=(TemporaryTLSCertificates const&) = delete; - TemporaryTLSCertificates(TemporaryTLSCertificates&&) = delete; - TemporaryTLSCertificates& - operator=(TemporaryTLSCertificates&&) = delete; - - [[nodiscard]] std::filesystem::path - getCACertPath() const - { - return tempDir_ / kCA_CERT_FILENAME; - } - - [[nodiscard]] std::filesystem::path - getServerCertPath() const - { - return tempDir_ / kSERVER_CERT_FILENAME; - } - - [[nodiscard]] std::filesystem::path - getServerKeyPath() const - { - return tempDir_ / kSERVER_KEY_FILENAME; - } - - [[nodiscard]] std::filesystem::path - getClientCertPath() const - { - return tempDir_ / kCLIENT_CERT_FILENAME; - } - - [[nodiscard]] std::filesystem::path - getClientKeyPath() const - { - return tempDir_ / kCLIENT_KEY_FILENAME; - } - - [[nodiscard]] std::filesystem::path - getTempDir() const - { - return tempDir_; - } - -private: - static void - writeFile(std::filesystem::path const& path, std::string_view content) - { - std::ofstream file(path); - if (!file) - throw std::runtime_error("Failed to create file: " + path.string()); - file << content; - if (!file) - throw std::runtime_error("Failed to write file: " + path.string()); - } - - std::filesystem::path tempDir_; -}; - -} // namespace - -namespace xrpl::test { -/** - * Helper function to make a simple gRPC call to test connectivity. - * Returns true if the call succeeded, false otherwise. - */ -bool -makeTestGRPCCall(std::unique_ptr const& stub) -{ - grpc::ClientContext context; - org::xrpl::rpc::v1::GetLedgerRequest const request; - org::xrpl::rpc::v1::GetLedgerResponse response; - - // Set a short deadline to avoid hanging on failed connections - context.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(2)); - - grpc::Status const status = stub->GetLedger(&context, request, &response); - return status.ok(); -} - -class GRPCServerTLS_test : public beast::unit_test::suite, public TemporaryTLSCertificates -{ -public: - void - testWithoutTLS() - { - testcase("GRPCServer without TLS"); - - using namespace jtx; - - // Create config without TLS settings - auto cfg = envconfig(addGrpcConfig); - Env env(*this, std::move(cfg)); - - // Verify the server actually started by checking the port - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort > 0); - - // Test 1: Plaintext client should connect successfully - std::string const serverAddress = "localhost:" + std::to_string(*grpcPort); - auto plaintextStub = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel(serverAddress, grpc::InsecureChannelCredentials())); - BEAST_EXPECT(makeTestGRPCCall(plaintextStub)); - } - - void - testWithValidTLS() - { - testcase("GRPCServer with valid TLS configuration (no mutual TLS)"); - - using namespace jtx; - - // Test with just server cert and key (no client verification) - auto cfg = envconfig( - addGrpcConfigWithTLS, getServerCertPath().string(), getServerKeyPath().string()); - Env env(*this, std::move(cfg)); - - // Verify the server actually started by checking the port - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort > 0); - - std::string const serverAddress = "localhost:" + std::to_string(*grpcPort); - - // Test 1: Plaintext client should FAIL against TLS server - auto plaintextStub = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel(serverAddress, grpc::InsecureChannelCredentials())); - BEAST_EXPECT(!makeTestGRPCCall(plaintextStub)); - - // Test 2: TLS client with server CA should succeed - grpc::SslCredentialsOptions sslOpts; - sslOpts.pem_root_certs = std::string(kCA_CERT_CONTENT); - auto tlsStub = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel(serverAddress, grpc::SslCredentials(sslOpts))); - BEAST_EXPECT(makeTestGRPCCall(tlsStub)); - } - - void - testWithMutualTLS() - { - testcase("GRPCServer with mutual TLS (client verification enabled)"); - - using namespace jtx; - - // Test with server cert, key, and CA for client verification - auto cfg = envconfig( - addGrpcConfigWithTLSAndClientCA, - getServerCertPath().string(), - getServerKeyPath().string(), - getCACertPath().string()); - Env env(*this, std::move(cfg)); - - // Verify the server actually started by checking the port - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort > 0); - - auto const serverAddress = "localhost:" + std::to_string(*grpcPort); - - // Test 1: TLS client WITHOUT client certificate should FAIL (mTLS requires client cert) - grpc::SslCredentialsOptions sslOptsNoClient; - sslOptsNoClient.pem_root_certs = std::string(kCA_CERT_CONTENT); - auto tlsStubNoClient = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel(serverAddress, grpc::SslCredentials(sslOptsNoClient))); - BEAST_EXPECT(!makeTestGRPCCall(tlsStubNoClient)); - - // Test 2: TLS client WITH client certificate should succeed - grpc::SslCredentialsOptions sslOptsWithClient; - sslOptsWithClient.pem_root_certs = std::string(kCA_CERT_CONTENT); - sslOptsWithClient.pem_cert_chain = std::string(kCLIENT_CERT_CONTENT); - sslOptsWithClient.pem_private_key = std::string(kCLIENT_KEY_CONTENT); - auto tlsStubWithClient = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel(serverAddress, grpc::SslCredentials(sslOptsWithClient))); - BEAST_EXPECT(makeTestGRPCCall(tlsStubWithClient)); - } - - void - testWithMissingKey() - { - testcase("GRPCServer with cert but no key"); - - using namespace jtx; - - // Create config with only cert (missing key) - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", getServerCertPath().string()); - // Intentionally omit ssl_key - - try - { - Env const env(*this, std::move(cfg)); - fail("Should have thrown exception for incomplete TLS config"); - } - catch (std::runtime_error const& e) - { - BEAST_EXPECT( - std::string(e.what()).find("Incomplete TLS configuration") != std::string::npos); - } - } - - void - testWithMissingCert() - { - testcase("GRPCServer with key but no cert"); - - using namespace jtx; - - // Create config with only key (missing cert) - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", getServerKeyPath().string()); - // Intentionally omit ssl_cert - - try - { - Env const env(*this, std::move(cfg)); - fail("Should have thrown exception for incomplete TLS config"); - } - catch (std::runtime_error const& e) - { - BEAST_EXPECT( - std::string(e.what()).find("Incomplete TLS configuration") != std::string::npos); - } - } - - void - testWithClientCAButNoTLS() - { - testcase("GRPCServer with ssl_client_ca but without both ssl_cert and ssl_key"); - - using namespace jtx; - - // Test 1: ssl_client_ca specified without any TLS config - { - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_client_ca", getCACertPath().string()); - // Intentionally omit both ssl_cert and ssl_key - - try - { - Env const env(*this, std::move(cfg)); - fail("Should have thrown exception for ssl_client_ca without TLS config"); - } - catch (std::runtime_error const& e) - { - BEAST_EXPECT( - std::string(e.what()).find( - "ssl_client_ca requires both ssl_cert and ssl_key") != std::string::npos); - } - } - - // Test 2: ssl_client_ca with only ssl_cert (missing ssl_key) - { - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", getServerCertPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_client_ca", getCACertPath().string()); - // Intentionally omit ssl_key - - try - { - Env const env(*this, std::move(cfg)); - fail("Should have thrown exception for ssl_client_ca with only ssl_cert"); - } - catch (std::runtime_error const& e) - { - // This should fail with "Incomplete TLS configuration" first - // because ssl_cert is specified without ssl_key - BEAST_EXPECT( - std::string(e.what()).find("Incomplete TLS configuration") != - std::string::npos); - } - } - - // Test 3: ssl_client_ca with only ssl_key (missing ssl_cert) - { - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", getServerKeyPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_client_ca", getCACertPath().string()); - // Intentionally omit ssl_cert - - try - { - Env const env(*this, std::move(cfg)); - fail("Should have thrown exception for ssl_client_ca with only ssl_key"); - } - catch (std::runtime_error const& e) - { - // This should fail with "Incomplete TLS configuration" first - // because ssl_key is specified without ssl_cert - BEAST_EXPECT( - std::string(e.what()).find("Incomplete TLS configuration") != - std::string::npos); - } - } - } - - void - testWithCertChainButNoTLS() - { - testcase("GRPCServer with ssl_cert_chain but without both ssl_cert and ssl_key"); - - using namespace jtx; - - // Test 1: ssl_cert_chain specified without any TLS config - { - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert_chain", getCACertPath().string()); - // Intentionally omit both ssl_cert and ssl_key - - try - { - Env const env(*this, std::move(cfg)); - fail("Should have thrown exception for ssl_cert_chain without TLS config"); - } - catch (std::runtime_error const& e) - { - BEAST_EXPECT( - std::string(e.what()).find( - "ssl_cert_chain requires both ssl_cert and ssl_key") != std::string::npos); - } - } - - // Test 2: ssl_cert_chain with only ssl_cert (missing ssl_key) - { - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", getServerCertPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert_chain", getCACertPath().string()); - // Intentionally omit ssl_key - - try - { - Env const env(*this, std::move(cfg)); - fail("Should have thrown exception for ssl_cert_chain with only ssl_cert"); - } - catch (std::runtime_error const& e) - { - // This should fail with "Incomplete TLS configuration" first - // because ssl_cert is specified without ssl_key - BEAST_EXPECT( - std::string(e.what()).find("Incomplete TLS configuration") != - std::string::npos); - } - } - } - - void - testWithCertChain() - { - testcase("GRPCServer with ssl_cert_chain for intermediate CA certificates"); - - using namespace jtx; - - // Test with server cert, key, and cert chain (intermediate CA) - // In this test, we use the CA cert as a stand-in for an intermediate CA cert - auto cfg = envconfig( - addGrpcConfigWithTLSAndCertChain, - getServerCertPath().string(), - getServerKeyPath().string(), - getCACertPath().string()); - Env env(*this, std::move(cfg)); - - // Verify the server actually started by checking the port - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort > 0); - - auto const serverAddress = "localhost:" + std::to_string(*grpcPort); - - // Test: TLS client should be able to connect (no client cert required) - grpc::SslCredentialsOptions sslOpts; - sslOpts.pem_root_certs = std::string(kCA_CERT_CONTENT); - auto tlsStub = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel(serverAddress, grpc::SslCredentials(sslOpts))); - BEAST_EXPECT(makeTestGRPCCall(tlsStub)); - - // Insecure client should fail - auto insecureStub = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel(serverAddress, grpc::InsecureChannelCredentials())); - BEAST_EXPECT(!makeTestGRPCCall(insecureStub)); - } - - void - testWithInvalidCertFile() - { - testcase("GRPCServer with invalid/non-existent certificate file"); - - using namespace jtx; - - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", "/nonexistent/path/to/cert.pem"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", getServerKeyPath().string()); - - Env env(*this, std::move(cfg)); - - // Server should fail to start - verify port is 0 - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort == 0); // Server should not have started - } - - void - testWithInvalidKeyFile() - { - testcase("GRPCServer with invalid/non-existent key file"); - - using namespace jtx; - - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", getServerCertPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", "/nonexistent/path/to/key.pem"); - - Env env(*this, std::move(cfg)); - - // Server should fail to start - verify port is 0 - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort == 0); // Server should not have started - } - - void - testWithInvalidCertChainFile() - { - testcase("GRPCServer with invalid/non-existent cert chain file"); - - using namespace jtx; - - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", getServerCertPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", getServerKeyPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert_chain", "/nonexistent/path/to/chain.pem"); - - Env env(*this, std::move(cfg)); - - // Server should fail to start - verify port is 0 - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort == 0); // Server should not have started - } - - void - testWithInvalidClientCAFile() - { - testcase("GRPCServer with invalid/non-existent client CA file"); - - using namespace jtx; - - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", getServerCertPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", getServerKeyPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_client_ca", "/nonexistent/path/to/ca.pem"); - - Env env(*this, std::move(cfg)); - - // Server should fail to start - verify port is 0 - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort == 0); // Server should not have started - } - - void - testWithEmptyClientCAFile() - { - testcase("GRPCServer with empty client CA file"); - - using namespace jtx; - - // Create an empty file for client CA - auto emptyCAPath = getTempDir() / "empty_ca.pem"; - std::ofstream emptyFile(emptyCAPath); - emptyFile.close(); - - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", "127.0.0.1"); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", getServerCertPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", getServerKeyPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_client_ca", emptyCAPath.string()); - - Env env(*this, std::move(cfg)); - - // Server should fail to start due to empty CA file - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort == 0); // Server should not have started - } - - void - testWithBothCertChainAndClientCA() - { - testcase("GRPCServer with both cert chain and client CA (full mTLS with intermediates)"); - - using namespace jtx; - - // Test with all TLS features enabled: cert, key, cert_chain, and client_ca - auto cfg = envconfig(); - (*cfg)[SECTION_PORT_GRPC].set("ip", getEnvLocalhostAddr()); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", getServerCertPath().string()); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", getServerKeyPath().string()); - (*cfg)[SECTION_PORT_GRPC].set( - "ssl_cert_chain", getCACertPath().string()); // Using CA as intermediate - (*cfg)[SECTION_PORT_GRPC].set("ssl_client_ca", getCACertPath().string()); - - Env env(*this, std::move(cfg)); - - // Verify the server started successfully - auto const grpcPort = env.app().config()[SECTION_PORT_GRPC].get("port"); - BEAST_EXPECT(grpcPort.has_value()); - BEAST_EXPECT(*grpcPort > 0); - - auto const serverAddress = "localhost:" + std::to_string(*grpcPort); - - // Test 1: TLS client WITHOUT client certificate should FAIL (mTLS requires client cert) - grpc::SslCredentialsOptions sslOptsNoClient; - sslOptsNoClient.pem_root_certs = std::string(kCA_CERT_CONTENT); - auto tlsStubNoClient = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel(serverAddress, grpc::SslCredentials(sslOptsNoClient))); - BEAST_EXPECT(!makeTestGRPCCall(tlsStubNoClient)); - - // Test 2: TLS client WITH client certificate should succeed - grpc::SslCredentialsOptions sslOptsWithClient; - sslOptsWithClient.pem_root_certs = std::string(kCA_CERT_CONTENT); - sslOptsWithClient.pem_cert_chain = std::string(kCLIENT_CERT_CONTENT); - sslOptsWithClient.pem_private_key = std::string(kCLIENT_KEY_CONTENT); - auto tlsStubWithClient = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( - grpc::CreateChannel(serverAddress, grpc::SslCredentials(sslOptsWithClient))); - BEAST_EXPECT(makeTestGRPCCall(tlsStubWithClient)); - } - - void - run() override - { - testWithoutTLS(); - testWithValidTLS(); - testWithMutualTLS(); - testWithMissingKey(); - testWithMissingCert(); - testWithClientCAButNoTLS(); - testWithCertChainButNoTLS(); - testWithCertChain(); - testWithInvalidCertFile(); - testWithInvalidKeyFile(); - testWithInvalidCertChainFile(); - testWithInvalidClientCAFile(); - testWithEmptyClientCAFile(); - testWithBothCertChainAndClientCA(); - } -}; - -BEAST_DEFINE_TESTSUITE(GRPCServerTLS, app, xrpl); - -} // namespace xrpl::test diff --git a/src/test/app/HashRouter_test.cpp b/src/test/app/HashRouter_test.cpp index 3ad317b157..e53515e421 100644 --- a/src/test/app/HashRouter_test.cpp +++ b/src/test/app/HashRouter_test.cpp @@ -2,17 +2,11 @@ #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class HashRouter_test : public beast::unit_test::suite { @@ -411,4 +405,5 @@ public: BEAST_DEFINE_TESTSUITE(HashRouter, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Invariants_test.cpp b/src/test/app/Invariants_test.cpp index 6060fc8950..e9d3948202 100644 --- a/src/test/app/Invariants_test.cpp +++ b/src/test/app/Invariants_test.cpp @@ -1,79 +1,29 @@ +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include #include #include #include #include -#include #include #include -#include -#include -#include #include -#include #include -#include -#include -#include #include -#include -#include -#include +#include #include -#include #include -#include #include -#include #include -#include -#include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { - -// Test-only factory — not part of the public API. -// The returned Transactor holds a raw reference to ctx; the caller must ensure -// the ApplyContext outlives the Transactor. Implemented in applySteps.cpp -std::unique_ptr -makeTransactor(ApplyContext& ctx); - -} // namespace xrpl - -namespace xrpl::test { +namespace test { class Invariants_test : public beast::unit_test::suite { @@ -182,10 +132,6 @@ class Invariants_test : public beast::unit_test::suite BEAST_EXPECT(precheck(A1, A2, ac)); - auto transactor = makeTransactor(ac); - if (!BEAST_EXPECT(transactor)) - return; - // invoke check twice to cover tec and tef cases if (!BEAST_EXPECT(ters.size() == 2)) return; @@ -193,10 +139,8 @@ class Invariants_test : public beast::unit_test::suite TER terActual = tesSUCCESS; for (TER const& terExpect : ters) { - terActual = transactor->checkInvariants(terActual, fee); - BEAST_EXPECTS( - terExpect == terActual, - "expected: " + transToken(terExpect) + " got: " + transToken(terActual)); + terActual = ac.checkInvariants(terActual, fee); + BEAST_EXPECTS(terExpect == terActual, std::to_string(TERtoInt(terActual))); auto const messages = sink.messages().str(); if (!isTesSuccess(terActual)) @@ -1682,24 +1626,23 @@ class Invariants_test : public beast::unit_test::suite }; auto const mods = std::to_array({ { - .expectedFailure = "pseudo-account has 0 pseudo-account fields set", - .func = - [this](SLE::pointer& sle) { - BEAST_EXPECT(sle->at(~sfVaultID)); - sle->at(~sfVaultID) = std::nullopt; - }, + "pseudo-account has 0 pseudo-account fields set", + [this](SLE::pointer& sle) { + BEAST_EXPECT(sle->at(~sfVaultID)); + sle->at(~sfVaultID) = std::nullopt; + }, }, { - .expectedFailure = "pseudo-account sequence changed", - .func = [](SLE::pointer& sle) { sle->at(sfSequence) = 12345; }, + "pseudo-account sequence changed", + [](SLE::pointer& sle) { sle->at(sfSequence) = 12345; }, }, { - .expectedFailure = "pseudo-account flags are not set", - .func = [](SLE::pointer& sle) { sle->at(sfFlags) = lsfNoFreeze; }, + "pseudo-account flags are not set", + [](SLE::pointer& sle) { sle->at(sfFlags) = lsfNoFreeze; }, }, { - .expectedFailure = "pseudo-account has a regular key", - .func = [](SLE::pointer& sle) { sle->at(sfRegularKey) = Account("regular").id(); }, + "pseudo-account has a regular key", + [](SLE::pointer& sle) { sle->at(sfRegularKey) = Account("regular").id(); }, }, }); @@ -1794,10 +1737,8 @@ class Invariants_test : public beast::unit_test::suite using namespace test::jtx; bool const fixPDEnabled = features[fixPermissionedDomainInvariant]; - bool const fixS313Enabled = features[fixSecurity3_1_3]; - testcase << "PermissionedDEX" + std::string(fixPDEnabled ? " fixPD" : "") + - std::string(fixS313Enabled ? " fixS313" : ""); + testcase << "PermissionedDEX" + std::string(fixPDEnabled ? " fix" : ""); doInvariantCheck( Env(*this, features), @@ -1885,45 +1826,6 @@ class Invariants_test : public beast::unit_test::suite {tecINVARIANT_FAILED, tecINVARIANT_FAILED}); } - // empty sfAdditionalBooks (size 0) - { - Env env1(*this, features); - - Account const A1{"A1"}; - Account const A2{"A2"}; - env1.fund(XRP(1000), A1, A2); - env1.close(); - - [[maybe_unused]] auto [seq1, pd1] = createPermissionedDomainEnv(env1, A1, A2); - env1.close(); - - doInvariantCheck( - std::move(env1), - A1, - A2, - fixS313Enabled ? std::vector{{"hybrid offer is malformed"}} - : std::vector{}, - [&pd1](Account const& A1, Account const& A2, ApplyContext& ac) { - Keylet const offerKey = keylet::offer(A2.id(), 10); - auto sleOffer = std::make_shared(offerKey); - sleOffer->setAccountID(sfAccount, A2); - sleOffer->setFieldAmount(sfTakerPays, A1["USD"](10)); - sleOffer->setFieldAmount(sfTakerGets, XRP(1)); - sleOffer->setFlag(lsfHybrid); - sleOffer->setFieldH256(sfDomainID, pd1); - - STArray const bookArr; // empty array, size 0 - sleOffer->setFieldArray(sfAdditionalBooks, bookArr); - ac.view().insert(sleOffer); - return true; - }, - XRPAmount{}, - STTx{ttOFFER_CREATE, [&](STObject&) {}}, - fixS313Enabled - ? std::initializer_list{tecINVARIANT_FAILED, tecINVARIANT_FAILED} - : std::initializer_list{tesSUCCESS, tesSUCCESS}); - } - // hybrid offer missing sfAdditionalBooks { Env env1(*this, features); @@ -2530,9 +2432,9 @@ class Invariants_test : public beast::unit_test::suite .sharesTotal = adjustment, .vaultAssets = adjustment, .accountAssets = // - AccountAmount{.account = id, .amount = -adjustment}, + AccountAmount{id, -adjustment}, .accountShares = // - AccountAmount{.account = id, .amount = adjustment}}; + AccountAmount{id, adjustment}}; fn(sample); return sample; }; @@ -4101,128 +4003,6 @@ class Invariants_test : public beast::unit_test::suite } } - void - testVaultComputeCoarsestScale() - { - using namespace jtx; - - Account const issuer{"issuer"}; - PrettyAsset const vaultAsset = issuer["IOU"]; - - struct TestCase - { - std::string name; - std::int32_t expectedMinScale; - std::vector values; - }; - - NumberMantissaScaleGuard const g{MantissaRange::large}; - - auto makeDelta = [&vaultAsset](Number const& n) -> ValidVault::DeltaInfo { - return {.delta = n, .scale = scale(n, vaultAsset.raw())}; - }; - - auto const testCases = std::vector{ - { - .name = "No values", - .expectedMinScale = 0, - .values = {}, - }, - { - .name = "Mixed integer and Number values", - .expectedMinScale = -15, - .values = {makeDelta(1), makeDelta(-1), makeDelta(Number{10, -1})}, - }, - { - .name = "Mixed scales", - .expectedMinScale = -17, - .values = - {makeDelta(Number{1, -2}), makeDelta(Number{5, -3}), makeDelta(Number{3, -2})}, - }, - { - .name = "Equal scales", - .expectedMinScale = -16, - .values = - {makeDelta(Number{1, -1}), makeDelta(Number{5, -1}), makeDelta(Number{1, -1})}, - }, - { - .name = "Mixed mantissa sizes", - .expectedMinScale = -12, - .values = - {makeDelta(Number{1}), - makeDelta(Number{1234, -3}), - makeDelta(Number{12345, -6}), - makeDelta(Number{123, 1})}, - }, - }; - - for (auto const& tc : testCases) - { - testcase("vault computeCoarsestScale: " + tc.name); - - auto const actualScale = ValidVault::computeCoarsestScale(tc.values); - - BEAST_EXPECTS( - actualScale == tc.expectedMinScale, - "expected: " + std::to_string(tc.expectedMinScale) + - ", actual: " + std::to_string(actualScale)); - for (auto const& num : tc.values) - { - // None of these scales are far enough apart that rounding the - // values would lose information, so check that the rounded - // value matches the original. - auto const actualRounded = roundToAsset(vaultAsset, num.delta, actualScale); - BEAST_EXPECTS( - actualRounded == num.delta, - "number " + to_string(num.delta) + " rounded to scale " + - std::to_string(actualScale) + " is " + to_string(actualRounded)); - } - } - - auto const testCases2 = std::vector{ - { - .name = "False equivalence", - .expectedMinScale = -15, - .values = - { - makeDelta(Number{1234567890123456789, -18}), - makeDelta(Number{12345, -4}), - makeDelta(Number{1}), - }, - }, - }; - - // Unlike the first set of test cases, the values in these test could - // look equivalent if using the wrong scale. - for (auto const& tc : testCases2) - { - testcase("vault computeCoarsestScale: " + tc.name); - - auto const actualScale = ValidVault::computeCoarsestScale(tc.values); - - BEAST_EXPECTS( - actualScale == tc.expectedMinScale, - "expected: " + std::to_string(tc.expectedMinScale) + - ", actual: " + std::to_string(actualScale)); - std::optional first; - Number firstRounded; - for (auto const& num : tc.values) - { - if (!first) - { - first = num.delta; - firstRounded = roundToAsset(vaultAsset, num.delta, actualScale); - continue; - } - auto const numRounded = roundToAsset(vaultAsset, num.delta, actualScale); - BEAST_EXPECTS( - numRounded != firstRounded, - "at a scale of " + std::to_string(actualScale) + " " + to_string(num.delta) + - " == " + to_string(*first)); - } - } - } - void testConfidentialMPTTransfer() { @@ -4433,20 +4213,16 @@ public: testPermissionedDomainInvariants(defaultAmendments() - fixPermissionedDomainInvariant); testPermissionedDEX(defaultAmendments() | fixPermissionedDomainInvariant); testPermissionedDEX(defaultAmendments() - fixPermissionedDomainInvariant); - testPermissionedDEX( - (defaultAmendments() | fixPermissionedDomainInvariant) - fixSecurity3_1_3); - testPermissionedDEX( - defaultAmendments() - fixPermissionedDomainInvariant - fixSecurity3_1_3); testNoModifiedUnmodifiableFields(); testValidPseudoAccounts(); testValidLoanBroker(); testVault(); testConfidentialMPTTransfer(); testMPT(); - testVaultComputeCoarsestScale(); } }; BEAST_DEFINE_TESTSUITE(Invariants, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/LPTokenTransfer_test.cpp b/src/test/app/LPTokenTransfer_test.cpp index 2b440c67d5..3a99c8782d 100644 --- a/src/test/app/LPTokenTransfer_test.cpp +++ b/src/test/app/LPTokenTransfer_test.cpp @@ -1,26 +1,9 @@ +#include #include #include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class LPTokenTransfer_test : public jtx::AMMTest { @@ -449,4 +432,5 @@ public: }; BEAST_DEFINE_TESTSUITE(LPTokenTransfer, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/LedgerHistory_test.cpp b/src/test/app/LedgerHistory_test.cpp index e78bdc588f..453c424251 100644 --- a/src/test/app/LedgerHistory_test.cpp +++ b/src/test/app/LedgerHistory_test.cpp @@ -1,30 +1,19 @@ -#include +#include #include -#include -#include -#include -#include -#include #include #include -#include -#include #include -#include -#include -#include +#include #include -#include -#include #include -#include -#include -#include +#include +#include -namespace xrpl::test { +namespace xrpl { +namespace test { class LedgerHistory_test : public beast::unit_test::suite { @@ -181,4 +170,5 @@ public: BEAST_DEFINE_TESTSUITE(LedgerHistory, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/LedgerLoad_test.cpp b/src/test/app/LedgerLoad_test.cpp index a97b492921..c4610d0225 100644 --- a/src/test/app/LedgerLoad_test.cpp +++ b/src/test/app/LedgerLoad_test.cpp @@ -1,33 +1,17 @@ -#include +#include #include -#include -#include -#include -#include -#include - -#include +#include #include #include #include -#include -#include -#include #include #include -#include -#include -#include +#include +#include -#include #include -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/test/app/LedgerMaster_test.cpp b/src/test/app/LedgerMaster_test.cpp index 625eb22ac5..7a8904dbd7 100644 --- a/src/test/app/LedgerMaster_test.cpp +++ b/src/test/app/LedgerMaster_test.cpp @@ -1,24 +1,10 @@ -#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class LedgerMaster_test : public beast::unit_test::suite { @@ -129,4 +115,5 @@ public: BEAST_DEFINE_TESTSUITE(LedgerMaster, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/LedgerReplay_test.cpp b/src/test/app/LedgerReplay_test.cpp index aec0bec592..f9ab08e900 100644 --- a/src/test/app/LedgerReplay_test.cpp +++ b/src/test/app/LedgerReplay_test.cpp @@ -1,15 +1,7 @@ -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include #include #include #include @@ -17,53 +9,16 @@ #include #include #include -#include -#include -#include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { struct LedgerReplay_test : public beast::unit_test::suite { @@ -113,9 +68,9 @@ public: : ledgerSource(ledgerSource), ledgerSink(ledgerSink), bhvr(bhvr) { } - ~MagicInboundLedgers() override = default; + virtual ~MagicInboundLedgers() = default; - std::shared_ptr + virtual std::shared_ptr acquire(uint256 const& hash, std::uint32_t seq, InboundLedger::Reason) override { if (bhvr == InboundLedgersBehavior::DropAll) @@ -129,18 +84,18 @@ public: return {}; } - void + virtual void acquireAsync(uint256 const& hash, std::uint32_t seq, InboundLedger::Reason reason) override { } - std::shared_ptr + virtual std::shared_ptr find(LedgerHash const& hash) override { return {}; } - bool + virtual bool gotLedgerData( LedgerHash const& ledgerHash, std::shared_ptr, @@ -149,59 +104,59 @@ public: return false; } - void + virtual void gotStaleData(std::shared_ptr packet) override { } - void + virtual void logFailure(uint256 const& h, std::uint32_t seq) override { } - bool + virtual bool isFailure(uint256 const& h) override { return false; } - void + virtual void clearFailures() override { } - Json::Value + virtual Json::Value getInfo() override { return {}; } - std::size_t + virtual std::size_t fetchRate() override { return 0; } - void + virtual void onLedgerFetched() override { } - void + virtual void gotFetchPack() override { } - void + virtual void sweep() override { } - void + virtual void stop() override { } - size_t + virtual size_t cacheSize() override { return 0; @@ -698,7 +653,7 @@ public: findTask(uint256 const& hash, int totalReplay) { std::unique_lock const lock(replayer.mtx_); - auto i = std::ranges::find_if(replayer.tasks_, [&](auto const& t) { + auto i = std::find_if(replayer.tasks_.begin(), replayer.tasks_.end(), [&](auto const& t) { return t->parameter_.finishHash_ == hash && t->parameter_.totalLedgers_ == totalReplay; }); if (i == replayer.tasks_.end()) @@ -903,7 +858,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite testProofPath() { testcase("ProofPath"); - LedgerServer server(*this, {.initLedgers = 1}); + LedgerServer server(*this, {1}); auto const l = server.ledgerMaster.getClosedLedger(); { @@ -961,7 +916,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite testReplayDelta() { testcase("ReplayDelta"); - LedgerServer server(*this, {.initLedgers = 1}); + LedgerServer server(*this, {1}); auto const l = server.ledgerMaster.getClosedLedger(); { @@ -1124,7 +1079,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite auto ilBhvr = InboundLedgersBehavior::DropAll; auto peerFeature = PeerFeature::None; - NetworkOfTwo net(*this, {.initLedgers = totalReplay + 1}, psBhvr, ilBhvr, peerFeature); + NetworkOfTwo net(*this, {totalReplay + 1}, psBhvr, ilBhvr, peerFeature); auto l = net.server.ledgerMaster.getClosedLedger(); uint256 const finalHash = l->header().hash; @@ -1159,7 +1114,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite testcase("all the ledgers from InboundLedgers"); NetworkOfTwo net( *this, - {.initLedgers = totalReplay + 1}, + {totalReplay + 1}, PeerSetBehavior::DropAll, InboundLedgersBehavior::Good, PeerFeature::None); @@ -1215,7 +1170,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite NetworkOfTwo net( *this, - {.initLedgers = totalReplay + 1}, + {totalReplay + 1}, peerSetBehavior, InboundLedgersBehavior::DropAll, PeerFeature::LedgerReplayEnabled); @@ -1248,7 +1203,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite int const totalReplay = 3; NetworkOfTwo net( *this, - {.initLedgers = totalReplay + 1}, + {totalReplay + 1}, PeerSetBehavior::DropAll, InboundLedgersBehavior::Good, PeerFeature::LedgerReplayEnabled); @@ -1273,7 +1228,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite int const totalReplay = 3; NetworkOfTwo net( *this, - {.initLedgers = totalReplay + 1 + 1}, + {totalReplay + 1 + 1}, PeerSetBehavior::DropAll, InboundLedgersBehavior::DropAll, PeerFeature::LedgerReplayEnabled); @@ -1306,7 +1261,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite int const totalReplay = 3; NetworkOfTwo net( *this, - {.initLedgers = totalReplay + 1}, + {totalReplay + 1}, PeerSetBehavior::DropLedgerDeltaReply, InboundLedgersBehavior::DropAll, PeerFeature::LedgerReplayEnabled); @@ -1339,7 +1294,7 @@ struct LedgerReplayer_test : public beast::unit_test::suite int const totalReplay = 5; NetworkOfTwo net( *this, - {.initLedgers = (totalReplay * 3) + 1}, + {(totalReplay * 3) + 1}, PeerSetBehavior::Good, InboundLedgersBehavior::Good, PeerFeature::LedgerReplayEnabled); @@ -1437,7 +1392,7 @@ struct LedgerReplayerTimeout_test : public beast::unit_test::suite int const totalReplay = 3; NetworkOfTwo net( *this, - {.initLedgers = totalReplay + 1}, + {totalReplay + 1}, PeerSetBehavior::DropAll, InboundLedgersBehavior::Good, PeerFeature::LedgerReplayEnabled); @@ -1463,7 +1418,7 @@ struct LedgerReplayerTimeout_test : public beast::unit_test::suite int const totalReplay = 3; NetworkOfTwo net( *this, - {.initLedgers = totalReplay + 1}, + {totalReplay + 1}, PeerSetBehavior::DropAll, InboundLedgersBehavior::Good, PeerFeature::LedgerReplayEnabled); @@ -1502,7 +1457,7 @@ struct LedgerReplayerLong_test : public beast::unit_test::suite int const rounds = 4; NetworkOfTwo net( *this, - {.initLedgers = (totalReplay * rounds) + 1}, + {(totalReplay * rounds) + 1}, PeerSetBehavior::Good, InboundLedgersBehavior::Good, PeerFeature::LedgerReplayEnabled); @@ -1550,4 +1505,5 @@ BEAST_DEFINE_TESTSUITE_PRIO(LedgerReplayer, app, xrpl, 1); BEAST_DEFINE_TESTSUITE(LedgerReplayerTimeout, app, xrpl); BEAST_DEFINE_TESTSUITE_MANUAL(LedgerReplayerLong, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/LendingHelpers_test.cpp b/src/test/app/LendingHelpers_test.cpp index 1e43c45104..06728413c8 100644 --- a/src/test/app/LendingHelpers_test.cpp +++ b/src/test/app/LendingHelpers_test.cpp @@ -1,19 +1,22 @@ #include // DO NOT REMOVE +#include #include -#include #include +#include -#include -#include -#include +#include +#include +#include #include +#include +#include -#include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class LendingHelpers_test : public beast::unit_test::suite { @@ -1208,4 +1211,5 @@ public: BEAST_DEFINE_TESTSUITE(LendingHelpers, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/LoadFeeTrack_test.cpp b/src/test/app/LoadFeeTrack_test.cpp index f6d05bf0e6..68ebcc70a1 100644 --- a/src/test/app/LoadFeeTrack_test.cpp +++ b/src/test/app/LoadFeeTrack_test.cpp @@ -1,7 +1,7 @@ #include -#include -#include +#include +#include #include namespace xrpl { diff --git a/src/test/app/LoanBroker_test.cpp b/src/test/app/LoanBroker_test.cpp index 55818b131c..9204a17b69 100644 --- a/src/test/app/LoanBroker_test.cpp +++ b/src/test/app/LoanBroker_test.cpp @@ -1,63 +1,10 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class LoanBroker_test : public beast::unit_test::suite { @@ -1851,4 +1798,5 @@ public: BEAST_DEFINE_TESTSUITE(LoanBroker, tx, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Loan_test.cpp b/src/test/app/Loan_test.cpp index 8d919d7dd3..bf46f886bd 100644 --- a/src/test/app/Loan_test.cpp +++ b/src/test/app/Loan_test.cpp @@ -1,86 +1,19 @@ #include // -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class Loan_test : public beast::unit_test::suite { @@ -181,11 +114,8 @@ protected: jtx::PrettyAsset const& asset_, Keylet const& brokerKeylet_, Keylet const& vaultKeylet_, - BrokerParameters p) - : asset(asset_) - , brokerID(brokerKeylet_.key) - , vaultID(vaultKeylet_.key) - , params(std::move(p)) + BrokerParameters const& p) + : asset(asset_), brokerID(brokerKeylet_.key), vaultID(vaultKeylet_.key), params(p) { } @@ -2749,7 +2679,7 @@ protected: env(manage(lender, loanKeylet.key, tfLoanDefault), ter(tecNO_PERMISSION)); }); -#if LOAN_TODO +#if LOANTODO // TODO /* @@ -3673,9 +3603,10 @@ protected: // From FIND-001 testcase << "Batch Bypass Counterparty"; - bool const lendingBatchEnabled = !std::ranges::any_of( - Batch::disabledTxTypes, - [](auto const& disabled) { return disabled == ttLOAN_BROKER_SET; }); + bool const lendingBatchEnabled = !std::any_of( + Batch::disabledTxTypes.begin(), Batch::disabledTxTypes.end(), [](auto const& disabled) { + return disabled == ttLOAN_BROKER_SET; + }); using namespace jtx; using namespace std::chrono_literals; @@ -5413,7 +5344,7 @@ protected: } } -#if LOAN_TODO +#if LOANTODO void testLoanPayLateFullPaymentBypassesPenalties() { @@ -7068,145 +6999,14 @@ protected: BEAST_EXPECT(afterSecondCoverAvailable == 0); } - // Tests that vault withdrawals work correctly when the vault has unrealized - // loss from an impaired loan, ensuring the invariant check properly - // accounts for the loss. - void - testWithdrawReflectsUnrealizedLoss() - { - using namespace jtx; - using namespace loan; - using namespace std::chrono_literals; - - testcase("Vault withdraw reflects sfLossUnrealized"); - - // Test constants - static constexpr std::int64_t INITIAL_FUNDING = 1'000'000; - static constexpr std::int64_t LENDER_INITIAL_IOU = 5'000'000; - static constexpr std::int64_t DEPOSITOR_INITIAL_IOU = 1'000'000; - static constexpr std::int64_t BORROWER_INITIAL_IOU = 100'000; - static constexpr std::int64_t DEPOSIT_AMOUNT = 5'000; - static constexpr std::int64_t PRINCIPAL_AMOUNT = 99; - static constexpr std::uint64_t EXPECTED_SHARES_PER_DEPOSITOR = 5'000'000'000; - static constexpr std::uint32_t PAYMENT_INTERVAL = 600; - static constexpr std::uint32_t PAYMENT_TOTAL = 2; - - Env env(*this, all); - - // Setup accounts - Account const issuer{"issuer"}; - Account const lender{"lender"}; - Account const depositorA{"lpA"}; - Account const depositorB{"lpB"}; - Account const borrower{"borrowerA"}; - - env.fund(XRP(INITIAL_FUNDING), issuer, lender, depositorA, depositorB, borrower); - env.close(); - - // Setup trust lines - PrettyAsset const iouAsset = issuer[iouCurrency]; - env(trust(lender, iouAsset(10'000'000))); - env(trust(depositorA, iouAsset(10'000'000))); - env(trust(depositorB, iouAsset(10'000'000))); - env(trust(borrower, iouAsset(10'000'000))); - env.close(); - - // Fund accounts with IOUs - env(pay(issuer, lender, iouAsset(LENDER_INITIAL_IOU))); - env(pay(issuer, depositorA, iouAsset(DEPOSITOR_INITIAL_IOU))); - env(pay(issuer, depositorB, iouAsset(DEPOSITOR_INITIAL_IOU))); - env(pay(issuer, borrower, iouAsset(BORROWER_INITIAL_IOU))); - env.close(); - - // Create vault and broker, then add deposits from two depositors - auto const broker = createVaultAndBroker(env, iouAsset, lender); - Vault v{env}; - - env(v.deposit({ - .depositor = depositorA, - .id = broker.vaultKeylet().key, - .amount = iouAsset(DEPOSIT_AMOUNT), - }), - ter(tesSUCCESS)); - env(v.deposit({ - .depositor = depositorB, - .id = broker.vaultKeylet().key, - .amount = iouAsset(DEPOSIT_AMOUNT), - }), - ter(tesSUCCESS)); - env.close(); - - // Create a loan - auto const sleBroker = env.le(keylet::loanbroker(broker.brokerID)); - if (!BEAST_EXPECT(sleBroker)) - return; - - auto const loanKeylet = keylet::loan(broker.brokerID, sleBroker->at(sfLoanSequence)); - - env(set(borrower, broker.brokerID, PRINCIPAL_AMOUNT), - sig(sfCounterpartySignature, lender), - paymentTotal(PAYMENT_TOTAL), - paymentInterval(PAYMENT_INTERVAL), - fee(env.current()->fees().base * 2), - ter(tesSUCCESS)); - env.close(); - - // Impair the loan to create unrealized loss - env(manage(lender, loanKeylet.key, tfLoanImpair), ter(tesSUCCESS)); - env.close(); - - // Verify unrealized loss is recorded in the vault - auto const vaultAfterImpair = env.le(broker.vaultKeylet()); - if (!BEAST_EXPECT(vaultAfterImpair)) - return; - - BEAST_EXPECT( - vaultAfterImpair->at(sfLossUnrealized) == broker.asset(PRINCIPAL_AMOUNT).value()); - - // Helper to get share balance for a depositor - auto const shareAsset = vaultAfterImpair->at(sfShareMPTID); - auto const getShareBalance = [&](Account const& depositor) -> std::uint64_t { - auto const token = env.le(keylet::mptoken(shareAsset, depositor.id())); - return token ? token->getFieldU64(sfMPTAmount) : 0; - }; - - // Verify both depositors have equal shares - auto const sharesLpA = getShareBalance(depositorA); - auto const sharesLpB = getShareBalance(depositorB); - BEAST_EXPECT(sharesLpA == EXPECTED_SHARES_PER_DEPOSITOR); - BEAST_EXPECT(sharesLpB == EXPECTED_SHARES_PER_DEPOSITOR); - BEAST_EXPECT(sharesLpA == sharesLpB); - - // Helper to attempt withdrawal - auto const attemptWithdrawShares = [&](Account const& depositor, - std::uint64_t shareAmount, - TER expected) { - STAmount const shareAmt{MPTIssue{shareAsset}, Number(shareAmount)}; - env(v.withdraw( - {.depositor = depositor, .id = broker.vaultKeylet().key, .amount = shareAmt}), - ter(expected)); - env.close(); - }; - - // Regression test: Both depositors should successfully withdraw despite - // unrealized loss. Previously failed with invariant violation: - // "withdrawal must change vault and destination balance by equal - // amount". This was caused by sharesToAssetsWithdraw rounding down, - // creating a mismatch where vaultDeltaAssets * -1 != destinationDelta - // when unrealized loss exists. - attemptWithdrawShares(depositorA, sharesLpA, tesSUCCESS); - attemptWithdrawShares(depositorB, sharesLpB, tesSUCCESS); - } - public: void run() override { -#if LOAN_TODO +#if LOANTODO testLoanPayLateFullPaymentBypassesPenalties(); testLoanCoverMinimumRoundingExploit(); #endif - testWithdrawReflectsUnrealizedLoss(); testInvalidLoanSet(); auto const all = jtx::testable_amendments(); @@ -7385,4 +7185,5 @@ BEAST_DEFINE_TESTSUITE(Loan, tx, xrpl); BEAST_DEFINE_TESTSUITE_MANUAL(LoanBatch, tx, xrpl); BEAST_DEFINE_TESTSUITE_MANUAL(LoanArbitrary, tx, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/MPToken_test.cpp b/src/test/app/MPToken_test.cpp index 314cfc2f7d..4ec6162ea1 100644 --- a/src/test/app/MPToken_test.cpp +++ b/src/test/app/MPToken_test.cpp @@ -1,72 +1,26 @@ +#include #include #include -#include -#include #include -#include -#include // IWYU pragma: keep #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include #include #include -#include -#include #include -#include -#include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include #include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class MPToken_test : public beast::unit_test::suite { @@ -3043,83 +2997,45 @@ class MPToken_test : public beast::unit_test::suite testcase("Mutate MPTRequireAuth"); using namespace test::jtx; - // test mutating RequireAuth flag on the issuance and its effect on payment authorization - { - Env env{*this, features}; - Account const alice("alice"); - Account const bob("bob"); + Env env{*this, features}; + Account const alice("alice"); + Account const bob("bob"); - MPTTester mptAlice(env, alice, {.holders = {bob}}); - mptAlice.create( - {.ownerCount = 1, - .flags = tfMPTRequireAuth, - .mutableFlags = tmfMPTCanMutateRequireAuth}); + MPTTester mptAlice(env, alice, {.holders = {bob}}); + mptAlice.create( + {.ownerCount = 1, + .flags = tfMPTRequireAuth, + .mutableFlags = tmfMPTCanMutateRequireAuth}); - mptAlice.authorize({.account = bob}); - mptAlice.authorize({.account = alice, .holder = bob}); + mptAlice.authorize({.account = bob}); + mptAlice.authorize({.account = alice, .holder = bob}); - // Pay to bob - mptAlice.pay(alice, bob, 1000); + // Pay to bob + mptAlice.pay(alice, bob, 1000); - // Unauthorize bob - mptAlice.authorize({.account = alice, .holder = bob, .flags = tfMPTUnauthorize}); + // Unauthorize bob + mptAlice.authorize({.account = alice, .holder = bob, .flags = tfMPTUnauthorize}); - // Can not pay to bob - mptAlice.pay(bob, alice, 100, tecNO_AUTH); + // Can not pay to bob + mptAlice.pay(bob, alice, 100, tecNO_AUTH); - // Clear RequireAuth - mptAlice.set({.account = alice, .mutableFlags = tmfMPTClearRequireAuth}); + // Clear RequireAuth + mptAlice.set({.account = alice, .mutableFlags = tmfMPTClearRequireAuth}); - // Can pay to bob - mptAlice.pay(alice, bob, 1000); + // Can pay to bob + mptAlice.pay(alice, bob, 1000); - // Set RequireAuth again - mptAlice.set({.account = alice, .mutableFlags = tmfMPTSetRequireAuth}); + // Set RequireAuth again + mptAlice.set({.account = alice, .mutableFlags = tmfMPTSetRequireAuth}); - // Can not pay to bob since he is not authorized - mptAlice.pay(bob, alice, 100, tecNO_AUTH); + // Can not pay to bob since he is not authorized + mptAlice.pay(bob, alice, 100, tecNO_AUTH); - // Authorize bob again - mptAlice.authorize({.account = alice, .holder = bob}); + // Authorize bob again + mptAlice.authorize({.account = alice, .holder = bob}); - // Can pay to bob again - mptAlice.pay(alice, bob, 100); - } - - // Cannot clear RequireAuth when a DomainID is set on the issuance - { - Account const alice{"alice"}; - Account const bob{"bob"}; - Account const credIssuer{"credIssuer"}; - pdomain::Credentials const credentials{ - {.issuer = credIssuer, .credType = "credential"}}; - - Env env{*this, features}; - env.fund(XRP(1000), credIssuer); - env.close(); - - env(pdomain::setTx(credIssuer, credentials)); - env.close(); - auto const domainId = pdomain::getNewDomain(env.meta()); - - MPTTester mptAlice(env, alice, {.holders = {bob}}); - mptAlice.create({ - .ownerCount = 1, - .flags = tfMPTRequireAuth, - .mutableFlags = tmfMPTCanMutateRequireAuth, - .domainID = domainId, - }); - - // Clearing RequireAuth while a DomainID is present must be rejected, - mptAlice.set({ - .account = alice, - .mutableFlags = tmfMPTClearRequireAuth, - .err = tecNO_PERMISSION, - }); - - // Setting RequireAuth (already set) is still allowed, though it has no effect. - mptAlice.set({.account = alice, .mutableFlags = tmfMPTSetRequireAuth}); - } + // Can pay to bob again + mptAlice.pay(alice, bob, 100); } void @@ -6814,4 +6730,5 @@ public: BEAST_DEFINE_TESTSUITE_PRIO(MPToken, app, xrpl, 2); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Manifest_test.cpp b/src/test/app/Manifest_test.cpp index 1025b73fe8..c2f789e80c 100644 --- a/src/test/app/Manifest_test.cpp +++ b/src/test/app/Manifest_test.cpp @@ -1,43 +1,23 @@ -#include +#include #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include #include -#include +#include #include #include -#include -#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class Manifest_test : public beast::unit_test::suite { @@ -96,7 +76,7 @@ public: { } } - ~Manifest_test() override + ~Manifest_test() { try { @@ -237,7 +217,7 @@ public: return result; }; auto sort = [](std::vector mv) -> std::vector { - std::ranges::sort(mv, [](Manifest const* lhs, Manifest const* rhs) { + std::sort(mv.begin(), mv.end(), [](Manifest const* lhs, Manifest const* rhs) { return lhs->serialized < rhs->serialized; }); return mv; @@ -950,4 +930,5 @@ public: BEAST_DEFINE_TESTSUITE(Manifest, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/MultiSign_test.cpp b/src/test/app/MultiSign_test.cpp index f41042644f..7a5a49ca9b 100644 --- a/src/test/app/MultiSign_test.cpp +++ b/src/test/app/MultiSign_test.cpp @@ -1,51 +1,12 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class MultiSign_test : public beast::unit_test::suite { @@ -362,7 +323,7 @@ public: env.require(owners(alice, 1)); msig phantoms{bogie, demon}; - std::ranges::reverse(phantoms.signers); + std::reverse(phantoms.signers.begin(), phantoms.signers.end()); std::uint32_t const aliceSeq = env.seq(alice); env(noop(alice), phantoms, @@ -1201,7 +1162,7 @@ public: STTx local = *(tx.stx); // Unsort the Signers array. auto& signers = local.peekFieldArray(sfSigners); - std::ranges::reverse(signers); + std::reverse(signers.begin(), signers.end()); // Signature should fail. auto const info = submitSTTx(local); BEAST_EXPECT( @@ -1563,4 +1524,5 @@ public: BEAST_DEFINE_TESTSUITE(MultiSign, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/NFTokenAuth_test.cpp b/src/test/app/NFTokenAuth_test.cpp index 2542f2eb36..e64935c8ab 100644 --- a/src/test/app/NFTokenAuth_test.cpp +++ b/src/test/app/NFTokenAuth_test.cpp @@ -1,31 +1,6 @@ +#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include namespace xrpl { diff --git a/src/test/app/NFTokenBurn_test.cpp b/src/test/app/NFTokenBurn_test.cpp index 08d7b4305e..99b1832466 100644 --- a/src/test/app/NFTokenBurn_test.cpp +++ b/src/test/app/NFTokenBurn_test.cpp @@ -1,44 +1,11 @@ +#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include #include -#include namespace xrpl { @@ -400,7 +367,7 @@ class NFTokenBurn_test : public beast::unit_test::suite // Sort the NFTs so they are listed in storage order, not // creation order. - std::ranges::sort(nfts); + std::sort(nfts.begin(), nfts.end()); // Verify that the ledger does indeed contain exactly three pages // of NFTs with 32 entries in each page. @@ -654,7 +621,7 @@ class NFTokenBurn_test : public beast::unit_test::suite return; // Burn all the tokens in the first page. - std::ranges::reverse(nfts); + std::reverse(nfts.begin(), nfts.end()); for (int i = 0; i < 32; ++i) { env(token::burn(alice, {nfts.back()})); @@ -682,7 +649,7 @@ class NFTokenBurn_test : public beast::unit_test::suite BEAST_EXPECT(!lastNFTokenPage->isFieldPresent(sfNextPageMin)); // Burn all the tokens in the last page. - std::ranges::reverse(nfts); + std::reverse(nfts.begin(), nfts.end()); for (int i = 0; i < 32; ++i) { env(token::burn(alice, {nfts.back()})); @@ -1057,7 +1024,7 @@ class NFTokenBurn_test : public beast::unit_test::suite // Sort the NFTs so they are listed in storage order, not // creation order. - std::ranges::sort(nfts); + std::sort(nfts.begin(), nfts.end()); // Verify that the ledger does indeed contain exactly three pages // of NFTs with 32 entries in each page. diff --git a/src/test/app/NFTokenDir_test.cpp b/src/test/app/NFTokenDir_test.cpp index 5764e87f76..6ed5912034 100644 --- a/src/test/app/NFTokenDir_test.cpp +++ b/src/test/app/NFTokenDir_test.cpp @@ -1,38 +1,11 @@ +#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include - -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include namespace xrpl { @@ -148,7 +121,7 @@ class NFTokenDir_test : public beast::unit_test::suite } // Buyer accepts all of the offers in reverse order. - std::ranges::reverse(offers); + std::reverse(offers.begin(), offers.end()); for (uint256 const& offer : offers) { env(token::acceptSellOffer(buyer, offer)); @@ -257,7 +230,7 @@ class NFTokenDir_test : public beast::unit_test::suite { uint256 ownedID; BEAST_EXPECT(ownedID.parseHex(ownedNFT[sfNFTokenID.jsonName].asString())); - auto const foundIter = std::ranges::find(nftIDs, ownedID); + auto const foundIter = std::find(nftIDs.begin(), nftIDs.end(), ownedID); // Assuming we find the NFT, erase it so we know it's been // found and can't be found again. @@ -465,7 +438,7 @@ class NFTokenDir_test : public beast::unit_test::suite { uint256 ownedID; BEAST_EXPECT(ownedID.parseHex(ownedNFT[sfNFTokenID.jsonName].asString())); - auto const foundIter = std::ranges::find(nftIDs, ownedID); + auto const foundIter = std::find(nftIDs.begin(), nftIDs.end(), ownedID); // Assuming we find the NFT, erase it so we know it's been // found and can't be found again. @@ -703,7 +676,7 @@ class NFTokenDir_test : public beast::unit_test::suite { uint256 ownedID; BEAST_EXPECT(ownedID.parseHex(ownedNFT[sfNFTokenID.jsonName].asString())); - auto const foundIter = std::ranges::find(nftIDs, ownedID); + auto const foundIter = std::find(nftIDs.begin(), nftIDs.end(), ownedID); // Assuming we find the NFT, erase it so we know it's been found // and can't be found again. diff --git a/src/test/app/NFToken_test.cpp b/src/test/app/NFToken_test.cpp index 40934cc095..5bdd686512 100644 --- a/src/test/app/NFToken_test.cpp +++ b/src/test/app/NFToken_test.cpp @@ -1,56 +1,11 @@ +#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include - -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -2519,9 +2474,9 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite sortedNFTs.reserve(nfts.size()); for (std::size_t i = 0; i < nfts.size(); ++i) sortedNFTs.push_back(nfts[i]); - std::ranges::sort( - sortedNFTs, - + std::sort( + sortedNFTs.begin(), + sortedNFTs.end(), [](Json::Value const& lhs, Json::Value const& rhs) { return lhs[jss::nft_serial] < rhs[jss::nft_serial]; }); @@ -5623,7 +5578,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite // The new NFT minted will not have the same ID // as any of the NFTs authorized minter minted - BEAST_EXPECT(std::ranges::find(nftIDs, remintNFTokenID) == nftIDs.end()); + BEAST_EXPECT(std::find(nftIDs.begin(), nftIDs.end(), remintNFTokenID) == nftIDs.end()); } // When an account mints and burns a batch of NFTokens using tickets, @@ -5722,7 +5677,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite // The new NFT minted will not have the same ID // as any of the NFTs authorized minter minted using tickets - BEAST_EXPECT(std::ranges::find(nftIDs, remintNFTokenID) == nftIDs.end()); + BEAST_EXPECT(std::find(nftIDs.begin(), nftIDs.end(), remintNFTokenID) == nftIDs.end()); } // When an authorized minter mints and burns a batch of NFTokens using // tickets, issuer's account needs to wait a longer time before it can @@ -5825,7 +5780,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite // The new NFT minted will not have the same ID // as one of NFTs authorized minter minted using tickets - BEAST_EXPECT(std::ranges::find(nftIDs, remintNFTokenID) == nftIDs.end()); + BEAST_EXPECT(std::find(nftIDs.begin(), nftIDs.end(), remintNFTokenID) == nftIDs.end()); } void @@ -6143,8 +6098,8 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite }); // Sort both array to prepare for comparison - std::ranges::sort(metaIDs); - std::ranges::sort(actualNftIDs); + std::sort(metaIDs.begin(), metaIDs.end()); + std::sort(actualNftIDs.begin(), actualNftIDs.end()); // Make sure the expect number of NFTs is correct BEAST_EXPECT(metaIDs.size() == actualNftIDs.size()); diff --git a/src/test/app/NetworkID_test.cpp b/src/test/app/NetworkID_test.cpp index 5ac97b8df3..17245f7ee5 100644 --- a/src/test/app/NetworkID_test.cpp +++ b/src/test/app/NetworkID_test.cpp @@ -1,27 +1,13 @@ // Copyright (c) 2020 Dev Null Productions +#include #include -#include -#include -#include -#include -#include -#include - -#include -#include #include -#include -#include -#include -#include #include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class NetworkID_test : public beast::unit_test::suite { @@ -155,4 +141,5 @@ public: BEAST_DEFINE_TESTSUITE(NetworkID, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/NetworkOPs_test.cpp b/src/test/app/NetworkOPs_test.cpp index e6673dc2f5..a176279444 100644 --- a/src/test/app/NetworkOPs_test.cpp +++ b/src/test/app/NetworkOPs_test.cpp @@ -1,21 +1,11 @@ +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class NetworkOPs_test : public beast::unit_test::suite { @@ -61,4 +51,5 @@ public: BEAST_DEFINE_TESTSUITE(NetworkOPs, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/OfferMPT_test.cpp b/src/test/app/OfferMPT_test.cpp index b07fe043d2..12d7b74c0a 100644 --- a/src/test/app/OfferMPT_test.cpp +++ b/src/test/app/OfferMPT_test.cpp @@ -1,57 +1,14 @@ -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class OfferMPT_test : public beast::unit_test::suite { @@ -2032,37 +1989,37 @@ public: // clang-format off TestData const tests[]{ // acct fundXrp bookAmt preTrust offerAmt tec spentXrp balanceUSD offers owners scale - {.account="ann", .fundXrp=reserve(env, 0) + 0 * f, .bookAmount=1, .preAuth=noPreAuth, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account is at the reserve, and will dip below once fees are subtracted. - {.account="bev", .fundXrp=reserve(env, 0) + 1 * f, .bookAmount=1, .preAuth=noPreAuth, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account has just enough for the reserve and the fee. - {.account="cam", .fundXrp=reserve(env, 0) + 2 * f, .bookAmount=0, .preAuth=noPreAuth, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account has enough for the reserve, the fee and the offer, and a bit more, but not enough for the reserve after the offer is placed. - {.account="deb", .fundXrp=reserve(env, 0) + 2 * f, .bookAmount=1, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=2 * f, .balanceUsd=USD( 1), .offers=0, .owners=1, .scale=100000}, // Account has enough to buy a little USD then the offer runs dry. - {.account="eve", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=0, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1}, // No offer to cross - {.account="flo", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=0, .owners=1}, - {.account="gay", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1000, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 50) + f, .balanceUsd=USD( 50), .offers=0, .owners=1}, - {.account="hye", .fundXrp=XRP(1000) + 1 * f, .bookAmount=1000, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 800) + f, .balanceUsd=USD( 800), .offers=0, .owners=1}, - {.account="ivy", .fundXrp=XRP( 1) + reserve(env, 1) + 1 * f, .bookAmount=1, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=0, .owners=1}, - {.account="joy", .fundXrp=XRP( 1) + reserve(env, 2) + 1 * f, .bookAmount=1, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=2}, - {.account="kim", .fundXrp=XRP( 900) + reserve(env, 2) + 1 * f, .bookAmount=999, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1}, - {.account="liz", .fundXrp=XRP( 998) + reserve(env, 0) + 1 * f, .bookAmount=999, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 998) + f, .balanceUsd=USD( 998), .offers=0, .owners=1}, - {.account="meg", .fundXrp=XRP( 998) + reserve(env, 1) + 1 * f, .bookAmount=999, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1}, - {.account="nia", .fundXrp=XRP( 998) + reserve(env, 2) + 1 * f, .bookAmount=999, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=1, .owners=2}, - {.account="ova", .fundXrp=XRP( 999) + reserve(env, 0) + 1 * f, .bookAmount=1000, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1}, - {.account="pam", .fundXrp=XRP( 999) + reserve(env, 1) + 1 * f, .bookAmount=1000, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(1000) + f, .balanceUsd=USD( 1000), .offers=0, .owners=1}, - {.account="rae", .fundXrp=XRP( 999) + reserve(env, 2) + 1 * f, .bookAmount=1000, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(1000) + f, .balanceUsd=USD( 1000), .offers=0, .owners=1}, - {.account="sue", .fundXrp=XRP(1000) + reserve(env, 2) + 1 * f, .bookAmount=0, .preAuth=noPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1}, + {"ann", reserve(env, 0) + 0 * f, 1, noPreAuth, 1000, tecUNFUNDED_OFFER, f, USD( 0), 0, 0}, // Account is at the reserve, and will dip below once fees are subtracted. + {"bev", reserve(env, 0) + 1 * f, 1, noPreAuth, 1000, tecUNFUNDED_OFFER, f, USD( 0), 0, 0}, // Account has just enough for the reserve and the fee. + {"cam", reserve(env, 0) + 2 * f, 0, noPreAuth, 1000, tecINSUF_RESERVE_OFFER, f, USD( 0), 0, 0}, // Account has enough for the reserve, the fee and the offer, and a bit more, but not enough for the reserve after the offer is placed. + {"deb", reserve(env, 0) + 2 * f, 1, noPreAuth, 1000, tesSUCCESS, 2 * f, USD( 1), 0, 1, 100000}, // Account has enough to buy a little USD then the offer runs dry. + {"eve", reserve(env, 1) + 0 * f, 0, noPreAuth, 1000, tesSUCCESS, f, USD( 0), 1, 1}, // No offer to cross + {"flo", reserve(env, 1) + 0 * f, 1, noPreAuth, 1000, tesSUCCESS, XRP( 1) + f, USD( 1), 0, 1}, + {"gay", reserve(env, 1) + 1 * f, 1000, noPreAuth, 1000, tesSUCCESS, XRP( 50) + f, USD( 50), 0, 1}, + {"hye", XRP(1000) + 1 * f, 1000, noPreAuth, 1000, tesSUCCESS, XRP( 800) + f, USD( 800), 0, 1}, + {"ivy", XRP( 1) + reserve(env, 1) + 1 * f, 1, noPreAuth, 1000, tesSUCCESS, XRP( 1) + f, USD( 1), 0, 1}, + {"joy", XRP( 1) + reserve(env, 2) + 1 * f, 1, noPreAuth, 1000, tesSUCCESS, XRP( 1) + f, USD( 1), 1, 2}, + {"kim", XRP( 900) + reserve(env, 2) + 1 * f, 999, noPreAuth, 1000, tesSUCCESS, XRP( 999) + f, USD( 999), 0, 1}, + {"liz", XRP( 998) + reserve(env, 0) + 1 * f, 999, noPreAuth, 1000, tesSUCCESS, XRP( 998) + f, USD( 998), 0, 1}, + {"meg", XRP( 998) + reserve(env, 1) + 1 * f, 999, noPreAuth, 1000, tesSUCCESS, XRP( 999) + f, USD( 999), 0, 1}, + {"nia", XRP( 998) + reserve(env, 2) + 1 * f, 999, noPreAuth, 1000, tesSUCCESS, XRP( 999) + f, USD( 999), 1, 2}, + {"ova", XRP( 999) + reserve(env, 0) + 1 * f, 1000, noPreAuth, 1000, tesSUCCESS, XRP( 999) + f, USD( 999), 0, 1}, + {"pam", XRP( 999) + reserve(env, 1) + 1 * f, 1000, noPreAuth, 1000, tesSUCCESS, XRP(1000) + f, USD( 1000), 0, 1}, + {"rae", XRP( 999) + reserve(env, 2) + 1 * f, 1000, noPreAuth, 1000, tesSUCCESS, XRP(1000) + f, USD( 1000), 0, 1}, + {"sue", XRP(1000) + reserve(env, 2) + 1 * f, 0, noPreAuth, 1000, tesSUCCESS, f, USD( 0), 1, 1}, //---------------- Pre-created MPT --------------------- // Unlike from IOU, an issuer can't pre-create MPToken for an account (see similar tests in Offer_test.cpp) - {.account="ned", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="ole", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="pat", .fundXrp=reserve(env, 1) + 2 * f, .bookAmount=0, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="quy", .fundXrp=reserve(env, 1) + 2 * f, .bookAmount=1, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="ron", .fundXrp=reserve(env, 1) + 3 * f, .bookAmount=0, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="syd", .fundXrp=reserve(env, 1) + 3 * f, .bookAmount=1, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=3 * f, .balanceUsd=USD( 1), .offers=0, .owners=1, .scale=100000}, - {.account="ted", .fundXrp=XRP( 20) + reserve(env, 1) + 2 * f, .bookAmount=1000, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(20) + 2 * f, .balanceUsd=USD( 20), .offers=0, .owners=1}, - {.account="uli", .fundXrp=reserve(env, 2) + 0 * f, .bookAmount=0, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="vic", .fundXrp=reserve(env, 2) + 0 * f, .bookAmount=1, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + 2 * f, .balanceUsd=USD( 1), .offers=0, .owners=1}, - {.account="wes", .fundXrp=reserve(env, 2) + 1 * f, .bookAmount=0, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=1, .owners=2}, - {.account="xan", .fundXrp=reserve(env, 2) + 1 * f, .bookAmount=1, .preAuth=acctPreAuth, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + 2 * f, .balanceUsd=USD( 1), .offers=1, .owners=2}, + {"ned", reserve(env, 1) + 0 * f, 1, acctPreAuth, 1000, tecUNFUNDED_OFFER, 2 * f, USD( 0), 0, 1}, + {"ole", reserve(env, 1) + 1 * f, 1, acctPreAuth, 1000, tecUNFUNDED_OFFER, 2 * f, USD( 0), 0, 1}, + {"pat", reserve(env, 1) + 2 * f, 0, acctPreAuth, 1000, tecUNFUNDED_OFFER, 2 * f, USD( 0), 0, 1}, + {"quy", reserve(env, 1) + 2 * f, 1, acctPreAuth, 1000, tecUNFUNDED_OFFER, 2 * f, USD( 0), 0, 1}, + {"ron", reserve(env, 1) + 3 * f, 0, acctPreAuth, 1000, tecINSUF_RESERVE_OFFER, 2 * f, USD( 0), 0, 1}, + {"syd", reserve(env, 1) + 3 * f, 1, acctPreAuth, 1000, tesSUCCESS, 3 * f, USD( 1), 0, 1, 100000}, + {"ted", XRP( 20) + reserve(env, 1) + 2 * f, 1000, acctPreAuth, 1000, tesSUCCESS, XRP(20) + 2 * f, USD( 20), 0, 1}, + {"uli", reserve(env, 2) + 0 * f, 0, acctPreAuth, 1000, tecINSUF_RESERVE_OFFER, 2 * f, USD( 0), 0, 1}, + {"vic", reserve(env, 2) + 0 * f, 1, acctPreAuth, 1000, tesSUCCESS, XRP( 1) + 2 * f, USD( 1), 0, 1}, + {"wes", reserve(env, 2) + 1 * f, 0, acctPreAuth, 1000, tesSUCCESS, 2 * f, USD( 0), 1, 2}, + {"xan", reserve(env, 2) + 1 * f, 1, acctPreAuth, 1000, tesSUCCESS, XRP( 1) + 2 * f, USD( 1), 1, 2}, }; // clang-format on @@ -2486,34 +2443,34 @@ public: // Constructor with takerGets/takerPays TestData( - std::string&& account_, // Account operated on - STAmount fundXrp_, // XRP acct funded with - STAmount fundUSD_, // USD acct funded with - STAmount gwGets_, // gw's offer - STAmount gwPays_, // - STAmount acctGets_, // acct's offer - STAmount acctPays_, // - TER tec_, // Returned tec code - STAmount spentXrp_, // Amount removed from fundXrp - STAmount finalUsd_, // Final USD balance on acct - int offers_, // Offers on acct - int owners_, // Owners on acct - STAmount takerGets_, // Remainder of acct's offer - STAmount takerPays_) // + std::string&& account_, // Account operated on + STAmount const& fundXrp_, // XRP acct funded with + STAmount const& fundUSD_, // USD acct funded with + STAmount const& gwGets_, // gw's offer + STAmount const& gwPays_, // + STAmount const& acctGets_, // acct's offer + STAmount const& acctPays_, // + TER tec_, // Returned tec code + STAmount const& spentXrp_, // Amount removed from fundXrp + STAmount const& finalUsd_, // Final USD balance on acct + int offers_, // Offers on acct + int owners_, // Owners on acct + STAmount const& takerGets_, // Remainder of acct's offer + STAmount const& takerPays_) // : account(std::move(account_)) - , fundXrp(std::move(fundXrp_)) - , fundUSD(std::move(fundUSD_)) - , gwGets(std::move(gwGets_)) - , gwPays(std::move(gwPays_)) - , acctGets(std::move(acctGets_)) - , acctPays(std::move(acctPays_)) + , fundXrp(fundXrp_) + , fundUSD(fundUSD_) + , gwGets(gwGets_) + , gwPays(gwPays_) + , acctGets(acctGets_) + , acctPays(acctPays_) , tec(tec_) - , spentXrp(std::move(spentXrp_)) - , finalUsd(std::move(finalUsd_)) + , spentXrp(spentXrp_) + , finalUsd(finalUsd_) , offers(offers_) , owners(owners_) - , takerGets(std::move(takerGets_)) - , takerPays(std::move(takerPays_)) + , takerGets(takerGets_) + , takerPays(takerPays_) { } @@ -4150,8 +4107,9 @@ public: sortedOffersOnAccount(jtx::Env& env, jtx::Account const& acct) { std::vector> offers{offersOnAccount(env, acct)}; - std::ranges::sort( - offers, + std::sort( + offers.begin(), + offers.end(), [](std::shared_ptr const& rhs, std::shared_ptr const& lhs) { return (*rhs)[sfSequence] < (*lhs)[sfSequence]; }); @@ -4769,4 +4727,5 @@ public: BEAST_DEFINE_TESTSUITE_PRIO(OfferMPT, tx, xrpl, 2); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/OfferStream_test.cpp b/src/test/app/OfferStream_test.cpp index 9cd3724b7b..becb190513 100644 --- a/src/test/app/OfferStream_test.cpp +++ b/src/test/app/OfferStream_test.cpp @@ -1,4 +1,5 @@ -#include +#include +#include namespace xrpl { diff --git a/src/test/app/Offer_test.cpp b/src/test/app/Offer_test.cpp index 0c00c91f63..1aeeb728f2 100644 --- a/src/test/app/Offer_test.cpp +++ b/src/test/app/Offer_test.cpp @@ -1,60 +1,13 @@ -#include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class OfferBaseUtil_test : public beast::unit_test::suite { @@ -2246,45 +2199,45 @@ public: // clang-format off TestData const tests[]{ // acct fundXrp bookAmt preTrust offerAmount tec spentXrp balanceUSD offers owners - {.account="ann", .fundXrp=reserve(env, 0) + 0 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account is at the reserve, and will dip below once fees are subtracted. - {.account="bev", .fundXrp=reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account has just enough for the reserve and the fee. - {.account="cam", .fundXrp=reserve(env, 0) + 2 * f, .bookAmount=0, .preTrust=noPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account has enough for the reserve, the fee and the offer, and a bit more, but not enough for the reserve after the offer is placed. - {.account="deb", .fundXrp=drops(10) + reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=drops(10) + f, .balanceUsd=USD(0.00001), .offers=0, .owners=1}, // Account has enough to buy a little USD then the offer runs dry. - {.account="eve", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=0, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1}, // No offer to cross - {.account="flo", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=0, .owners=1}, - {.account="gay", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 50) + f, .balanceUsd=USD( 50), .offers=0, .owners=1}, - {.account="hye", .fundXrp=XRP(1000) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 800) + f, .balanceUsd=USD( 800), .offers=0, .owners=1}, - {.account="ivy", .fundXrp=XRP( 1) + reserve(env, 1) + 1 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=0, .owners=1}, - {.account="joy", .fundXrp=XRP( 1) + reserve(env, 2) + 1 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=2}, - {.account="kim", .fundXrp=XRP( 900) + reserve(env, 2) + 1 * f, .bookAmount=999, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1}, - {.account="liz", .fundXrp=XRP( 998) + reserve(env, 0) + 1 * f, .bookAmount=999, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 998) + f, .balanceUsd=USD( 998), .offers=0, .owners=1}, - {.account="meg", .fundXrp=XRP( 998) + reserve(env, 1) + 1 * f, .bookAmount=999, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1}, - {.account="nia", .fundXrp=XRP( 998) + reserve(env, 2) + 1 * f, .bookAmount=999, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=1, .owners=2}, - {.account="ova", .fundXrp=XRP( 999) + reserve(env, 0) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1}, - {.account="pam", .fundXrp=XRP( 999) + reserve(env, 1) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(1000) + f, .balanceUsd=USD( 1000), .offers=0, .owners=1}, - {.account="rae", .fundXrp=XRP( 999) + reserve(env, 2) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(1000) + f, .balanceUsd=USD( 1000), .offers=0, .owners=1}, - {.account="sue", .fundXrp=XRP(1000) + reserve(env, 2) + 1 * f, .bookAmount=0, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1}, + {"ann", reserve(env, 0) + 0 * f, 1, noPreTrust, 1000, tecUNFUNDED_OFFER, f, USD( 0), 0, 0}, // Account is at the reserve, and will dip below once fees are subtracted. + {"bev", reserve(env, 0) + 1 * f, 1, noPreTrust, 1000, tecUNFUNDED_OFFER, f, USD( 0), 0, 0}, // Account has just enough for the reserve and the fee. + {"cam", reserve(env, 0) + 2 * f, 0, noPreTrust, 1000, tecINSUF_RESERVE_OFFER, f, USD( 0), 0, 0}, // Account has enough for the reserve, the fee and the offer, and a bit more, but not enough for the reserve after the offer is placed. + {"deb", drops(10) + reserve(env, 0) + 1 * f, 1, noPreTrust, 1000, tesSUCCESS, drops(10) + f, USD(0.00001), 0, 1}, // Account has enough to buy a little USD then the offer runs dry. + {"eve", reserve(env, 1) + 0 * f, 0, noPreTrust, 1000, tesSUCCESS, f, USD( 0), 1, 1}, // No offer to cross + {"flo", reserve(env, 1) + 0 * f, 1, noPreTrust, 1000, tesSUCCESS, XRP( 1) + f, USD( 1), 0, 1}, + {"gay", reserve(env, 1) + 1 * f, 1000, noPreTrust, 1000, tesSUCCESS, XRP( 50) + f, USD( 50), 0, 1}, + {"hye", XRP(1000) + 1 * f, 1000, noPreTrust, 1000, tesSUCCESS, XRP( 800) + f, USD( 800), 0, 1}, + {"ivy", XRP( 1) + reserve(env, 1) + 1 * f, 1, noPreTrust, 1000, tesSUCCESS, XRP( 1) + f, USD( 1), 0, 1}, + {"joy", XRP( 1) + reserve(env, 2) + 1 * f, 1, noPreTrust, 1000, tesSUCCESS, XRP( 1) + f, USD( 1), 1, 2}, + {"kim", XRP( 900) + reserve(env, 2) + 1 * f, 999, noPreTrust, 1000, tesSUCCESS, XRP( 999) + f, USD( 999), 0, 1}, + {"liz", XRP( 998) + reserve(env, 0) + 1 * f, 999, noPreTrust, 1000, tesSUCCESS, XRP( 998) + f, USD( 998), 0, 1}, + {"meg", XRP( 998) + reserve(env, 1) + 1 * f, 999, noPreTrust, 1000, tesSUCCESS, XRP( 999) + f, USD( 999), 0, 1}, + {"nia", XRP( 998) + reserve(env, 2) + 1 * f, 999, noPreTrust, 1000, tesSUCCESS, XRP( 999) + f, USD( 999), 1, 2}, + {"ova", XRP( 999) + reserve(env, 0) + 1 * f, 1000, noPreTrust, 1000, tesSUCCESS, XRP( 999) + f, USD( 999), 0, 1}, + {"pam", XRP( 999) + reserve(env, 1) + 1 * f, 1000, noPreTrust, 1000, tesSUCCESS, XRP(1000) + f, USD( 1000), 0, 1}, + {"rae", XRP( 999) + reserve(env, 2) + 1 * f, 1000, noPreTrust, 1000, tesSUCCESS, XRP(1000) + f, USD( 1000), 0, 1}, + {"sue", XRP(1000) + reserve(env, 2) + 1 * f, 0, noPreTrust, 1000, tesSUCCESS, f, USD( 0), 1, 1}, //---------------- Pre-established trust lines --------------------- - {.account="abe", .fundXrp=reserve(env, 0) + 0 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, - {.account="bud", .fundXrp=reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, - {.account="che", .fundXrp=reserve(env, 0) + 2 * f, .bookAmount=0, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, - {.account="dan", .fundXrp=drops(10) + reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=drops(10) + f, .balanceUsd=USD(0.00001), .offers=0, .owners=0}, - {.account="eli", .fundXrp=XRP( 20) + reserve(env, 0) + 1 * f, .bookAmount=1000, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(20) + 1 * f, .balanceUsd=USD( 20), .offers=0, .owners=0}, - {.account="fyn", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=0, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1}, - {.account="gar", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=1}, - {.account="hal", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=1}, + {"abe", reserve(env, 0) + 0 * f, 1, gwPreTrust, 1000, tecUNFUNDED_OFFER, f, USD( 0), 0, 0}, + {"bud", reserve(env, 0) + 1 * f, 1, gwPreTrust, 1000, tecUNFUNDED_OFFER, f, USD( 0), 0, 0}, + {"che", reserve(env, 0) + 2 * f, 0, gwPreTrust, 1000, tecINSUF_RESERVE_OFFER, f, USD( 0), 0, 0}, + {"dan", drops(10) + reserve(env, 0) + 1 * f, 1, gwPreTrust, 1000, tesSUCCESS, drops(10) + f, USD(0.00001), 0, 0}, + {"eli", XRP( 20) + reserve(env, 0) + 1 * f, 1000, gwPreTrust, 1000, tesSUCCESS, XRP(20) + 1 * f, USD( 20), 0, 0}, + {"fyn", reserve(env, 1) + 0 * f, 0, gwPreTrust, 1000, tesSUCCESS, f, USD( 0), 1, 1}, + {"gar", reserve(env, 1) + 0 * f, 1, gwPreTrust, 1000, tesSUCCESS, XRP( 1) + f, USD( 1), 1, 1}, + {"hal", reserve(env, 1) + 1 * f, 1, gwPreTrust, 1000, tesSUCCESS, XRP( 1) + f, USD( 1), 1, 1}, - {.account="ned", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="ole", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="pat", .fundXrp=reserve(env, 1) + 2 * f, .bookAmount=0, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="quy", .fundXrp=reserve(env, 1) + 2 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="ron", .fundXrp=reserve(env, 1) + 3 * f, .bookAmount=0, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="syd", .fundXrp=drops(10) + reserve(env, 1) + 2 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=drops(10) + 2 * f, .balanceUsd=USD(0.00001), .offers=0, .owners=1}, - {.account="ted", .fundXrp=XRP( 20) + reserve(env, 1) + 2 * f, .bookAmount=1000, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(20) + 2 * f, .balanceUsd=USD( 20), .offers=0, .owners=1}, - {.account="uli", .fundXrp=reserve(env, 2) + 0 * f, .bookAmount=0, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1}, - {.account="vic", .fundXrp=reserve(env, 2) + 0 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + 2 * f, .balanceUsd=USD( 1), .offers=0, .owners=1}, - {.account="wes", .fundXrp=reserve(env, 2) + 1 * f, .bookAmount=0, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=1, .owners=2}, - {.account="xan", .fundXrp=reserve(env, 2) + 1 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + 2 * f, .balanceUsd=USD( 1), .offers=1, .owners=2}, + {"ned", reserve(env, 1) + 0 * f, 1, acctPreTrust, 1000, tecUNFUNDED_OFFER, 2 * f, USD( 0), 0, 1}, + {"ole", reserve(env, 1) + 1 * f, 1, acctPreTrust, 1000, tecUNFUNDED_OFFER, 2 * f, USD( 0), 0, 1}, + {"pat", reserve(env, 1) + 2 * f, 0, acctPreTrust, 1000, tecUNFUNDED_OFFER, 2 * f, USD( 0), 0, 1}, + {"quy", reserve(env, 1) + 2 * f, 1, acctPreTrust, 1000, tecUNFUNDED_OFFER, 2 * f, USD( 0), 0, 1}, + {"ron", reserve(env, 1) + 3 * f, 0, acctPreTrust, 1000, tecINSUF_RESERVE_OFFER, 2 * f, USD( 0), 0, 1}, + {"syd", drops(10) + reserve(env, 1) + 2 * f, 1, acctPreTrust, 1000, tesSUCCESS, drops(10) + 2 * f, USD(0.00001), 0, 1}, + {"ted", XRP( 20) + reserve(env, 1) + 2 * f, 1000, acctPreTrust, 1000, tesSUCCESS, XRP(20) + 2 * f, USD( 20), 0, 1}, + {"uli", reserve(env, 2) + 0 * f, 0, acctPreTrust, 1000, tecINSUF_RESERVE_OFFER, 2 * f, USD( 0), 0, 1}, + {"vic", reserve(env, 2) + 0 * f, 1, acctPreTrust, 1000, tesSUCCESS, XRP( 1) + 2 * f, USD( 1), 0, 1}, + {"wes", reserve(env, 2) + 1 * f, 0, acctPreTrust, 1000, tesSUCCESS, 2 * f, USD( 0), 1, 2}, + {"xan", reserve(env, 2) + 1 * f, 1, acctPreTrust, 1000, tesSUCCESS, XRP( 1) + 2 * f, USD( 1), 1, 2}, }; // clang-format on @@ -2695,34 +2648,34 @@ public: // Constructor with takerGets/takerPays TestData( - std::string&& account_, // Account operated on - STAmount fundXrp_, // XRP acct funded with - STAmount fundUSD_, // USD acct funded with - STAmount gwGets_, // gw's offer - STAmount gwPays_, // - STAmount acctGets_, // acct's offer - STAmount acctPays_, // - TER tec_, // Returned tec code - STAmount spentXrp_, // Amount removed from fundXrp - STAmount finalUsd_, // Final USD balance on acct - int offers_, // Offers on acct - int owners_, // Owners on acct - STAmount takerGets_, // Remainder of acct's offer - STAmount takerPays_) // + std::string&& account_, // Account operated on + STAmount const& fundXrp_, // XRP acct funded with + STAmount const& fundUSD_, // USD acct funded with + STAmount const& gwGets_, // gw's offer + STAmount const& gwPays_, // + STAmount const& acctGets_, // acct's offer + STAmount const& acctPays_, // + TER tec_, // Returned tec code + STAmount const& spentXrp_, // Amount removed from fundXrp + STAmount const& finalUsd_, // Final USD balance on acct + int offers_, // Offers on acct + int owners_, // Owners on acct + STAmount const& takerGets_, // Remainder of acct's offer + STAmount const& takerPays_) // : account(std::move(account_)) - , fundXrp(std::move(fundXrp_)) - , fundUSD(std::move(fundUSD_)) - , gwGets(std::move(gwGets_)) - , gwPays(std::move(gwPays_)) - , acctGets(std::move(acctGets_)) - , acctPays(std::move(acctPays_)) + , fundXrp(fundXrp_) + , fundUSD(fundUSD_) + , gwGets(gwGets_) + , gwPays(gwPays_) + , acctGets(acctGets_) + , acctPays(acctPays_) , tec(tec_) - , spentXrp(std::move(spentXrp_)) - , finalUsd(std::move(finalUsd_)) + , spentXrp(spentXrp_) + , finalUsd(finalUsd_) , offers(offers_) , owners(owners_) - , takerGets(std::move(takerGets_)) - , takerPays(std::move(takerPays_)) + , takerGets(takerGets_) + , takerPays(takerPays_) { } @@ -3335,12 +3288,12 @@ public: // clang-format off TestData const tests[]{ // acct fundXRP fundUSD fundEUR firstOfferTec secondOfferTec - {.acct="ann", .fundXRP=reserve(env, 3) + f * 4, .fundUSD=USD(1000), .fundEUR=EUR(1000), .firstOfferTec=tesSUCCESS, .secondOfferTec=tesSUCCESS}, - {.acct="bev", .fundXRP=reserve(env, 3) + f * 4, .fundUSD=USD( 1), .fundEUR=EUR(1000), .firstOfferTec=tesSUCCESS, .secondOfferTec=tesSUCCESS}, - {.acct="cam", .fundXRP=reserve(env, 3) + f * 4, .fundUSD=USD(1000), .fundEUR=EUR( 1), .firstOfferTec=tesSUCCESS, .secondOfferTec=tesSUCCESS}, - {.acct="deb", .fundXRP=reserve(env, 3) + f * 4, .fundUSD=USD( 0), .fundEUR=EUR( 1), .firstOfferTec=tesSUCCESS, .secondOfferTec=tecUNFUNDED_OFFER}, - {.acct="eve", .fundXRP=reserve(env, 3) + f * 4, .fundUSD=USD( 1), .fundEUR=EUR( 0), .firstOfferTec=tecUNFUNDED_OFFER, .secondOfferTec=tesSUCCESS}, - {.acct="flo", .fundXRP=reserve(env, 3) + 0, .fundUSD=USD(1000), .fundEUR=EUR(1000), .firstOfferTec=tecINSUF_RESERVE_OFFER, .secondOfferTec=tecINSUF_RESERVE_OFFER}, + {"ann", reserve(env, 3) + f * 4, USD(1000), EUR(1000), tesSUCCESS, tesSUCCESS}, + {"bev", reserve(env, 3) + f * 4, USD( 1), EUR(1000), tesSUCCESS, tesSUCCESS}, + {"cam", reserve(env, 3) + f * 4, USD(1000), EUR( 1), tesSUCCESS, tesSUCCESS}, + {"deb", reserve(env, 3) + f * 4, USD( 0), EUR( 1), tesSUCCESS, tecUNFUNDED_OFFER}, + {"eve", reserve(env, 3) + f * 4, USD( 1), EUR( 0), tecUNFUNDED_OFFER, tesSUCCESS}, + {"flo", reserve(env, 3) + 0, USD(1000), EUR(1000), tecINSUF_RESERVE_OFFER, tecINSUF_RESERVE_OFFER}, }; //clang-format on @@ -3921,10 +3874,10 @@ public: // clang-format off TestData const tests[]{ // btcStart --------------------- actor[0] --------------------- -------------------- actor[1] ------------------- - {.self=0, .leg0=0, .leg1=1, .btcStart=BTC(20), .actors={{"ann", 0, drops(3900000'000000 - (4 * baseFee)), BTC(20.0), USD(3000)}, {"abe", 0, drops(4100000'000000 - (3 * baseFee)), BTC( 0), USD(750)}}}, // no BTC xfer fee - {.self=0, .leg0=1, .leg1=0, .btcStart=BTC(20), .actors={{"bev", 0, drops(4100000'000000 - (4 * baseFee)), BTC( 7.5), USD(2000)}, {"bob", 0, drops(3900000'000000 - (3 * baseFee)), BTC(10), USD( 0)}}}, // no USD xfer fee - {.self=0, .leg0=0, .leg1=0, .btcStart=BTC(20), .actors={{"cam", 0, drops(4000000'000000 - (5 * baseFee)), BTC(20.0), USD(2000)} }}, // no xfer fee - {.self=0, .leg0=1, .leg1=0, .btcStart=BTC( 5), .actors={{"deb", 1, drops(4040000'000000 - (4 * baseFee)), BTC( 0.0), USD(2000)}, {"dan", 1, drops(3960000'000000 - (3 * baseFee)), BTC( 4), USD( 0)}}}, // no USD xfer fee + {0, 0, 1, BTC(20), {{"ann", 0, drops(3900000'000000 - (4 * baseFee)), BTC(20.0), USD(3000)}, {"abe", 0, drops(4100000'000000 - (3 * baseFee)), BTC( 0), USD(750)}}}, // no BTC xfer fee + {0, 1, 0, BTC(20), {{"bev", 0, drops(4100000'000000 - (4 * baseFee)), BTC( 7.5), USD(2000)}, {"bob", 0, drops(3900000'000000 - (3 * baseFee)), BTC(10), USD( 0)}}}, // no USD xfer fee + {0, 0, 0, BTC(20), {{"cam", 0, drops(4000000'000000 - (5 * baseFee)), BTC(20.0), USD(2000)} }}, // no xfer fee + {0, 1, 0, BTC( 5), {{"deb", 1, drops(4040000'000000 - (4 * baseFee)), BTC( 0.0), USD(2000)}, {"dan", 1, drops(3960000'000000 - (3 * baseFee)), BTC( 4), USD( 0)}}}, // no USD xfer fee }; // clang-format on @@ -3973,9 +3926,12 @@ public: auto actorOffers = offersOnAccount(env, actor.acct); auto const offerCount = std::distance( actorOffers.begin(), - std::ranges::remove_if(actorOffers, [](std::shared_ptr& offer) { - return (*offer)[sfTakerGets].signum() == 0; - }).begin()); + std::remove_if( + actorOffers.begin(), + actorOffers.end(), + [](std::shared_ptr& offer) { + return (*offer)[sfTakerGets].signum() == 0; + })); BEAST_EXPECT(offerCount == actor.offers); env.require(balance(actor.acct, actor.xrp)); @@ -4069,8 +4025,8 @@ public: // clang-format off TestData const tests[]{ // btcStart ------------------- actor[0] -------------------- ------------------- actor[1] -------------------- - {.self=0, .leg0=0, .leg1=1, .btcStart=BTC(5), .actors={{"gay", 1, drops(3950000'000000 - (4 * baseFee)), BTC(5), USD(2500)}, {"gar", 1, drops(4050000'000000 - (3 * baseFee)), BTC(0), USD(1375)}}}, // no BTC xfer fee - {.self=0, .leg0=0, .leg1=0, .btcStart=BTC(5), .actors={{"hye", 2, drops(4000000'000000 - (5 * baseFee)), BTC(5), USD(2000)} }} // no xfer fee + {0, 0, 1, BTC(5), {{"gay", 1, drops(3950000'000000 - (4 * baseFee)), BTC(5), USD(2500)}, {"gar", 1, drops(4050000'000000 - (3 * baseFee)), BTC(0), USD(1375)}}}, // no BTC xfer fee + {0, 0, 0, BTC(5), {{"hye", 2, drops(4000000'000000 - (5 * baseFee)), BTC(5), USD(2000)} }} // no xfer fee }; // clang-format on @@ -4119,9 +4075,12 @@ public: auto actorOffers = offersOnAccount(env, actor.acct); auto const offerCount = std::distance( actorOffers.begin(), - std::ranges::remove_if(actorOffers, [](std::shared_ptr& offer) { - return (*offer)[sfTakerGets].signum() == 0; - }).begin()); + std::remove_if( + actorOffers.begin(), + actorOffers.end(), + [](std::shared_ptr& offer) { + return (*offer)[sfTakerGets].signum() == 0; + })); BEAST_EXPECT(offerCount == actor.offers); env.require(balance(actor.acct, actor.xrp)); @@ -4673,8 +4632,9 @@ public: sortedOffersOnAccount(jtx::Env& env, jtx::Account const& acct) { std::vector> offers{offersOnAccount(env, acct)}; - std::ranges::sort( - offers, + std::sort( + offers.begin(), + offers.end(), [](std::shared_ptr const& rhs, std::shared_ptr const& lhs) { return (*rhs)[sfSequence] < (*lhs)[sfSequence]; }); @@ -5216,4 +5176,5 @@ BEAST_DEFINE_TESTSUITE_PRIO(OfferWOSmallQOffers, app, xrpl, 2); BEAST_DEFINE_TESTSUITE_PRIO(OfferAllFeatures, app, xrpl, 2); BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Offer_manual, app, xrpl, 20); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Oracle_test.cpp b/src/test/app/Oracle_test.cpp index 43d4a13e2b..83b658ac41 100644 --- a/src/test/app/Oracle_test.cpp +++ b/src/test/app/Oracle_test.cpp @@ -1,37 +1,11 @@ -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include - -namespace xrpl::test::jtx::oracle { +namespace xrpl { +namespace test { +namespace jtx { +namespace oracle { struct Oracle_test : public beast::unit_test::suite { @@ -818,4 +792,10 @@ public: BEAST_DEFINE_TESTSUITE(Oracle, app, xrpl); -} // namespace xrpl::test::jtx::oracle +} // namespace oracle + +} // namespace jtx + +} // namespace test + +} // namespace xrpl diff --git a/src/test/app/OversizeMeta_test.cpp b/src/test/app/OversizeMeta_test.cpp index 17f4410cf6..d6305bedb6 100644 --- a/src/test/app/OversizeMeta_test.cpp +++ b/src/test/app/OversizeMeta_test.cpp @@ -1,18 +1,9 @@ +#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include +#include -#include -#include - -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { // Make sure "plump" order books don't have problems class PlumpBook_test : public beast::unit_test::suite @@ -178,4 +169,5 @@ public: BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(FindOversizeCross, app, xrpl, 50); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/PathMPT_test.cpp b/src/test/app/PathMPT_test.cpp index 482d120342..9562f1478f 100644 --- a/src/test/app/PathMPT_test.cpp +++ b/src/test/app/PathMPT_test.cpp @@ -1,45 +1,24 @@ -#include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include #include #include -#include +#include #include #include -#include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include -#include #include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { namespace detail { static Json::Value @@ -116,16 +95,16 @@ public: Resource::Consumer c; RPC::JsonContext context{ - {.j = env.journal, - .app = app, - .loadType = loadType, - .netOps = app.getOPs(), - .ledgerMaster = app.getLedgerMaster(), - .consumer = c, - .role = Role::USER, - .coro = {}, - .infoSub = {}, - .apiVersion = RPC::apiVersionIfUnspecified}, + {env.journal, + app, + loadType, + app.getOPs(), + app.getLedgerMaster(), + c, + Role::USER, + {}, + {}, + RPC::apiVersionIfUnspecified}, {}, {}}; Json::Value result; @@ -460,4 +439,5 @@ public: BEAST_DEFINE_TESTSUITE(PathMPT, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Path_test.cpp b/src/test/app/Path_test.cpp index 505d052faa..7e7354c9ee 100644 --- a/src/test/app/Path_test.cpp +++ b/src/test/app/Path_test.cpp @@ -1,62 +1,28 @@ +#include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include // IWYU pragma: keep -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include +#include #include -#include -#include -#include +#include #include #include -#include -#include #include -#include -#include -#include -#include #include -#include -#include #include -#include #include -#include -#include #include -#include -#include -#include -#include #include #include #include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { //------------------------------------------------------------------------------ @@ -155,16 +121,16 @@ public: Resource::Consumer c; RPC::JsonContext context{ - {.j = env.journal, - .app = app, - .loadType = loadType, - .netOps = app.getOPs(), - .ledgerMaster = app.getLedgerMaster(), - .consumer = c, - .role = Role::USER, - .coro = {}, - .infoSub = {}, - .apiVersion = RPC::apiVersionIfUnspecified}, + {env.journal, + app, + loadType, + app.getOPs(), + app.getLedgerMaster(), + c, + Role::USER, + {}, + {}, + RPC::apiVersionIfUnspecified}, {}, {}}; @@ -266,16 +232,16 @@ public: Resource::Consumer c; RPC::JsonContext context{ - {.j = env.journal, - .app = app, - .loadType = loadType, - .netOps = app.getOPs(), - .ledgerMaster = app.getLedgerMaster(), - .consumer = c, - .role = Role::USER, - .coro = {}, - .infoSub = {}, - .apiVersion = RPC::apiVersionIfUnspecified}, + {env.journal, + app, + loadType, + app.getOPs(), + app.getLedgerMaster(), + c, + Role::USER, + {}, + {}, + RPC::apiVersionIfUnspecified}, {}, {}}; Json::Value result; @@ -1912,4 +1878,5 @@ public: BEAST_DEFINE_TESTSUITE(Path, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/PayChan_test.cpp b/src/test/app/PayChan_test.cpp index 758d16931c..768031c3af 100644 --- a/src/test/app/PayChan_test.cpp +++ b/src/test/app/PayChan_test.cpp @@ -1,58 +1,15 @@ +#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { using namespace jtx::paychan; struct PayChan_test : public beast::unit_test::suite @@ -1649,7 +1606,6 @@ struct PayChan_test : public beast::unit_test::suite Account const& acc, std::shared_ptr const& chan) -> bool { xrpl::Dir const ownerDir(view, keylet::ownerDir(acc.id())); - // NOLINTNEXTLINE(modernize-use-ranges) return std::find(ownerDir.begin(), ownerDir.end(), chan) != ownerDir.end(); }; @@ -1980,4 +1936,5 @@ public: }; BEAST_DEFINE_TESTSUITE(PayChan, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/PayStrandMPT_test.cpp b/src/test/app/PayStrandMPT_test.cpp index 44f25d54dc..cfeeaa5d35 100644 --- a/src/test/app/PayStrandMPT_test.cpp +++ b/src/test/app/PayStrandMPT_test.cpp @@ -1,50 +1,24 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { struct PayStrandMPT_test : public beast::unit_test::suite { static jtx::DirectStepInfo makeEndpointStep(jtx::Account const& src, jtx::Account const& dst, jtx::IOU const& iou) { - return jtx::DirectStepInfo{.src = src, .dst = dst, .currency = iou.currency}; + return jtx::DirectStepInfo{src, dst, iou.currency}; } static jtx::MPTEndpointStepInfo makeEndpointStep(jtx::Account const& src, jtx::Account const& dst, jtx::MPT const& mpt) { - return jtx::MPTEndpointStepInfo{.src = src, .dst = dst, .mptid = mpt.mpt()}; + return jtx::MPTEndpointStepInfo{src, dst, mpt.mpt()}; } void @@ -649,4 +623,5 @@ struct PayStrandMPT_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(PayStrandMPT, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/PayStrand_test.cpp b/src/test/app/PayStrand_test.cpp index 24efb4b155..e0ead8536c 100644 --- a/src/test/app/PayStrand_test.cpp +++ b/src/test/app/PayStrand_test.cpp @@ -1,53 +1,21 @@ -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include + +#include #include #include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { enum class TrustFlag { freeze, auth, noripple }; @@ -1159,4 +1127,5 @@ struct PayStrand_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(PayStrand, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/PermissionedDEX_test.cpp b/src/test/app/PermissionedDEX_test.cpp index 600f753c96..f3aed0579b 100644 --- a/src/test/app/PermissionedDEX_test.cpp +++ b/src/test/app/PermissionedDEX_test.cpp @@ -1,51 +1,34 @@ +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include -#include +#include #include +#include #include #include #include #include -#include #include -#include -#include #include #include +#include +#include -#include -#include +#include #include +#include #include -#include #include #include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { using namespace jtx; @@ -1389,73 +1372,6 @@ class PermissionedDEX_test : public beast::unit_test::suite BEAST_EXPECT(!offerExists(env, bob, carolOfferSeq)); } - void - testHybridMalformedOffer(FeatureBitset features) - { - bool const fixS313Enabled = features[fixSecurity3_1_3]; - - testcase << "Hybrid offer with empty AdditionalBooks" - << (fixS313Enabled ? " (fixSecurity3_1_3 enabled)" - : " (fixSecurity3_1_3 disabled)"); - - // offerInDomain has two code paths gated by fixSecurity3_1_3: - // - // pre-fix: only rejects a hybrid offer when sfAdditionalBooks is - // entirely absent — an empty array (size 0) passes through. - // post-fix: also rejects a hybrid offer whose sfAdditionalBooks array - // has size != 1 (i.e. 0 or >1 entries). - // - // We create a valid hybrid offer, then directly manipulate its SLE to - // produce the size==0 case that cannot occur via normal transactions, - // and verify that the two code paths produce the expected outcomes. - // - // Note: the PermissionedDEX invariant checker (ValidPermissionedDEX) - // does not flag this malformation for ttPAYMENT — only for - // ttOFFER_CREATE — so the without-fix payment completes as tesSUCCESS. - - Env env(*this, features); - auto const& [gw, domainOwner, alice, bob, carol, USD, domainID, credType] = - PermissionedDEX(env); - - // Create a valid hybrid offer (sfAdditionalBooks has exactly 1 entry) - auto const bobOfferSeq{env.seq(bob)}; - env(offer(bob, XRP(10), USD(10)), txflags(tfHybrid), domain(domainID)); - env.close(); - BEAST_EXPECT(offerExists(env, bob, bobOfferSeq)); - - // Directly manipulate the offer SLE in the open ledger so that - // sfAdditionalBooks is present but empty (size 0). This is the - // malformed state that fixSecurity3_1_3 is designed to catch. - auto const offerKey = keylet::offer(bob.id(), bobOfferSeq); - env.app().getOpenLedger().modify([&offerKey](OpenView& view, beast::Journal) { - auto const sle = view.read(offerKey); - if (!sle) - return false; - auto replacement = std::make_shared(*sle, sle->key()); - replacement->setFieldArray(sfAdditionalBooks, STArray{}); - view.rawReplace(replacement); - return true; - }); - - if (fixS313Enabled) - { - // post-fixSecurity3_1_3: offerInDomain rejects the malformed - // offer (size == 0), so no valid domain offer is found. - env(pay(alice, carol, USD(10)), - path(~USD), - sendmax(XRP(10)), - domain(domainID), - ter(tecPATH_PARTIAL)); - } - else - { - // pre-fixSecurity3_1_3: offerInDomain only checks for a missing - // sfAdditionalBooks field; size == 0 passes through, so the - // malformed offer is crossed and the payment succeeds. - env(pay(alice, carol, USD(10)), path(~USD), sendmax(XRP(10)), domain(domainID)); - } - } - public: void run() override @@ -1477,11 +1393,10 @@ public: testHybridBookStep(all); testHybridInvalidOffer(all); testHybridOfferDirectories(all); - testHybridMalformedOffer(all); - testHybridMalformedOffer(all - fixSecurity3_1_3); } }; BEAST_DEFINE_TESTSUITE(PermissionedDEX, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/PermissionedDomains_test.cpp b/src/test/app/PermissionedDomains_test.cpp index f94fc53f71..c4bde9831a 100644 --- a/src/test/app/PermissionedDomains_test.cpp +++ b/src/test/app/PermissionedDomains_test.cpp @@ -1,35 +1,18 @@ +#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include - -#include -#include -#include #include -#include -#include -#include #include +#include -#include #include #include #include #include -#include -#include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { using namespace jtx; @@ -548,4 +531,5 @@ public: BEAST_DEFINE_TESTSUITE(PermissionedDomains, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/PseudoTx_test.cpp b/src/test/app/PseudoTx_test.cpp index 22c0cff075..a9180d0e03 100644 --- a/src/test/app/PseudoTx_test.cpp +++ b/src/test/app/PseudoTx_test.cpp @@ -1,24 +1,13 @@ +#include -#include - -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { struct PseudoTx_test : public beast::unit_test::suite { @@ -27,7 +16,7 @@ struct PseudoTx_test : public beast::unit_test::suite { std::vector res; - res.emplace_back(ttFEE, [&](auto& obj) { + res.emplace_back(STTx(ttFEE, [&](auto& obj) { obj[sfAccount] = AccountID(); obj[sfLedgerSequence] = seq; if (rules.enabled(featureXRPFees)) @@ -43,13 +32,13 @@ struct PseudoTx_test : public beast::unit_test::suite obj[sfReserveIncrement] = 0; obj[sfReferenceFeeUnits] = 0; } - }); + })); - res.emplace_back(ttAMENDMENT, [&](auto& obj) { + res.emplace_back(STTx(ttAMENDMENT, [&](auto& obj) { obj.setAccountID(sfAccount, AccountID()); obj.setFieldH256(sfAmendment, uint256(2)); obj.setFieldU32(sfLedgerSequence, seq); - }); + })); return res; } @@ -59,12 +48,12 @@ struct PseudoTx_test : public beast::unit_test::suite { std::vector res; - res.emplace_back(ttACCOUNT_SET, [&](auto& obj) { obj[sfAccount] = AccountID(1); }); + res.emplace_back(STTx(ttACCOUNT_SET, [&](auto& obj) { obj[sfAccount] = AccountID(1); })); - res.emplace_back(ttPAYMENT, [&](auto& obj) { + res.emplace_back(STTx(ttPAYMENT, [&](auto& obj) { obj.setAccountID(sfAccount, AccountID(2)); obj.setAccountID(sfDestination, AccountID(3)); - }); + })); return res; } @@ -115,4 +104,5 @@ struct PseudoTx_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(PseudoTx, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/RCLValidations_test.cpp b/src/test/app/RCLValidations_test.cpp index 164ded6138..32267cbf45 100644 --- a/src/test/app/RCLValidations_test.cpp +++ b/src/test/app/RCLValidations_test.cpp @@ -1,25 +1,13 @@ - -#include +#include #include -#include -#include #include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class RCLValidations_test : public beast::unit_test::suite { @@ -324,4 +312,5 @@ public: BEAST_DEFINE_TESTSUITE(RCLValidations, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/ReducedOffer_test.cpp b/src/test/app/ReducedOffer_test.cpp index a6d7160071..3aa57423b5 100644 --- a/src/test/app/ReducedOffer_test.cpp +++ b/src/test/app/ReducedOffer_test.cpp @@ -1,30 +1,13 @@ +#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include - -#include -#include -#include #include #include -#include -#include -#include #include -#include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class ReducedOffer_test : public beast::unit_test::suite { @@ -684,4 +667,5 @@ public: BEAST_DEFINE_TESTSUITE_PRIO(ReducedOffer, app, xrpl, 2); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Regression_test.cpp b/src/test/app/Regression_test.cpp index c38013d1f3..59ab0e427d 100644 --- a/src/test/app/Regression_test.cpp +++ b/src/test/app/Regression_test.cpp @@ -1,57 +1,18 @@ -#include -#include -#include -#include -#include // IWYU pragma: keep +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include #include -#include -#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { struct Regression_test : public beast::unit_test::suite { @@ -348,4 +309,5 @@ struct Regression_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(Regression, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/SHAMapStore_test.cpp b/src/test/app/SHAMapStore_test.cpp index 75e4c0c721..73cbf1c617 100644 --- a/src/test/app/SHAMapStore_test.cpp +++ b/src/test/app/SHAMapStore_test.cpp @@ -1,38 +1,17 @@ -#include -#include +#include #include #include #include #include #include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class SHAMapStore_test : public beast::unit_test::suite { @@ -178,10 +157,10 @@ public: auto ledgerTmp = env.rpc("ledger", "0"); BEAST_EXPECT(bad(ledgerTmp)); - ledgers.emplace(1, env.rpc("ledger", "1")); + ledgers.emplace(std::make_pair(1, env.rpc("ledger", "1"))); BEAST_EXPECT(goodLedger(env, ledgers[1], "1")); - ledgers.emplace(2, env.rpc("ledger", "2")); + ledgers.emplace(std::make_pair(2, env.rpc("ledger", "2"))); BEAST_EXPECT(goodLedger(env, ledgers[2], "2")); ledgerTmp = env.rpc("ledger", "current"); @@ -208,7 +187,7 @@ public: for (auto i = 3; i < deleteInterval + lastRotated; ++i) { - ledgers.emplace(i, env.rpc("ledger", std::to_string(i))); + ledgers.emplace(std::make_pair(i, env.rpc("ledger", std::to_string(i)))); BEAST_EXPECT( goodLedger(env, ledgers[i], std::to_string(i), true) && !getHash(ledgers[i]).empty()); @@ -245,7 +224,7 @@ public: ledgerTmp = env.rpc("ledger", "current"); BEAST_EXPECT(goodLedger(env, ledgerTmp, std::to_string(i + 3))); - ledgers.emplace(i, env.rpc("ledger", std::to_string(i))); + ledgers.emplace(std::make_pair(i, env.rpc("ledger", std::to_string(i)))); BEAST_EXPECT( store.getLastRotated() == lastRotated || i == lastRotated + deleteInterval - 2); BEAST_EXPECT( @@ -597,4 +576,5 @@ public: // VFALCO This test fails because of thread asynchronous issues BEAST_DEFINE_TESTSUITE(SHAMapStore, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/SetAuth_test.cpp b/src/test/app/SetAuth_test.cpp index 5982fc282d..a38cf7175a 100644 --- a/src/test/app/SetAuth_test.cpp +++ b/src/test/app/SetAuth_test.cpp @@ -1,24 +1,10 @@ +#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include #include -#include -#include -#include -#include #include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { struct SetAuth_test : public beast::unit_test::suite { @@ -73,4 +59,5 @@ struct SetAuth_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(SetAuth, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/SetRegularKey_test.cpp b/src/test/app/SetRegularKey_test.cpp index af79bb75bc..3cce01a112 100644 --- a/src/test/app/SetRegularKey_test.cpp +++ b/src/test/app/SetRegularKey_test.cpp @@ -1,25 +1,6 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include +#include namespace xrpl { diff --git a/src/test/app/TheoreticalQuality_test.cpp b/src/test/app/TheoreticalQuality_test.cpp index 2316b3249f..0f73b8da6a 100644 --- a/src/test/app/TheoreticalQuality_test.cpp +++ b/src/test/app/TheoreticalQuality_test.cpp @@ -1,50 +1,18 @@ +#include +#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { struct RippleCalcTestParams { @@ -543,4 +511,5 @@ public: BEAST_DEFINE_TESTSUITE_PRIO(TheoreticalQuality, app, xrpl, 3); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/Ticket_test.cpp b/src/test/app/Ticket_test.cpp index 0dc9f0155f..7f96caa05f 100644 --- a/src/test/app/Ticket_test.cpp +++ b/src/test/app/Ticket_test.cpp @@ -1,48 +1,10 @@ - -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { class Ticket_test : public beast::unit_test::suite @@ -228,8 +190,8 @@ class Ticket_test : public beast::unit_test::suite // Verify that all the expected Tickets were created. BEAST_EXPECT(ticketSeqs.size() == count); - std::ranges::sort(ticketSeqs); - BEAST_EXPECT(std::ranges::adjacent_find(ticketSeqs) == ticketSeqs.end()); + std::sort(ticketSeqs.begin(), ticketSeqs.end()); + BEAST_EXPECT(std::adjacent_find(ticketSeqs.begin(), ticketSeqs.end()) == ticketSeqs.end()); BEAST_EXPECT(*ticketSeqs.rbegin() == acctRootFinalSeq - 1); } diff --git a/src/test/app/Transaction_ordering_test.cpp b/src/test/app/Transaction_ordering_test.cpp index af5001b06e..c50fbf4e56 100644 --- a/src/test/app/Transaction_ordering_test.cpp +++ b/src/test/app/Transaction_ordering_test.cpp @@ -1,24 +1,9 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include #include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { struct Transaction_ordering_test : public beast::unit_test::suite { @@ -149,4 +134,5 @@ struct Transaction_ordering_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(Transaction_ordering, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/TrustAndBalance_test.cpp b/src/test/app/TrustAndBalance_test.cpp index e6cc7e71ca..e4cc1d34d5 100644 --- a/src/test/app/TrustAndBalance_test.cpp +++ b/src/test/app/TrustAndBalance_test.cpp @@ -1,26 +1,11 @@ -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include -#include #include -#include - namespace xrpl { class TrustAndBalance_test : public beast::unit_test::suite diff --git a/src/test/app/TrustSet_test.cpp b/src/test/app/TrustSet_test.cpp index 6d24b695c7..d359ba1f26 100644 --- a/src/test/app/TrustSet_test.cpp +++ b/src/test/app/TrustSet_test.cpp @@ -1,30 +1,11 @@ +#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include +namespace xrpl { -namespace xrpl::test { +namespace test { class TrustSet_test : public beast::unit_test::suite { @@ -619,4 +600,5 @@ public: } }; BEAST_DEFINE_TESTSUITE(TrustSet, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/TxQ_test.cpp b/src/test/app/TxQ_test.cpp index 248c8121f4..6f13f9d419 100644 --- a/src/test/app/TxQ_test.cpp +++ b/src/test/app/TxQ_test.cpp @@ -1,61 +1,22 @@ -#include -#include -#include +#include #include +#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +namespace xrpl { -namespace xrpl::test { +namespace test { class TxQPosNegFlows_test : public beast::unit_test::suite { @@ -4693,4 +4654,5 @@ class TxQMetaInfo_test : public TxQPosNegFlows_test BEAST_DEFINE_TESTSUITE_PRIO(TxQPosNegFlows, app, xrpl, 1); BEAST_DEFINE_TESTSUITE_PRIO(TxQMetaInfo, app, xrpl, 1); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/ValidatorKeys_test.cpp b/src/test/app/ValidatorKeys_test.cpp index bbc77671bc..3be6fcd028 100644 --- a/src/test/app/ValidatorKeys_test.cpp +++ b/src/test/app/ValidatorKeys_test.cpp @@ -1,5 +1,4 @@ #include -#include #include #include @@ -7,20 +6,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class ValidatorKeys_test : public beast::unit_test::suite { @@ -175,4 +167,5 @@ public: BEAST_DEFINE_TESTSUITE(ValidatorKeys, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/ValidatorList_test.cpp b/src/test/app/ValidatorList_test.cpp index 63c2ca37d8..74b208e5e2 100644 --- a/src/test/app/ValidatorList_test.cpp +++ b/src/test/app/ValidatorList_test.cpp @@ -1,55 +1,23 @@ - -#include -#include +#include #include -#include #include #include -#include #include -#include #include -#include -#include #include -#include #include -#include -#include #include -#include #include -#include #include #include -#include -#include +#include -#include #include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class ValidatorList_test : public beast::unit_test::suite { @@ -124,9 +92,9 @@ private: auto const masterPublic = derivePublicKey(KeyType::ed25519, secret); auto const signingKeys = randomKeyPair(KeyType::secp256k1); return { - .masterPublic = masterPublic, - .signingPublic = signingKeys.first, - .manifest = base64_encode(makeManifestString( + masterPublic, + signingKeys.first, + base64_encode(makeManifestString( masterPublic, secret, signingKeys.first, signingKeys.second, 1))}; } @@ -1898,11 +1866,11 @@ private: auto const sig2 = signList(blob2, pubSigningKeys); return PreparedList{ - .publisherPublic = publisherPublic, - .manifest = manifest, - .blobs = {{blob1, sig1, {}}, {blob2, sig2, {}}}, - .version = version, - .expirations = {expiration1, expiration2}}; + publisherPublic, + manifest, + {{blob1, sig1, {}}, {blob2, sig2, {}}}, + version, + {expiration1, expiration2}}; }; // Configure two publishers and prepare 2 lists @@ -3949,4 +3917,5 @@ public: BEAST_DEFINE_TESTSUITE(ValidatorList, app, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/app/ValidatorSite_test.cpp b/src/test/app/ValidatorSite_test.cpp index f652689b2b..9f9b0cbdf7 100644 --- a/src/test/app/ValidatorSite_test.cpp +++ b/src/test/app/ValidatorSite_test.cpp @@ -1,34 +1,21 @@ -#include +#include #include -#include #include -#include #include -#include #include -#include -#include -#include -#include +#include #include #include -#include -#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { namespace detail { @@ -177,7 +164,7 @@ private: for (auto const& cfg : paths) { - servers.emplace_back(cfg); + servers.push_back(cfg); auto& item = servers.back(); item.isRetry = cfg.path == "/bad-resource"; item.list.reserve(listSize); diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index 0e6b680ff3..95b9165feb 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -1,37 +1,15 @@ -#include +#include #include -#include #include -#include #include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include #include -#include -#include #include #include -#include -#include #include #include #include @@ -40,27 +18,16 @@ #include #include #include -#include #include #include #include #include -#include #include #include -#include -#include #include #include -#include -#include -#include -#include #include -#include -#include -#include namespace xrpl { @@ -4870,8 +4837,8 @@ class Vault_test : public beast::unit_test::suite } }; - Account const owner{"alice"}; - Account const depositor{"bob"}; + Account owner{"alice"}; + Account depositor{"bob"}; Account const issuer{"issuer"}; env.fund(XRP(10000), issuer, owner, depositor); @@ -5370,7 +5337,7 @@ class Vault_test : public beast::unit_test::suite }; Account owner{"alice"}; - Account const depositor{"bob"}; + Account depositor{"bob"}; Account const issuer{"issuer"}; env.fund(XRP(10000), issuer, owner, depositor); diff --git a/src/test/app/XChain_test.cpp b/src/test/app/XChain_test.cpp index 852bbbbb8b..5386d9ecdc 100644 --- a/src/test/app/XChain_test.cpp +++ b/src/test/app/XChain_test.cpp @@ -1,54 +1,25 @@ -#include +#include #include -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include - -#include -#include #include -#include -#include -#include #include #include #include -#include #include -#include #include +#include #include -#include -#include +#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include +#include #include #include #include #include -#include -#include #include #include @@ -2331,15 +2302,15 @@ struct XChain_test : public beast::unit_test::suite, public jtx::XChainBridgeObj Account const ua{"ua"}; // unfunded account we want to create BridgeDef xrp_b{ - .doorA = doorA, - .issueA = xrpIssue(), - .doorB = Account::master, - .issueB = xrpIssue(), - .reward = XRP(1), // reward - .minAccountCreate = XRP(20), // minAccountCreate - .quorum = 4, // quorum - .signers = signers, - .jvb = Json::nullValue}; + doorA, + xrpIssue(), + Account::master, + xrpIssue(), + XRP(1), // reward + XRP(20), // minAccountCreate + 4, // quorum + signers, + Json::nullValue}; xrp_b.initBridge(mcEnv, scEnv); @@ -4529,30 +4500,30 @@ public: // create XRP -> XRP bridge // ------------------------ BridgeDef xrp_b{ - .doorA = doorXRPLocking, - .issueA = xrpIssue(), - .doorB = Account::master, - .issueB = xrpIssue(), - .reward = XRP(1), - .minAccountCreate = XRP(20), - .quorum = quorum, - .signers = signers, - .jvb = Json::nullValue}; + doorXRPLocking, + xrpIssue(), + Account::master, + xrpIssue(), + XRP(1), + XRP(20), + quorum, + signers, + Json::nullValue}; initBridge(xrp_b); // create USD -> USD bridge // ------------------------ BridgeDef usd_b{ - .doorA = doorUSDLocking, - .issueA = usdLocking, - .doorB = doorUSDIssuing, - .issueB = usdIssuing, - .reward = XRP(1), - .minAccountCreate = XRP(20), - .quorum = quorum, - .signers = signers, - .jvb = Json::nullValue}; + doorUSDLocking, + usdLocking, + doorUSDIssuing, + usdIssuing, + XRP(1), + XRP(20), + quorum, + signers, + Json::nullValue}; initBridge(usd_b); @@ -4561,262 +4532,79 @@ public: // give time enough for ua[0] to be funded now so it can reserve // the claimID // ----------------------------------------------------------------- - ac(0, - st, - xrp_b, - {.from = a[0], .to = ua[0], .amt = XRP(777), .reward = xrp_b.reward, .a2b = true}); - xfer( - 8, - st, - xrp_b, - {.from = a[0], .to = ua[0], .finaldest = a[2], .amt = XRP(3), .a2b = true}); + ac(0, st, xrp_b, {a[0], ua[0], XRP(777), xrp_b.reward, true}); + xfer(8, st, xrp_b, {a[0], ua[0], a[2], XRP(3), true}); runSimulation(st); // try the same thing in the other direction // ----------------------------------------- - ac(0, - st, - xrp_b, - {.from = a[0], .to = ua[0], .amt = XRP(777), .reward = xrp_b.reward, .a2b = false}); - xfer( - 8, - st, - xrp_b, - {.from = a[0], .to = ua[0], .finaldest = a[2], .amt = XRP(3), .a2b = false}); + ac(0, st, xrp_b, {a[0], ua[0], XRP(777), xrp_b.reward, false}); + xfer(8, st, xrp_b, {a[0], ua[0], a[2], XRP(3), false}); runSimulation(st); // run multiple XRP transfers // -------------------------- - xfer( - 0, - st, - xrp_b, - {.from = a[0], - .to = a[0], - .finaldest = a[1], - .amt = XRP(6), - .a2b = true, - .with_claim = WithClaim::no}); - xfer( - 1, - st, - xrp_b, - {.from = a[0], - .to = a[0], - .finaldest = a[1], - .amt = XRP(8), - .a2b = false, - .with_claim = WithClaim::no}); - xfer( - 1, - st, - xrp_b, - {.from = a[1], .to = a[1], .finaldest = a[1], .amt = XRP(1), .a2b = true}); - xfer( - 2, - st, - xrp_b, - {.from = a[0], .to = a[0], .finaldest = a[1], .amt = XRP(3), .a2b = false}); - xfer( - 2, - st, - xrp_b, - {.from = a[1], .to = a[1], .finaldest = a[1], .amt = XRP(5), .a2b = false}); - xfer( - 2, - st, - xrp_b, - {.from = a[0], - .to = a[0], - .finaldest = a[1], - .amt = XRP(7), - .a2b = false, - .with_claim = WithClaim::no}); - xfer( - 2, - st, - xrp_b, - {.from = a[1], .to = a[1], .finaldest = a[1], .amt = XRP(9), .a2b = true}); + xfer(0, st, xrp_b, {a[0], a[0], a[1], XRP(6), true, WithClaim::no}); + xfer(1, st, xrp_b, {a[0], a[0], a[1], XRP(8), false, WithClaim::no}); + xfer(1, st, xrp_b, {a[1], a[1], a[1], XRP(1), true}); + xfer(2, st, xrp_b, {a[0], a[0], a[1], XRP(3), false}); + xfer(2, st, xrp_b, {a[1], a[1], a[1], XRP(5), false}); + xfer(2, st, xrp_b, {a[0], a[0], a[1], XRP(7), false, WithClaim::no}); + xfer(2, st, xrp_b, {a[1], a[1], a[1], XRP(9), true}); runSimulation(st); // run one USD transfer // -------------------- - xfer( - 0, - st, - usd_b, - {.from = a[0], .to = a[1], .finaldest = a[2], .amt = usdLocking(3), .a2b = true}); + xfer(0, st, usd_b, {a[0], a[1], a[2], usdLocking(3), true}); runSimulation(st); // run multiple USD transfers // -------------------------- - xfer( - 0, - st, - usd_b, - {.from = a[0], .to = a[0], .finaldest = a[1], .amt = usdLocking(6), .a2b = true}); - xfer( - 1, - st, - usd_b, - {.from = a[0], .to = a[0], .finaldest = a[1], .amt = usdIssuing(8), .a2b = false}); - xfer( - 1, - st, - usd_b, - {.from = a[1], .to = a[1], .finaldest = a[1], .amt = usdLocking(1), .a2b = true}); - xfer( - 2, - st, - usd_b, - {.from = a[0], .to = a[0], .finaldest = a[1], .amt = usdIssuing(3), .a2b = false}); - xfer( - 2, - st, - usd_b, - {.from = a[1], .to = a[1], .finaldest = a[1], .amt = usdIssuing(5), .a2b = false}); - xfer( - 2, - st, - usd_b, - {.from = a[0], .to = a[0], .finaldest = a[1], .amt = usdIssuing(7), .a2b = false}); - xfer( - 2, - st, - usd_b, - {.from = a[1], .to = a[1], .finaldest = a[1], .amt = usdLocking(9), .a2b = true}); + xfer(0, st, usd_b, {a[0], a[0], a[1], usdLocking(6), true}); + xfer(1, st, usd_b, {a[0], a[0], a[1], usdIssuing(8), false}); + xfer(1, st, usd_b, {a[1], a[1], a[1], usdLocking(1), true}); + xfer(2, st, usd_b, {a[0], a[0], a[1], usdIssuing(3), false}); + xfer(2, st, usd_b, {a[1], a[1], a[1], usdIssuing(5), false}); + xfer(2, st, usd_b, {a[0], a[0], a[1], usdIssuing(7), false}); + xfer(2, st, usd_b, {a[1], a[1], a[1], usdLocking(9), true}); runSimulation(st); // run mixed transfers // ------------------- - xfer( - 0, - st, - xrp_b, - {.from = a[0], .to = a[0], .finaldest = a[0], .amt = XRP(1), .a2b = true}); - xfer( - 0, - st, - usd_b, - {.from = a[1], .to = a[3], .finaldest = a[3], .amt = usdIssuing(3), .a2b = false}); - xfer( - 0, - st, - usd_b, - {.from = a[3], .to = a[2], .finaldest = a[1], .amt = usdIssuing(5), .a2b = false}); + xfer(0, st, xrp_b, {a[0], a[0], a[0], XRP(1), true}); + xfer(0, st, usd_b, {a[1], a[3], a[3], usdIssuing(3), false}); + xfer(0, st, usd_b, {a[3], a[2], a[1], usdIssuing(5), false}); - xfer( - 1, - st, - xrp_b, - {.from = a[0], .to = a[0], .finaldest = a[0], .amt = XRP(4), .a2b = false}); - xfer( - 1, - st, - xrp_b, - {.from = a[1], .to = a[1], .finaldest = a[0], .amt = XRP(8), .a2b = true}); - xfer( - 1, - st, - usd_b, - {.from = a[4], .to = a[1], .finaldest = a[1], .amt = usdLocking(7), .a2b = true}); + xfer(1, st, xrp_b, {a[0], a[0], a[0], XRP(4), false}); + xfer(1, st, xrp_b, {a[1], a[1], a[0], XRP(8), true}); + xfer(1, st, usd_b, {a[4], a[1], a[1], usdLocking(7), true}); - xfer( - 3, - st, - xrp_b, - {.from = a[1], .to = a[1], .finaldest = a[0], .amt = XRP(7), .a2b = true}); - xfer( - 3, - st, - xrp_b, - {.from = a[0], .to = a[4], .finaldest = a[3], .amt = XRP(2), .a2b = false}); - xfer( - 3, - st, - xrp_b, - {.from = a[1], .to = a[1], .finaldest = a[0], .amt = XRP(9), .a2b = true}); - xfer( - 3, - st, - usd_b, - {.from = a[3], .to = a[1], .finaldest = a[1], .amt = usdIssuing(11), .a2b = false}); + xfer(3, st, xrp_b, {a[1], a[1], a[0], XRP(7), true}); + xfer(3, st, xrp_b, {a[0], a[4], a[3], XRP(2), false}); + xfer(3, st, xrp_b, {a[1], a[1], a[0], XRP(9), true}); + xfer(3, st, usd_b, {a[3], a[1], a[1], usdIssuing(11), false}); runSimulation(st); // run multiple account create to stress attestation batching // ---------------------------------------------------------- - ac(0, - st, - xrp_b, - {.from = a[0], .to = ua[1], .amt = XRP(301), .reward = xrp_b.reward, .a2b = true}); - ac(0, - st, - xrp_b, - {.from = a[1], .to = ua[2], .amt = XRP(302), .reward = xrp_b.reward, .a2b = true}); - ac(1, - st, - xrp_b, - {.from = a[0], .to = ua[3], .amt = XRP(303), .reward = xrp_b.reward, .a2b = true}); - ac(2, - st, - xrp_b, - {.from = a[1], .to = ua[4], .amt = XRP(304), .reward = xrp_b.reward, .a2b = true}); - ac(3, - st, - xrp_b, - {.from = a[0], .to = ua[5], .amt = XRP(305), .reward = xrp_b.reward, .a2b = true}); - ac(4, - st, - xrp_b, - {.from = a[1], .to = ua[6], .amt = XRP(306), .reward = xrp_b.reward, .a2b = true}); - ac(6, - st, - xrp_b, - {.from = a[0], .to = ua[7], .amt = XRP(307), .reward = xrp_b.reward, .a2b = true}); - ac(7, - st, - xrp_b, - {.from = a[2], .to = ua[8], .amt = XRP(308), .reward = xrp_b.reward, .a2b = true}); - ac(9, - st, - xrp_b, - {.from = a[0], .to = ua[9], .amt = XRP(309), .reward = xrp_b.reward, .a2b = true}); - ac(9, - st, - xrp_b, - {.from = a[0], .to = ua[9], .amt = XRP(309), .reward = xrp_b.reward, .a2b = true}); - ac(10, - st, - xrp_b, - {.from = a[0], .to = ua[10], .amt = XRP(310), .reward = xrp_b.reward, .a2b = true}); - ac(12, - st, - xrp_b, - {.from = a[0], .to = ua[11], .amt = XRP(311), .reward = xrp_b.reward, .a2b = true}); - ac(12, - st, - xrp_b, - {.from = a[3], .to = ua[12], .amt = XRP(312), .reward = xrp_b.reward, .a2b = true}); - ac(12, - st, - xrp_b, - {.from = a[4], .to = ua[13], .amt = XRP(313), .reward = xrp_b.reward, .a2b = true}); - ac(12, - st, - xrp_b, - {.from = a[3], .to = ua[14], .amt = XRP(314), .reward = xrp_b.reward, .a2b = true}); - ac(12, - st, - xrp_b, - {.from = a[6], .to = ua[15], .amt = XRP(315), .reward = xrp_b.reward, .a2b = true}); - ac(13, - st, - xrp_b, - {.from = a[7], .to = ua[16], .amt = XRP(316), .reward = xrp_b.reward, .a2b = true}); - ac(15, - st, - xrp_b, - {.from = a[3], .to = ua[17], .amt = XRP(317), .reward = xrp_b.reward, .a2b = true}); + ac(0, st, xrp_b, {a[0], ua[1], XRP(301), xrp_b.reward, true}); + ac(0, st, xrp_b, {a[1], ua[2], XRP(302), xrp_b.reward, true}); + ac(1, st, xrp_b, {a[0], ua[3], XRP(303), xrp_b.reward, true}); + ac(2, st, xrp_b, {a[1], ua[4], XRP(304), xrp_b.reward, true}); + ac(3, st, xrp_b, {a[0], ua[5], XRP(305), xrp_b.reward, true}); + ac(4, st, xrp_b, {a[1], ua[6], XRP(306), xrp_b.reward, true}); + ac(6, st, xrp_b, {a[0], ua[7], XRP(307), xrp_b.reward, true}); + ac(7, st, xrp_b, {a[2], ua[8], XRP(308), xrp_b.reward, true}); + ac(9, st, xrp_b, {a[0], ua[9], XRP(309), xrp_b.reward, true}); + ac(9, st, xrp_b, {a[0], ua[9], XRP(309), xrp_b.reward, true}); + ac(10, st, xrp_b, {a[0], ua[10], XRP(310), xrp_b.reward, true}); + ac(12, st, xrp_b, {a[0], ua[11], XRP(311), xrp_b.reward, true}); + ac(12, st, xrp_b, {a[3], ua[12], XRP(312), xrp_b.reward, true}); + ac(12, st, xrp_b, {a[4], ua[13], XRP(313), xrp_b.reward, true}); + ac(12, st, xrp_b, {a[3], ua[14], XRP(314), xrp_b.reward, true}); + ac(12, st, xrp_b, {a[6], ua[15], XRP(315), xrp_b.reward, true}); + ac(13, st, xrp_b, {a[7], ua[16], XRP(316), xrp_b.reward, true}); + ac(15, st, xrp_b, {a[3], ua[17], XRP(317), xrp_b.reward, true}); runSimulation(st, true); // balances verification working now. } diff --git a/src/test/app/tx/apply_test.cpp b/src/test/app/tx/apply_test.cpp index ffacc0a563..6d3efea5f3 100644 --- a/src/test/app/tx/apply_test.cpp +++ b/src/test/app/tx/apply_test.cpp @@ -2,16 +2,10 @@ #include -#include #include -#include -#include -#include +#include #include -#include -#include - namespace xrpl { class Apply_test : public beast::unit_test::suite diff --git a/src/test/basics/Buffer_test.cpp b/src/test/basics/Buffer_test.cpp index 1fd0ed9e09..95a8853975 100644 --- a/src/test/basics/Buffer_test.cpp +++ b/src/test/basics/Buffer_test.cpp @@ -1,14 +1,11 @@ #include -#include -#include +#include -#include #include -#include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { struct Buffer_test : beast::unit_test::suite { @@ -103,8 +100,8 @@ struct Buffer_test : beast::unit_test::suite { testcase("Move Construction / Assignment"); - static_assert(std::is_nothrow_move_constructible_v, ""); - static_assert(std::is_nothrow_move_assignable_v, ""); + static_assert(std::is_nothrow_move_constructible::value, ""); + static_assert(std::is_nothrow_move_assignable::value, ""); { // Move-construct from empty buf Buffer x; @@ -265,4 +262,5 @@ struct Buffer_test : beast::unit_test::suite BEAST_DEFINE_TESTSUITE(Buffer, basics, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/basics/DetectCrash_test.cpp b/src/test/basics/DetectCrash_test.cpp index b47975873e..0dd2787dff 100644 --- a/src/test/basics/DetectCrash_test.cpp +++ b/src/test/basics/DetectCrash_test.cpp @@ -2,7 +2,8 @@ #include -namespace xrpl::test { +namespace xrpl { +namespace test { struct DetectCrash_test : public beast::unit_test::suite { @@ -23,4 +24,5 @@ struct DetectCrash_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE_MANUAL(DetectCrash, basics, beast); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/basics/Expected_test.cpp b/src/test/basics/Expected_test.cpp index b76955f53a..fa35946624 100644 --- a/src/test/basics/Expected_test.cpp +++ b/src/test/basics/Expected_test.cpp @@ -1,20 +1,15 @@ #include -#include +#include #include -#include -#include - -#include -#include -#include -#include - #if BOOST_VERSION >= 107500 -#endif // BOOST_VERSION +#include // Not part of boost before version 1.75 +#endif // BOOST_VERSION +#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { struct Expected_test : beast::unit_test::suite { @@ -218,4 +213,5 @@ struct Expected_test : beast::unit_test::suite BEAST_DEFINE_TESTSUITE(Expected, basics, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/basics/FileUtilities_test.cpp b/src/test/basics/FileUtilities_test.cpp index b427e800ec..b63f8baf0a 100644 --- a/src/test/basics/FileUtilities_test.cpp +++ b/src/test/basics/FileUtilities_test.cpp @@ -2,10 +2,7 @@ #include #include -#include - -#include -#include +#include namespace xrpl { diff --git a/src/test/basics/IOUAmount_test.cpp b/src/test/basics/IOUAmount_test.cpp index 95362c7545..d0e272c28b 100644 --- a/src/test/basics/IOUAmount_test.cpp +++ b/src/test/basics/IOUAmount_test.cpp @@ -1,12 +1,6 @@ -#include -#include -#include +#include #include -#include -#include -#include - namespace xrpl { class IOUAmount_test : public beast::unit_test::suite diff --git a/src/test/basics/IntrusiveShared_test.cpp b/src/test/basics/IntrusiveShared_test.cpp index 23b0c43499..52cb8f5c1c 100644 --- a/src/test/basics/IntrusiveShared_test.cpp +++ b/src/test/basics/IntrusiveShared_test.cpp @@ -1,29 +1,24 @@ +#include -#include // IWYU pragma: keep -#include // IWYU pragma: keep +#include #include -#include +#include +#include -#include #include #include -#include -#include // IWYU pragma: keep +#include +#include #include -#include -#include -#include #include -#include #include #include #include #include -#include #include -#include -namespace xrpl::tests { +namespace xrpl { +namespace tests { /** Experimentally, we discovered that using std::barrier performs extremely @@ -127,7 +122,7 @@ public: assert(state.size() > id_); state[id_].store(TrackedState::alive, std::memory_order_relaxed); } - ~TIBase() override + ~TIBase() { using enum TrackedState; @@ -239,7 +234,7 @@ public: BEAST_EXPECT(b->use_count() == 1); for (int i = 0; i < 10; ++i) { - weak.emplace_back(b); + weak.push_back(b); BEAST_EXPECT(b->use_count() == 1); } BEAST_EXPECT(TIBase::getState(id) == alive); @@ -530,11 +525,11 @@ public: { if (isStrongDist(eng)) { - result.emplace_back(SharedIntrusive(toClone)); + result.push_back(SharedIntrusive(toClone)); } else { - result.emplace_back(WeakIntrusive(toClone)); + result.push_back(WeakIntrusive(toClone)); } } return result; @@ -581,7 +576,7 @@ public: toClone.resize(numThreads); auto strong = make_SharedIntrusive(); strong->tracingCallback_ = tracingCallback; - std::ranges::fill(toClone, strong); + std::fill(toClone.begin(), toClone.end(), strong); } // ------ Sync Point ------ @@ -661,7 +656,7 @@ public: auto numToCreate = toCreateDist(eng); result.reserve(numToCreate); for (int i = 0; i < numToCreate; ++i) - result.emplace_back(SharedIntrusive(toClone)); + result.push_back(SharedIntrusive(toClone)); return result; }; constexpr int loopIters = 2 * 1024; @@ -708,7 +703,7 @@ public: toClone.resize(numThreads); auto strong = make_SharedIntrusive(); strong->tracingCallback_ = tracingCallback; - std::ranges::fill(toClone, strong); + std::fill(toClone.begin(), toClone.end(), strong); } // ------ Sync Point ------ @@ -829,7 +824,7 @@ public: toLock.resize(numThreads); auto strong = make_SharedIntrusive(); strong->tracingCallback_ = tracingCallback; - std::ranges::fill(toLock, strong); + std::fill(toLock.begin(), toLock.end(), strong); } // ------ Sync Point ------ @@ -876,4 +871,5 @@ public: }; // namespace tests BEAST_DEFINE_TESTSUITE(IntrusiveShared, basics, xrpl); -} // namespace xrpl::tests +} // namespace tests +} // namespace xrpl diff --git a/src/test/basics/KeyCache_test.cpp b/src/test/basics/KeyCache_test.cpp index 2370f87f5d..55b275ae09 100644 --- a/src/test/basics/KeyCache_test.cpp +++ b/src/test/basics/KeyCache_test.cpp @@ -1,13 +1,10 @@ #include #include -#include // IWYU pragma: keep +#include #include -#include #include -#include - namespace xrpl { class KeyCache_test : public beast::unit_test::suite diff --git a/src/test/basics/Number_test.cpp b/src/test/basics/Number_test.cpp index cc7ccaa8c2..856b379533 100644 --- a/src/test/basics/Number_test.cpp +++ b/src/test/basics/Number_test.cpp @@ -1,18 +1,10 @@ #include -#include +#include #include -#include #include #include -#include -#include -#include -#include -#include #include -#include -#include #include namespace xrpl { diff --git a/src/test/basics/PerfLog_test.cpp b/src/test/basics/PerfLog_test.cpp index cd00b180e7..470a52d220 100644 --- a/src/test/basics/PerfLog_test.cpp +++ b/src/test/basics/PerfLog_test.cpp @@ -1,39 +1,20 @@ #include #include -#include #include #include -#include +#include #include -#include -#include #include #include -#include -#include #include -#include -#include -#include -#include - -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include -#include -#include //------------------------------------------------------------------------------ @@ -105,7 +86,7 @@ class PerfLog_test : public beast::unit_test::suite perfLog(WithFile withFile) { perf::PerfLog::Setup const setup{ - .perfLog = withFile == WithFile::no ? "" : logFile(), .logInterval = logInterval()}; + withFile == WithFile::no ? "" : logFile(), logInterval()}; return perf::make_PerfLog(setup, app_, j_, [this]() { signalStop(); return; @@ -178,7 +159,7 @@ class PerfLog_test : public beast::unit_test::suite // Note that the longest durations should be at the front of the // vector since they were started first. - std::ranges::sort(currents, [](Cur const& lhs, Cur const& rhs) { + std::sort(currents.begin(), currents.end(), [](Cur const& lhs, Cur const& rhs) { if (lhs.dur != rhs.dur) return (rhs.dur < lhs.dur); return (lhs.name < rhs.name); diff --git a/src/test/basics/StringUtilities_test.cpp b/src/test/basics/StringUtilities_test.cpp index e566e43c9f..fb7cdb3d69 100644 --- a/src/test/basics/StringUtilities_test.cpp +++ b/src/test/basics/StringUtilities_test.cpp @@ -1,9 +1,7 @@ #include #include #include -#include - -#include +#include namespace xrpl { diff --git a/src/test/basics/TaggedCache_test.cpp b/src/test/basics/TaggedCache_test.cpp index 9621719803..78dc25380b 100644 --- a/src/test/basics/TaggedCache_test.cpp +++ b/src/test/basics/TaggedCache_test.cpp @@ -1,13 +1,10 @@ #include #include -#include // IWYU pragma: keep +#include #include -#include #include -#include - namespace xrpl { /* diff --git a/src/test/basics/Units_test.cpp b/src/test/basics/Units_test.cpp index 8769a0d386..6bb7f400cc 100644 --- a/src/test/basics/Units_test.cpp +++ b/src/test/basics/Units_test.cpp @@ -1,15 +1,9 @@ -#include -#include -#include +#include #include #include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class units_test : public beast::unit_test::suite { @@ -341,4 +335,5 @@ public: BEAST_DEFINE_TESTSUITE(units, basics, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/basics/XRPAmount_test.cpp b/src/test/basics/XRPAmount_test.cpp index b0e8213b73..ad81050558 100644 --- a/src/test/basics/XRPAmount_test.cpp +++ b/src/test/basics/XRPAmount_test.cpp @@ -1,10 +1,6 @@ -#include -#include +#include #include -#include -#include - namespace xrpl { class XRPAmount_test : public beast::unit_test::suite diff --git a/src/test/basics/base58_test.cpp b/src/test/basics/base58_test.cpp index 948195b424..52d06b324d 100644 --- a/src/test/basics/base58_test.cpp +++ b/src/test/basics/base58_test.cpp @@ -1,31 +1,20 @@ -#include -#include - -#include // IWYU pragma: keep - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifndef _MSC_VER +#include #include #include +#include +#include + #include #include #include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { namespace { [[nodiscard]] inline auto @@ -100,7 +89,7 @@ printAsChar(std::span a, std::span b) auto asString = [](std::span s) { std::string r; r.resize(s.size()); - std::ranges::copy(s, r.begin()); + std::copy(s.begin(), s.end(), r.begin()); return r; }; auto sa = asString(a); @@ -286,7 +275,7 @@ class base58_test : public beast::unit_test::suite b256Data.data(), b256Data.size(), tmpBuf.data(), tmpBuf.size()); BEAST_EXPECT(s.size()); b58Result[i] = outBuf.subspan(0, s.size()); - std::ranges::copy(s, b58Result[i].begin()); + std::copy(s.begin(), s.end(), b58Result[i].begin()); } } if (BEAST_EXPECT(b58Result[0].size() == b58Result[1].size())) @@ -315,7 +304,7 @@ class base58_test : public beast::unit_test::suite std::string const s = xrpl::b58_ref::detail::decodeBase58(st); BEAST_EXPECT(s.size()); b256Result[i] = outBuf.subspan(0, s.size()); - std::ranges::copy(s, b256Result[i].begin()); + std::copy(s.begin(), s.end(), b256Result[i].begin()); } } @@ -352,7 +341,7 @@ class base58_test : public beast::unit_test::suite xrpl::b58_ref::encodeBase58Token(tokType, b256Data.data(), b256Data.size()); BEAST_EXPECT(s.size()); b58Result[i] = outBuf.subspan(0, s.size()); - std::ranges::copy(s, b58Result[i].begin()); + std::copy(s.begin(), s.end(), b58Result[i].begin()); } } if (BEAST_EXPECT(b58Result[0].size() == b58Result[1].size())) @@ -381,7 +370,7 @@ class base58_test : public beast::unit_test::suite std::string const s = xrpl::b58_ref::decodeBase58Token(st, tokType); BEAST_EXPECT(s.size()); b256Result[i] = outBuf.subspan(0, s.size()); - std::ranges::copy(s, b256Result[i].begin()); + std::copy(s.begin(), s.end(), b256Result[i].begin()); } } @@ -434,6 +423,6 @@ class base58_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(base58, basics, xrpl); -} // namespace xrpl::test - +} // namespace test +} // namespace xrpl #endif // _MSC_VER diff --git a/src/test/basics/base_uint_test.cpp b/src/test/basics/base_uint_test.cpp index 8148f3bdce..139c635e5f 100644 --- a/src/test/basics/base_uint_test.cpp +++ b/src/test/basics/base_uint_test.cpp @@ -1,25 +1,15 @@ #include #include #include -#include -#include +#include -#include +#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { // a non-hashing Hasher that just copies the bytes. // Used to test hash_append in base_uint @@ -50,8 +40,8 @@ struct nonhash struct base_uint_test : beast::unit_test::suite { using test96 = base_uint<96>; - static_assert(std::is_copy_constructible_v); - static_assert(std::is_copy_assignable_v); + static_assert(std::is_copy_constructible::value); + static_assert(std::is_copy_assignable::value); void testComparisons() @@ -122,8 +112,8 @@ struct base_uint_test : beast::unit_test::suite { testcase("base_uint: general purpose tests"); - static_assert(!std::is_constructible_v>); - static_assert(!std::is_assignable_v>); + static_assert(!std::is_constructible>::value); + static_assert(!std::is_assignable>::value); testComparisons(); @@ -355,4 +345,5 @@ struct base_uint_test : beast::unit_test::suite BEAST_DEFINE_TESTSUITE(base_uint, basics, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/basics/hardened_hash_test.cpp b/src/test/basics/hardened_hash_test.cpp index 361a961312..3910e5e414 100644 --- a/src/test/basics/hardened_hash_test.cpp +++ b/src/test/basics/hardened_hash_test.cpp @@ -1,18 +1,14 @@ #include -#include +#include #include -#include #include #include -#include -#include -#include -#include #include #include -namespace xrpl::detail { +namespace xrpl { +namespace detail { template class test_user_type_member @@ -54,7 +50,8 @@ public: } }; -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl //------------------------------------------------------------------------------ @@ -81,7 +78,7 @@ class unsigned_integer { private: static_assert( - std::is_integral_v && std::is_unsigned_v, + std::is_integral::value && std::is_unsigned::value, "UInt must be an unsigned integral type"); static_assert(Bits % (8 * sizeof(UInt)) == 0, "Bits must be a multiple of 8*sizeof(UInt)"); diff --git a/src/test/basics/join_test.cpp b/src/test/basics/join_test.cpp index c03a027971..36d34eee04 100644 --- a/src/test/basics/join_test.cpp +++ b/src/test/basics/join_test.cpp @@ -1,17 +1,10 @@ #include -#include #include -#include +#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { struct join_test : beast::unit_test::suite { @@ -80,4 +73,5 @@ struct join_test : beast::unit_test::suite BEAST_DEFINE_TESTSUITE(join, basics, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/beast/IPEndpointCommon.h b/src/test/beast/IPEndpointCommon.h index 2f839af5e2..73cbe7d95b 100644 --- a/src/test/beast/IPEndpointCommon.h +++ b/src/test/beast/IPEndpointCommon.h @@ -1,7 +1,8 @@ #include #include -namespace beast::IP { +namespace beast { +namespace IP { inline Endpoint randomEP(bool v4 = true) @@ -38,4 +39,5 @@ randomEP(bool v4 = true) rand_int(1, UINT16_MAX)}; } -} // namespace beast::IP +} // namespace IP +} // namespace beast diff --git a/src/test/beast/IPEndpoint_test.cpp b/src/test/beast/IPEndpoint_test.cpp index 759a3fe3ad..ce01743896 100644 --- a/src/test/beast/IPEndpoint_test.cpp +++ b/src/test/beast/IPEndpoint_test.cpp @@ -4,25 +4,15 @@ #include #include -#include -#include -#include #include -#include +#include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include - -namespace beast::IP { +namespace beast { +namespace IP { //------------------------------------------------------------------------------ @@ -466,4 +456,5 @@ public: BEAST_DEFINE_TESTSUITE(IPEndpoint, beast, beast); -} // namespace beast::IP +} // namespace IP +} // namespace beast diff --git a/src/test/beast/LexicalCast_test.cpp b/src/test/beast/LexicalCast_test.cpp index 410358111e..aa3ccfe64e 100644 --- a/src/test/beast/LexicalCast_test.cpp +++ b/src/test/beast/LexicalCast_test.cpp @@ -1,12 +1,7 @@ #include -#include +#include #include -#include -#include -#include -#include - namespace beast { class LexicalCast_test : public unit_test::suite diff --git a/src/test/beast/SemanticVersion_test.cpp b/src/test/beast/SemanticVersion_test.cpp index 7e25e845fc..cae10497af 100644 --- a/src/test/beast/SemanticVersion_test.cpp +++ b/src/test/beast/SemanticVersion_test.cpp @@ -1,7 +1,5 @@ #include -#include - -#include +#include namespace beast { diff --git a/src/test/beast/aged_associative_container_test.cpp b/src/test/beast/aged_associative_container_test.cpp index a979cdbb38..c47b41478b 100644 --- a/src/test/beast/aged_associative_container_test.cpp +++ b/src/test/beast/aged_associative_container_test.cpp @@ -7,18 +7,9 @@ #include #include #include -#include -#include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #ifndef BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR @@ -45,8 +36,6 @@ public: template struct CompT { - CompT() = delete; - explicit CompT(int) { } @@ -62,6 +51,7 @@ public: } private: + CompT() = delete; std::less m_less; }; @@ -69,8 +59,6 @@ public: class HashT { public: - HashT() = delete; - explicit HashT(int) { } @@ -82,6 +70,7 @@ public: } private: + HashT() = delete; std::hash m_hash; }; @@ -89,8 +78,6 @@ public: struct EqualT { public: - EqualT() = delete; - explicit EqualT(int) { } @@ -102,6 +89,7 @@ public: } private: + EqualT() = delete; std::equal_to m_eq; }; @@ -160,6 +148,7 @@ public: { } #else + private: AllocT() = delete; #endif }; @@ -403,22 +392,22 @@ public: //-------------------------------------------------------------------------- template - std::enable_if_t + typename std::enable_if::type checkMapContents(Container& c, Values const& v); template - std::enable_if_t + typename std::enable_if::type checkMapContents(Container, Values const&) { } // unordered template - std::enable_if_t::type::is_unordered::value> + typename std::enable_if::type::is_unordered::value>::type checkUnorderedContentsRefRef(C&& c, Values const& v); template - std::enable_if_t::type::is_unordered::value> + typename std::enable_if::type::is_unordered::value>::type checkUnorderedContentsRefRef(C&&, Values const&) { } @@ -439,32 +428,32 @@ public: // ordered template - std::enable_if_t + typename std::enable_if::type testConstructEmpty(); // unordered template - std::enable_if_t + typename std::enable_if::type testConstructEmpty(); // ordered template - std::enable_if_t + typename std::enable_if::type testConstructRange(); // unordered template - std::enable_if_t + typename std::enable_if::type testConstructRange(); // ordered template - std::enable_if_t + typename std::enable_if::type testConstructInitList(); // unordered template - std::enable_if_t + typename std::enable_if::type testConstructInitList(); //-------------------------------------------------------------------------- @@ -481,11 +470,11 @@ public: // Unordered containers don't have reverse iterators template - std::enable_if_t + typename std::enable_if::type testReverseIterator(); template - std::enable_if_t + typename std::enable_if::type testReverseIterator() { } @@ -530,11 +519,11 @@ public: // map, unordered_map template - std::enable_if_t + typename std::enable_if::type testArrayCreate(); template - std::enable_if_t + typename std::enable_if::type testArrayCreate() { } @@ -574,11 +563,11 @@ public: // ordered template - std::enable_if_t + typename std::enable_if::type testCompare(); template - std::enable_if_t + typename std::enable_if::type testCompare() { } @@ -587,12 +576,12 @@ public: // ordered template - std::enable_if_t + typename std::enable_if::type testObservers(); // unordered template - std::enable_if_t + typename std::enable_if::type testObservers(); //-------------------------------------------------------------------------- @@ -615,7 +604,7 @@ public: // Check contents via at() and operator[] // map, unordered_map template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::checkMapContents(Container& c, Values const& v) { if (v.empty()) @@ -641,10 +630,10 @@ aged_associative_container_test_base::checkMapContents(Container& c, Values cons // unordered template -std::enable_if_t::type::is_unordered::value> +typename std::enable_if::type::is_unordered::value>::type aged_associative_container_test_base::checkUnorderedContentsRefRef(C&& c, Values const& v) { - using Cont = std::remove_reference_t; + using Cont = typename std::remove_reference::type; using Traits = TestTraits; using size_type = typename Cont::size_type; @@ -670,7 +659,7 @@ template void aged_associative_container_test_base::checkContentsRefRef(C&& c, Values const& v) { - using Cont = std::remove_reference_t; + using Cont = typename std::remove_reference::type; using size_type = typename Cont::size_type; BEAST_EXPECT(c.size() == v.size()); @@ -715,7 +704,7 @@ aged_associative_container_test_base::checkContents(Cont& c) // ordered template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testConstructEmpty() { using Traits = TestTraits; @@ -751,7 +740,7 @@ aged_associative_container_test_base::testConstructEmpty() // unordered template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testConstructEmpty() { using Traits = TestTraits; @@ -809,7 +798,7 @@ aged_associative_container_test_base::testConstructEmpty() // ordered template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testConstructRange() { using Traits = TestTraits; @@ -856,7 +845,7 @@ aged_associative_container_test_base::testConstructRange() // unordered template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testConstructRange() { using Traits = TestTraits; @@ -922,7 +911,7 @@ aged_associative_container_test_base::testConstructRange() // ordered template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testConstructInitList() { using Traits = TestTraits; @@ -938,7 +927,7 @@ aged_associative_container_test_base::testConstructInitList() // unordered template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testConstructInitList() { using Traits = TestTraits; @@ -1084,7 +1073,7 @@ aged_associative_container_test_base::testIterator() } template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testReverseIterator() { using Traits = TestTraits; @@ -1360,7 +1349,7 @@ aged_associative_container_test_base::testChronological() // map, unordered_map template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testArrayCreate() { using Traits = TestTraits; @@ -1643,7 +1632,7 @@ aged_associative_container_test_base::testRangeErase() // ordered template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testCompare() { using Traits = TestTraits; @@ -1674,7 +1663,7 @@ aged_associative_container_test_base::testCompare() // ordered template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testObservers() { using Traits = TestTraits; @@ -1692,7 +1681,7 @@ aged_associative_container_test_base::testObservers() // unordered template -std::enable_if_t +typename std::enable_if::type aged_associative_container_test_base::testObservers() { using Traits = TestTraits; @@ -1744,43 +1733,45 @@ public: using T = int; static_assert( - std::is_same_v, detail::aged_ordered_container>, + std::is_same, detail::aged_ordered_container>::value, "bad alias: aged_set"); static_assert( - std::is_same_v, detail::aged_ordered_container>, + std::is_same, detail::aged_ordered_container>:: + value, "bad alias: aged_multiset"); static_assert( - std::is_same_v, detail::aged_ordered_container>, + std::is_same, detail::aged_ordered_container>::value, "bad alias: aged_map"); static_assert( - std::is_same_v, detail::aged_ordered_container>, + std::is_same, detail::aged_ordered_container>:: + value, "bad alias: aged_multimap"); static_assert( - std::is_same_v< + std::is_same< aged_unordered_set, - detail::aged_unordered_container>, + detail::aged_unordered_container>::value, "bad alias: aged_unordered_set"); static_assert( - std::is_same_v< + std::is_same< aged_unordered_multiset, - detail::aged_unordered_container>, + detail::aged_unordered_container>::value, "bad alias: aged_unordered_multiset"); static_assert( - std::is_same_v< + std::is_same< aged_unordered_map, - detail::aged_unordered_container>, + detail::aged_unordered_container>::value, "bad alias: aged_unordered_map"); static_assert( - std::is_same_v< + std::is_same< aged_unordered_multimap, - detail::aged_unordered_container>, + detail::aged_unordered_container>::value, "bad alias: aged_unordered_multimap"); void diff --git a/src/test/beast/beast_CurrentThreadName_test.cpp b/src/test/beast/beast_CurrentThreadName_test.cpp index d3d3850d75..2a365c6e9c 100644 --- a/src/test/beast/beast_CurrentThreadName_test.cpp +++ b/src/test/beast/beast_CurrentThreadName_test.cpp @@ -1,17 +1,12 @@ #include -#include +#include #include -#if BOOST_OS_LINUX -#include -#endif - -#include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class CurrentThreadName_test : public beast::unit_test::suite { @@ -105,4 +100,5 @@ public: BEAST_DEFINE_TESTSUITE(CurrentThreadName, beast, beast); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/beast/beast_Journal_test.cpp b/src/test/beast/beast_Journal_test.cpp index 7a96a1e2aa..35ab3640bd 100644 --- a/src/test/beast/beast_Journal_test.cpp +++ b/src/test/beast/beast_Journal_test.cpp @@ -1,8 +1,6 @@ -#include +#include #include -#include - namespace beast { class Journal_test : public unit_test::suite diff --git a/src/test/beast/beast_PropertyStream_test.cpp b/src/test/beast/beast_PropertyStream_test.cpp index 6709671a70..9e76749218 100644 --- a/src/test/beast/beast_PropertyStream_test.cpp +++ b/src/test/beast/beast_PropertyStream_test.cpp @@ -1,8 +1,6 @@ -#include +#include #include -#include - namespace beast { class PropertyStream_test : public unit_test::suite diff --git a/src/test/beast/beast_Zero_test.cpp b/src/test/beast/beast_Zero_test.cpp index a509723773..c3dfbc8c4b 100644 --- a/src/test/beast/beast_Zero_test.cpp +++ b/src/test/beast/beast_Zero_test.cpp @@ -1,4 +1,4 @@ -#include +#include #include namespace beast { diff --git a/src/test/beast/beast_abstract_clock_test.cpp b/src/test/beast/beast_abstract_clock_test.cpp index c1a0c18839..43a210e128 100644 --- a/src/test/beast/beast_abstract_clock_test.cpp +++ b/src/test/beast/beast_abstract_clock_test.cpp @@ -2,10 +2,9 @@ #include #include -#include +#include -#include -#include +#include #include #include diff --git a/src/test/beast/beast_basic_seconds_clock_test.cpp b/src/test/beast/beast_basic_seconds_clock_test.cpp index b0d8ab5e92..ccdd76da20 100644 --- a/src/test/beast/beast_basic_seconds_clock_test.cpp +++ b/src/test/beast/beast_basic_seconds_clock_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace beast { diff --git a/src/test/beast/beast_io_latency_probe_test.cpp b/src/test/beast/beast_io_latency_probe_test.cpp index dfd20eced0..dfa18e6770 100644 --- a/src/test/beast/beast_io_latency_probe_test.cpp +++ b/src/test/beast/beast_io_latency_probe_test.cpp @@ -1,22 +1,16 @@ #include #include -#include +#include #include -#include // IWYU pragma: keep +#include +#include #include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include -#include -#include // IWYU pragma: keep +#include +#include +#include +#include #include using namespace std::chrono_literals; diff --git a/src/test/beast/define_print.cpp b/src/test/beast/define_print.cpp index e3da3e7fe1..07b1422a54 100644 --- a/src/test/beast/define_print.cpp +++ b/src/test/beast/define_print.cpp @@ -5,15 +5,13 @@ #include #include #include -#include -#include -#include #include // Include this .cpp in your project to gain access to the printing suite -namespace beast::unit_test { +namespace beast { +namespace unit_test { /** A suite that prints the list of globally defined suites. */ class print_test : public suite @@ -44,4 +42,5 @@ public: BEAST_DEFINE_TESTSUITE_MANUAL(print, beast, beast); -} // namespace beast::unit_test +} // namespace unit_test +} // namespace beast diff --git a/src/test/beast/xxhasher_test.cpp b/src/test/beast/xxhasher_test.cpp index 385ed0558a..868d522384 100644 --- a/src/test/beast/xxhasher_test.cpp +++ b/src/test/beast/xxhasher_test.cpp @@ -1,7 +1,5 @@ #include -#include - -#include +#include namespace beast { diff --git a/src/test/conditions/PreimageSha256_test.cpp b/src/test/conditions/PreimageSha256_test.cpp index 3e6ee24d57..374b6eb925 100644 --- a/src/test/conditions/PreimageSha256_test.cpp +++ b/src/test/conditions/PreimageSha256_test.cpp @@ -1,16 +1,19 @@ #include #include #include -#include +#include +#include #include #include +#include +#include #include -#include #include #include -namespace xrpl::cryptoconditions { +namespace xrpl { +namespace cryptoconditions { class PreimageSha256_test : public beast::unit_test::suite { @@ -165,4 +168,6 @@ class PreimageSha256_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(PreimageSha256, conditions, xrpl); -} // namespace xrpl::cryptoconditions +} // namespace cryptoconditions + +} // namespace xrpl diff --git a/src/test/consensus/ByzantineFailureSim_test.cpp b/src/test/consensus/ByzantineFailureSim_test.cpp index 19de5ac83c..f86ae556bf 100644 --- a/src/test/consensus/ByzantineFailureSim_test.cpp +++ b/src/test/consensus/ByzantineFailureSim_test.cpp @@ -1,20 +1,11 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include -#include +#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class ByzantineFailureSim_test : public beast::unit_test::suite { @@ -86,4 +77,5 @@ class ByzantineFailureSim_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE_MANUAL(ByzantineFailureSim, consensus, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/consensus/Consensus_test.cpp b/src/test/consensus/Consensus_test.cpp index c8be3f09f5..8b562454e3 100644 --- a/src/test/consensus/Consensus_test.cpp +++ b/src/test/consensus/Consensus_test.cpp @@ -1,35 +1,13 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class Consensus_test : public beast::unit_test::suite { @@ -1050,7 +1028,7 @@ public: // Simulate clients submitting 1 tx every 5 seconds to a random // validator - Rate const rate{.count = 1, .duration = 5s}; + Rate const rate{1, 5s}; auto peerSelector = makeSelector( network.begin(), network.end(), std::vector(network.size(), 1.), sim.rng); auto txSubmitter = makeSubmitter( @@ -1443,4 +1421,5 @@ public: }; BEAST_DEFINE_TESTSUITE(Consensus, consensus, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/consensus/DistributedValidatorsSim_test.cpp b/src/test/consensus/DistributedValidatorsSim_test.cpp index 70a7e59988..f510e00628 100644 --- a/src/test/consensus/DistributedValidatorsSim_test.cpp +++ b/src/test/consensus/DistributedValidatorsSim_test.cpp @@ -1,26 +1,18 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include #include -#include -#include #include -#include -#include -#include -#include #include #include -#include +#include -namespace xrpl::test { +namespace xrpl { +namespace test { /** In progress simulations for diversifying and distributing validators */ @@ -69,7 +61,7 @@ class DistributedValidators_test : public beast::unit_test::suite // Run for 10 minutes, submitting 100 tx/second std::chrono::nanoseconds const simDuration = 10min; std::chrono::nanoseconds const quiet = 10s; - Rate const rate{.count = 100, .duration = 1000ms}; + Rate const rate{100, 1000ms}; // Initialize timers HeartbeatTimer heart(sim.scheduler); @@ -165,7 +157,7 @@ class DistributedValidators_test : public beast::unit_test::suite // Run for 10 minutes, submitting 100 tx/second std::chrono::nanoseconds const simDuration = 10min; std::chrono::nanoseconds const quiet = 10s; - Rate const rate{.count = 100, .duration = 1000ms}; + Rate const rate{100, 1000ms}; // Initialize timers HeartbeatTimer heart(sim.scheduler); @@ -250,4 +242,5 @@ class DistributedValidators_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(DistributedValidators, consensus, xrpl, 2); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/consensus/LedgerTiming_test.cpp b/src/test/consensus/LedgerTiming_test.cpp index 749a2488b3..8313ffd0d4 100644 --- a/src/test/consensus/LedgerTiming_test.cpp +++ b/src/test/consensus/LedgerTiming_test.cpp @@ -1,12 +1,8 @@ -#include -#include +#include #include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class LedgerTiming_test : public beast::unit_test::suite { @@ -115,4 +111,5 @@ class LedgerTiming_test : public beast::unit_test::suite }; BEAST_DEFINE_TESTSUITE(LedgerTiming, consensus, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/consensus/LedgerTrie_test.cpp b/src/test/consensus/LedgerTrie_test.cpp index 1ae6e99d80..0836b9c342 100644 --- a/src/test/consensus/LedgerTrie_test.cpp +++ b/src/test/consensus/LedgerTrie_test.cpp @@ -2,13 +2,12 @@ #include -#include +#include -#include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class LedgerTrie_test : public beast::unit_test::suite { @@ -708,4 +707,5 @@ class LedgerTrie_test : public beast::unit_test::suite }; BEAST_DEFINE_TESTSUITE(LedgerTrie, consensus, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/consensus/NegativeUNL_test.cpp b/src/test/consensus/NegativeUNL_test.cpp index 220ca5ef12..0f97704755 100644 --- a/src/test/consensus/NegativeUNL_test.cpp +++ b/src/test/consensus/NegativeUNL_test.cpp @@ -1,42 +1,15 @@ - -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { /* * This file implements the following negative UNL related tests: @@ -785,13 +758,7 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite */ { // 1. no skip list - NetworkHistory history = { - *this, - {.numNodes = 10, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = 1}}; + NetworkHistory history = {*this, {10, 0, false, false, 1}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -803,13 +770,7 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite { // 2. short skip list - NetworkHistory history = { - *this, - {.numNodes = 10, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = 256 / 2}}; + NetworkHistory history = {*this, {10, 0, false, false, 256 / 2}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -821,13 +782,7 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite { // 3. local node not enough history - NetworkHistory history = { - *this, - {.numNodes = 10, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = 256 + 2}}; + NetworkHistory history = {*this, {10, 0, false, false, 256 + 2}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -846,13 +801,7 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite { // 4. a node double validated some seq // 5. local node had enough validations but on a wrong chain - NetworkHistory history = { - *this, - {.numNodes = 10, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = 256 + 2}}; + NetworkHistory history = {*this, {10, 0, false, false, 256 + 2}}; // We need two chains for these tests bool const wrongChainSuccess = history.goodHistory; BEAST_EXPECT(wrongChainSuccess); @@ -913,13 +862,7 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite { // 6. a good case - NetworkHistory history = { - *this, - {.numNodes = 10, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = 256 + 1}}; + NetworkHistory history = {*this, {10, 0, false, false, 256 + 1}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -991,13 +934,7 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite * 8. 2 new validators have bad scores, not in negUnl * 9. expired the new validators have bad scores, not in negUnl */ - NetworkHistory history = { - *this, - {.numNodes = 35, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = 0}}; + NetworkHistory history = {*this, {35, 0, false, false, 0}}; hash_set negUnl_012; for (std::uint32_t i = 0; i < 3; ++i) @@ -1372,13 +1309,7 @@ class NegativeUNLVoteScoreTable_test : public beast::unit_test::suite { for (std::uint32_t sp = 0; sp < 4; ++sp) { - NetworkHistory history = { - *this, - {.numNodes = unlSize, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = 256 + 2}}; + NetworkHistory history = {*this, {unlSize, 0, false, false, 256 + 2}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1493,13 +1424,7 @@ class NegativeUNLVoteGoodScore_test : public beast::unit_test::suite { //== all good score, negativeUNL empty //-- txSet.size = 0 - NetworkHistory history = { - *this, - {.numNodes = 51, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = {}}}; + NetworkHistory history = {*this, {51, 0, false, false, {}}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1514,13 +1439,7 @@ class NegativeUNLVoteGoodScore_test : public beast::unit_test::suite { // all good score, negativeUNL not empty (use hasToDisable) //-- txSet.size = 1 - NetworkHistory history = { - *this, - {.numNodes = 37, - .negUNLSize = 0, - .hasToDisable = true, - .hasToReEnable = false, - .numLedgers = {}}}; + NetworkHistory history = {*this, {37, 0, true, false, {}}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1550,13 +1469,7 @@ class NegativeUNLVoteOffline_test : public beast::unit_test::suite { //== 2 nodes offline, negativeUNL empty (use hasToReEnable) //-- txSet.size = 1 - NetworkHistory history = { - *this, - {.numNodes = 29, - .negUNLSize = 1, - .hasToDisable = false, - .hasToReEnable = true, - .numLedgers = {}}}; + NetworkHistory history = {*this, {29, 1, false, true, {}}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1572,13 +1485,7 @@ class NegativeUNLVoteOffline_test : public beast::unit_test::suite { // 2 nodes offline, in negativeUNL //-- txSet.size = 0 - NetworkHistory history = { - *this, - {.numNodes = 30, - .negUNLSize = 1, - .hasToDisable = true, - .hasToReEnable = false, - .numLedgers = {}}}; + NetworkHistory history = {*this, {30, 1, true, false, {}}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1612,13 +1519,7 @@ class NegativeUNLVoteMaxListed_test : public beast::unit_test::suite { // 2 nodes offline, not in negativeUNL, but maxListed //-- txSet.size = 0 - NetworkHistory history = { - *this, - {.numNodes = 32, - .negUNLSize = 8, - .hasToDisable = true, - .hasToReEnable = true, - .numLedgers = {}}}; + NetworkHistory history = {*this, {32, 8, true, true, {}}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1649,13 +1550,7 @@ class NegativeUNLVoteRetiredValidator_test : public beast::unit_test::suite { //== 2 nodes offline including me, not in negativeUNL //-- txSet.size = 0 - NetworkHistory history = { - *this, - {.numNodes = 35, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = {}}}; + NetworkHistory history = {*this, {35, 0, false, false, {}}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1670,13 +1565,7 @@ class NegativeUNLVoteRetiredValidator_test : public beast::unit_test::suite { // 2 nodes offline, not in negativeUNL, but I'm not a validator //-- txSet.size = 0 - NetworkHistory history = { - *this, - {.numNodes = 40, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = {}}}; + NetworkHistory history = {*this, {40, 0, false, false, {}}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1691,13 +1580,7 @@ class NegativeUNLVoteRetiredValidator_test : public beast::unit_test::suite { //== 2 in negativeUNL, but not in unl, no other remove candidates //-- txSet.size = 1 - NetworkHistory history = { - *this, - {.numNodes = 25, - .negUNLSize = 2, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = {}}}; + NetworkHistory history = {*this, {25, 2, false, false, {}}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1731,13 +1614,7 @@ class NegativeUNLVoteNewValidator_test : public beast::unit_test::suite { //== 2 new validators have bad scores //-- txSet.size = 0 - NetworkHistory history = { - *this, - {.numNodes = 15, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = {}}}; + NetworkHistory history = {*this, {15, 0, false, false, {}}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1763,12 +1640,7 @@ class NegativeUNLVoteNewValidator_test : public beast::unit_test::suite //== 2 expired new validators have bad scores //-- txSet.size = 1 NetworkHistory history = { - *this, - {.numNodes = 21, - .negUNLSize = 0, - .hasToDisable = false, - .hasToReEnable = false, - .numLedgers = NegativeUNLVote::newValidatorDisableSkip * 2}}; + *this, {21, 0, false, false, NegativeUNLVote::newValidatorDisableSkip * 2}}; BEAST_EXPECT(history.goodHistory); if (history.goodHistory) { @@ -1986,4 +1858,5 @@ createTx(bool disabling, LedgerIndex seq, PublicKey const& txKey) return STTx(ttUNL_MODIFY, fill); } -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/consensus/RCLCensorshipDetector_test.cpp b/src/test/consensus/RCLCensorshipDetector_test.cpp index 1ebf85c848..4093ffe900 100644 --- a/src/test/consensus/RCLCensorshipDetector_test.cpp +++ b/src/test/consensus/RCLCensorshipDetector_test.cpp @@ -1,12 +1,12 @@ #include -#include +#include #include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class RCLCensorshipDetector_test : public beast::unit_test::suite { @@ -80,4 +80,5 @@ public: }; BEAST_DEFINE_TESTSUITE(RCLCensorshipDetector, consensus, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/consensus/ScaleFreeSim_test.cpp b/src/test/consensus/ScaleFreeSim_test.cpp index 23952ab850..2c8014d8e8 100644 --- a/src/test/consensus/ScaleFreeSim_test.cpp +++ b/src/test/consensus/ScaleFreeSim_test.cpp @@ -1,21 +1,12 @@ #include -#include -#include -#include #include -#include -#include -#include +#include -#include +#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class ScaleFreeSim_test : public beast::unit_test::suite { @@ -67,7 +58,7 @@ class ScaleFreeSim_test : public beast::unit_test::suite // Run for 10 minutes, submitting 100 tx/second std::chrono::nanoseconds const simDuration = 10min; std::chrono::nanoseconds const quiet = 10s; - Rate const rate{.count = 100, .duration = 1000ms}; + Rate const rate{100, 1000ms}; // txs, start/stop/step, target auto peerSelector = makeSelector(network.begin(), network.end(), ranks, sim.rng); @@ -107,4 +98,5 @@ class ScaleFreeSim_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(ScaleFreeSim, consensus, xrpl, 80); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/consensus/Validations_test.cpp b/src/test/consensus/Validations_test.cpp index 2cb8ae2f6c..fef6e79036 100644 --- a/src/test/consensus/Validations_test.cpp +++ b/src/test/consensus/Validations_test.cpp @@ -1,25 +1,17 @@ #include -#include #include #include -#include -#include #include -#include #include -#include +#include -#include -#include -#include -#include -#include -#include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { class Validations_test : public beast::unit_test::suite { using clock_type = beast::abstract_clock const; @@ -1055,4 +1047,6 @@ class Validations_test : public beast::unit_test::suite }; BEAST_DEFINE_TESTSUITE(Validations, consensus, xrpl); -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/core/ClosureCounter_test.cpp b/src/test/core/ClosureCounter_test.cpp index d8e95a1dda..088b7b9ff9 100644 --- a/src/test/core/ClosureCounter_test.cpp +++ b/src/test/core/ClosureCounter_test.cpp @@ -1,16 +1,14 @@ #include -#include -#include -#include +#include #include #include -#include +#include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { //------------------------------------------------------------------------------ @@ -319,4 +317,5 @@ public: BEAST_DEFINE_TESTSUITE(ClosureCounter, core, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/core/Config_test.cpp b/src/test/core/Config_test.cpp index a3137b8e69..6392a75f80 100644 --- a/src/test/core/Config_test.cpp +++ b/src/test/core/Config_test.cpp @@ -4,31 +4,15 @@ #include #include -#include #include #include #include -#include -#include // IWYU pragma: keep -#include -#include +#include +#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include namespace xrpl { namespace detail { @@ -265,7 +249,9 @@ public: return absolute(file()).string(); } - ~ValidatorsTxtGuard() = default; + ~ValidatorsTxtGuard() + { + } }; } // namespace detail @@ -521,7 +507,7 @@ port_wss_admin { c.loadFromString(boost::str(configTemplate % validationSeed % token)); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -542,7 +528,7 @@ port_wss_admin main )xrpldConfig"); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -555,7 +541,7 @@ main c.loadFromString(R"xrpldConfig( )xrpldConfig"); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -570,7 +556,7 @@ main 255 )xrpldConfig"); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -585,7 +571,7 @@ main 10000 )xrpldConfig"); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -612,7 +598,7 @@ main Config c; c.loadFromString(boost::str(cc % missingPath)); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -631,7 +617,7 @@ main Config c; c.loadFromString(boost::str(cc % invalidFile.string())); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -739,7 +725,7 @@ trust-these-validators.gov c.loadFromString(toLoad); fail(); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -768,7 +754,7 @@ value = 2 c.loadFromString(toLoad); fail(); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -816,7 +802,7 @@ trust-these-validators.gov c.loadFromString(toLoad); fail(); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -962,7 +948,7 @@ trust-these-validators.gov c.loadFromString(boost::str(cc % vtg.validatorsFile())); fail(); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -988,7 +974,7 @@ trust-these-validators.gov Config c2; c2.loadFromString(boost::str(cc % vtg.validatorsFile())); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -1276,41 +1262,20 @@ r.ripple.com:51235 }; std::array const tests = { - {{.line = "password = aaaa\\#bbbb", - .field = "password", - .expect = "aaaa#bbbb", - .had_comment = false}, - {.line = "password = aaaa#bbbb", - .field = "password", - .expect = "aaaa", - .had_comment = true}, - {.line = "password = aaaa #bbbb", - .field = "password", - .expect = "aaaa", - .had_comment = true}, + {{"password = aaaa\\#bbbb", "password", "aaaa#bbbb", false}, + {"password = aaaa#bbbb", "password", "aaaa", true}, + {"password = aaaa #bbbb", "password", "aaaa", true}, // since the value is all comment, this doesn't parse as k=v : - {.line = "password = #aaaa #bbbb", - .field = "", - .expect = "password =", - .had_comment = true}, - {.line = "password = aaaa\\# #bbbb", - .field = "password", - .expect = "aaaa#", - .had_comment = true}, - {.line = "password = aaaa\\##bbbb", - .field = "password", - .expect = "aaaa#", - .had_comment = true}, - {.line = "aaaa#bbbb", .field = "", .expect = "aaaa", .had_comment = true}, - {.line = "aaaa\\#bbbb", .field = "", .expect = "aaaa#bbbb", .had_comment = false}, - {.line = "aaaa\\##bbbb", .field = "", .expect = "aaaa#", .had_comment = true}, - {.line = "aaaa #bbbb", .field = "", .expect = "aaaa", .had_comment = true}, - {.line = "1 #comment", .field = "", .expect = "1", .had_comment = true}, - {.line = "#whole thing is comment", .field = "", .expect = "", .had_comment = false}, - {.line = " #whole comment with space", - .field = "", - .expect = "", - .had_comment = false}}}; + {"password = #aaaa #bbbb", "", "password =", true}, + {"password = aaaa\\# #bbbb", "password", "aaaa#", true}, + {"password = aaaa\\##bbbb", "password", "aaaa#", true}, + {"aaaa#bbbb", "", "aaaa", true}, + {"aaaa\\#bbbb", "", "aaaa#bbbb", false}, + {"aaaa\\##bbbb", "", "aaaa#", true}, + {"aaaa #bbbb", "", "aaaa", true}, + {"1 #comment", "", "1", true}, + {"#whole thing is comment", "", "", false}, + {" #whole comment with space", "", "", false}}}; for (auto const& t : tests) { @@ -1486,7 +1451,7 @@ r.ripple.com:51235 fail(); } } - catch (std::runtime_error const&) + catch (std::runtime_error&) { if (!shouldPass) { @@ -1512,7 +1477,7 @@ r.ripple.com:51235 c.loadFromString("[overlay]\nmax_unknown_time=" + value); return c.MAX_UNKNOWN_TIME; } - catch (std::runtime_error const&) + catch (std::runtime_error&) { return {}; } @@ -1546,7 +1511,7 @@ r.ripple.com:51235 c.loadFromString("[overlay]\nmax_diverged_time=" + value); return c.MAX_DIVERGED_TIME; } - catch (std::runtime_error const&) + catch (std::runtime_error&) { return {}; } diff --git a/src/test/core/Coroutine_test.cpp b/src/test/core/Coroutine_test.cpp index 38bafe08fd..4cfb86f931 100644 --- a/src/test/core/Coroutine_test.cpp +++ b/src/test/core/Coroutine_test.cpp @@ -1,21 +1,12 @@ +#include -#include -#include - -#include - -#include -#include -#include #include -#include #include -#include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class Coroutine_test : public beast::unit_test::suite { @@ -174,4 +165,5 @@ public: BEAST_DEFINE_TESTSUITE(Coroutine, core, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/core/JobQueue_test.cpp b/src/test/core/JobQueue_test.cpp index 8163c7b057..13142c299f 100644 --- a/src/test/core/JobQueue_test.cpp +++ b/src/test/core/JobQueue_test.cpp @@ -1,13 +1,10 @@ #include -#include -#include +#include #include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { //------------------------------------------------------------------------------ @@ -141,4 +138,5 @@ public: BEAST_DEFINE_TESTSUITE(JobQueue, core, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/core/SociDB_test.cpp b/src/test/core/SociDB_test.cpp index 29aeca7ce5..c58c34756a 100644 --- a/src/test/core/SociDB_test.cpp +++ b/src/test/core/SociDB_test.cpp @@ -2,28 +2,12 @@ #include #include -#include #include -#include -#include -#include -#include +#include +#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include #include -#include -#include namespace xrpl { class SociDB_test final : public TestSuite @@ -80,7 +64,7 @@ public: { } } - ~SociDB_test() override + ~SociDB_test() { try { @@ -129,8 +113,10 @@ public: for (int i = 0; i < stringResult.size(); ++i) { auto si = std::distance( - stringData.begin(), std::ranges::find(stringData, stringResult[i])); - auto ii = std::distance(intData.begin(), std::ranges::find(intData, intResult[i])); + stringData.begin(), + std::find(stringData.begin(), stringData.end(), stringResult[i])); + auto ii = std::distance( + intData.begin(), std::find(intData.begin(), intData.end(), intResult[i])); BEAST_EXPECT(si == ii && si < stringResult.size()); } }; diff --git a/src/test/core/Workers_test.cpp b/src/test/core/Workers_test.cpp index 84ff85f4ec..6631cff1c4 100644 --- a/src/test/core/Workers_test.cpp +++ b/src/test/core/Workers_test.cpp @@ -1,5 +1,4 @@ -#include -#include +#include #include #include #include diff --git a/src/test/csf/BasicNetwork.h b/src/test/csf/BasicNetwork.h index 63d85c3070..85c77ac47d 100644 --- a/src/test/csf/BasicNetwork.h +++ b/src/test/csf/BasicNetwork.h @@ -3,7 +3,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** Peer to peer network simulator. The network is formed from a set of Peer objects representing @@ -72,7 +74,7 @@ class BasicNetwork { bool inbound = false; duration delay{}; - time_point established; + time_point established{}; link_type() = default; link_type(bool inbound_, duration delay_, time_point established_) : inbound(inbound_), delay(delay_), established(established_) @@ -222,4 +224,6 @@ BasicNetwork::send(Peer const& from, Peer const& to, Function&& f) }); } -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/BasicNetwork_test.cpp b/src/test/csf/BasicNetwork_test.cpp index d81638c214..eee16c2ce1 100644 --- a/src/test/csf/BasicNetwork_test.cpp +++ b/src/test/csf/BasicNetwork_test.cpp @@ -1,12 +1,13 @@ #include #include -#include +#include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class BasicNetwork_test : public beast::unit_test::suite { @@ -131,4 +132,5 @@ public: BEAST_DEFINE_TESTSUITE(BasicNetwork, csf, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/CollectorRef.h b/src/test/csf/CollectorRef.h index 23baa020b8..735a42ab16 100644 --- a/src/test/csf/CollectorRef.h +++ b/src/test/csf/CollectorRef.h @@ -3,7 +3,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** Holds a type-erased reference to an arbitrary collector. @@ -137,31 +139,31 @@ class CollectorRef Any& operator=(Any&&) = default; - void + virtual void on(PeerID node, tp when, Share const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Share const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Share const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Share const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Share const& e) override { t_.on(node, when, e); @@ -173,25 +175,25 @@ class CollectorRef t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Receive const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Receive const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Receive const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Receive const& e) override { t_.on(node, when, e); @@ -203,61 +205,61 @@ class CollectorRef t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Relay const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Relay const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Relay const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, Relay const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, SubmitTx const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, StartRound const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, CloseLedger const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, AcceptLedger const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, WrongPrevLedger const& e) override { t_.on(node, when, e); } - void + virtual void on(PeerID node, tp when, FullyValidateLedger const& e) override { t_.on(node, when, e); @@ -322,4 +324,6 @@ public: } }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Digraph.h b/src/test/csf/Digraph.h index a5678cc539..66ef73390a 100644 --- a/src/test/csf/Digraph.h +++ b/src/test/csf/Digraph.h @@ -18,7 +18,8 @@ struct NoEdgeData } // namespace detail -namespace test::csf { +namespace test { +namespace csf { /** Directed graph @@ -224,6 +225,6 @@ public: } }; -} // namespace test::csf - +} // namespace csf +} // namespace test } // namespace xrpl diff --git a/src/test/csf/Digraph_test.cpp b/src/test/csf/Digraph_test.cpp index 8f5a0fea1b..1c34bbcfec 100644 --- a/src/test/csf/Digraph_test.cpp +++ b/src/test/csf/Digraph_test.cpp @@ -1,13 +1,12 @@ #include -#include +#include -#include #include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class Digraph_test : public beast::unit_test::suite { @@ -78,4 +77,5 @@ public: BEAST_DEFINE_TESTSUITE(Digraph, csf, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Histogram.h b/src/test/csf/Histogram.h index 6eef1b08c1..cbc2d42d6c 100644 --- a/src/test/csf/Histogram.h +++ b/src/test/csf/Histogram.h @@ -6,7 +6,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** Basic histogram. @@ -106,4 +108,6 @@ public: } }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Histogram_test.cpp b/src/test/csf/Histogram_test.cpp index 6de04ad1ab..b0a8d8490d 100644 --- a/src/test/csf/Histogram_test.cpp +++ b/src/test/csf/Histogram_test.cpp @@ -1,8 +1,9 @@ #include -#include +#include -namespace xrpl::test { +namespace xrpl { +namespace test { class Histogram_test : public beast::unit_test::suite { @@ -63,4 +64,5 @@ public: BEAST_DEFINE_TESTSUITE(Histogram, csf, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Peer.h b/src/test/csf/Peer.h index 5cf2757ab1..fb1238990e 100644 --- a/src/test/csf/Peer.h +++ b/src/test/csf/Peer.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include #include @@ -20,7 +19,9 @@ #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { namespace bc = boost::container; @@ -61,8 +62,8 @@ struct Peer return proposal_.getJson(); } - static std::string - render() + std::string + render() const { return ""; } @@ -294,13 +295,9 @@ struct Peer using namespace std::chrono_literals; if (when == 0ns) - { what(); - } else - { scheduler.in(when, std::forward(what)); - } } // Issue a new event to the collectors @@ -343,10 +340,8 @@ struct Peer trusts(PeerID const& oId) { for (auto const p : trustGraph.trustedPeers(this)) - { if (p->id == oId) return true; - } return false; } @@ -491,7 +486,7 @@ struct Peer Result onClose(Ledger const& prevLedger, NetClock::time_point closeTime, ConsensusMode mode) { - issue(CloseLedger{.prevLedger = prevLedger, .txs = openTxs}); + issue(CloseLedger{prevLedger, openTxs}); return Result( TxSet{openTxs}, @@ -531,14 +526,15 @@ struct Peer prevLedger, acceptedTxs.txs(), closeResolution, result.position.closeTime()); ledgers[newLedger.id()] = newLedger; - issue(AcceptLedger{.ledger = newLedger, .prior = lastClosedLedger}); + issue(AcceptLedger{newLedger, lastClosedLedger}); prevProposers = result.proposers; prevRoundTime = result.roundTime.read(); lastClosedLedger = newLedger; - auto const removed = std::ranges::remove_if( - openTxs, [&](Tx const& tx) { return acceptedTxs.exists(tx.id()); }); - openTxs.erase(removed.begin(), removed.end()); + auto const it = std::remove_if(openTxs.begin(), openTxs.end(), [&](Tx const& tx) { + return acceptedTxs.exists(tx.id()); + }); + openTxs.erase(it, openTxs.end()); // Only send validation if the new ledger is compatible with our // fully validated ledger @@ -592,7 +588,7 @@ struct Peer if (netLgr != ledgerID) { JLOG(j.trace()) << Json::Compact(validations.getJsonTrie()); - issue(WrongPrevLedger{.wrong = ledgerID, .right = netLgr}); + issue(WrongPrevLedger{ledgerID, netLgr}); } return netLgr; @@ -665,7 +661,7 @@ struct Peer quorum = static_cast(std::ceil(numTrustedPeers * 0.8)); if (count >= quorum && ledger.isAncestor(fullyValidatedLedger)) { - issue(FullyValidateLedger{.ledger = ledger, .prior = fullyValidatedLedger}); + issue(FullyValidateLedger{ledger, fullyValidatedLedger}); fullyValidatedLedger = ledger; } } @@ -754,7 +750,7 @@ struct Peer // TODO: This always suppresses relay of peer positions already seen // Should it allow forwarding if for a recent ledger ? auto& dest = peerPositions[p.prevLedger()]; - if (std::ranges::find(dest, p) != dest.end()) + if (std::find(dest.begin(), dest.end(), p) != dest.end()) return false; dest.push_back(p); @@ -778,7 +774,7 @@ struct Peer { // Ignore and suppress relay of transactions already in last ledger TxSetType const& lastClosedTxs = lastClosedLedger.txs(); - if (lastClosedTxs.contains(tx)) + if (lastClosedTxs.find(tx) != lastClosedTxs.end()) return false; // only relay if it was new to our open ledger @@ -834,8 +830,8 @@ struct Peer { } - static bool - validating() + bool + validating() const { // does not matter return false; @@ -875,7 +871,7 @@ struct Peer if (bestLCL == Ledger::ID{0}) bestLCL = lastClosedLedger.id(); - issue(StartRound{.bestLedger = bestLCL, .prevLedger = lastClosedLedger}); + issue(StartRound{bestLCL, lastClosedLedger}); // Not yet modeling dynamic UNL. hash_set const nowUntrusted; @@ -945,4 +941,6 @@ struct Peer } }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/PeerGroup.h b/src/test/csf/PeerGroup.h index 6503ac62df..5df6de84a6 100644 --- a/src/test/csf/PeerGroup.h +++ b/src/test/csf/PeerGroup.h @@ -6,7 +6,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** A group of simulation Peers @@ -33,11 +35,11 @@ public: } PeerGroup(std::vector&& peers) : peers_{std::move(peers)} { - std::ranges::sort(peers_); + std::sort(peers_.begin(), peers_.end()); } PeerGroup(std::vector const& peers) : peers_{peers} { - std::ranges::sort(peers_); + std::sort(peers_.begin(), peers_.end()); } PeerGroup(std::set const& peers) : peers_{peers.begin(), peers.end()} @@ -77,14 +79,15 @@ public: bool contains(Peer const* p) { - return std::ranges::find(peers_, p) != peers_.end(); + return std::find(peers_.begin(), peers_.end(), p) != peers_.end(); } bool contains(PeerID id) { - return std::ranges::find_if(peers_, [id](Peer const* p) { return p->id == id; }) != - peers_.end(); + return std::find_if(peers_.begin(), peers_.end(), [id](Peer const* p) { + return p->id == id; + }) != peers_.end(); } std::size_t @@ -212,7 +215,12 @@ public: operator+(PeerGroup const& a, PeerGroup const& b) { PeerGroup res; - std::ranges::set_union(a.peers_, b.peers_, std::back_inserter(res.peers_)); + std::set_union( + a.peers_.begin(), + a.peers_.end(), + b.peers_.begin(), + b.peers_.end(), + std::back_inserter(res.peers_)); return res; } @@ -222,7 +230,12 @@ public: { PeerGroup res; - std::ranges::set_difference(a.peers_, b.peers_, std::back_inserter(res.peers_)); + std::set_difference( + a.peers_.begin(), + a.peers_.end(), + b.peers_.begin(), + b.peers_.end(), + std::back_inserter(res.peers_)); return res; } @@ -333,4 +346,6 @@ randomRankedConnect( } } -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Proposal.h b/src/test/csf/Proposal.h index 06486daed3..641fd2010a 100644 --- a/src/test/csf/Proposal.h +++ b/src/test/csf/Proposal.h @@ -6,10 +6,14 @@ #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** Proposal is a position taken in the consensus process and is represented directly from the generic types. */ using Proposal = ConsensusProposal; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Scheduler.h b/src/test/csf/Scheduler.h index 82753124d9..61ec8f62ff 100644 --- a/src/test/csf/Scheduler.h +++ b/src/test/csf/Scheduler.h @@ -9,7 +9,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** Simulated discrete-event scheduler. @@ -263,7 +265,7 @@ inline Scheduler::queue_type::~queue_type() auto e = &*iter; ++iter; e->~event(); - alloc_->deallocate(e, sizeof(e)); // NOLINT(bugprone-sizeof-expression) + alloc_->deallocate(e, sizeof(e)); } } @@ -379,10 +381,8 @@ Scheduler::step() if (!step_one()) return false; for (;;) - { if (!step_one()) break; - } return true; } @@ -427,4 +427,6 @@ Scheduler::step_for(std::chrono::duration const& amount) return step_until(now() + amount); } -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Scheduler_test.cpp b/src/test/csf/Scheduler_test.cpp index 6b14a771d3..a0b57dd87f 100644 --- a/src/test/csf/Scheduler_test.cpp +++ b/src/test/csf/Scheduler_test.cpp @@ -1,10 +1,11 @@ #include -#include +#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class Scheduler_test : public beast::unit_test::suite { @@ -65,4 +66,5 @@ public: BEAST_DEFINE_TESTSUITE(Scheduler, csf, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Sim.h b/src/test/csf/Sim.h index ca85d79f47..e5f64cae1f 100644 --- a/src/test/csf/Sim.h +++ b/src/test/csf/Sim.h @@ -13,7 +13,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** Sink that prepends simulation time to messages */ class BasicSink : public beast::Journal::Sink @@ -149,4 +151,6 @@ public: branches() const; }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/SimTime.h b/src/test/csf/SimTime.h index 662f3fe19c..2131de9b41 100644 --- a/src/test/csf/SimTime.h +++ b/src/test/csf/SimTime.h @@ -4,7 +4,9 @@ #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { using RealClock = std::chrono::system_clock; using RealDuration = RealClock::duration; @@ -14,4 +16,6 @@ using SimClock = beast::manual_clock; using SimDuration = typename SimClock::duration; using SimTime = typename SimClock::time_point; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/TrustGraph.h b/src/test/csf/TrustGraph.h index 096104bc15..3f1fcae0c1 100644 --- a/src/test/csf/TrustGraph.h +++ b/src/test/csf/TrustGraph.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include @@ -10,7 +9,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** Trust graph @@ -145,4 +146,6 @@ public: } }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Tx.h b/src/test/csf/Tx.h index 8e8f6ea7e4..81393f7bda 100644 --- a/src/test/csf/Tx.h +++ b/src/test/csf/Tx.h @@ -12,9 +12,10 @@ #include #include #include -#include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { //! A single transaction class Tx @@ -95,7 +96,7 @@ public: }; TxSet() = default; - TxSet(TxSetType s) : txs_{std::move(s)}, id_{calcID(txs_)} + TxSet(TxSetType const& s) : txs_{s}, id_{calcID(txs_)} { } @@ -182,13 +183,9 @@ operator<<(std::ostream& o, boost::container::flat_set const& ts) for (auto const& t : ts) { if (do_comma) - { o << ", "; - } else - { do_comma = true; - } o << t; } o << " }"; @@ -211,4 +208,6 @@ hash_append(Hasher& h, Tx const& tx) hash_append(h, tx.id()); } -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/Validation.h b/src/test/csf/Validation.h index 2adf64196b..ba4da148f4 100644 --- a/src/test/csf/Validation.h +++ b/src/test/csf/Validation.h @@ -8,7 +8,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { struct PeerIDTag; //< Uniquely identifies a peer @@ -56,7 +58,7 @@ public: , seq_{seq} , signTime_{sign} , seenTime_{seen} - , key_{std::move(key)} + , key_{key} , nodeID_{nodeID} , full_{full} , loadFee_{loadFee} @@ -170,4 +172,6 @@ public: } }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/collectors.h b/src/test/csf/collectors.h index 8da86cc287..cfe40330ff 100644 --- a/src/test/csf/collectors.h +++ b/src/test/csf/collectors.h @@ -11,7 +11,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { // A collector is any class that implements // @@ -132,9 +134,7 @@ struct SimDurationCollector init = true; } else - { stop = when; - } } }; @@ -631,7 +631,7 @@ struct JumpCollector { // Not a direct child -> parent switch if (e.ledger.parentID() != e.prior.id()) - closeJumps.emplace_back(Jump{.id = who, .when = when, .from = e.prior, .to = e.ledger}); + closeJumps.emplace_back(Jump{who, when, e.prior, e.ledger}); } void @@ -639,11 +639,10 @@ struct JumpCollector { // Not a direct child -> parent switch if (e.ledger.parentID() != e.prior.id()) - { - fullyValidatedJumps.emplace_back( - Jump{.id = who, .when = when, .from = e.prior, .to = e.ledger}); - } + fullyValidatedJumps.emplace_back(Jump{who, when, e.prior, e.ledger}); } }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/events.h b/src/test/csf/events.h index ea163d3a80..2aae22d125 100644 --- a/src/test/csf/events.h +++ b/src/test/csf/events.h @@ -7,7 +7,9 @@ #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { // Events are emitted by peers at a variety of points during the simulation. // Each event is emitted by a particular peer at a particular time. Collectors @@ -124,4 +126,6 @@ struct FullyValidateLedger Ledger prior; }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/impl/Sim.cpp b/src/test/csf/impl/Sim.cpp index 8cf6869522..a775dd30ff 100644 --- a/src/test/csf/impl/Sim.cpp +++ b/src/test/csf/impl/Sim.cpp @@ -1,14 +1,8 @@ #include -#include -#include - -#include -#include -#include -#include - -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { void Sim::run(int ledgers) @@ -44,7 +38,7 @@ Sim::synchronized(PeerGroup const& g) if (g.size() < 1) return true; Peer const* ref = g[0]; - return std::ranges::all_of(g, [&ref](Peer const* p) { + return std::all_of(g.begin(), g.end(), [&ref](Peer const* p) { return p->lastClosedLedger.id() == ref->lastClosedLedger.id() && p->fullyValidatedLedger.id() == ref->fullyValidatedLedger.id(); }); @@ -67,4 +61,6 @@ Sim::branches(PeerGroup const& g) const return oracle.branches(ledgers); } -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/impl/ledgers.cpp b/src/test/csf/impl/ledgers.cpp index a4203b2a15..9b0a4e3973 100644 --- a/src/test/csf/impl/ledgers.cpp +++ b/src/test/csf/impl/ledgers.cpp @@ -1,19 +1,10 @@ #include -#include - -#include -#include -#include - #include -#include -#include -#include -#include -#include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { Ledger::Instance const Ledger::genesis; @@ -164,4 +155,6 @@ LedgerOracle::branches(std::set const& ledgers) // The size of tips is the number of branches return tips.size(); } -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/ledgers.h b/src/test/csf/ledgers.h index 3869fb7bd4..67a7427af6 100644 --- a/src/test/csf/ledgers.h +++ b/src/test/csf/ledgers.h @@ -14,7 +14,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** A ledger is a set of observed transactions and a sequence number identifying the ledger. @@ -57,7 +59,9 @@ private: // ID by the oracle struct Instance { - Instance() = default; + Instance() + { + } // Sequence number Seq seq{0}; @@ -328,4 +332,6 @@ struct LedgerHistoryHelper } }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/random.h b/src/test/csf/random.h index a5c54ec9bf..f3ecca1dbc 100644 --- a/src/test/csf/random.h +++ b/src/test/csf/random.h @@ -3,7 +3,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { /** Return a randomly shuffled copy of vector based on weights w. @@ -74,7 +76,7 @@ public: { using tag = typename std::iterator_traits::iterator_category; static_assert( - std::is_same_v, + std::is_same::value, "Selector only supports random access iterators."); // TODO: Allow for forward iterators } @@ -109,7 +111,7 @@ public: } template - double + inline double operator()(Generator&) { return t_; @@ -138,7 +140,7 @@ public: } template - double + inline double operator()(Generator& g) { // use inverse transform of CDF to sample @@ -147,4 +149,6 @@ public: } }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/submitters.h b/src/test/csf/submitters.h index be45b4ea2a..ae81b3e89c 100644 --- a/src/test/csf/submitters.h +++ b/src/test/csf/submitters.h @@ -7,7 +7,9 @@ #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { // Submitters are classes for simulating submission of transactions to the // network @@ -60,7 +62,7 @@ class Submitter } template - static std::enable_if_t, SimDuration> + static std::enable_if_t::value, SimDuration> asDuration(T t) { return SimDuration{static_cast(t)}; @@ -103,4 +105,6 @@ makeSubmitter( return Submitter(dist, start, end, sel, s, g); } -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/csf/timers.h b/src/test/csf/timers.h index 2f2ec4dc93..beb4e142d9 100644 --- a/src/test/csf/timers.h +++ b/src/test/csf/timers.h @@ -6,7 +6,9 @@ #include #include -namespace xrpl::test::csf { +namespace xrpl { +namespace test { +namespace csf { // Timers are classes that schedule repeated events and are mostly independent // of simulation-specific details. @@ -58,4 +60,6 @@ public: } }; -} // namespace xrpl::test::csf +} // namespace csf +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/AMM.h b/src/test/jtx/AMM.h index faad982bcc..45f0e13797 100644 --- a/src/test/jtx/AMM.h +++ b/src/test/jtx/AMM.h @@ -14,7 +14,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { class LPToken { @@ -97,7 +99,7 @@ struct BidArg std::optional account = std::nullopt; std::optional> bidMin = std::nullopt; std::optional> bidMax = std::nullopt; - std::vector authAccounts = {}; // NOLINT(readability-redundant-member-init) + std::vector authAccounts = {}; std::optional flags = std::nullopt; std::optional> assets = std::nullopt; }; @@ -137,9 +139,9 @@ class AMM public: AMM(Env& env, - Account account, - STAmount asset1, - STAmount asset2, + Account const& account, + STAmount const& asset1, + STAmount const& asset2, bool log = false, std::uint16_t tfee = 0, std::uint32_t fee = 0, @@ -370,13 +372,13 @@ public: } std::string - operator[](AccountID const& lp) const + operator[](AccountID const& lp) { return ammRpcInfo(lp).toStyledString(); } Json::Value - operator()(AccountID const& lp) const + operator()(AccountID const& lp) { return ammRpcInfo(lp); } @@ -423,13 +425,9 @@ public: auto const& jr = p.amm.ammRpcInfo(); auto out = [&](Json::Value const& jv) { if (jv.isMember(jss::value)) - { std::cout << jv[jss::value].asString(); - } else - { std::cout << jv.asString(); - } std::cout << " "; }; if (p.names.empty()) @@ -458,13 +456,9 @@ public: { auto out = [&](Json::Value const& jv) { if (jv.isMember(jss::value)) - { s << jv[jss::value].asString(); - } else - { s << jv; - } }; for (auto const& o : offers.jv[jss::offers]) { @@ -523,4 +517,6 @@ ammClawback( std::optional const& amount); } // namespace amm -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/AMMTest.h b/src/test/jtx/AMMTest.h index 8f46ef6f59..a3d126646d 100644 --- a/src/test/jtx/AMMTest.h +++ b/src/test/jtx/AMMTest.h @@ -7,7 +7,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { class AMM; @@ -150,4 +152,6 @@ protected: pathTestEnv(); }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/AbstractClient.h b/src/test/jtx/AbstractClient.h index 2002b3a7d8..94e58f60cd 100644 --- a/src/test/jtx/AbstractClient.h +++ b/src/test/jtx/AbstractClient.h @@ -2,7 +2,8 @@ #include -namespace xrpl::test { +namespace xrpl { +namespace test { /* Abstract XRPL client interface. @@ -37,4 +38,5 @@ public: version() const = 0; }; -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/Account.h b/src/test/jtx/Account.h index 1e39f5a546..6f796e08b3 100644 --- a/src/test/jtx/Account.h +++ b/src/test/jtx/Account.h @@ -8,7 +8,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { class IOU; @@ -141,4 +143,6 @@ operator<=>(Account const& lhs, Account const& rhs) noexcept return lhs.id() <=> rhs.id(); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/CaptureLogs.h b/src/test/jtx/CaptureLogs.h index 0e9598decd..8c8da6817b 100644 --- a/src/test/jtx/CaptureLogs.h +++ b/src/test/jtx/CaptureLogs.h @@ -2,7 +2,8 @@ #include -namespace xrpl::test { +namespace xrpl { +namespace test { /** * @brief Log manager for CaptureSinks. This class holds the stream @@ -65,4 +66,5 @@ public: } }; -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/CheckMessageLogs.h b/src/test/jtx/CheckMessageLogs.h index 4c6bd35036..286cfa1844 100644 --- a/src/test/jtx/CheckMessageLogs.h +++ b/src/test/jtx/CheckMessageLogs.h @@ -2,7 +2,8 @@ #include -namespace xrpl::test { +namespace xrpl { +namespace test { /** Log manager that searches for a specific message substring */ @@ -54,4 +55,5 @@ public: } }; -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/Env.h b/src/test/jtx/Env.h index 75c0195f40..d638d520ba 100644 --- a/src/test/jtx/Env.h +++ b/src/test/jtx/Env.h @@ -40,7 +40,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Wrapper that captures std::source_location when implicitly constructed. This solves the problem of combining std::source_location with variadic @@ -83,13 +85,9 @@ testable_amendments() { (void)vote; if (auto const f = getRegisteredFeature(s)) - { feats.push_back(*f); - } else - { Throw("Unknown feature: " + s + " in allAmendments."); - } } return FeatureBitset(feats); }(); @@ -130,12 +128,12 @@ public: /// Used by parseResult() and postConditions() struct ParsedResult { - std::optional ter; + std::optional ter{}; // RPC errors tend to return either a "code" and a "message" (sometimes // with an "error" that corresponds to the "code"), or with an "error" // and an "exception". However, this structure allows all possible // combinations. - std::optional rpcCode; + std::optional rpcCode{}; std::string rpcMessage; std::string rpcError; std::string rpcException; @@ -258,7 +256,6 @@ public: virtual ~Env() = default; Application& - // NOLINTNEXTLINE(readability-make-member-function-const) app() { return *bundle_.app; @@ -271,7 +268,6 @@ public: } ManualTimeKeeper& - // NOLINTNEXTLINE(readability-make-member-function-const) timeKeeper() { return *bundle_.timeKeeper; @@ -283,7 +279,6 @@ public: close or by callers. */ NetClock::time_point - // NOLINTNEXTLINE(readability-make-member-function-const) now() { return timeKeeper().now(); @@ -291,7 +286,6 @@ public: /** Returns the connected client. */ AbstractClient& - // NOLINTNEXTLINE(readability-make-member-function-const) client() { return *bundle_.client; @@ -779,7 +773,7 @@ public: trust(STAmount const& amount, Account const& to0, Account const& to1, Accounts const&... toN) { trust(amount, to0); - trust(amount, to1, toN...); // NOLINT(readability-suspicious-call-argument) + trust(amount, to1, toN...); } /** @} */ @@ -883,4 +877,6 @@ Env::rpc(std::string const& cmd, Args&&... args) return rpc(std::unordered_map(), cmd, std::forward(args)...); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/Env_ss.h b/src/test/jtx/Env_ss.h index e9f6ae3bb1..d6f5fd1a29 100644 --- a/src/test/jtx/Env_ss.h +++ b/src/test/jtx/Env_ss.h @@ -2,7 +2,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** A transaction testing environment wrapper. Transactions submitted in sign-and-submit mode @@ -64,4 +66,6 @@ public: } }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/Env_test.cpp b/src/test/jtx/Env_test.cpp index 6cef617ea7..4e9f0d99e2 100644 --- a/src/test/jtx/Env_test.cpp +++ b/src/test/jtx/Env_test.cpp @@ -1,69 +1,21 @@ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include #include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include #include #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class Env_test : public beast::unit_test::suite { @@ -109,10 +61,10 @@ public: PrettyAmount(0u); // NOLINT(bugprone-unused-raii) PrettyAmount(1u); // NOLINT(bugprone-unused-raii) PrettyAmount(-1); // NOLINT(bugprone-unused-raii) - static_assert(!std::is_trivially_constructible_v, ""); - static_assert(!std::is_trivially_constructible_v, ""); - static_assert(!std::is_trivially_constructible_v, ""); - static_assert(!std::is_trivially_constructible_v, ""); + static_assert(!std::is_trivially_constructible::value, ""); + static_assert(!std::is_trivially_constructible::value, ""); + static_assert(!std::is_trivially_constructible::value, ""); + static_assert(!std::is_trivially_constructible::value, ""); try { @@ -902,4 +854,5 @@ public: BEAST_DEFINE_TESTSUITE(Env, jtx, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/JSONRPCClient.h b/src/test/jtx/JSONRPCClient.h index a2ff815f48..41129a36ec 100644 --- a/src/test/jtx/JSONRPCClient.h +++ b/src/test/jtx/JSONRPCClient.h @@ -6,10 +6,12 @@ #include -namespace xrpl::test { +namespace xrpl { +namespace test { /** Returns a client using JSON-RPC over HTTP/S. */ std::unique_ptr makeJSONRPCClient(Config const& cfg, unsigned rpc_version = 2); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/JTx.h b/src/test/jtx/JTx.h index a4db523ff5..bf43d0aa75 100644 --- a/src/test/jtx/JTx.h +++ b/src/test/jtx/JTx.h @@ -12,7 +12,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { class Env; @@ -150,4 +152,6 @@ private: prop_list props_; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/ManualTimeKeeper.h b/src/test/jtx/ManualTimeKeeper.h index 1fd94858d6..d5fdd467e1 100644 --- a/src/test/jtx/ManualTimeKeeper.h +++ b/src/test/jtx/ManualTimeKeeper.h @@ -4,12 +4,13 @@ #include -namespace xrpl::test { +namespace xrpl { +namespace test { class ManualTimeKeeper : public TimeKeeper { private: - std::atomic now_; + std::atomic now_{}; public: ManualTimeKeeper() = default; @@ -27,4 +28,5 @@ public: } }; -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/Oracle.h b/src/test/jtx/Oracle.h index 42376b3599..8f48ad4d37 100644 --- a/src/test/jtx/Oracle.h +++ b/src/test/jtx/Oracle.h @@ -4,7 +4,10 @@ #include -namespace xrpl::test::jtx::oracle { +namespace xrpl { +namespace test { +namespace jtx { +namespace oracle { using AnyValue = std::variant; using OraclesData = std::vector, std::optional>>; @@ -55,7 +58,7 @@ struct UpdateArg { std::optional owner = std::nullopt; std::optional documentID = std::nullopt; - DataSeries series = {}; // NOLINT(readability-redundant-member-init) + DataSeries series = {}; std::optional assetClass = std::nullopt; std::optional provider = std::nullopt; std::optional uri = "URI"; @@ -174,4 +177,7 @@ public: } }; -} // namespace xrpl::test::jtx::oracle +} // namespace oracle +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/PathSet.h b/src/test/jtx/PathSet.h index 4db3b7d62e..86b38f7eaf 100644 --- a/src/test/jtx/PathSet.h +++ b/src/test/jtx/PathSet.h @@ -6,7 +6,8 @@ #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { /** Count offer */ @@ -185,4 +186,5 @@ private: } }; -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/SignerUtils.h b/src/test/jtx/SignerUtils.h index dd68701303..994868e4a2 100644 --- a/src/test/jtx/SignerUtils.h +++ b/src/test/jtx/SignerUtils.h @@ -2,11 +2,11 @@ #include -#include -#include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { struct Reg { @@ -17,7 +17,7 @@ struct Reg { } - Reg(Account acct_, Account regularSig) : acct(std::move(acct_)), sig(std::move(regularSig)) + Reg(Account const& acct_, Account const& regularSig) : acct(acct_), sig(regularSig) { } @@ -40,7 +40,11 @@ struct Reg inline void sortSigners(std::vector& signers) { - std::ranges::sort(signers, [](Reg const& lhs, Reg const& rhs) { return lhs.acct < rhs.acct; }); + std::sort(signers.begin(), signers.end(), [](Reg const& lhs, Reg const& rhs) { + return lhs.acct < rhs.acct; + }); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index 70692d1675..0beca74e90 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -13,12 +13,12 @@ #include #include -#include #include -#include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Generic helper class for helper classes that set a field on a JTx. @@ -40,7 +40,7 @@ protected: SV value_; public: - explicit JTxField(SF const& sfield, SV value) : sfield_(sfield), value_(std::move(value)) + explicit JTxField(SF const& sfield, SV const& value) : sfield_(sfield), value_(value) { } @@ -68,7 +68,7 @@ protected: SV value_; public: - explicit JTxField(SF const& sfield, SV value) : sfield_(sfield), value_(std::move(value)) + explicit JTxField(SF const& sfield, SV const& value) : sfield_(sfield), value_(value) { } @@ -367,7 +367,7 @@ void stpath_append_one(STPath& st, Account const& account); template -std::enable_if_t> +std::enable_if_t::value> stpath_append_one(STPath& st, T const& t) { stpath_append_one(st, Account{t}); @@ -424,7 +424,7 @@ same(STPathSet const& st1, Args const&... args) for (auto const& p : st2) { - if (std::ranges::find(st1, p) == st1.end()) + if (std::find(st1.begin(), st1.end(), p) == st1.end()) return false; } return true; @@ -994,9 +994,9 @@ struct IssuerArgs { jtx::Env& env; // 3-letter currency if Issue, ignored if MPT - std::string token; + std::string token = ""; jtx::Account issuer; - std::vector holders = {}; // NOLINT(readability-redundant-member-init) + std::vector holders = {}; // trust-limit if Issue, maxAmount if MPT std::optional limit = std::nullopt; // 0-50'000 (0-50%) @@ -1035,4 +1035,6 @@ testHelper3TokensMix(TTester&& tester) tester(detail::issueHelperIOU, detail::issueHelperIOU, detail::issueHelperMPT); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/TrustedPublisherServer.h b/src/test/jtx/TrustedPublisherServer.h index 097dae97bb..c9304426cf 100644 --- a/src/test/jtx/TrustedPublisherServer.h +++ b/src/test/jtx/TrustedPublisherServer.h @@ -21,9 +21,9 @@ #include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class TrustedPublisherServer : public std::enable_shared_from_this { @@ -54,7 +54,7 @@ class TrustedPublisherServer : public std::enable_shared_from_this( path.substr(strlen(refreshPrefix))); - } res.body() = getList2_(refresh); } } @@ -554,22 +543,16 @@ private: res.result(http::status::ok); res.insert("Content-Type", "application/json"); if (path == "/validators/bad") - { res.body() = "{ 'bad': \"1']"; - } else if (path == "/validators/missing") - { res.body() = "{\"version\": 1}"; - } else { int refresh = 5; constexpr char const* refreshPrefix = "/validators/refresh/"; if (boost::starts_with(path, refreshPrefix)) - { refresh = boost::lexical_cast( path.substr(strlen(refreshPrefix))); - } res.body() = getList_(refresh); } } @@ -587,10 +570,8 @@ private: { std::stringstream body; for (auto i = 0; i < 1024; ++i) - { body << static_cast(rand_int(32, 126)), res.body() = body.str(); - } } } else if (boost::starts_with(path, "/sleep/")) @@ -601,21 +582,13 @@ private: else if (boost::starts_with(path, "/redirect")) { if (boost::ends_with(path, "/301")) - { res.result(http::status::moved_permanently); - } else if (boost::ends_with(path, "/302")) - { res.result(http::status::found); - } else if (boost::ends_with(path, "/307")) - { res.result(http::status::temporary_redirect); - } else if (boost::ends_with(path, "/308")) - { res.result(http::status::permanent_redirect); - } std::stringstream location; if (boost::starts_with(path, "/redirect_to/")) @@ -657,13 +630,9 @@ private: } if (ssl) - { write(*ssl_stream, res, ec); - } else - { write(sock, res, ec); - } if (ec || req.need_eof()) break; @@ -693,4 +662,5 @@ make_TrustedPublisherServer( return r; } -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/WSClient.h b/src/test/jtx/WSClient.h index e95920d085..d1801cb4a9 100644 --- a/src/test/jtx/WSClient.h +++ b/src/test/jtx/WSClient.h @@ -8,7 +8,8 @@ #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class WSClient : public AbstractClient { @@ -32,4 +33,5 @@ makeWSClient( unsigned rpc_version = 2, std::unordered_map const& headers = {}); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/WSClient_test.cpp b/src/test/jtx/WSClient_test.cpp index 157b7665a8..206b550b87 100644 --- a/src/test/jtx/WSClient_test.cpp +++ b/src/test/jtx/WSClient_test.cpp @@ -1,13 +1,10 @@ -#include +#include #include -#include -#include -#include +#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class WSClient_test : public beast::unit_test::suite { @@ -32,4 +29,5 @@ public: BEAST_DEFINE_TESTSUITE(WSClient, jtx, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/account_txn_id.h b/src/test/jtx/account_txn_id.h index 424ce13b14..71ac606418 100644 --- a/src/test/jtx/account_txn_id.h +++ b/src/test/jtx/account_txn_id.h @@ -2,7 +2,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { struct account_txn_id { @@ -17,4 +19,6 @@ public: void operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/acctdelete.h b/src/test/jtx/acctdelete.h index 774baca7a1..c081eb92a5 100644 --- a/src/test/jtx/acctdelete.h +++ b/src/test/jtx/acctdelete.h @@ -5,7 +5,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Delete account. If successful transfer remaining XRP to dest. */ Json::Value @@ -17,4 +19,7 @@ acctdelete(Account const& account, Account const& dest); void incLgrSeqForAccDel(jtx::Env& env, jtx::Account const& acc, std::uint32_t margin = 0); -} // namespace xrpl::test::jtx +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/amount.h b/src/test/jtx/amount.h index 122af2faa1..7819a09451 100644 --- a/src/test/jtx/amount.h +++ b/src/test/jtx/amount.h @@ -13,7 +13,6 @@ #include #include #include -#include namespace xrpl { namespace detail { @@ -25,7 +24,8 @@ struct epsilon_multiple } // namespace detail -namespace test::jtx { +namespace test { +namespace jtx { /* @@ -74,8 +74,7 @@ public: PrettyAmount& operator=(PrettyAmount const&) = default; - PrettyAmount(STAmount amount, std::string name) - : amount_(std::move(amount)), name_(std::move(name)) + PrettyAmount(STAmount const& amount, std::string const& name) : amount_(amount), name_(name) { } @@ -121,7 +120,7 @@ public: return amount_; } - int + inline int signum() const { return amount_.signum(); @@ -258,8 +257,8 @@ struct XRP_t return xrpIssue(); } - static bool - integral() + bool + integral() const { return true; } @@ -361,7 +360,9 @@ drops(XRPAmount i) // The smallest possible IOU STAmount struct epsilon_t { - epsilon_t() = default; + epsilon_t() + { + } detail::epsilon_multiple operator()(std::size_t n) const @@ -385,8 +386,8 @@ public: Account account; xrpl::Currency currency; - IOU(Account account_, xrpl::Currency const& currency_) - : account(std::move(account_)), currency(currency_) + IOU(Account const& account_, xrpl::Currency const& currency_) + : account(account_), currency(currency_) { } @@ -426,7 +427,7 @@ public: template < class T, - class = std::enable_if_t= sizeof(int) && std::is_arithmetic_v>> + class = std::enable_if_t= sizeof(int) && std::is_arithmetic::value>> PrettyAmount operator()(T v) const { @@ -475,16 +476,17 @@ public: std::string name; xrpl::MPTID issuanceID; - MPT(std::string n, xrpl::MPTID const& issuanceID_) : name(std::move(n)), issuanceID(issuanceID_) + MPT(std::string const& n, xrpl::MPTID const& issuanceID_) : name(n), issuanceID(issuanceID_) { } - MPT(std::string n = "") : name(std::move(n)), issuanceID(noMPT()) + MPT(std::string const& n = "") : name(n), issuanceID(noMPT()) { } - MPT(Asset const& asset) : issuanceID(asset.get()) + MPT(Asset const& asset) : name(""), issuanceID(asset.get()) { } - MPT(AccountID const& account, std::int32_t seq = 0) : issuanceID(makeMptID(seq, account)) + MPT(AccountID const& account, std::int32_t seq = 0) + : name(""), issuanceID(makeMptID(seq, account)) { } @@ -506,8 +508,8 @@ public: { return mptIssue(); } - static bool - integral() + bool + integral() const { return true; } @@ -584,11 +586,11 @@ struct AnyAmount AnyAmount& operator=(AnyAmount const&) = default; - AnyAmount(STAmount amount) : is_any(false), value(std::move(amount)) + AnyAmount(STAmount const& amount) : is_any(false), value(amount) { } - AnyAmount(STAmount amount, any_t const*) : is_any(true), value(std::move(amount)) + AnyAmount(STAmount const& amount, any_t const*) : is_any(true), value(amount) { } @@ -613,6 +615,6 @@ any_t::operator()(STAmount const& sta) const */ extern any_t const any; -} // namespace test::jtx - +} // namespace jtx +} // namespace test } // namespace xrpl diff --git a/src/test/jtx/attester.h b/src/test/jtx/attester.h index 1c38684890..6904135f21 100644 --- a/src/test/jtx/attester.h +++ b/src/test/jtx/attester.h @@ -13,7 +13,8 @@ class SecretKey; class STXChainBridge; class STAmount; -namespace test::jtx { +namespace test { +namespace jtx { Buffer sign_claim_attestation( @@ -39,6 +40,6 @@ sign_create_account_attestation( bool wasLockingChainSend, std::uint64_t createCount, AccountID const& dst); -} // namespace test::jtx - +} // namespace jtx +} // namespace test } // namespace xrpl diff --git a/src/test/jtx/balance.h b/src/test/jtx/balance.h index a75583b1a3..2181429908 100644 --- a/src/test/jtx/balance.h +++ b/src/test/jtx/balance.h @@ -3,9 +3,9 @@ #include #include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** A balance matches. @@ -23,17 +23,17 @@ private: STAmount const value_; public: - balance(Account account, none_t) : none_(true), account_(std::move(account)), value_(XRP) + balance(Account const& account, none_t) : none_(true), account_(account), value_(XRP) { } - balance(Account account, None const& value) - : none_(true), account_(std::move(account)), value_(value.asset) + balance(Account const& account, None const& value) + : none_(true), account_(account), value_(value.asset) { } - balance(Account account, STAmount value) - : none_(false), account_(std::move(account)), value_(std::move(value)) + balance(Account const& account, STAmount const& value) + : none_(false), account_(account), value_(value) { } @@ -41,4 +41,6 @@ public: operator()(Env&) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/basic_prop.h b/src/test/jtx/basic_prop.h index d2b4805651..080eecd34b 100644 --- a/src/test/jtx/basic_prop.h +++ b/src/test/jtx/basic_prop.h @@ -2,7 +2,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { struct basic_prop { @@ -36,4 +38,6 @@ struct prop_type : basic_prop } }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/batch.h b/src/test/jtx/batch.h index 90a7bef8cc..f81bed3c6e 100644 --- a/src/test/jtx/batch.h +++ b/src/test/jtx/batch.h @@ -2,20 +2,24 @@ #include #include -#include #include #include #include #include +#include "test/jtx/SignerUtils.h" + #include #include #include -#include + +namespace xrpl { +namespace test { +namespace jtx { /** Batch operations */ -namespace xrpl::test::jtx::batch { +namespace batch { /** Calculate Batch Fee. */ XRPAmount @@ -35,10 +39,10 @@ private: public: inner( - Json::Value txn, + Json::Value const& txn, std::uint32_t const& sequence, std::optional const& ticket = std::nullopt) - : txn_(std::move(txn)), seq_(sequence), ticket_(ticket) + : txn_(txn), seq_(sequence), ticket_(ticket) { txn_[jss::SigningPubKey] = ""; txn_[jss::Sequence] = seq_; @@ -105,16 +109,16 @@ public: Account master; std::vector signers; - msig(Account masterAccount, std::vector signers_) - : master(std::move(masterAccount)), signers(std::move(signers_)) + msig(Account const& masterAccount, std::vector signers_) + : master(masterAccount), signers(std::move(signers_)) { sortSigners(signers); } template requires std::convertible_to - explicit msig(Account masterAccount, AccountType&& a0, Accounts&&... aN) - : master(std::move(masterAccount)) + explicit msig(Account const& masterAccount, AccountType&& a0, Accounts&&... aN) + : master(masterAccount) , signers{std::forward(a0), std::forward(aN)...} { sortSigners(signers); @@ -124,4 +128,9 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx::batch +} // namespace batch + +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/check.h b/src/test/jtx/check.h index fc1d8054c6..9a1c6b2d2c 100644 --- a/src/test/jtx/check.h +++ b/src/test/jtx/check.h @@ -4,9 +4,9 @@ #include #include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Check operations. */ namespace check { @@ -19,7 +19,7 @@ cash(jtx::Account const& dest, uint256 const& checkId, STAmount const& amount); struct DeliverMin { STAmount value; - explicit DeliverMin(STAmount deliverMin) : value(std::move(deliverMin)) + explicit DeliverMin(STAmount const& deliverMin) : value(deliverMin) { } }; @@ -37,4 +37,7 @@ cancel(jtx::Account const& dest, uint256 const& checkId); /** Match the number of checks on the account. */ using checks = owner_count; -} // namespace xrpl::test::jtx +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/credentials.h b/src/test/jtx/credentials.h index fd6d31f56d..56d127fca9 100644 --- a/src/test/jtx/credentials.h +++ b/src/test/jtx/credentials.h @@ -4,7 +4,11 @@ #include #include -namespace xrpl::test::jtx::credentials { +namespace xrpl { +namespace test { +namespace jtx { + +namespace credentials { inline Keylet keylet( @@ -76,4 +80,7 @@ ledgerEntry( Json::Value ledgerEntry(jtx::Env& env, std::string const& credIdx); -} // namespace xrpl::test::jtx::credentials +} // namespace credentials +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/delegate.h b/src/test/jtx/delegate.h index 197750a511..7aecb54922 100644 --- a/src/test/jtx/delegate.h +++ b/src/test/jtx/delegate.h @@ -3,9 +3,11 @@ #include #include -#include +namespace xrpl { +namespace test { +namespace jtx { -namespace xrpl::test::jtx::delegate { +namespace delegate { Json::Value set(jtx::Account const& account, @@ -21,7 +23,7 @@ private: jtx::Account delegate_; public: - explicit as(jtx::Account account) : delegate_(std::move(account)) + explicit as(jtx::Account const& account) : delegate_(account) { } @@ -32,4 +34,7 @@ public: } }; -} // namespace xrpl::test::jtx::delegate +} // namespace delegate +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/delivermin.h b/src/test/jtx/delivermin.h index 6dc0bea2ad..3edb38ffef 100644 --- a/src/test/jtx/delivermin.h +++ b/src/test/jtx/delivermin.h @@ -4,9 +4,9 @@ #include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Sets the DeliverMin on a JTx. */ class deliver_min @@ -15,7 +15,7 @@ private: STAmount amount_; public: - deliver_min(STAmount amount) : amount_(std::move(amount)) + deliver_min(STAmount const& amount) : amount_(amount) { } @@ -23,4 +23,6 @@ public: operator()(Env&, JTx& jtx) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/deposit.h b/src/test/jtx/deposit.h index d74db770c7..d7762e9ae3 100644 --- a/src/test/jtx/deposit.h +++ b/src/test/jtx/deposit.h @@ -3,8 +3,12 @@ #include #include +namespace xrpl { +namespace test { +namespace jtx { + /** Deposit preauthorize operations */ -namespace xrpl::test::jtx::deposit { +namespace deposit { /** Preauthorize for deposit. Invoke as deposit::auth. */ Json::Value @@ -48,4 +52,9 @@ authCredentials(jtx::Account const& account, std::vector c Json::Value unauthCredentials(jtx::Account const& account, std::vector const& auth); -} // namespace xrpl::test::jtx::deposit +} // namespace deposit + +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/did.h b/src/test/jtx/did.h index faf4b2046c..e6b06f8f7c 100644 --- a/src/test/jtx/did.h +++ b/src/test/jtx/did.h @@ -4,8 +4,12 @@ #include #include +namespace xrpl { +namespace test { +namespace jtx { + /** DID operations. */ -namespace xrpl::test::jtx::did { +namespace did { Json::Value set(jtx::Account const& account); @@ -70,4 +74,9 @@ public: Json::Value del(jtx::Account const& account); -} // namespace xrpl::test::jtx::did +} // namespace did + +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/directory.h b/src/test/jtx/directory.h index 0940c23623..e9fff35434 100644 --- a/src/test/jtx/directory.h +++ b/src/test/jtx/directory.h @@ -9,8 +9,10 @@ #include #include +namespace xrpl::test::jtx { + /** Directory operations. */ -namespace xrpl::test::jtx::directory { +namespace directory { enum Error { DirectoryRootNotFound, @@ -51,4 +53,6 @@ maximumPageIndex(Env const& env) -> std::uint64_t return dirNodeMaxPages - 1; } -} // namespace xrpl::test::jtx::directory +} // namespace directory + +} // namespace xrpl::test::jtx diff --git a/src/test/jtx/domain.h b/src/test/jtx/domain.h index 993c89ee19..cb67ce3622 100644 --- a/src/test/jtx/domain.h +++ b/src/test/jtx/domain.h @@ -2,7 +2,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Set the domain on a JTx. */ class domain @@ -19,4 +21,6 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/envconfig.h b/src/test/jtx/envconfig.h index dcfafc426e..e4a1975e74 100644 --- a/src/test/jtx/envconfig.h +++ b/src/test/jtx/envconfig.h @@ -2,7 +2,8 @@ #include -namespace xrpl::test { +namespace xrpl { +namespace test { // frequently used macros defined here for convenience. #define PORT_WS "port_ws" @@ -106,56 +107,11 @@ std::unique_ptr addGrpcConfig(std::unique_ptr); std::unique_ptr addGrpcConfigWithSecureGateway(std::unique_ptr, std::string const& secureGateway); -/// @brief add a grpc address, port and TLS certificate/key paths to config -/// -/// This is intended for use with envconfig, for tests that require a grpc -/// server with TLS enabled. -/// -/// @param cfg config instance to be modified -/// @param certPath path to SSL certificate file -/// @param keyPath path to SSL private key file -std::unique_ptr -addGrpcConfigWithTLS( - std::unique_ptr, - std::string const& certPath, - std::string const& keyPath); - -/// @brief add a grpc address, port and TLS certificate/key/client CA paths to config -/// -/// This is intended for use with envconfig, for tests that require a grpc -/// server with mutual TLS (client certificate verification) enabled. -/// -/// @param cfg config instance to be modified -/// @param certPath path to SSL certificate file -/// @param keyPath path to SSL private key file -/// @param clientCAPath path to SSL client CA certificate file for mTLS -std::unique_ptr -addGrpcConfigWithTLSAndClientCA( - std::unique_ptr, - std::string const& certPath, - std::string const& keyPath, - std::string const& clientCAPath); - -/// @brief add a grpc address, port and TLS with server cert chain to config -/// -/// This is intended for use with envconfig, for tests that require a grpc -/// server with TLS enabled and intermediate CA certificates. -/// -/// @param cfg config instance to be modified -/// @param certPath path to SSL certificate file -/// @param keyPath path to SSL private key file -/// @param certChainPath path to SSL intermediate CA certificate(s) file -std::unique_ptr -addGrpcConfigWithTLSAndCertChain( - std::unique_ptr, - std::string const& certPath, - std::string const& keyPath, - std::string const& certChainPath); - std::unique_ptr makeConfig( std::map extraTxQ = {}, std::map extraVoting = {}); } // namespace jtx -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/escrow.h b/src/test/jtx/escrow.h index 8bb505a592..8fe9d9f5f9 100644 --- a/src/test/jtx/escrow.h +++ b/src/test/jtx/escrow.h @@ -8,8 +8,12 @@ #include +namespace xrpl { +namespace test { +namespace jtx { + /** Escrow operations. */ -namespace xrpl::test::jtx::escrow { +namespace escrow { Json::Value create(AccountID const& account, AccountID const& to, STAmount const& amount); @@ -75,4 +79,9 @@ auto const condition = JTxFieldWrapper(sfCondition); auto const fulfillment = JTxFieldWrapper(sfFulfillment); -} // namespace xrpl::test::jtx::escrow +} // namespace escrow + +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/fee.h b/src/test/jtx/fee.h index f586e2a082..281066f0aa 100644 --- a/src/test/jtx/fee.h +++ b/src/test/jtx/fee.h @@ -8,7 +8,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Set the fee on a JTx. */ class fee @@ -45,4 +47,6 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/flags.h b/src/test/jtx/flags.h index 4bf095e685..c4fb5cb34c 100644 --- a/src/test/jtx/flags.h +++ b/src/test/jtx/flags.h @@ -6,8 +6,6 @@ #include #include -#include - namespace xrpl { namespace detail { @@ -89,7 +87,8 @@ protected: } // namespace detail -namespace test::jtx { +namespace test { +namespace jtx { // JSON generators @@ -112,7 +111,7 @@ private: public: template - flags(Account account, Args... args) : flags_helper(args...), account_(std::move(account)) + flags(Account const& account, Args... args) : flags_helper(args...), account_(account) { } @@ -128,7 +127,7 @@ private: public: template - nflags(Account account, Args... args) : flags_helper(args...), account_(std::move(account)) + nflags(Account const& account, Args... args) : flags_helper(args...), account_(account) { } @@ -136,6 +135,6 @@ public: operator()(Env& env) const; }; -} // namespace test::jtx - +} // namespace jtx +} // namespace test } // namespace xrpl diff --git a/src/test/jtx/impl/AMM.cpp b/src/test/jtx/impl/AMM.cpp index 6f68033fc4..79f4fa222e 100644 --- a/src/test/jtx/impl/AMM.cpp +++ b/src/test/jtx/impl/AMM.cpp @@ -1,44 +1,16 @@ #include - -#include #include -#include -#include -#include -#include -#include #include -#include -#include #include -#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { static Number number(STAmount const& a) @@ -61,9 +33,9 @@ AMM::initialTokens() AMM::AMM( Env& env, - Account account, - STAmount asset1, - STAmount asset2, + Account const& account, + STAmount const& asset1, + STAmount const& asset2, bool log, std::uint16_t tfee, std::uint32_t fee, @@ -73,14 +45,14 @@ AMM::AMM( std::optional const& ter, bool close) : env_(env) - , creatorAccount_(std::move(account)) - , asset1_(std::move(asset1)) - , asset2_(std::move(asset2)) + , creatorAccount_(account) + , asset1_(asset1) + , asset2_(asset2) , ammID_(keylet::amm(asset1_.asset(), asset2_.asset()).key) , log_(log) , doClose_(close) , lastPurchasePrice_(0) - , msig_(std::move(ms)) + , msig_(ms) , fee_(fee) , ammAccount_(create(tfee, flags, seq, ter)) , lptIssue_(xrpl::ammLPTIssue(asset1_.asset(), asset2_.asset(), ammAccount_)) @@ -310,8 +282,10 @@ AMM::expectAuctionSlot(std::vector const& authAccounts) const [&](std::uint32_t, std::optional, IOUAmount const&, STArray const& accounts) { for (auto const& account : accounts) { - if (std::ranges::find(authAccounts, account.getAccountID(sfAccount)) == - authAccounts.end()) + if (std::find( + authAccounts.cbegin(), + authAccounts.cend(), + account.getAccountID(sfAccount)) == authAccounts.end()) return false; } return true; @@ -918,4 +892,6 @@ ammClawback( return jv; } } // namespace amm -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/AMMTest.cpp b/src/test/jtx/impl/AMMTest.cpp index 24d831be7d..9527dd1e4e 100644 --- a/src/test/jtx/impl/AMMTest.cpp +++ b/src/test/jtx/impl/AMMTest.cpp @@ -1,34 +1,19 @@ -#include - #include -#include +#include #include #include -#include -#include #include #include -#include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { [[maybe_unused]] std::vector fund( @@ -219,4 +204,6 @@ AMMTest::pathTestEnv() return cfg; })); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/Account.cpp b/src/test/jtx/impl/Account.cpp index 4e09940487..a7b71ea6eb 100644 --- a/src/test/jtx/impl/Account.cpp +++ b/src/test/jtx/impl/Account.cpp @@ -1,25 +1,11 @@ #include - #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { std::unordered_map, Account, beast::uhash<>> Account::cache_; @@ -93,4 +79,6 @@ Account::operator[](std::string const& s) const return IOU(*this, currency); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/Env.cpp b/src/test/jtx/impl/Env.cpp index f03e26b567..bba10439ed 100644 --- a/src/test/jtx/impl/Env.cpp +++ b/src/test/jtx/impl/Env.cpp @@ -1,48 +1,25 @@ #include - -#include #include -#include -#include -#include #include #include #include #include #include #include -#include #include #include -#include #include -#include -#include #include -#include -#include -#include +#include #include -#include #include -#include -#include -#include #include -#include #include #include -#include -#include #include #include -#include -#include -#include -#include -#include #include #include #include @@ -50,22 +27,12 @@ #include #include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { //------------------------------------------------------------------------------ @@ -694,4 +661,6 @@ Env::disableFeature(uint256 const feature) app().config().features.erase(feature); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/JSONRPCClient.cpp b/src/test/jtx/impl/JSONRPCClient.cpp index c44371c13e..6b60744aad 100644 --- a/src/test/jtx/impl/JSONRPCClient.cpp +++ b/src/test/jtx/impl/JSONRPCClient.cpp @@ -1,37 +1,21 @@ #include -#include - -#include - -#include -#include #include -#include #include #include #include -#include -#include -#include -#include -#include -#include +#include #include #include #include #include -#include #include -#include -#include -#include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class JSONRPCClient : public AbstractClient { @@ -47,7 +31,7 @@ class JSONRPCClient : public AbstractClient continue; ParsedPort pp; parse_Port(pp, cfg[name], log); - if (not pp.protocol.contains("http")) + if (pp.protocol.count("http") == 0) continue; using namespace boost::asio::ip; if (pp.ip && pp.ip->is_unspecified()) @@ -90,6 +74,12 @@ public: stream_.connect(ep_); } + ~JSONRPCClient() override + { + // stream_.shutdown(boost::asio::ip::tcp::socket::shutdown_both); + // stream_.close(); + } + /* Return value is an Object type with up to three keys: status @@ -158,4 +148,5 @@ makeJSONRPCClient(Config const& cfg, unsigned rpc_version) return std::make_unique(cfg, rpc_version); } -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/Oracle.cpp b/src/test/jtx/impl/Oracle.cpp index 7e49cdcd3d..c692664b93 100644 --- a/src/test/jtx/impl/Oracle.cpp +++ b/src/test/jtx/impl/Oracle.cpp @@ -1,34 +1,16 @@ #include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include // IWYU pragma: keep -#include +#include -#include -#include -#include -#include -#include -#include -#include +#include -namespace xrpl::test::jtx::oracle { +namespace xrpl { +namespace test { +namespace jtx { +namespace oracle { Oracle::Oracle(Env& env, CreateArg const& arg, bool submit) : env_(env) { @@ -134,7 +116,7 @@ Oracle::expectPrice(DataSeries const& series) const return false; for (auto const& data : series) { - if (std::ranges::find_if(leSeries, [&](STObject const& o) -> bool { + if (std::find_if(leSeries.begin(), leSeries.end(), [&](STObject const& o) -> bool { auto const& baseAsset = o.getFieldCurrency(sfBaseAsset); auto const& quoteAsset = o.getFieldCurrency(sfQuoteAsset); auto const& price = o.getFieldU64(sfAssetPrice); @@ -419,4 +401,7 @@ validDocumentID(AnyValue const& v) } } -} // namespace xrpl::test::jtx::oracle +} // namespace oracle +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/TestHelpers.cpp b/src/test/jtx/impl/TestHelpers.cpp index 2495e151f3..8010f171f7 100644 --- a/src/test/jtx/impl/TestHelpers.cpp +++ b/src/test/jtx/impl/TestHelpers.cpp @@ -1,67 +1,20 @@ #include - -#include -#include -#include -#include // IWYU pragma: keep -#include #include #include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { // Functions used in debugging Json::Value @@ -215,16 +168,16 @@ find_paths_request( Resource::Consumer c; RPC::JsonContext context{ - {.j = env.journal, - .app = app, - .loadType = loadType, - .netOps = app.getOPs(), - .ledgerMaster = app.getLedgerMaster(), - .consumer = c, - .role = Role::USER, - .coro = {}, - .infoSub = {}, - .apiVersion = RPC::apiVersionIfUnspecified}, + {env.journal, + app, + loadType, + app.getOPs(), + app.getLedgerMaster(), + c, + Role::USER, + {}, + {}, + RPC::apiVersionIfUnspecified}, {}, {}}; @@ -413,7 +366,7 @@ expectOffers( if (sle->getType() == ltOFFER) { ++cnt; - if (std::ranges::find_if(toMatch, [&](auto const& a) { + if (std::find_if(toMatch.begin(), toMatch.end(), [&](auto const& a) { return a.in == sle->getFieldAmount(sfTakerPays) && a.out == sle->getFieldAmount(sfTakerGets); }) != toMatch.end()) @@ -856,4 +809,6 @@ pay(AccountID const& account, uint256 const& loanID, STAmount const& amount, std } } // namespace loan -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/WSClient.cpp b/src/test/jtx/impl/WSClient.cpp index 617e2b8881..2c3389c131 100644 --- a/src/test/jtx/impl/WSClient.cpp +++ b/src/test/jtx/impl/WSClient.cpp @@ -1,48 +1,23 @@ +#include #include -#include - -#include -#include #include -#include #include #include #include -#include -#include #include #include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include +#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class WSClientImpl : public WSClient { @@ -334,4 +309,5 @@ makeWSClient( return std::make_unique(cfg, v2, rpc_version, headers); } -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/account_txn_id.cpp b/src/test/jtx/impl/account_txn_id.cpp index a556ea8e91..ceda6e7b50 100644 --- a/src/test/jtx/impl/account_txn_id.cpp +++ b/src/test/jtx/impl/account_txn_id.cpp @@ -1,11 +1,8 @@ #include -#include -#include - -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void account_txn_id::operator()(Env&, JTx& jt) const @@ -14,4 +11,6 @@ account_txn_id::operator()(Env&, JTx& jt) const jt["AccountTxnID"] = strHex(hash_); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/acctdelete.cpp b/src/test/jtx/impl/acctdelete.cpp index 433ed5ec92..0b87d501dd 100644 --- a/src/test/jtx/impl/acctdelete.cpp +++ b/src/test/jtx/impl/acctdelete.cpp @@ -1,16 +1,11 @@ +#include #include -#include -#include - -#include -#include -#include #include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { // Delete account. If successful transfer remaining XRP to dest. Json::Value @@ -43,4 +38,6 @@ incLgrSeqForAccDel(jtx::Env& env, jtx::Account const& acc, std::uint32_t margin) env.test.BEAST_EXPECT(openLedgerSeq(env) == env.seq(acc) + 255 - margin); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/amount.cpp b/src/test/jtx/impl/amount.cpp index 1a02e07bdf..c3ae76967a 100644 --- a/src/test/jtx/impl/amount.cpp +++ b/src/test/jtx/impl/amount.cpp @@ -1,22 +1,13 @@ +#include #include -#include - -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { PrettyAmount:: operator AnyAmount() const @@ -118,4 +109,6 @@ operator<<(std::ostream& os, MPT const& mpt) any_t const any{}; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/attester.cpp b/src/test/jtx/impl/attester.cpp index 74c0ae24ed..d4693e69fb 100644 --- a/src/test/jtx/impl/attester.cpp +++ b/src/test/jtx/impl/attester.cpp @@ -1,16 +1,13 @@ #include -#include #include -#include #include #include #include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { Buffer sign_claim_attestation( @@ -54,4 +51,6 @@ sign_create_account_attestation( return sign(pk, sk, makeSlice(toSign)); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/balance.cpp b/src/test/jtx/impl/balance.cpp index 1c7b4c0c25..157c6c4d8e 100644 --- a/src/test/jtx/impl/balance.cpp +++ b/src/test/jtx/impl/balance.cpp @@ -1,17 +1,8 @@ #include -#include - -#include -#include -#include -#include -#include -#include - -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { #define TEST_EXPECT(cond) env.test.expect(cond, __FILE__, __LINE__) #define TEST_EXPECTS(cond, reason) \ @@ -80,4 +71,6 @@ balance::operator()(Env& env) const value_.asset().value()); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/batch.cpp b/src/test/jtx/impl/batch.cpp index d45f195b66..65aca2a935 100644 --- a/src/test/jtx/impl/batch.cpp +++ b/src/test/jtx/impl/batch.cpp @@ -1,34 +1,19 @@ #include - -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include #include -#include -#include #include -#include -#include +#include -namespace xrpl::test::jtx::batch { +namespace xrpl { +namespace test { +namespace jtx { + +namespace batch { XRPAmount calcBatchFee(test::jtx::Env const& env, uint32_t const& numSigners, uint32_t const& txns) @@ -134,4 +119,8 @@ msig::operator()(Env& env, JTx& jt) const } } -} // namespace xrpl::test::jtx::batch +} // namespace batch + +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/check.cpp b/src/test/jtx/impl/check.cpp index d03700e2c3..22f348aa3f 100644 --- a/src/test/jtx/impl/check.cpp +++ b/src/test/jtx/impl/check.cpp @@ -1,14 +1,13 @@ #include -#include - -#include -#include -#include -#include +#include #include -namespace xrpl::test::jtx::check { +namespace xrpl { +namespace test { +namespace jtx { + +namespace check { // Cash a check requiring that a specific amount be delivered. Json::Value @@ -45,4 +44,8 @@ cancel(jtx::Account const& dest, uint256 const& checkId) return jv; } -} // namespace xrpl::test::jtx::check +} // namespace check + +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/creds.cpp b/src/test/jtx/impl/creds.cpp index 4d38d6d88b..e1018cc0e5 100644 --- a/src/test/jtx/impl/creds.cpp +++ b/src/test/jtx/impl/creds.cpp @@ -1,16 +1,13 @@ -#include -#include #include -#include -#include -#include -#include +#include #include -#include +namespace xrpl { +namespace test { +namespace jtx { -namespace xrpl::test::jtx::credentials { +namespace credentials { Json::Value create(jtx::Account const& subject, jtx::Account const& issuer, std::string_view credType) @@ -76,4 +73,9 @@ ledgerEntry(jtx::Env& env, std::string const& credIdx) return env.rpc("json", "ledger_entry", to_string(jvParams)); } -} // namespace xrpl::test::jtx::credentials +} // namespace credentials + +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/delegate.cpp b/src/test/jtx/impl/delegate.cpp index e4e5e4ca96..7cca9aa738 100644 --- a/src/test/jtx/impl/delegate.cpp +++ b/src/test/jtx/impl/delegate.cpp @@ -1,17 +1,12 @@ #include -#include -#include - -#include -#include -#include #include -#include -#include +namespace xrpl { +namespace test { +namespace jtx { -namespace xrpl::test::jtx::delegate { +namespace delegate { Json::Value set(jtx::Account const& account, @@ -47,4 +42,7 @@ entry(jtx::Env& env, jtx::Account const& account, jtx::Account const& authorize) return env.rpc("json", "ledger_entry", to_string(jvParams)); } -} // namespace xrpl::test::jtx::delegate +} // namespace delegate +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/delivermin.cpp b/src/test/jtx/impl/delivermin.cpp index 140f4d7c66..a5c1414525 100644 --- a/src/test/jtx/impl/delivermin.cpp +++ b/src/test/jtx/impl/delivermin.cpp @@ -1,11 +1,10 @@ #include -#include -#include - #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void deliver_min::operator()(Env& env, JTx& jt) const @@ -13,4 +12,6 @@ deliver_min::operator()(Env& env, JTx& jt) const jt.jv[jss::DeliverMin] = amount_.getJson(JsonOptions::none); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/deposit.cpp b/src/test/jtx/impl/deposit.cpp index 5e432b6aa8..4a2ecf0139 100644 --- a/src/test/jtx/impl/deposit.cpp +++ b/src/test/jtx/impl/deposit.cpp @@ -1,15 +1,12 @@ #include -#include - -#include -#include #include -#include -#include +namespace xrpl { +namespace test { +namespace jtx { -namespace xrpl::test::jtx::deposit { +namespace deposit { // Add DepositPreauth. Json::Value @@ -69,4 +66,8 @@ unauthCredentials(jtx::Account const& account, std::vector return jv; } -} // namespace xrpl::test::jtx::deposit +} // namespace deposit + +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/dids.cpp b/src/test/jtx/impl/dids.cpp index 9b3a08bbfa..bb782bcd43 100644 --- a/src/test/jtx/impl/dids.cpp +++ b/src/test/jtx/impl/dids.cpp @@ -1,14 +1,14 @@ -#include #include -#include -#include -#include -#include +#include #include +namespace xrpl { +namespace test { +namespace jtx { + /** DID operations. */ -namespace xrpl::test::jtx::did { +namespace did { Json::Value set(jtx::Account const& account) @@ -38,4 +38,9 @@ del(jtx::Account const& account) return jv; } -} // namespace xrpl::test::jtx::did +} // namespace did + +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/directory.cpp b/src/test/jtx/impl/directory.cpp index ac4d81bdfb..da0a338e7c 100644 --- a/src/test/jtx/impl/directory.cpp +++ b/src/test/jtx/impl/directory.cpp @@ -1,25 +1,11 @@ #include -#include - -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include +namespace xrpl::test::jtx { /** Directory operations. */ -namespace xrpl::test::jtx::directory { +namespace directory { auto bumpLastPage( @@ -136,4 +122,6 @@ adjustOwnerNode(ApplyView& view, uint256 key, std::uint64_t page) return false; } -} // namespace xrpl::test::jtx::directory +} // namespace directory + +} // namespace xrpl::test::jtx diff --git a/src/test/jtx/impl/domain.cpp b/src/test/jtx/impl/domain.cpp index 70d4daf002..91568783d2 100644 --- a/src/test/jtx/impl/domain.cpp +++ b/src/test/jtx/impl/domain.cpp @@ -1,12 +1,10 @@ #include -#include -#include +#include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void domain::operator()(Env&, JTx& jt) const @@ -14,4 +12,6 @@ domain::operator()(Env&, JTx& jt) const jt[sfDomainID.jsonName] = to_string(v_); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/envconfig.cpp b/src/test/jtx/impl/envconfig.cpp index ae05e4f1dd..e31e687c3d 100644 --- a/src/test/jtx/impl/envconfig.cpp +++ b/src/test/jtx/impl/envconfig.cpp @@ -1,16 +1,10 @@ +#include #include -#include - -#include #include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { std::atomic envUseIPv4{false}; @@ -131,49 +125,6 @@ addGrpcConfigWithSecureGateway(std::unique_ptr cfg, std::string const& s return cfg; } -std::unique_ptr -addGrpcConfigWithTLS( - std::unique_ptr cfg, - std::string const& certPath, - std::string const& keyPath) -{ - (*cfg)[SECTION_PORT_GRPC].set("ip", getEnvLocalhostAddr()); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", certPath); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", keyPath); - return cfg; -} - -std::unique_ptr -addGrpcConfigWithTLSAndClientCA( - std::unique_ptr cfg, - std::string const& certPath, - std::string const& keyPath, - std::string const& clientCAPath) -{ - (*cfg)[SECTION_PORT_GRPC].set("ip", getEnvLocalhostAddr()); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", certPath); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", keyPath); - (*cfg)[SECTION_PORT_GRPC].set("ssl_client_ca", clientCAPath); - return cfg; -} - -std::unique_ptr -addGrpcConfigWithTLSAndCertChain( - std::unique_ptr cfg, - std::string const& certPath, - std::string const& keyPath, - std::string const& certChainPath) -{ - (*cfg)[SECTION_PORT_GRPC].set("ip", getEnvLocalhostAddr()); - (*cfg)[SECTION_PORT_GRPC].set("port", "0"); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert", certPath); - (*cfg)[SECTION_PORT_GRPC].set("ssl_key", keyPath); - (*cfg)[SECTION_PORT_GRPC].set("ssl_cert_chain", certChainPath); - return cfg; -} - std::unique_ptr makeConfig( std::map extraTxQ, @@ -208,4 +159,5 @@ makeConfig( } } // namespace jtx -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/escrow.cpp b/src/test/jtx/impl/escrow.cpp index 3d5d1e2bac..067c304178 100644 --- a/src/test/jtx/impl/escrow.cpp +++ b/src/test/jtx/impl/escrow.cpp @@ -1,21 +1,14 @@ #include -#include -#include - -#include -#include -#include -#include -#include -#include #include #include -#include +namespace xrpl { +namespace test { +namespace jtx { /** Escrow operations. */ -namespace xrpl::test::jtx::escrow { +namespace escrow { Json::Value create(AccountID const& account, AccountID const& to, STAmount const& amount) @@ -62,4 +55,9 @@ rate(Env& env, Account const& account, std::uint32_t const& seq) return Rate{0}; } -} // namespace xrpl::test::jtx::escrow +} // namespace escrow + +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/fee.cpp b/src/test/jtx/impl/fee.cpp index edc3b5adf9..fc05afcb46 100644 --- a/src/test/jtx/impl/fee.cpp +++ b/src/test/jtx/impl/fee.cpp @@ -1,13 +1,10 @@ #include -#include -#include +#include -#include - -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void fee::operator()(Env& env, JTx& jt) const @@ -26,4 +23,6 @@ fee::operator()(Env& env, JTx& jt) const } } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/flags.cpp b/src/test/jtx/impl/flags.cpp index 3caa2ece17..aee01a107e 100644 --- a/src/test/jtx/impl/flags.cpp +++ b/src/test/jtx/impl/flags.cpp @@ -1,15 +1,10 @@ #include -#include -#include - -#include -#include #include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { Json::Value fset(Account const& account, std::uint32_t on, std::uint32_t off) @@ -60,4 +55,6 @@ nflags::operator()(Env& env) const } } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/invoice_id.cpp b/src/test/jtx/impl/invoice_id.cpp index ce3eb783ac..6d6dae0fbf 100644 --- a/src/test/jtx/impl/invoice_id.cpp +++ b/src/test/jtx/impl/invoice_id.cpp @@ -1,11 +1,8 @@ #include -#include -#include - -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void invoice_id::operator()(Env&, JTx& jt) const @@ -14,4 +11,6 @@ invoice_id::operator()(Env&, JTx& jt) const jt["InvoiceID"] = strHex(hash_); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/jtx_json.cpp b/src/test/jtx/impl/jtx_json.cpp index 0360dba351..c39503d038 100644 --- a/src/test/jtx/impl/jtx_json.cpp +++ b/src/test/jtx/impl/jtx_json.cpp @@ -1,17 +1,12 @@ #include - -#include -#include #include #include #include -#include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { json::json(std::string const& s) { @@ -35,4 +30,6 @@ json::operator()(Env&, JTx& jt) const jv[iter.key().asString()] = *iter; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/last_ledger_sequence.cpp b/src/test/jtx/impl/last_ledger_sequence.cpp index dc4bae6212..5f29282ad6 100644 --- a/src/test/jtx/impl/last_ledger_sequence.cpp +++ b/src/test/jtx/impl/last_ledger_sequence.cpp @@ -1,9 +1,8 @@ #include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void last_ledger_seq::operator()(Env&, JTx& jt) const @@ -11,4 +10,6 @@ last_ledger_seq::operator()(Env&, JTx& jt) const jt["LastLedgerSequence"] = num_; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/ledgerStateFixes.cpp b/src/test/jtx/impl/ledgerStateFixes.cpp index 99cd03cbb6..e5a7495a44 100644 --- a/src/test/jtx/impl/ledgerStateFixes.cpp +++ b/src/test/jtx/impl/ledgerStateFixes.cpp @@ -1,12 +1,14 @@ -#include #include -#include -#include +#include #include #include -namespace xrpl::test::jtx::ledgerStateFix { +namespace xrpl { +namespace test { +namespace jtx { + +namespace ledgerStateFix { // Fix NFTokenPage links on owner's account. acct pays fee. Json::Value @@ -20,4 +22,8 @@ nftPageLinks(jtx::Account const& acct, jtx::Account const& owner) return jv; } -} // namespace xrpl::test::jtx::ledgerStateFix +} // namespace ledgerStateFix + +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/memo.cpp b/src/test/jtx/impl/memo.cpp index f092f48d70..e503b9a073 100644 --- a/src/test/jtx/impl/memo.cpp +++ b/src/test/jtx/impl/memo.cpp @@ -1,11 +1,8 @@ #include -#include -#include - -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void memo::operator()(Env&, JTx& jt) const @@ -49,4 +46,6 @@ memo_type::operator()(Env&, JTx& jt) const m["MemoType"] = strHex(s_); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/mpt.cpp b/src/test/jtx/impl/mpt.cpp index 6e851796b2..6bd2421fdd 100644 --- a/src/test/jtx/impl/mpt.cpp +++ b/src/test/jtx/impl/mpt.cpp @@ -1,55 +1,20 @@ +#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include #include -#include #include -#include -#include -#include #include #include -#include -#include - -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** * @brief Helper function to convert a PedersenProofParams into the C library struct. @@ -100,9 +65,9 @@ MPTTester::makeHolders(std::vector const& holders) return accounts; } -MPTTester::MPTTester(Env& env, Account issuer, MPTInit const& arg) +MPTTester::MPTTester(Env& env, Account const& issuer, MPTInit const& arg) : env_(env) - , issuer_(std::move(issuer)) + , issuer_(issuer) , holders_(makeHolders(arg.holders)) , auditor_(arg.auditor) , close_(arg.close) @@ -137,11 +102,11 @@ MPTTester::MPTTester(Env& env, Account issuer, MPTInit const& arg) MPTTester::MPTTester( Env& env, - Account issuer, + Account const& issuer, MPTID const& id, std::vector const& holders, bool close) - : env_(env), issuer_(std::move(issuer)), holders_(makeHolders(holders)), id_(id), close_(close) + : env_(env), issuer_(issuer), holders_(makeHolders(holders)), id_(id), close_(close) { } @@ -390,7 +355,9 @@ void MPTTester::authorizeHolders(Holders const& holders) { for (auto const& holder : holders) + { authorize({.account = holder}); + } } Json::Value @@ -454,7 +421,7 @@ MPTTester::set(MPTSet const& arg) .auditorPubKey = arg.auditorPubKey}); if (submit(arg, jv) == tesSUCCESS && ((arg.flags.value_or(0) != 0u) || arg.mutableFlags)) { - if ((arg.flags.value_or(0) != 0u || arg.mutableFlags)) + if ((arg.flags.value_or(0) || arg.mutableFlags)) { auto require = [&](std::optional const& holder, bool unchanged) { auto flags = getFlags(holder); @@ -553,10 +520,8 @@ MPTTester::set(MPTSet const& arg) { auto const issuerPubKey = getPubKey(issuer_); if (!issuerPubKey) - { Throw( "MPTTester::set: issuer's pubkey is not set"); - } return strHex((*sle)[sfIssuerEncryptionKey]) == strHex(*issuerPubKey); } @@ -576,10 +541,8 @@ MPTTester::set(MPTSet const& arg) auto const auditorPubKey = getPubKey(*auditor_); if (!auditorPubKey) - { Throw( "MPTTester::set: auditor's pubkey is not set"); - } return strHex((*sle)[sfAuditorEncryptionKey]) == strHex(*auditorPubKey); } @@ -995,28 +958,20 @@ MPTTester::getEncryptedBalance(Account const& account, EncryptedBalanceType opti if (auto const sle = env_.le(keylet::mptoken(*id_, account.id()))) { if (option == HOLDER_ENCRYPTED_INBOX && sle->isFieldPresent(sfConfidentialBalanceInbox)) - { return Buffer( (*sle)[sfConfidentialBalanceInbox].data(), (*sle)[sfConfidentialBalanceInbox].size()); - } if (option == HOLDER_ENCRYPTED_SPENDING && sle->isFieldPresent(sfConfidentialBalanceSpending)) - { return Buffer( (*sle)[sfConfidentialBalanceSpending].data(), (*sle)[sfConfidentialBalanceSpending].size()); - } if (option == ISSUER_ENCRYPTED_BALANCE && sle->isFieldPresent(sfIssuerEncryptedBalance)) - { return Buffer( (*sle)[sfIssuerEncryptedBalance].data(), (*sle)[sfIssuerEncryptedBalance].size()); - } if (option == AUDITOR_ENCRYPTED_BALANCE && sle->isFieldPresent(sfAuditorEncryptedBalance)) - { return Buffer( (*sle)[sfAuditorEncryptedBalance].data(), (*sle)[sfAuditorEncryptedBalance].size()); - } } return {}; @@ -1062,37 +1017,25 @@ MPTTester::fillConversionCiphertexts( // Handle Holder if (arg.holderEncryptedAmt) - { holderCiphertext = *arg.holderEncryptedAmt; - } else - { holderCiphertext = encryptAmount(*arg.account, *arg.amt, blindingFactor); - } jv[sfHolderEncryptedAmount.jsonName] = strHex(holderCiphertext); // Handle Issuer if (arg.issuerEncryptedAmt) - { issuerCiphertext = *arg.issuerEncryptedAmt; - } else - { issuerCiphertext = encryptAmount(issuer_, *arg.amt, blindingFactor); - } jv[sfIssuerEncryptedAmount.jsonName] = strHex(issuerCiphertext); // Handle Auditor if (arg.auditorEncryptedAmt) - { auditorCiphertext = *arg.auditorEncryptedAmt; - } else if (auditor_.has_value() && *arg.fillAuditorEncryptedAmt) - { auditorCiphertext = encryptAmount(*auditor_, *arg.amt, blindingFactor); - } // Update auditor JSON only if ciphertext exists if (auditorCiphertext) @@ -1104,19 +1047,13 @@ MPTTester::convert(MPTConvert const& arg) { Json::Value jv; if (arg.account) - { jv[sfAccount] = arg.account->human(); - } else - { Throw("Account not specified"); - } jv[jss::TransactionType] = jss::ConfidentialMPTConvert; if (arg.id) - { jv[sfMPTokenIssuanceID] = to_string(*arg.id); - } else { if (!id_) @@ -1139,9 +1076,7 @@ MPTTester::convert(MPTConvert const& arg) jv[sfBlindingFactor.jsonName] = strHex(blindingFactor); if (arg.proof) - { jv[sfZKProof.jsonName] = *arg.proof; - } else if (arg.fillSchnorrProof.value_or(arg.holderPubKey.has_value())) { // whether to automatically generate and attach a Schnorr proof: @@ -1153,13 +1088,9 @@ MPTTester::convert(MPTConvert const& arg) auto const proof = getSchnorrProof(*arg.account, contextHash); if (proof) - { jv[sfZKProof.jsonName] = strHex(*proof); - } else - { jv[sfZKProof.jsonName] = strHex(makeZeroBuffer(ecSchnorrProofLength)); - } } auto const holderAmt = getBalance(*arg.account); @@ -1235,11 +1166,9 @@ MPTTester::convert(MPTConvert const& arg) { auto const holderPubKey = getPubKey(*arg.account); if (!holderPubKey) - { Throw( "MPTTester::convert: holder's pubkey is " "not set"); - } return strHex((*sle)[sfHolderEncryptionKey]) == strHex(*holderPubKey); } @@ -1256,19 +1185,13 @@ MPTTester::convertJV(MPTConvert const& arg, std::uint32_t seq) { Json::Value jv; if (arg.account) - { jv[sfAccount] = arg.account->human(); - } else - { Throw("Account not specified"); - } jv[jss::TransactionType] = jss::ConfidentialMPTConvert; if (arg.id) - { jv[sfMPTokenIssuanceID] = to_string(*arg.id); - } else { if (!id_) @@ -1292,21 +1215,15 @@ MPTTester::convertJV(MPTConvert const& arg, std::uint32_t seq) jv[sfBlindingFactor.jsonName] = strHex(blindingFactor); if (arg.proof) - { jv[sfZKProof.jsonName] = *arg.proof; - } else if (arg.fillSchnorrProof.value_or(arg.holderPubKey.has_value())) { auto const contextHash = getConvertContextHash(arg.account->id(), *id_, seq); auto const proof = getSchnorrProof(*arg.account, contextHash); if (proof) - { jv[sfZKProof.jsonName] = strHex(*proof); - } else - { jv[sfZKProof.jsonName] = strHex(makeZeroBuffer(ecSchnorrProofLength)); - } } return jv; @@ -1319,30 +1236,20 @@ MPTTester::send(MPTConfidentialSend const& arg) jv[jss::TransactionType] = jss::ConfidentialMPTSend; if (arg.account) - { jv[sfAccount] = arg.account->human(); - } else - { Throw("Account not specified"); - } if (arg.dest) - { jv[sfDestination] = arg.dest->human(); - } else - { Throw("Destination not specified"); - } if (!arg.amt) Throw("Amount not specified for testing purposes"); if (arg.id) - { jv[sfMPTokenIssuanceID] = to_string(*arg.id); - } else { if (!id_) @@ -1365,13 +1272,9 @@ MPTTester::send(MPTConfidentialSend const& arg) std::optional auditorAmt; if (arg.auditorEncryptedAmt) - { auditorAmt = arg.auditorEncryptedAmt; - } else if (auditor_.has_value() && *arg.fillAuditorEncryptedAmt) - { auditorAmt = encryptAmount(*auditor_, *arg.amt, blindingFactor); - } jv[sfSenderEncryptedAmount] = strHex(senderAmt); jv[sfDestinationEncryptedAmount] = strHex(destAmt); @@ -1426,33 +1329,23 @@ MPTTester::send(MPTConfidentialSend const& arg) // for each would cause proof verification to fail. Buffer amountCommitment, balanceCommitment; if (arg.amountCommitment) - { amountCommitment = *arg.amountCommitment; - } else - { amountCommitment = getPedersenCommitment(*arg.amt, blindingFactor); - } jv[sfAmountCommitment] = strHex(amountCommitment); auto const balanceBlindingFactor = generateBlindingFactor(); if (arg.balanceCommitment) - { balanceCommitment = *arg.balanceCommitment; - } else - { balanceCommitment = getPedersenCommitment(*prevSenderSpending, balanceBlindingFactor); - } jv[sfBalanceCommitment] = strHex(balanceCommitment); // Fill in the proof if not provided if (arg.proof) - { jv[sfZKProof] = *arg.proof; - } else { auto const version = getMPTokenVersion(*arg.account); @@ -1503,20 +1396,15 @@ MPTTester::send(MPTConfidentialSend const& arg) recipients, blindingFactor, ctxHash, - {.pedersenCommitment = amountCommitment, - .amt = *arg.amt, - .encryptedAmt = senderAmt, - .blindingFactor = blindingFactor}, - {.pedersenCommitment = balanceCommitment, - .amt = *prevSenderSpending, - .encryptedAmt = *prevEncryptedSenderSpending, - .blindingFactor = balanceBlindingFactor}); + {amountCommitment, *arg.amt, senderAmt, blindingFactor}, + {balanceCommitment, + *prevSenderSpending, + *prevEncryptedSenderSpending, + balanceBlindingFactor}); } if (proof) - { jv[sfZKProof.jsonName] = strHex(*proof); - } else { jv[sfZKProof.jsonName] = strHex(makeZeroBuffer(ecSendProofLength)); @@ -1624,30 +1512,20 @@ MPTTester::sendJV( jv[jss::TransactionType] = jss::ConfidentialMPTSend; if (arg.account) - { jv[sfAccount] = arg.account->human(); - } else - { Throw("Account not specified"); - } if (arg.dest) - { jv[sfDestination] = arg.dest->human(); - } else - { Throw("Destination not specified"); - } if (!arg.amt) Throw("Amount not specified for testing purposes"); if (arg.id) - { jv[sfMPTokenIssuanceID] = to_string(*arg.id); - } else { if (!id_) @@ -1669,13 +1547,9 @@ MPTTester::sendJV( std::optional auditorAmt; if (arg.auditorEncryptedAmt) - { auditorAmt = arg.auditorEncryptedAmt; - } else if (auditor_.has_value() && *arg.fillAuditorEncryptedAmt) - { auditorAmt = encryptAmount(*auditor_, *arg.amt, blindingFactor); - } jv[sfSenderEncryptedAmount] = strHex(senderAmt); jv[sfDestinationEncryptedAmount] = strHex(destAmt); @@ -1713,32 +1587,22 @@ MPTTester::sendJV( // encryption blinding factor. Buffer amountCommitment, balanceCommitment; if (arg.amountCommitment) - { amountCommitment = *arg.amountCommitment; - } else - { amountCommitment = getPedersenCommitment(*arg.amt, blindingFactor); - } jv[sfAmountCommitment] = strHex(amountCommitment); auto const balanceBlindingFactor = generateBlindingFactor(); if (arg.balanceCommitment) - { balanceCommitment = *arg.balanceCommitment; - } else - { balanceCommitment = getPedersenCommitment(prevSenderSpending, balanceBlindingFactor); - } jv[sfBalanceCommitment] = strHex(balanceCommitment); if (arg.proof) - { jv[sfZKProof.jsonName] = *arg.proof; - } else { auto const ctxHash = @@ -1778,24 +1642,17 @@ MPTTester::sendJV( recipients, blindingFactor, ctxHash, - {.pedersenCommitment = amountCommitment, - .amt = *arg.amt, - .encryptedAmt = senderAmt, - .blindingFactor = blindingFactor}, - {.pedersenCommitment = balanceCommitment, - .amt = prevSenderSpending, - .encryptedAmt = *prevEncryptedSenderSpending, - .blindingFactor = balanceBlindingFactor}); + {amountCommitment, *arg.amt, senderAmt, blindingFactor}, + {balanceCommitment, + prevSenderSpending, + *prevEncryptedSenderSpending, + balanceBlindingFactor}); } if (proof) - { jv[sfZKProof.jsonName] = strHex(*proof); - } else - { jv[sfZKProof.jsonName] = strHex(makeZeroBuffer(ecSendProofLength)); - } } return jv; @@ -1859,35 +1716,23 @@ MPTTester::confidentialClaw(MPTConfidentialClawback const& arg) jv[sfAccount] = account.human(); if (arg.holder) - { jv[sfHolder] = arg.holder->human(); - } else - { Throw("Holder not specified"); - } jv[jss::TransactionType] = jss::ConfidentialMPTClawback; if (arg.id) - { jv[sfMPTokenIssuanceID] = to_string(*arg.id); - } else if (id_) - { jv[sfMPTokenIssuanceID] = to_string(*id_); - } else - { Throw("MPT has not been created"); - } if (arg.amt) jv[sfMPTAmount] = std::to_string(*arg.amt); if (arg.proof) - { jv[sfZKProof] = *arg.proof; - } else { auto const seq = arg.ticketSeq ? *arg.ticketSeq : env_.seq(account); @@ -1900,13 +1745,9 @@ MPTTester::confidentialClaw(MPTConfidentialClawback const& arg) auto const proof = getClawbackProof(*arg.holder, *arg.amt, *privKey, contextHash); if (proof) - { jv[sfZKProof] = strHex(*proof); - } else - { jv[sfZKProof] = strHex(makeZeroBuffer(ecClawbackProofLength)); - } } auto const holderPubAmt = getBalance(*arg.holder); @@ -1953,7 +1794,7 @@ MPTTester::generateKeyPair(Account const& account) { unsigned char privKey[ecPrivKeyLength]; secp256k1_pubkey pubKey; - if (secp256k1_elgamal_generate_keypair(secp256k1Context(), privKey, &pubKey) == 0) + if (!secp256k1_elgamal_generate_keypair(secp256k1Context(), privKey, &pubKey)) Throw("failed to generate key pair"); // Serialize public key to compressed format (33 bytes) @@ -1962,7 +1803,9 @@ MPTTester::generateKeyPair(Account const& account) if (secp256k1_ec_pubkey_serialize( secp256k1Context(), compressedPubKey, &outLen, &pubKey, SECP256K1_EC_COMPRESSED) != 1 || outLen != ecPubKeyLength) + { Throw("failed to serialize public key"); + } pubKeys.insert({account.id(), Buffer{compressedPubKey, ecPubKeyLength}}); privKeys.insert({account.id(), Buffer{privKey, ecPrivKeyLength}}); @@ -2016,9 +1859,11 @@ MPTTester::decryptAmount(Account const& account, Buffer const& amt) const return std::nullopt; uint64_t decryptedAmt = 0; - if (secp256k1_elgamal_decrypt( - secp256k1Context(), &decryptedAmt, &pair->c1, &pair->c2, privKey->data()) == 0) + if (!secp256k1_elgamal_decrypt( + secp256k1Context(), &decryptedAmt, &pair->c1, &pair->c2, privKey->data())) + { return std::nullopt; + } return decryptedAmt; } @@ -2036,9 +1881,7 @@ MPTTester::getDecryptedBalance(Account const& account, EncryptedBalanceType bala Account decryptor = account; if (balanceType == ISSUER_ENCRYPTED_BALANCE) - { decryptor = issuer_; - } else if (balanceType == AUDITOR_ENCRYPTED_BALANCE) { if (!auditor_) @@ -2054,18 +1897,11 @@ MPTTester::mergeInboxJV(MPTMergeInbox const& arg) const { Json::Value jv; if (arg.account) - { jv[sfAccount] = arg.account->human(); - } else - { Throw("Account not specified"); - } - if (arg.id) - { jv[sfMPTokenIssuanceID] = to_string(*arg.id); - } else { if (!id_) @@ -2081,18 +1917,11 @@ MPTTester::mergeInbox(MPTMergeInbox const& arg) { Json::Value jv; if (arg.account) - { jv[sfAccount] = arg.account->human(); - } else - { Throw("Account not specified"); - } - if (arg.id) - { jv[sfMPTokenIssuanceID] = to_string(*arg.id); - } else { if (!id_) @@ -2167,19 +1996,13 @@ MPTTester::convertBack(MPTConvertBack const& arg) { Json::Value jv; if (arg.account) - { jv[sfAccount] = arg.account->human(); - } else - { Throw("Account not specified"); - } jv[jss::TransactionType] = jss::ConfidentialMPTConvertBack; if (arg.id) - { jv[sfMPTokenIssuanceID] = to_string(*arg.id); - } else { if (!id_) @@ -2210,20 +2033,14 @@ MPTTester::convertBack(MPTConvertBack const& arg) Buffer pedersenCommitment; Buffer const pcBlindingFactor = generateBlindingFactor(); if (arg.pedersenCommitment) - { pedersenCommitment = *arg.pedersenCommitment; - } else - { pedersenCommitment = getPedersenCommitment(*prevSpendingBalance, pcBlindingFactor); - } jv[sfBalanceCommitment] = strHex(pedersenCommitment); if (arg.proof) - { jv[sfZKProof.jsonName] = strHex(*arg.proof); - } else { auto const version = getMPTokenVersion(*arg.account); @@ -2239,9 +2056,7 @@ MPTTester::convertBack(MPTConvertBack const& arg) // generate a dummy proof if no encrypted amount field, so that other // preflight/preclaim are checked if (!prevEncryptedSpendingBalance) - { proof = makeZeroBuffer(ecConvertBackProofLength); - } else { proof = getConvertBackProof( @@ -2322,19 +2137,13 @@ MPTTester::convertBackJV(MPTConvertBack const& arg, std::uint32_t seq) { Json::Value jv; if (arg.account) - { jv[sfAccount] = arg.account->human(); - } else - { Throw("Account not specified"); - } jv[jss::TransactionType] = jss::ConfidentialMPTConvertBack; if (arg.id) - { jv[sfMPTokenIssuanceID] = to_string(*arg.id); - } else { if (!id_) @@ -2362,20 +2171,14 @@ MPTTester::convertBackJV(MPTConvertBack const& arg, std::uint32_t seq) Buffer pedersenCommitment; Buffer const pcBlindingFactor = generateBlindingFactor(); if (arg.pedersenCommitment) - { pedersenCommitment = *arg.pedersenCommitment; - } else - { pedersenCommitment = getPedersenCommitment(*prevSpendingBalance, pcBlindingFactor); - } jv[sfBalanceCommitment] = strHex(pedersenCommitment); if (arg.proof) - { jv[sfZKProof.jsonName] = strHex(*arg.proof); - } else { auto const version = getMPTokenVersion(*arg.account); @@ -2384,11 +2187,8 @@ MPTTester::convertBackJV(MPTConvertBack const& arg, std::uint32_t seq) Buffer proof; if (!prevEncSpending) - { proof = makeZeroBuffer(ecConvertBackProofLength); - } else - { proof = getConvertBackProof( *arg.account, *arg.amt, @@ -2399,7 +2199,6 @@ MPTTester::convertBackJV(MPTConvertBack const& arg, std::uint32_t seq) .encryptedAmt = *prevEncSpending, .blindingFactor = pcBlindingFactor, }); - } jv[sfZKProof] = strHex(proof); } @@ -2407,4 +2206,6 @@ MPTTester::convertBackJV(MPTConvertBack const& arg, std::uint32_t seq) return jv; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/multisign.cpp b/src/test/jtx/impl/multisign.cpp index e21a3621be..8e3c37f68c 100644 --- a/src/test/jtx/impl/multisign.cpp +++ b/src/test/jtx/impl/multisign.cpp @@ -1,31 +1,15 @@ #include - -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include #include -#include -#include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { Json::Value signers(Account const& account, std::uint32_t quorum, std::vector const& v) @@ -109,4 +93,6 @@ msig::operator()(Env& env, JTx& jt) const } } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/offer.cpp b/src/test/jtx/impl/offer.cpp index abb777484a..5a2264601a 100644 --- a/src/test/jtx/impl/offer.cpp +++ b/src/test/jtx/impl/offer.cpp @@ -1,14 +1,10 @@ #include -#include - -#include -#include #include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { Json::Value offer( @@ -37,4 +33,6 @@ offer_cancel(Account const& account, std::uint32_t offerSeq) return jv; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/owners.cpp b/src/test/jtx/impl/owners.cpp index fde456f3ab..855c5b04ff 100644 --- a/src/test/jtx/impl/owners.cpp +++ b/src/test/jtx/impl/owners.cpp @@ -1,16 +1,6 @@ #include -#include - -#include -#include #include -#include -#include -#include - -#include -#include namespace xrpl { namespace detail { @@ -38,7 +28,8 @@ owned_count_helper( } // namespace detail -namespace test::jtx { +namespace test { +namespace jtx { void owners::operator()(Env& env) const @@ -46,6 +37,6 @@ owners::operator()(Env& env) const env.test.expect(env.le(account_)->getFieldU32(sfOwnerCount) == value_); } -} // namespace test::jtx - +} // namespace jtx +} // namespace test } // namespace xrpl diff --git a/src/test/jtx/impl/paths.cpp b/src/test/jtx/impl/paths.cpp index f508d0d3b6..718aca6979 100644 --- a/src/test/jtx/impl/paths.cpp +++ b/src/test/jtx/impl/paths.cpp @@ -1,26 +1,14 @@ #include -#include -#include -#include - -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void paths::operator()(Env& env, JTx& jt) const @@ -116,4 +104,6 @@ path::operator()(Env& env, JTx& jt) const jt.jv["Paths"].append(jv_); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/pay.cpp b/src/test/jtx/impl/pay.cpp index 34b6b13d86..9e927c6270 100644 --- a/src/test/jtx/impl/pay.cpp +++ b/src/test/jtx/impl/pay.cpp @@ -1,14 +1,11 @@ #include -#include -#include - -#include -#include #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { Json::Value pay(AccountID const& account, AccountID const& to, AnyAmount amount) @@ -28,4 +25,6 @@ pay(Account const& account, Account const& to, AnyAmount amount) return pay(account.id(), to.id(), amount); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/permissioned_dex.cpp b/src/test/jtx/impl/permissioned_dex.cpp index 012932fed5..494ea897d4 100644 --- a/src/test/jtx/impl/permissioned_dex.cpp +++ b/src/test/jtx/impl/permissioned_dex.cpp @@ -1,19 +1,13 @@ +#include -#include +#include +#include -#include -#include -#include -#include -#include -#include +#include -#include - -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { uint256 setupDomain( @@ -67,4 +61,6 @@ PermissionedDEX::PermissionedDEX(Env& env) } } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/permissioned_domains.cpp b/src/test/jtx/impl/permissioned_domains.cpp index ff3146e67a..60d653e956 100644 --- a/src/test/jtx/impl/permissioned_domains.cpp +++ b/src/test/jtx/impl/permissioned_domains.cpp @@ -1,28 +1,9 @@ -#include +#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test::jtx::pdomain { +namespace xrpl { +namespace test { +namespace jtx { +namespace pdomain { // helpers // Make json for PermissionedDomainSet transaction @@ -168,4 +149,7 @@ getNewDomain(std::shared_ptr const& meta) return ret; } -} // namespace xrpl::test::jtx::pdomain +} // namespace pdomain +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/quality2.cpp b/src/test/jtx/impl/quality2.cpp index 32aca1b1cd..9da366d4c2 100644 --- a/src/test/jtx/impl/quality2.cpp +++ b/src/test/jtx/impl/quality2.cpp @@ -1,14 +1,11 @@ -#include -#include #include #include #include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { qualityInPercent::qualityInPercent(double percent) // NOLINTNEXTLINE(cppcoreguidelines-use-default-member-init) @@ -54,4 +51,6 @@ qualityOutPercent::operator()(Env&, JTx& jt) const insertQualityIntoJtx(sfQualityOut, qOut_, jt); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/rate.cpp b/src/test/jtx/impl/rate.cpp index dab02b33c4..b4e9b2cb60 100644 --- a/src/test/jtx/impl/rate.cpp +++ b/src/test/jtx/impl/rate.cpp @@ -1,15 +1,13 @@ #include -#include - #include -#include #include -#include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { Json::Value rate(Account const& account, double multiplier) @@ -23,4 +21,6 @@ rate(Account const& account, double multiplier) return jv; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/regkey.cpp b/src/test/jtx/impl/regkey.cpp index 2f4c1bccdd..a2e2198eee 100644 --- a/src/test/jtx/impl/regkey.cpp +++ b/src/test/jtx/impl/regkey.cpp @@ -1,13 +1,10 @@ #include -#include -#include - -#include -#include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { Json::Value regkey(Account const& account, disabled_t) @@ -28,4 +25,6 @@ regkey(Account const& account, Account const& signer) return jv; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/sendmax.cpp b/src/test/jtx/impl/sendmax.cpp index c33cab79fa..f117458cfa 100644 --- a/src/test/jtx/impl/sendmax.cpp +++ b/src/test/jtx/impl/sendmax.cpp @@ -1,11 +1,10 @@ #include -#include -#include - #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void sendmax::operator()(Env& env, JTx& jt) const @@ -13,4 +12,6 @@ sendmax::operator()(Env& env, JTx& jt) const jt.jv[jss::SendMax] = amount_.getJson(JsonOptions::none); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/seq.cpp b/src/test/jtx/impl/seq.cpp index cab970974b..99c6ddbf0d 100644 --- a/src/test/jtx/impl/seq.cpp +++ b/src/test/jtx/impl/seq.cpp @@ -1,11 +1,10 @@ #include -#include -#include - #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void seq::operator()(Env&, JTx& jt) const @@ -17,4 +16,6 @@ seq::operator()(Env&, JTx& jt) const jt[jss::Sequence] = *num_; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/sig.cpp b/src/test/jtx/impl/sig.cpp index fe246f8f90..1bdadc0bd3 100644 --- a/src/test/jtx/impl/sig.cpp +++ b/src/test/jtx/impl/sig.cpp @@ -1,10 +1,9 @@ #include - -#include -#include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void sig::operator()(Env&, JTx& jt) const @@ -34,4 +33,6 @@ sig::operator()(Env&, JTx& jt) const } } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/tag.cpp b/src/test/jtx/impl/tag.cpp index 9c1dab724c..8321322f75 100644 --- a/src/test/jtx/impl/tag.cpp +++ b/src/test/jtx/impl/tag.cpp @@ -1,9 +1,8 @@ #include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void dtag::operator()(Env&, JTx& jt) const @@ -17,4 +16,6 @@ stag::operator()(Env&, JTx& jt) const jt.jv["SourceTag"] = value_; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/ticket.cpp b/src/test/jtx/impl/ticket.cpp index f0975e6151..2cb1826bbb 100644 --- a/src/test/jtx/impl/ticket.cpp +++ b/src/test/jtx/impl/ticket.cpp @@ -1,16 +1,12 @@ #include -#include -#include -#include - -#include -#include #include -#include +namespace xrpl { +namespace test { +namespace jtx { -namespace xrpl::test::jtx::ticket { +namespace ticket { Json::Value create(Account const& account, std::uint32_t count) @@ -30,4 +26,8 @@ use::operator()(Env&, JTx& jt) const jt[sfTicketSequence.jsonName] = ticketSeq_; } -} // namespace xrpl::test::jtx::ticket +} // namespace ticket + +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/token.cpp b/src/test/jtx/impl/token.cpp index c3779c3c56..9db79361eb 100644 --- a/src/test/jtx/impl/token.cpp +++ b/src/test/jtx/impl/token.cpp @@ -1,23 +1,14 @@ +#include #include -#include -#include -#include -#include - -#include -#include #include -#include #include -#include #include -#include -#include -#include - -namespace xrpl::test::jtx::token { +namespace xrpl { +namespace test { +namespace jtx { +namespace token { Json::Value mint(jtx::Account const& account, std::uint32_t nfTokenTaxon) @@ -219,4 +210,7 @@ modify(jtx::Account const& account, uint256 const& nftokenID) return jv; } -} // namespace xrpl::test::jtx::token +} // namespace token +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/trust.cpp b/src/test/jtx/impl/trust.cpp index 5450e0892d..08cd4ef94c 100644 --- a/src/test/jtx/impl/trust.cpp +++ b/src/test/jtx/impl/trust.cpp @@ -1,18 +1,13 @@ #include -#include - #include -#include -#include -#include #include -#include -#include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { Json::Value trust(Account const& account, STAmount const& amount, std::uint32_t flags) @@ -61,4 +56,6 @@ claw(Account const& account, STAmount const& amount, std::optional cons return jv; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/txflags.cpp b/src/test/jtx/impl/txflags.cpp index 686be767fe..7b49f9380b 100644 --- a/src/test/jtx/impl/txflags.cpp +++ b/src/test/jtx/impl/txflags.cpp @@ -1,11 +1,10 @@ #include -#include -#include - #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { void txflags::operator()(Env&, JTx& jt) const @@ -13,4 +12,6 @@ txflags::operator()(Env&, JTx& jt) const jt[jss::Flags] = v_ /*| tfFullyCanonicalSig*/; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/utility.cpp b/src/test/jtx/impl/utility.cpp index 4bb6c83b88..7332358031 100644 --- a/src/test/jtx/impl/utility.cpp +++ b/src/test/jtx/impl/utility.cpp @@ -1,30 +1,18 @@ #include -#include - #include #include -#include -#include -#include -#include -#include #include #include #include -#include -#include #include -#include -#include -#include +#include #include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { STObject parse(Json::Value const& jv) @@ -101,4 +89,6 @@ cmdToJSONRPC(std::vector const& args, beast::Journal j, unsigned in return jv; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/vault.cpp b/src/test/jtx/impl/vault.cpp index 5f4b488092..49c0dddaec 100644 --- a/src/test/jtx/impl/vault.cpp +++ b/src/test/jtx/impl/vault.cpp @@ -1,20 +1,15 @@ +#include #include -#include - -#include #include -#include -#include -#include -#include -#include +#include #include #include -#include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { std::tuple Vault::create(CreateArgs const& args) const @@ -84,4 +79,6 @@ Vault::clawback(ClawbackArgs const& args) return jv; } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/impl/xchain_bridge.cpp b/src/test/jtx/impl/xchain_bridge.cpp index 2cf1c305a7..0e5a2c56d0 100644 --- a/src/test/jtx/impl/xchain_bridge.cpp +++ b/src/test/jtx/impl/xchain_bridge.cpp @@ -1,31 +1,20 @@ +#include +#include #include -#include -#include -#include -#include -#include - -#include #include -#include -#include #include -#include #include -#include #include #include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { // use this for creating a bridge for a transaction Json::Value @@ -479,4 +468,6 @@ XChainBridgeObjects::createBridgeObjects(Env& mcEnv, Env& scEnv) createMcBridgeObjects(mcEnv); createScBridgeObjects(scEnv); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/invoice_id.h b/src/test/jtx/invoice_id.h index 9366cc9bf5..fd1b7ae45b 100644 --- a/src/test/jtx/invoice_id.h +++ b/src/test/jtx/invoice_id.h @@ -2,7 +2,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { struct invoice_id { @@ -17,4 +19,6 @@ public: void operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/jtx_json.h b/src/test/jtx/jtx_json.h index 0bd7c2ff94..c7f52fe283 100644 --- a/src/test/jtx/jtx_json.h +++ b/src/test/jtx/jtx_json.h @@ -4,7 +4,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Inject raw JSON. */ class json @@ -35,4 +37,6 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/last_ledger_sequence.h b/src/test/jtx/last_ledger_sequence.h index 9015c87f02..540d6ff384 100644 --- a/src/test/jtx/last_ledger_sequence.h +++ b/src/test/jtx/last_ledger_sequence.h @@ -2,7 +2,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { struct last_ledger_seq { @@ -18,4 +20,6 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/ledgerStateFix.h b/src/test/jtx/ledgerStateFix.h index 8735882d15..7adc863cb4 100644 --- a/src/test/jtx/ledgerStateFix.h +++ b/src/test/jtx/ledgerStateFix.h @@ -3,11 +3,20 @@ #include #include +namespace xrpl { +namespace test { +namespace jtx { + /** LedgerStateFix operations. */ -namespace xrpl::test::jtx::ledgerStateFix { +namespace ledgerStateFix { /** Repair the links in an NFToken directory. */ Json::Value nftPageLinks(jtx::Account const& acct, jtx::Account const& owner); -} // namespace xrpl::test::jtx::ledgerStateFix +} // namespace ledgerStateFix + +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/memo.h b/src/test/jtx/memo.h index 8cb41b3f1c..2371490b30 100644 --- a/src/test/jtx/memo.h +++ b/src/test/jtx/memo.h @@ -2,9 +2,9 @@ #include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Add a memo to a JTx. @@ -19,8 +19,8 @@ private: std::string type_; public: - memo(std::string data, std::string format, std::string type) - : data_(std::move(data)), format_(std::move(format)), type_(std::move(type)) + memo(std::string const& data, std::string const& format, std::string const& type) + : data_(data), format_(format), type_(type) { } @@ -34,7 +34,7 @@ private: std::string s_; public: - memo_data(std::string s) : s_(std::move(s)) + memo_data(std::string const& s) : s_(s) { } @@ -48,7 +48,7 @@ private: std::string s_; public: - memo_format(std::string s) : s_(std::move(s)) + memo_format(std::string const& s) : s_(s) { } @@ -62,7 +62,7 @@ private: std::string s_; public: - memo_type(std::string s) : s_(std::move(s)) + memo_type(std::string const& s) : s_(s) { } @@ -70,4 +70,6 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/mpt.h b/src/test/jtx/mpt.h index 17bdfad1aa..c35ca4b44a 100644 --- a/src/test/jtx/mpt.h +++ b/src/test/jtx/mpt.h @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -13,7 +12,11 @@ #include #include -namespace xrpl::test::jtx { +#include + +namespace xrpl { +namespace test { +namespace jtx { class MPTTester; @@ -115,7 +118,7 @@ struct MPTCreate struct MPTInit { - Holders holders = {}; // NOLINT(readability-redundant-member-init) + Holders holders = {}; std::optional auditor = std::nullopt; PrettyAmount const xrp = XRP(10'000); PrettyAmount const xrpHolders = XRP(10'000); @@ -130,7 +133,7 @@ struct MPTInitDef { Env& env; Account issuer; - Holders holders = {}; // NOLINT(readability-redundant-member-init) + Holders holders = {}; std::optional auditor = std::nullopt; std::uint16_t transferFee = 0; std::optional pay = std::nullopt; @@ -354,11 +357,11 @@ public: AUDITOR_ENCRYPTED_BALANCE, }; - MPTTester(Env& env, Account issuer, MPTInit const& constr = {}); + MPTTester(Env& env, Account const& issuer, MPTInit const& constr = {}); MPTTester(MPTInitDef const& constr); MPTTester( Env& env, - Account issuer, + Account const& issuer, MPTID const& id, std::vector const& holders = {}, bool close = true); @@ -580,7 +583,7 @@ public: std::uint32_t getMPTokenVersion(Account const account) const; - static Buffer + Buffer getPedersenCommitment(std::uint64_t const amount, Buffer const& pedersenBlindingFactor); friend BookSpec @@ -616,31 +619,20 @@ private: dstTag = arg.destinationTag; if (ticketSeq && delegateAcct) - { env_( jv, expectedFlags, expectedTer, ticket::use(*ticketSeq), delegate::as(*delegateAcct)); - } else if (ticketSeq) - { env_(jv, expectedFlags, expectedTer, ticket::use(*ticketSeq)); - } else if (delegateAcct) - { env_(jv, expectedFlags, expectedTer, delegate::as(*delegateAcct)); - } else if (dstTag) - { env_(jv, expectedFlags, expectedTer, dtag(*dstTag)); - } else - { env_(jv, expectedFlags, expectedTer); - } - auto const err = env_.ter(); if (close_) env_.close(); @@ -671,4 +663,6 @@ private: Buffer& blindingFactor) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/multisign.h b/src/test/jtx/multisign.h index 5b6a18b527..b3f38cc453 100644 --- a/src/test/jtx/multisign.h +++ b/src/test/jtx/multisign.h @@ -10,7 +10,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** A signer in a SignerList */ struct signer @@ -98,4 +100,6 @@ public: /** The number of signer lists matches. */ using siglists = owner_count; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/noop.h b/src/test/jtx/noop.h index 29c6188386..47d12fb9af 100644 --- a/src/test/jtx/noop.h +++ b/src/test/jtx/noop.h @@ -2,7 +2,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** The null transaction. */ inline Json::Value @@ -11,4 +13,6 @@ noop(Account const& account) return fset(account, 0); } -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/offer.h b/src/test/jtx/offer.h index 5f81db751f..0fad9ec6dc 100644 --- a/src/test/jtx/offer.h +++ b/src/test/jtx/offer.h @@ -5,7 +5,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Create an offer. */ Json::Value @@ -19,4 +21,6 @@ offer( Json::Value offer_cancel(Account const& account, std::uint32_t offerSeq); -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/owners.h b/src/test/jtx/owners.h index 572b63757c..b24f0a686f 100644 --- a/src/test/jtx/owners.h +++ b/src/test/jtx/owners.h @@ -7,7 +7,6 @@ #include #include -#include namespace xrpl { @@ -25,7 +24,8 @@ owned_count_helper( } // namespace detail -namespace test::jtx { +namespace test { +namespace jtx { // Helper for aliases template @@ -36,7 +36,7 @@ private: std::uint32_t value_; public: - owner_count(Account account, std::uint32_t value) : account_(std::move(account)), value_(value) + owner_count(Account const& account, std::uint32_t value) : account_(account), value_(value) { } @@ -55,7 +55,7 @@ private: std::uint32_t value_; public: - owners(Account account, std::uint32_t value) : account_(std::move(account)), value_(value) + owners(Account const& account, std::uint32_t value) : account_(account), value_(value) { } @@ -72,6 +72,6 @@ using offers = owner_count; /** Match the number of MPToken in the account's owner directory */ using mptokens = owner_count; -} // namespace test::jtx - +} // namespace jtx +} // namespace test } // namespace xrpl diff --git a/src/test/jtx/paths.h b/src/test/jtx/paths.h index f63faa6292..8558b6232b 100644 --- a/src/test/jtx/paths.h +++ b/src/test/jtx/paths.h @@ -8,8 +8,8 @@ namespace xrpl { class STPath; - -namespace test::jtx { +namespace test { +namespace jtx { /** Set Paths, SendMax on a JTx. */ class paths @@ -62,7 +62,7 @@ private: append_one(AccountID const& account); template - std::enable_if_t> + std::enable_if_t::value> append_one(T const& t) { append_one(Account{t}); @@ -94,6 +94,6 @@ path::append(T const& t, Args const&... args) append(args...); } -} // namespace test::jtx - +} // namespace jtx +} // namespace test } // namespace xrpl diff --git a/src/test/jtx/pay.h b/src/test/jtx/pay.h index 093920a970..a155d7bdc8 100644 --- a/src/test/jtx/pay.h +++ b/src/test/jtx/pay.h @@ -5,7 +5,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Create a payment. */ Json::Value @@ -13,4 +15,6 @@ pay(AccountID const& account, AccountID const& to, AnyAmount amount); Json::Value pay(Account const& account, Account const& to, AnyAmount amount); -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/permissioned_dex.h b/src/test/jtx/permissioned_dex.h index 025097116f..2023342ded 100644 --- a/src/test/jtx/permissioned_dex.h +++ b/src/test/jtx/permissioned_dex.h @@ -3,7 +3,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { uint256 setupDomain( @@ -27,4 +29,6 @@ public: PermissionedDEX(Env& env); }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/permissioned_domains.h b/src/test/jtx/permissioned_domains.h index a582b001b1..bf67722c9c 100644 --- a/src/test/jtx/permissioned_domains.h +++ b/src/test/jtx/permissioned_domains.h @@ -4,7 +4,10 @@ #include #include -namespace xrpl::test::jtx::pdomain { +namespace xrpl { +namespace test { +namespace jtx { +namespace pdomain { // Helpers for PermissionedDomains testing using Credential = xrpl::test::jtx::deposit::AuthorizeCredentials; @@ -44,4 +47,7 @@ sortCredentials(Credentials const& input); uint256 getNewDomain(std::shared_ptr const& meta); -} // namespace xrpl::test::jtx::pdomain +} // namespace pdomain +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/prop.h b/src/test/jtx/prop.h index 5651ac58ce..b1f8cb5ffc 100644 --- a/src/test/jtx/prop.h +++ b/src/test/jtx/prop.h @@ -4,7 +4,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Set a property on a JTx. */ template @@ -24,4 +26,6 @@ struct prop } }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/quality.h b/src/test/jtx/quality.h index adb198038a..2da83eeef5 100644 --- a/src/test/jtx/quality.h +++ b/src/test/jtx/quality.h @@ -2,7 +2,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Sets the literal QualityIn on a trust JTx. */ class qualityIn @@ -60,4 +62,6 @@ public: operator()(Env&, JTx& jtx) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/rate.h b/src/test/jtx/rate.h index 740c2ffd1a..a92bd2364a 100644 --- a/src/test/jtx/rate.h +++ b/src/test/jtx/rate.h @@ -4,10 +4,14 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Set a transfer rate. */ Json::Value rate(Account const& account, double multiplier); -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/regkey.h b/src/test/jtx/regkey.h index 3da055c66f..2c95baacc3 100644 --- a/src/test/jtx/regkey.h +++ b/src/test/jtx/regkey.h @@ -5,7 +5,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Disable the regular key. */ Json::Value @@ -15,4 +17,6 @@ regkey(Account const& account, disabled_t); Json::Value regkey(Account const& account, Account const& signer); -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/require.h b/src/test/jtx/require.h index 20f79ff838..7d712e8ab7 100644 --- a/src/test/jtx/require.h +++ b/src/test/jtx/require.h @@ -20,7 +20,8 @@ require_args(test::jtx::requires_t& vec, Cond const& cond, Args const&... args) } // namespace detail -namespace test::jtx { +namespace test { +namespace jtx { /** Compose many condition functors into one */ template @@ -59,6 +60,6 @@ public: } }; -} // namespace test::jtx - +} // namespace jtx +} // namespace test } // namespace xrpl diff --git a/src/test/jtx/requires.h b/src/test/jtx/requires.h index d41d0cd0b0..2411d040c6 100644 --- a/src/test/jtx/requires.h +++ b/src/test/jtx/requires.h @@ -3,11 +3,15 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { class Env; using require_t = std::function; using requires_t = std::vector; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/rpc.h b/src/test/jtx/rpc.h index be7ab8d456..bbdecf1519 100644 --- a/src/test/jtx/rpc.h +++ b/src/test/jtx/rpc.h @@ -3,9 +3,10 @@ #include #include -#include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Set the expected result code for a JTx The test will fail if the code doesn't match. @@ -21,13 +22,13 @@ private: public: /// If there's an error code, we expect an error message explicit rpc(error_code_i code, std::optional m = {}) - : code_(code), errorMessage_(std::move(m)) + : code_(code), errorMessage_(m) { } /// If there is not a code, we expect an exception message explicit rpc(std::string error, std::optional exceptionMessage = {}) - : error_(error), errorException_(std::move(exceptionMessage)) + : error_(error), errorException_(exceptionMessage) { } @@ -55,4 +56,6 @@ public: } }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/sendmax.h b/src/test/jtx/sendmax.h index e559a87641..8a471be3cd 100644 --- a/src/test/jtx/sendmax.h +++ b/src/test/jtx/sendmax.h @@ -4,9 +4,9 @@ #include -#include - -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Sets the SendMax on a JTx. */ class sendmax @@ -15,7 +15,7 @@ private: STAmount amount_; public: - sendmax(STAmount amount) : amount_(std::move(amount)) + sendmax(STAmount const& amount) : amount_(amount) { } @@ -23,4 +23,6 @@ public: operator()(Env&, JTx& jtx) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/seq.h b/src/test/jtx/seq.h index ea5ccfa259..b861800ac9 100644 --- a/src/test/jtx/seq.h +++ b/src/test/jtx/seq.h @@ -5,7 +5,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Set the sequence number on a JTx. */ struct seq @@ -31,4 +33,6 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/sig.h b/src/test/jtx/sig.h index e23022b4b5..0ed59de50e 100644 --- a/src/test/jtx/sig.h +++ b/src/test/jtx/sig.h @@ -4,7 +4,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Set the regular signature on a JTx. @note For multisign, use msig. @@ -54,4 +56,6 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/tag.h b/src/test/jtx/tag.h index c11dff2550..c8d5723754 100644 --- a/src/test/jtx/tag.h +++ b/src/test/jtx/tag.h @@ -2,7 +2,10 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { + +namespace jtx { /** Set the destination tag on a JTx*/ struct dtag @@ -34,4 +37,7 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/tags.h b/src/test/jtx/tags.h index 9c7a21145d..c8a6170048 100644 --- a/src/test/jtx/tags.h +++ b/src/test/jtx/tags.h @@ -1,31 +1,45 @@ #pragma once -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { + +namespace jtx { struct none_t { - none_t() = default; + none_t() + { + } }; static none_t const none; struct autofill_t { - autofill_t() = default; + autofill_t() + { + } }; static autofill_t const autofill; struct disabled_t { - disabled_t() = default; + disabled_t() + { + } }; static disabled_t const disabled; /** Used for fee() calls that use an owner reserve increment */ struct increment_t { - increment_t() = default; + increment_t() + { + } }; static increment_t const increment; -} // namespace xrpl::test::jtx +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/ter.h b/src/test/jtx/ter.h index ab21bc8e2b..074ba307cb 100644 --- a/src/test/jtx/ter.h +++ b/src/test/jtx/ter.h @@ -4,7 +4,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Set the expected result code for a JTx The test will fail if the code doesn't match. @@ -30,4 +32,6 @@ public: } }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/ticket.h b/src/test/jtx/ticket.h index 7ab3b9c1f9..dca16ac7c6 100644 --- a/src/test/jtx/ticket.h +++ b/src/test/jtx/ticket.h @@ -6,7 +6,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /* This shows how the jtx system may be extended to other @@ -41,4 +43,7 @@ public: /** Match the number of tickets on the account. */ using tickets = owner_count; -} // namespace xrpl::test::jtx +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/token.h b/src/test/jtx/token.h index 28ccd7520b..3f4a3f75a3 100644 --- a/src/test/jtx/token.h +++ b/src/test/jtx/token.h @@ -8,7 +8,11 @@ #include -namespace xrpl::test::jtx::token { +namespace xrpl { +namespace test { +namespace jtx { + +namespace token { /** Mint an NFToken. */ Json::Value @@ -210,4 +214,9 @@ clearMinter(jtx::Account const& account); Json::Value modify(jtx::Account const& account, uint256 const& nftokenID); -} // namespace xrpl::test::jtx::token +} // namespace token + +} // namespace jtx + +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/trust.h b/src/test/jtx/trust.h index f6fb5b388f..afea256382 100644 --- a/src/test/jtx/trust.h +++ b/src/test/jtx/trust.h @@ -5,7 +5,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Modify a trust line. */ Json::Value @@ -21,4 +23,6 @@ claw( STAmount const& amount, std::optional const& mptHolder = std::nullopt); -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/txflags.h b/src/test/jtx/txflags.h index 838f7f5f30..f51c26d035 100644 --- a/src/test/jtx/txflags.h +++ b/src/test/jtx/txflags.h @@ -2,7 +2,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Set the flags on a JTx. */ class txflags @@ -19,4 +21,6 @@ public: operator()(Env&, JTx& jt) const; }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/utility.h b/src/test/jtx/utility.h index b00f5b433e..c9189efc36 100644 --- a/src/test/jtx/utility.h +++ b/src/test/jtx/utility.h @@ -8,7 +8,9 @@ #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { /** Thrown when parse fails. */ struct parse_error : std::logic_error @@ -51,4 +53,6 @@ fill_seq(Json::Value& jv, ReadView const& view); Json::Value cmdToJSONRPC(std::vector const& args, beast::Journal j, unsigned int apiVersion); -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/vault.h b/src/test/jtx/vault.h index bbd8c129cc..748d3341a5 100644 --- a/src/test/jtx/vault.h +++ b/src/test/jtx/vault.h @@ -11,7 +11,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { class Env; @@ -23,8 +25,7 @@ struct Vault { Account owner; Asset asset; - std::optional flags = - std::nullopt; // NOLINT(readability-redundant-member-init) + std::optional flags{}; }; /** Return a VaultCreate transaction and the Vault's expected keylet. */ @@ -74,11 +75,13 @@ struct Vault Account issuer; uint256 id; Account holder; - std::optional amount = std::nullopt; // NOLINT(readability-redundant-member-init) + std::optional amount{}; }; static Json::Value clawback(ClawbackArgs const& args); }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/jtx/xchain_bridge.h b/src/test/jtx/xchain_bridge.h index bb01bf17ba..1270d03ed6 100644 --- a/src/test/jtx/xchain_bridge.h +++ b/src/test/jtx/xchain_bridge.h @@ -8,7 +8,9 @@ #include #include -namespace xrpl::test::jtx { +namespace xrpl { +namespace test { +namespace jtx { using JValueVec = std::vector; @@ -222,11 +224,13 @@ struct XChainBridgeObjects Account const& acc, Json::Value const& bridge = Json::nullValue, STAmount const& _reward = XRP(1), - std::optional const& minAccountCreate = std::nullopt) const + std::optional const& minAccountCreate = std::nullopt) { return bridge_create( acc, bridge == Json::nullValue ? jvb : bridge, _reward, minAccountCreate); } }; -} // namespace xrpl::test::jtx +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/ledger/BookDirs_test.cpp b/src/test/ledger/BookDirs_test.cpp index efd1688c6f..951a53185b 100644 --- a/src/test/ledger/BookDirs_test.cpp +++ b/src/test/ledger/BookDirs_test.cpp @@ -1,21 +1,10 @@ +#include -#include -#include -#include -#include -#include - -#include #include -#include #include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { struct BookDirs_test : public beast::unit_test::suite { @@ -99,4 +88,5 @@ struct BookDirs_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(BookDirs, ledger, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/ledger/Directory_test.cpp b/src/test/ledger/Directory_test.cpp index f14ce2f0d7..518ec2511c 100644 --- a/src/test/ledger/Directory_test.cpp +++ b/src/test/ledger/Directory_test.cpp @@ -1,50 +1,19 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include - -#include #include -#include -#include -#include -#include -#include #include #include #include -#include #include -#include -#include -#include #include -#include #include #include #include -#include -#include #include -#include -#include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { struct Directory_test : public beast::unit_test::suite { @@ -133,7 +102,7 @@ struct Directory_test : public beast::unit_test::suite // Ensure that the entries in the page are sorted auto const& v = p->getFieldV256(sfIndexes); - BEAST_EXPECT(std::ranges::is_sorted(v)); + BEAST_EXPECT(std::is_sorted(v.begin(), v.end())); // Ensure that the page contains the correct orders by // calculating which sequence numbers belong here. @@ -599,4 +568,5 @@ struct Directory_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE_PRIO(Directory, ledger, xrpl, 1); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/ledger/PaymentSandbox_test.cpp b/src/test/ledger/PaymentSandbox_test.cpp index 0dc2cb6e74..f1d648153c 100644 --- a/src/test/ledger/PaymentSandbox_test.cpp +++ b/src/test/ledger/PaymentSandbox_test.cpp @@ -1,34 +1,14 @@ -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class PaymentSandbox_test : public beast::unit_test::suite { @@ -397,4 +377,5 @@ public: BEAST_DEFINE_TESTSUITE(PaymentSandbox, ledger, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/ledger/PendingSaves_test.cpp b/src/test/ledger/PendingSaves_test.cpp index deca50c9be..5e08fc53e4 100644 --- a/src/test/ledger/PendingSaves_test.cpp +++ b/src/test/ledger/PendingSaves_test.cpp @@ -1,7 +1,8 @@ -#include +#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { struct PendingSaves_test : public beast::unit_test::suite { @@ -40,4 +41,5 @@ struct PendingSaves_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(PendingSaves, ledger, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/ledger/SkipList_test.cpp b/src/test/ledger/SkipList_test.cpp index 33f6f505f1..a2695bfce8 100644 --- a/src/test/ledger/SkipList_test.cpp +++ b/src/test/ledger/SkipList_test.cpp @@ -1,17 +1,11 @@ #include -#include - -#include -#include +#include #include #include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class SkipList_test : public beast::unit_test::suite { @@ -80,4 +74,5 @@ class SkipList_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(SkipList, ledger, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/ledger/View_test.cpp b/src/test/ledger/View_test.cpp index cf2e478889..d2d930732e 100644 --- a/src/test/ledger/View_test.cpp +++ b/src/test/ledger/View_test.cpp @@ -1,55 +1,20 @@ +#include +#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include #include #include #include #include -#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include -#include -#include -#include -#include #include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class View_test : public beast::unit_test::suite { @@ -1083,4 +1048,5 @@ class GetAmendments_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(View, ledger, xrpl); BEAST_DEFINE_TESTSUITE(GetAmendments, ledger, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/nodestore/Backend_test.cpp b/src/test/nodestore/Backend_test.cpp index 0bba847c30..101138de88 100644 --- a/src/test/nodestore/Backend_test.cpp +++ b/src/test/nodestore/Backend_test.cpp @@ -1,22 +1,17 @@ #include #include -#include #include -#include +#include #include -#include -#include #include #include -#include #include -#include -#include -#include -namespace xrpl::NodeStore { +namespace xrpl { + +namespace NodeStore { // Tests the Backend interface // @@ -78,8 +73,8 @@ public: Batch copy; fetchCopyOfBatch(*backend, ©, batch); // Canonicalize the source and destination batches - std::ranges::sort(batch, LessThan{}); - std::ranges::sort(copy, LessThan{}); + std::sort(batch.begin(), batch.end(), LessThan{}); + std::sort(copy.begin(), copy.end(), LessThan{}); BEAST_EXPECT(areBatchesEqual(batch, copy)); } } @@ -105,4 +100,5 @@ public: BEAST_DEFINE_TESTSUITE(Backend, nodestore, xrpl); -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/test/nodestore/Basics_test.cpp b/src/test/nodestore/Basics_test.cpp index f31111eed5..c9755d04d7 100644 --- a/src/test/nodestore/Basics_test.cpp +++ b/src/test/nodestore/Basics_test.cpp @@ -1,14 +1,10 @@ #include -#include -#include #include #include -#include -#include - -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { // Tests predictable batches, and NodeObject blob encoding // @@ -70,4 +66,5 @@ public: BEAST_DEFINE_TESTSUITE(NodeStoreBasic, nodestore, xrpl); -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/test/nodestore/Database_test.cpp b/src/test/nodestore/Database_test.cpp index 684347c6cc..43bda9dcae 100644 --- a/src/test/nodestore/Database_test.cpp +++ b/src/test/nodestore/Database_test.cpp @@ -1,32 +1,17 @@ +#include #include -#include #include #include #include -#include - -#include -#include -#include #include -#include -#include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include +namespace xrpl { -namespace xrpl::NodeStore { +namespace NodeStore { class Database_test : public TestBase { @@ -571,8 +556,8 @@ public: } // Canonicalize the source and destination batches - std::ranges::sort(batch, LessThan{}); - std::ranges::sort(copy, LessThan{}); + std::sort(batch.begin(), batch.end(), LessThan{}); + std::sort(copy.begin(), copy.end(), LessThan{}); BEAST_EXPECT(areBatchesEqual(batch, copy)); } @@ -636,8 +621,8 @@ public: fetchCopyOfBatch(*db, ©, batch); // Canonicalize the source and destination batches - std::ranges::sort(batch, LessThan{}); - std::ranges::sort(copy, LessThan{}); + std::sort(batch.begin(), batch.end(), LessThan{}); + std::sort(copy.begin(), copy.end(), LessThan{}); BEAST_EXPECT(areBatchesEqual(batch, copy)); } @@ -724,4 +709,5 @@ public: BEAST_DEFINE_TESTSUITE(Database, nodestore, xrpl); -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/test/nodestore/NuDBFactory_test.cpp b/src/test/nodestore/NuDBFactory_test.cpp index 0755708cee..3e6b68c9e5 100644 --- a/src/test/nodestore/NuDBFactory_test.cpp +++ b/src/test/nodestore/NuDBFactory_test.cpp @@ -3,23 +3,15 @@ #include #include -#include -#include -#include #include #include #include -#include -#include -#include #include #include -#include -#include -#include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { class NuDBFactory_test : public TestBase { @@ -446,4 +438,5 @@ public: BEAST_DEFINE_TESTSUITE(NuDBFactory, xrpl_core, xrpl); -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/test/nodestore/TestBase.h b/src/test/nodestore/TestBase.h index e527942629..893e06579c 100644 --- a/src/test/nodestore/TestBase.h +++ b/src/test/nodestore/TestBase.h @@ -13,7 +13,8 @@ #include -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { /** Binary function that satisfies the strict-weak-ordering requirement. @@ -74,10 +75,9 @@ public: return hotTRANSACTION_NODE; case 3: return hotUNKNOWN; - default: - // will never happen, but make static analysis tool happy. - return hotUNKNOWN; } + // will never happen, but make static analysis tool happy. + return hotUNKNOWN; }(); uint256 hash; @@ -118,7 +118,7 @@ public: } // Store a batch in a backend - static void + void storeBatch(Backend& backend, Batch const& batch) { for (int i = 0; i < batch.size(); ++i) @@ -195,4 +195,5 @@ public: } }; -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/test/nodestore/Timing_test.cpp b/src/test/nodestore/Timing_test.cpp index cc9881dbac..39e8b59638 100644 --- a/src/test/nodestore/Timing_test.cpp +++ b/src/test/nodestore/Timing_test.cpp @@ -2,48 +2,34 @@ #include #include -#include #include -#include -#include #include -#include +#include #include -#include #include #include -#include #include #include -#include -#include -#include -#include -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include #include -#include +#include +#include #include -#include #ifndef NODESTORE_TIMING_DO_VERIFY #define NODESTORE_TIMING_DO_VERIFY 0 #endif -namespace xrpl::NodeStore { +namespace xrpl { +namespace NodeStore { std::unique_ptr make_Backend(Section const& config, Scheduler& scheduler, beast::Journal journal) @@ -225,7 +211,7 @@ public: parallel_for(std::size_t const n, std::size_t number_of_threads, Args const&... args) { std::atomic c(0); - std::vector t; + std::vector t; t.reserve(number_of_threads); for (std::size_t id = 0; id < number_of_threads; ++id) t.emplace_back(*this, parallel_for_lambda(n, c), args...); @@ -238,7 +224,7 @@ public: parallel_for_id(std::size_t const n, std::size_t number_of_threads, Args const&... args) { std::atomic c(0); - std::vector t; + std::vector t; t.reserve(number_of_threads); for (std::size_t id = 0; id < number_of_threads; ++id) t.emplace_back(*this, parallel_for_lambda(n, c), id, args...); @@ -728,4 +714,5 @@ public: BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Timing, nodestore, xrpl, 1); -} // namespace xrpl::NodeStore +} // namespace NodeStore +} // namespace xrpl diff --git a/src/test/nodestore/import_test.cpp b/src/test/nodestore/import_test.cpp index 1341b98894..6d336c1f51 100644 --- a/src/test/nodestore/import_test.cpp +++ b/src/test/nodestore/import_test.cpp @@ -1,46 +1,23 @@ #include +#include #include +#include #include -#include +#include #include #include -#include // IWYU pragma: keep -#include -#include -#include +#include -#include // IWYU pragma: keep -#include -#include -#include -#include +#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include #include -#include -#include -#include -#include #include -#include #include -#include -#include -#include #include -#include -#include /* diff --git a/src/test/nodestore/varint_test.cpp b/src/test/nodestore/varint_test.cpp index b97b31f1fe..f6145a9f52 100644 --- a/src/test/nodestore/varint_test.cpp +++ b/src/test/nodestore/varint_test.cpp @@ -1,12 +1,12 @@ -#include +#include #include #include -#include -#include #include -namespace xrpl::NodeStore::tests { +namespace xrpl { +namespace NodeStore { +namespace tests { class varint_test : public beast::unit_test::suite { @@ -54,4 +54,6 @@ public: BEAST_DEFINE_TESTSUITE(varint, nodestore, xrpl); -} // namespace xrpl::NodeStore::tests +} // namespace tests +} // namespace NodeStore +} // namespace xrpl diff --git a/src/test/overlay/ProtocolVersion_test.cpp b/src/test/overlay/ProtocolVersion_test.cpp index a04bb3b36e..fc25812cbb 100644 --- a/src/test/overlay/ProtocolVersion_test.cpp +++ b/src/test/overlay/ProtocolVersion_test.cpp @@ -1,9 +1,6 @@ #include -#include - -#include -#include +#include namespace xrpl { diff --git a/src/test/overlay/TMGetObjectByHash_test.cpp b/src/test/overlay/TMGetObjectByHash_test.cpp index c1db5262d0..a2a934f182 100644 --- a/src/test/overlay/TMGetObjectByHash_test.cpp +++ b/src/test/overlay/TMGetObjectByHash_test.cpp @@ -1,42 +1,20 @@ +#include #include -#include -#include #include -#include #include #include -#include #include -#include +#include -#include -#include #include -#include -#include +#include #include -#include -#include -#include #include -#include -#include +#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { using namespace jtx; @@ -81,7 +59,7 @@ class TMGetObjectByHash_test : public beast::unit_test::suite { } - ~PeerTest() override = default; + ~PeerTest() = default; void run() override @@ -221,4 +199,5 @@ class TMGetObjectByHash_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(TMGetObjectByHash, overlay, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/overlay/cluster_test.cpp b/src/test/overlay/cluster_test.cpp index 41db90dc57..6fc7f3f59b 100644 --- a/src/test/overlay/cluster_test.cpp +++ b/src/test/overlay/cluster_test.cpp @@ -4,20 +4,10 @@ #include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include - -namespace xrpl::tests { +namespace xrpl { +namespace tests { class cluster_test : public xrpl::TestSuite { @@ -91,7 +81,7 @@ public: for (auto const& n : network) { - auto found = std::ranges::find(cluster, n); + auto found = std::find(cluster.begin(), cluster.end(), n); BEAST_EXPECT(static_cast(c->member(n)) == (found != cluster.end())); } } @@ -108,7 +98,7 @@ public: for (auto const& n : network) { - auto found = std::ranges::find(cluster, n); + auto found = std::find(cluster.begin(), cluster.end(), n); BEAST_EXPECT(static_cast(c->member(n)) == (found != cluster.end())); } } @@ -253,4 +243,5 @@ public: BEAST_DEFINE_TESTSUITE(cluster, overlay, xrpl); -} // namespace xrpl::tests +} // namespace tests +} // namespace xrpl diff --git a/src/test/overlay/compression_test.cpp b/src/test/overlay/compression_test.cpp index bb4b95220a..4ffc805726 100644 --- a/src/test/overlay/compression_test.cpp +++ b/src/test/overlay/compression_test.cpp @@ -2,55 +2,37 @@ #include #include #include -#include #include -#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include #include -#include -#include -#include +#include #include -#include +#include #include -#include -#include -#include -#include +#include #include -#include -#include #include #include #include +#include #include -#include -#include +#include #include -#include - -#include +#include #include -#include -#include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { + +namespace test { using namespace xrpl::test; using namespace xrpl::test::jtx; @@ -77,7 +59,9 @@ class compression_test : public beast::unit_test::suite using Algorithm = compression::Algorithm; public: - compression_test() = default; + compression_test() + { + } template void @@ -462,4 +446,5 @@ public: BEAST_DEFINE_TESTSUITE_MANUAL(compression, overlay, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/overlay/handshake_test.cpp b/src/test/overlay/handshake_test.cpp index 50b987f794..8e2d5d5ec1 100644 --- a/src/test/overlay/handshake_test.cpp +++ b/src/test/overlay/handshake_test.cpp @@ -1,8 +1,10 @@ #include -#include +#include -namespace xrpl::test { +namespace xrpl { + +namespace test { class handshake_test : public beast::unit_test::suite { @@ -40,4 +42,5 @@ public: BEAST_DEFINE_TESTSUITE(handshake, overlay, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/overlay/reduce_relay_test.cpp b/src/test/overlay/reduce_relay_test.cpp index 842511b860..bac70d35a6 100644 --- a/src/test/overlay/reduce_relay_test.cpp +++ b/src/test/overlay/reduce_relay_test.cpp @@ -1,52 +1,28 @@ +#include #include -#include -#include #include #include -#include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include -#include - -#include +#include #include -#include #include -#include -#include -#include #include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { + +namespace test { using namespace std::chrono; @@ -75,7 +51,9 @@ public: } PublicKey nodePublicKey_; - ~PeerPartial() override = default; + virtual ~PeerPartial() + { + } virtual void onMessage(MessageSPtr const& m, SquelchCB f) = 0; virtual void @@ -196,10 +174,10 @@ public: class ManualClock { public: - using rep = uint64_t; - using period = std::milli; - using duration = std::chrono::duration; - using time_point = std::chrono::time_point; + typedef uint64_t rep; + typedef std::milli period; + typedef std::chrono::duration duration; + typedef std::chrono::time_point time_point; inline static bool const is_steady = false; static void @@ -268,8 +246,11 @@ class Link using Latency = std::pair; public: - Link(Validator& validator, PeerSPtr peer, Latency latency = {milliseconds(5), milliseconds(15)}) - : validator_(validator), peer_(peer), latency_(std::move(latency)) + Link( + Validator& validator, + PeerSPtr peer, + Latency const& latency = {milliseconds(5), milliseconds(15)}) + : validator_(validator), peer_(peer), latency_(latency) { auto sp = peer_.lock(); assert(sp); @@ -390,7 +371,9 @@ public: for_links(LinkIterCB f, bool simulateSlow = false) { std::vector v; - std::ranges::transform(links_, std::back_inserter(v), [](auto& kv) { return kv.second; }); + std::transform(links_.begin(), links_.end(), std::back_inserter(v), [](auto& kv) { + return kv.second; + }); std::random_device d; std::mt19937 g(d()); std::shuffle(v.begin(), v.end(), g); @@ -460,7 +443,7 @@ public: id_ = sid_++; } - ~PeerSim() override = default; + ~PeerSim() = default; id_t id() const override @@ -494,7 +477,7 @@ public: } /** Remote Peer (Directly connected Peer) */ - void + virtual void onMessage(protocol::TMSquelch const& squelch) override { auto validator = squelch.validatorpubkey(); @@ -528,7 +511,7 @@ public: { } - ~OverlaySim() override = default; + ~OverlaySim() = default; void clear() @@ -769,7 +752,8 @@ public: void enableLink(std::uint16_t validatorId, Peer::id_t peer, bool enable) { - auto it = std::ranges::find_if(validators_, [&](auto& v) { return v.id() == validatorId; }); + auto it = std::find_if( + validators_.begin(), validators_.end(), [&](auto& v) { return v.id() == validatorId; }); assert(it != validators_.end()); if (enable) { @@ -1267,7 +1251,7 @@ protected: ManualClock::advance(seconds(601)); BEAST_EXPECT(propagateAndSquelch(log, true, false)); auto peers = network_.overlay().getPeers(network_.validator(0)); - auto it = std::ranges::find_if(peers, [&](auto it) { + auto it = std::find_if(peers.begin(), peers.end(), [&](auto it) { return std::get(it.second) == reduce_relay::PeerState::Squelched; }); @@ -1361,7 +1345,7 @@ vp_enable=0 { c.loadFromString(toLoad); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -1405,7 +1389,7 @@ vp_base_squelch_max_selected_peers=2 { c2.loadFromString(toLoad); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { error = e.what(); } @@ -1479,7 +1463,9 @@ vp_base_squelch_max_selected_peers=2 struct Handler : public reduce_relay::SquelchHandler { - Handler() = default; + Handler() + { + } void squelch(PublicKey const&, Peer::id_t, std::uint32_t duration) const override { @@ -1671,4 +1657,6 @@ class reduce_relay_simulate_test : public reduce_relay_test BEAST_DEFINE_TESTSUITE(reduce_relay, overlay, xrpl); BEAST_DEFINE_TESTSUITE_MANUAL(reduce_relay_simulate, overlay, xrpl); -} // namespace xrpl::test +} // namespace test + +} // namespace xrpl diff --git a/src/test/overlay/short_read_test.cpp b/src/test/overlay/short_read_test.cpp index 5d145fb6b1..0c8b7f8a43 100644 --- a/src/test/overlay/short_read_test.cpp +++ b/src/test/overlay/short_read_test.cpp @@ -2,39 +2,21 @@ #include #include -#include +#include -#include #include #include -#include -#include -#include -#include #include -#include #include -#include -#include +#include #include #include -#include -#include -#include +#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include #include #include -#include namespace xrpl { /* @@ -645,7 +627,7 @@ public: { } - ~short_read_test() override + ~short_read_test() { work_.reset(); thread_.join(); diff --git a/src/test/overlay/traffic_count_test.cpp b/src/test/overlay/traffic_count_test.cpp index b5cb73c65d..5e6e4e685c 100644 --- a/src/test/overlay/traffic_count_test.cpp +++ b/src/test/overlay/traffic_count_test.cpp @@ -1,13 +1,12 @@ +#include #include -#include +#include +#include -#include +namespace xrpl { -#include -#include - -namespace xrpl::test { +namespace test { class traffic_count_test : public beast::unit_test::suite { @@ -51,13 +50,13 @@ public: TrafficCount m_traffic; auto const counts = m_traffic.getCounts(); - std::ranges::for_each(counts, [&](auto const& pair) { + std::for_each(counts.begin(), counts.end(), [&](auto const& pair) { for (auto i = 0; i < tc.messageCount; ++i) m_traffic.addCount(pair.first, tc.inbound, tc.size); }); auto const counts_new = m_traffic.getCounts(); - std::ranges::for_each(counts_new, [&](auto const& pair) { + std::for_each(counts_new.begin(), counts_new.end(), [&](auto const& pair) { BEAST_EXPECT(pair.second.bytesIn.load() == tc.expectedBytesIn); BEAST_EXPECT(pair.second.bytesOut.load() == tc.expectedBytesOut); BEAST_EXPECT(pair.second.messagesIn.load() == tc.expectedMessagesIn); @@ -126,4 +125,5 @@ public: BEAST_DEFINE_TESTSUITE(traffic_count, overlay, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/overlay/tx_reduce_relay_test.cpp b/src/test/overlay/tx_reduce_relay_test.cpp index bbb31fd38b..abb1632858 100644 --- a/src/test/overlay/tx_reduce_relay_test.cpp +++ b/src/test/overlay/tx_reduce_relay_test.cpp @@ -1,49 +1,16 @@ +#include #include -#include -#include -#include -#include -#include -#include #include #include -#include -#include +#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include -#include -#include -#include -#include -#include -#include -#include +namespace xrpl { -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace test { class tx_reduce_relay_test : public beast::unit_test::suite { @@ -141,7 +108,7 @@ private: { sid_++; } - ~PeerTest() override = default; + ~PeerTest() = default; void run() override @@ -297,4 +264,5 @@ private: }; BEAST_DEFINE_TESTSUITE(tx_reduce_relay, overlay, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/peerfinder/Livecache_test.cpp b/src/test/peerfinder/Livecache_test.cpp index 561b17f71c..d12da84ffd 100644 --- a/src/test/peerfinder/Livecache_test.cpp +++ b/src/test/peerfinder/Livecache_test.cpp @@ -1,28 +1,16 @@ #include #include -#include #include -#include #include -#include -#include -#include +#include +#include -#include -#include -#include -#include +#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { bool operator==(Endpoint const& a, Endpoint const& b) @@ -211,4 +199,5 @@ public: BEAST_DEFINE_TESTSUITE(Livecache, peerfinder, xrpl); -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/test/peerfinder/PeerFinder_test.cpp b/src/test/peerfinder/PeerFinder_test.cpp index 0e37c7baf4..2726604c72 100644 --- a/src/test/peerfinder/PeerFinder_test.cpp +++ b/src/test/peerfinder/PeerFinder_test.cpp @@ -2,28 +2,15 @@ #include #include -#include #include -#include #include -#include #include -#include #include #include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { class PeerFinder_test : public beast::unit_test::suite { @@ -529,4 +516,5 @@ public: BEAST_DEFINE_TESTSUITE(PeerFinder, peerfinder, xrpl); -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/test/protocol/ApiVersion_test.cpp b/src/test/protocol/ApiVersion_test.cpp index 569aed5fa2..0b7babc764 100644 --- a/src/test/protocol/ApiVersion_test.cpp +++ b/src/test/protocol/ApiVersion_test.cpp @@ -1,7 +1,16 @@ +#include #include #include -namespace xrpl::test { +#include +#include +#include +#include +#include +#include + +namespace xrpl { +namespace test { struct ApiVersion_test : beast::unit_test::suite { void @@ -38,4 +47,5 @@ struct ApiVersion_test : beast::unit_test::suite BEAST_DEFINE_TESTSUITE(ApiVersion, protocol, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/protocol/BuildInfo_test.cpp b/src/test/protocol/BuildInfo_test.cpp index d157978744..589eb00637 100644 --- a/src/test/protocol/BuildInfo_test.cpp +++ b/src/test/protocol/BuildInfo_test.cpp @@ -1,4 +1,4 @@ -#include +#include #include namespace xrpl { diff --git a/src/test/protocol/Hooks_test.cpp b/src/test/protocol/Hooks_test.cpp index c6254d16bb..6f08517c0f 100644 --- a/src/test/protocol/Hooks_test.cpp +++ b/src/test/protocol/Hooks_test.cpp @@ -1,15 +1,7 @@ +#include +#include -#include // IWYU pragma: keep - -#include -#include -#include -#include -#include -#include - -#include #include #include diff --git a/src/test/protocol/InnerObjectFormats_test.cpp b/src/test/protocol/InnerObjectFormats_test.cpp index 8a4d527db3..2961e90db7 100644 --- a/src/test/protocol/InnerObjectFormats_test.cpp +++ b/src/test/protocol/InnerObjectFormats_test.cpp @@ -1,16 +1,11 @@ - -#include +#include #include -#include -#include // Json::Reader -#include +#include +#include // Json::Reader #include // RPC::containsError #include // STParsedJSONObject -#include -#include - namespace xrpl { namespace InnerObjectFormatsUnitTestDetail { @@ -24,7 +19,7 @@ struct TestJSONTxt static TestJSONTxt const testArray[] = { // Valid SignerEntry - {.txt = R"({ + {R"({ "Account" : "rDg53Haik2475DJx8bjMDSDPj4VX7htaMd", "SignerEntries" : [ @@ -46,10 +41,10 @@ static TestJSONTxt const testArray[] = { "SignerQuorum" : 7, "TransactionType" : "SignerListSet" })", - .expectFail = false}, + false}, // SignerEntry missing Account - {.txt = R"({ + {R"({ "Account" : "rDg53Haik2475DJx8bjMDSDPj4VX7htaMd", "SignerEntries" : [ @@ -70,10 +65,10 @@ static TestJSONTxt const testArray[] = { "SignerQuorum" : 7, "TransactionType" : "SignerListSet" })", - .expectFail = true}, + true}, // SignerEntry missing SignerWeight - {.txt = R"({ + {R"({ "Account" : "rDg53Haik2475DJx8bjMDSDPj4VX7htaMd", "SignerEntries" : [ @@ -94,10 +89,10 @@ static TestJSONTxt const testArray[] = { "SignerQuorum" : 7, "TransactionType" : "SignerListSet" })", - .expectFail = true}, + true}, // SignerEntry with unexpected Amount - {.txt = R"({ + {R"({ "Account" : "rDg53Haik2475DJx8bjMDSDPj4VX7htaMd", "SignerEntries" : [ @@ -120,10 +115,10 @@ static TestJSONTxt const testArray[] = { "SignerQuorum" : 7, "TransactionType" : "SignerListSet" })", - .expectFail = true}, + true}, // SignerEntry with no Account and unexpected Amount - {.txt = R"({ + {R"({ "Account" : "rDg53Haik2475DJx8bjMDSDPj4VX7htaMd", "SignerEntries" : [ @@ -145,7 +140,7 @@ static TestJSONTxt const testArray[] = { "SignerQuorum" : 7, "TransactionType" : "SignerListSet" })", - .expectFail = true}, + true}, }; diff --git a/src/test/protocol/Issue_test.cpp b/src/test/protocol/Issue_test.cpp index 116ac7ca27..eddaf1c6d8 100644 --- a/src/test/protocol/Issue_test.cpp +++ b/src/test/protocol/Issue_test.cpp @@ -1,16 +1,15 @@ #include -#include -#include -#include +#include #include #include -#include -#include +#include + #include #include #include -#include +#include +#include #if BEAST_MSVC #define STL_SET_HAS_EMPLACE 1 diff --git a/src/test/protocol/Memo_test.cpp b/src/test/protocol/Memo_test.cpp index fa6d7905a4..a39fdfd194 100644 --- a/src/test/protocol/Memo_test.cpp +++ b/src/test/protocol/Memo_test.cpp @@ -1,17 +1,6 @@ - -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include - -#include namespace xrpl { diff --git a/src/test/protocol/MultiApiJson_test.cpp b/src/test/protocol/MultiApiJson_test.cpp index f0cbf805f3..5aafa19771 100644 --- a/src/test/protocol/MultiApiJson_test.cpp +++ b/src/test/protocol/MultiApiJson_test.cpp @@ -1,16 +1,14 @@ -#include -#include -#include +#include #include -#include -#include +#include #include #include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { namespace { @@ -919,4 +917,5 @@ struct MultiApiJson_test : beast::unit_test::suite BEAST_DEFINE_TESTSUITE(MultiApiJson, protocol, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/protocol/PublicKey_test.cpp b/src/test/protocol/PublicKey_test.cpp index cc5658d1c1..79ab589404 100644 --- a/src/test/protocol/PublicKey_test.cpp +++ b/src/test/protocol/PublicKey_test.cpp @@ -1,17 +1,7 @@ -#include -#include -#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include namespace xrpl { diff --git a/src/test/protocol/Quality_test.cpp b/src/test/protocol/Quality_test.cpp index 09308c71a8..f421f98c94 100644 --- a/src/test/protocol/Quality_test.cpp +++ b/src/test/protocol/Quality_test.cpp @@ -1,12 +1,6 @@ -#include -#include -#include -#include +#include #include -#include -#include -#include #include namespace xrpl { @@ -22,17 +16,17 @@ public: template static STAmount - amount(Integer integer, std::enable_if_t>* = 0) + amount(Integer integer, std::enable_if_t::value>* = 0) { - static_assert(std::is_integral_v, ""); + static_assert(std::is_integral::value, ""); return STAmount(integer, false); } template static STAmount - amount(Integer integer, std::enable_if_t>* = 0) + amount(Integer integer, std::enable_if_t::value>* = 0) { - static_assert(std::is_integral_v, ""); + static_assert(std::is_integral::value, ""); if (integer < 0) return STAmount(-integer, true); return STAmount(integer, false); diff --git a/src/test/protocol/STAccount_test.cpp b/src/test/protocol/STAccount_test.cpp index eb356ecb8d..3b12605a92 100644 --- a/src/test/protocol/STAccount_test.cpp +++ b/src/test/protocol/STAccount_test.cpp @@ -1,12 +1,5 @@ -#include -#include -#include -#include +#include #include -#include - -#include -#include namespace xrpl { diff --git a/src/test/protocol/STAmount_test.cpp b/src/test/protocol/STAmount_test.cpp index 78ef9c2a8a..92f30bbaa1 100644 --- a/src/test/protocol/STAmount_test.cpp +++ b/src/test/protocol/STAmount_test.cpp @@ -1,30 +1,10 @@ +#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { class STAmount_test : public beast::unit_test::suite diff --git a/src/test/protocol/STInteger_test.cpp b/src/test/protocol/STInteger_test.cpp index ccb3e726da..4a0204d349 100644 --- a/src/test/protocol/STInteger_test.cpp +++ b/src/test/protocol/STInteger_test.cpp @@ -1,7 +1,6 @@ -#include +#include #include #include -#include #include #include diff --git a/src/test/protocol/STIssue_test.cpp b/src/test/protocol/STIssue_test.cpp index 41b8e27d7b..2ffdb1d9af 100644 --- a/src/test/protocol/STIssue_test.cpp +++ b/src/test/protocol/STIssue_test.cpp @@ -1,17 +1,10 @@ +#include -#include -#include // IWYU pragma: keep - -#include -#include -#include -#include -#include +#include #include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class STIssue_test : public beast::unit_test::suite { @@ -148,4 +141,5 @@ public: BEAST_DEFINE_TESTSUITE(STIssue, protocol, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/protocol/STNumber_test.cpp b/src/test/protocol/STNumber_test.cpp index 156f5b42aa..d4e82eeef2 100644 --- a/src/test/protocol/STNumber_test.cpp +++ b/src/test/protocol/STNumber_test.cpp @@ -1,20 +1,14 @@ -#include +#include #include #include -#include #include #include #include #include -#include -#include -#include #include +#include #include -#include -#include -#include namespace xrpl { diff --git a/src/test/protocol/STObject_test.cpp b/src/test/protocol/STObject_test.cpp index d76446599c..135c577fb4 100644 --- a/src/test/protocol/STObject_test.cpp +++ b/src/test/protocol/STObject_test.cpp @@ -1,30 +1,4 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -356,7 +330,7 @@ public: STObject st(sfGeneric); auto const v = ~st[~sf1Outer]; static_assert( - std::is_same_v, std::optional>, ""); + std::is_same, std::optional>::value, ""); } // UDT scalar fields @@ -431,7 +405,7 @@ public: BEAST_EXPECT(cst[sf][0] == 1); BEAST_EXPECT(cst[sf][1] == 2); static_assert( - std::is_same_v const&>, ""); + std::is_same const&>::value, ""); } // Default by reference field diff --git a/src/test/protocol/STParsedJSON_test.cpp b/src/test/protocol/STParsedJSON_test.cpp index 75d3d74ddd..1c86a90348 100644 --- a/src/test/protocol/STParsedJSON_test.cpp +++ b/src/test/protocol/STParsedJSON_test.cpp @@ -1,27 +1,11 @@ +#include -#include - -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include #include #include -#include -#include - -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -419,7 +403,8 @@ class STParsedJSON_test : public beast::unit_test::suite // NOLINTNEXTLINE(bugprone-unchecked-optional-access) auto const& h128 = obj.object->getFieldH128(sfEmailHash); BEAST_EXPECT(h128.size() == 16); - bool const allZero = std::ranges::all_of(h128, [](auto b) { return b == 0; }); + bool const allZero = + std::all_of(h128.begin(), h128.end(), [](auto b) { return b == 0; }); BEAST_EXPECT(allZero); } @@ -514,7 +499,8 @@ class STParsedJSON_test : public beast::unit_test::suite // NOLINTNEXTLINE(bugprone-unchecked-optional-access) auto const& h160 = obj.object->getFieldH160(sfTakerPaysCurrency); BEAST_EXPECT(h160.size() == 20); - bool const allZero = std::ranges::all_of(h160, [](auto b) { return b == 0; }); + bool const allZero = + std::all_of(h160.begin(), h160.end(), [](auto b) { return b == 0; }); BEAST_EXPECT(allZero); } @@ -602,7 +588,8 @@ class STParsedJSON_test : public beast::unit_test::suite // NOLINTNEXTLINE(bugprone-unchecked-optional-access) auto const& h192 = obj.object->getFieldH192(sfMPTokenIssuanceID); BEAST_EXPECT(h192.size() == 24); - bool const allZero = std::ranges::all_of(h192, [](auto b) { return b == 0; }); + bool const allZero = + std::all_of(h192.begin(), h192.end(), [](auto b) { return b == 0; }); BEAST_EXPECT(allZero); } @@ -703,7 +690,8 @@ class STParsedJSON_test : public beast::unit_test::suite // NOLINTNEXTLINE(bugprone-unchecked-optional-access) auto const& h256 = obj.object->getFieldH256(sfLedgerHash); BEAST_EXPECT(h256.size() == 32); - bool const allZero = std::ranges::all_of(h256, [](auto b) { return b == 0; }); + bool const allZero = + std::all_of(h256.begin(), h256.end(), [](auto b) { return b == 0; }); BEAST_EXPECT(allZero); } @@ -2142,10 +2130,10 @@ class STParsedJSON_test : public beast::unit_test::suite STParsedJSONObject const parsed("test", faultyJson); BEAST_EXPECT(!parsed.object); } - catch (std::runtime_error const& e) + catch (std::runtime_error& e) { std::string const what(e.what()); - unexpected(!what.starts_with("First level children of `Template`")); + unexpected(what.find("First level children of `Template`") != 0); } } } diff --git a/src/test/protocol/STTx_test.cpp b/src/test/protocol/STTx_test.cpp index 70074ed496..0804c89bd4 100644 --- a/src/test/protocol/STTx_test.cpp +++ b/src/test/protocol/STTx_test.cpp @@ -1,34 +1,15 @@ #include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include +#include +#include #include -#include -#include #include -#include -#include #include #include -#include -#include #include #include +#include -#include - -#include -#include -#include -#include #include -#include -#include -#include namespace xrpl { diff --git a/src/test/protocol/STValidation_test.cpp b/src/test/protocol/STValidation_test.cpp index 779e4d4c55..e426af3e44 100644 --- a/src/test/protocol/STValidation_test.cpp +++ b/src/test/protocol/STValidation_test.cpp @@ -1,21 +1,12 @@ +#include -#include #include -#include +#include #include -#include // IWYU pragma: keep -#include -#include -#include -#include +#include -#include -#include -#include -#include #include -#include -#include +#include namespace xrpl { diff --git a/src/test/protocol/SecretKey_test.cpp b/src/test/protocol/SecretKey_test.cpp index 7e71775988..9072f5c0d9 100644 --- a/src/test/protocol/SecretKey_test.cpp +++ b/src/test/protocol/SecretKey_test.cpp @@ -1,22 +1,13 @@ #include -#include -#include -#include +#include #include #include -#include -#include #include #include #include -#include #include -#include -#include -#include -#include #include #include @@ -167,7 +158,8 @@ public: // swaps the smallest and largest elements in buffer std::iter_swap( - std::ranges::min_element(badData), std::ranges::max_element(badData)); + std::min_element(badData.begin(), badData.end()), + std::max_element(badData.begin(), badData.end())); // Wrong data: should fail BEAST_EXPECT(!verify(pk, makeSlice(badData), sig)); @@ -353,1149 +345,1149 @@ public: private: // clang-format off inline static TestKeyData const secp256k1TestVectors[] = { - {.seed={0xDE,0xDC,0xE9,0xCE,0x67,0xB4,0x51,0xD8,0x52,0xFD,0x4E,0x84,0x6F,0xCD,0xE3,0x1C}, - .pubkey={0x03,0x30,0xE7,0xFC,0x9D,0x56,0xBB,0x25,0xD6,0x89,0x3B,0xA3,0xF3,0x17,0xAE,0x5B, + {{0xDE,0xDC,0xE9,0xCE,0x67,0xB4,0x51,0xD8,0x52,0xFD,0x4E,0x84,0x6F,0xCD,0xE3,0x1C}, + {0x03,0x30,0xE7,0xFC,0x9D,0x56,0xBB,0x25,0xD6,0x89,0x3B,0xA3,0xF3,0x17,0xAE,0x5B, 0xCF,0x33,0xB3,0x29,0x1B,0xD6,0x3D,0xB3,0x26,0x54,0xA3,0x13,0x22,0x2F,0x7F,0xD0,0x20}, - .seckey={0x1A,0xCA,0xAE,0xDE,0xCE,0x40,0x5B,0x2A,0x95,0x82,0x12,0x62,0x9E,0x16,0xF2,0xEB, + {0x1A,0xCA,0xAE,0xDE,0xCE,0x40,0x5B,0x2A,0x95,0x82,0x12,0x62,0x9E,0x16,0xF2,0xEB, 0x46,0xB1,0x53,0xEE,0xE9,0x4C,0xDD,0x35,0x0F,0xDE,0xFF,0x52,0x79,0x55,0x25,0xB7}, - .addr="rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"}, - {.seed={0xF7,0x5C,0x48,0xFE,0xC4,0x6D,0x4D,0x64,0x92,0x8B,0x79,0x5F,0x3F,0xBA,0xBB,0xA0}, - .pubkey={0x03,0xAF,0x53,0xE8,0x01,0x1E,0x85,0xB3,0x66,0x64,0xF1,0x71,0x08,0x90,0x50,0x1C, + "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"}, + {{0xF7,0x5C,0x48,0xFE,0xC4,0x6D,0x4D,0x64,0x92,0x8B,0x79,0x5F,0x3F,0xBA,0xBB,0xA0}, + {0x03,0xAF,0x53,0xE8,0x01,0x1E,0x85,0xB3,0x66,0x64,0xF1,0x71,0x08,0x90,0x50,0x1C, 0x3E,0x86,0xFC,0x2C,0x66,0x58,0xC2,0xEE,0x83,0xCA,0x58,0x0D,0xC9,0x97,0x25,0x41,0xB1}, - .seckey={0x5B,0x8A,0xB0,0xE7,0xCD,0xAF,0x48,0x87,0x4D,0x5D,0x99,0x34,0xBF,0x3E,0x7B,0x2C, + {0x5B,0x8A,0xB0,0xE7,0xCD,0xAF,0x48,0x87,0x4D,0x5D,0x99,0x34,0xBF,0x3E,0x7B,0x2C, 0xB0,0x6B,0xC4,0xC7,0xEA,0xAA,0xF7,0x62,0x68,0x2E,0xD8,0xD0,0xA3,0x1E,0x3C,0x70}, - .addr="r9ZERztesFu3ZBs7zsWTeCvBg14GQ9zWF7"}, - {.seed={0x7A,0xEA,0x88,0xC1,0x48,0xA8,0xC4,0xA8,0x90,0x69,0xF9,0x8A,0x37,0x33,0x16,0x7B}, - .pubkey={0x03,0x7A,0xD9,0x30,0xB3,0x1B,0x0F,0x81,0x03,0x6D,0x65,0xA6,0x2D,0x4E,0x11,0x31, + "r9ZERztesFu3ZBs7zsWTeCvBg14GQ9zWF7"}, + {{0x7A,0xEA,0x88,0xC1,0x48,0xA8,0xC4,0xA8,0x90,0x69,0xF9,0x8A,0x37,0x33,0x16,0x7B}, + {0x03,0x7A,0xD9,0x30,0xB3,0x1B,0x0F,0x81,0x03,0x6D,0x65,0xA6,0x2D,0x4E,0x11,0x31, 0xEF,0x60,0x5F,0x73,0x8E,0x7D,0x7F,0x95,0x46,0x5B,0xBE,0xCB,0xCB,0xFF,0xA7,0x07,0x6E}, - .seckey={0x3D,0xDC,0x5F,0xE1,0x63,0x78,0xAE,0x85,0x03,0xE9,0x74,0x23,0x30,0x17,0x79,0x1C, + {0x3D,0xDC,0x5F,0xE1,0x63,0x78,0xAE,0x85,0x03,0xE9,0x74,0x23,0x30,0x17,0x79,0x1C, 0xC0,0x7C,0x10,0x77,0x65,0x3A,0xB7,0x23,0xC8,0xF6,0x5B,0x17,0xB9,0x98,0x0D,0xA1}, - .addr="rfmZ1iAuSzB2gxjoJgBub6iJPCk92D7YfC"}, - {.seed={0xE4,0x24,0x9B,0xFF,0x02,0xB7,0x66,0x91,0x99,0xA2,0x3F,0xAF,0x48,0x8C,0x17,0x9E}, - .pubkey={0x02,0xEF,0x88,0x8E,0x93,0xB9,0xA8,0x50,0xFC,0x93,0xCF,0x00,0xF6,0xA9,0x3C,0x3C, + "rfmZ1iAuSzB2gxjoJgBub6iJPCk92D7YfC"}, + {{0xE4,0x24,0x9B,0xFF,0x02,0xB7,0x66,0x91,0x99,0xA2,0x3F,0xAF,0x48,0x8C,0x17,0x9E}, + {0x02,0xEF,0x88,0x8E,0x93,0xB9,0xA8,0x50,0xFC,0x93,0xCF,0x00,0xF6,0xA9,0x3C,0x3C, 0xDE,0xF2,0x86,0x0D,0xBF,0x3A,0x4F,0x11,0xCD,0x0A,0xE8,0xE6,0x45,0x4D,0x20,0x95,0xE3}, - .seckey={0x84,0xBF,0xD9,0x22,0x68,0xCA,0x02,0x01,0x9C,0xE6,0xD9,0x35,0xEF,0xA9,0x94,0x4B, + {0x84,0xBF,0xD9,0x22,0x68,0xCA,0x02,0x01,0x9C,0xE6,0xD9,0x35,0xEF,0xA9,0x94,0x4B, 0xAE,0xC3,0x3E,0x23,0x41,0x34,0xDE,0xF4,0xF2,0xA8,0xE7,0x75,0x19,0xF3,0x42,0xBE}, - .addr="rwm4pKGoRDHez72gumG7VZw5Fb9ah7o6K2"}, - {.seed={0x04,0xC7,0x18,0x9B,0x62,0x72,0x94,0x39,0x81,0x6B,0x25,0x9C,0x4E,0x61,0x99,0xE1}, - .pubkey={0x03,0x3E,0x4F,0xA3,0x7A,0x91,0xFC,0xCD,0x49,0xEF,0x91,0xB8,0x1D,0x34,0x1F,0x27, + "rwm4pKGoRDHez72gumG7VZw5Fb9ah7o6K2"}, + {{0x04,0xC7,0x18,0x9B,0x62,0x72,0x94,0x39,0x81,0x6B,0x25,0x9C,0x4E,0x61,0x99,0xE1}, + {0x03,0x3E,0x4F,0xA3,0x7A,0x91,0xFC,0xCD,0x49,0xEF,0x91,0xB8,0x1D,0x34,0x1F,0x27, 0x24,0x1A,0x35,0xE9,0x13,0x05,0x55,0x33,0xE3,0x0C,0xA0,0x4D,0xA4,0x12,0x10,0x8F,0xCA}, - .seckey={0xA6,0x74,0x67,0x08,0x1E,0x99,0x33,0xC0,0x74,0x63,0x5C,0xEB,0x81,0x92,0x51,0xA5, + {0xA6,0x74,0x67,0x08,0x1E,0x99,0x33,0xC0,0x74,0x63,0x5C,0xEB,0x81,0x92,0x51,0xA5, 0x02,0x5E,0xD3,0x6E,0x88,0x87,0xDC,0xC1,0xD9,0xEB,0x8F,0x5B,0x52,0x08,0x74,0x81}, - .addr="rHsP2baL7CdEjfJ89AYoWuocKBiPSikBnm"}, - {.seed={0x3E,0x94,0x83,0x6F,0xA5,0x42,0x87,0xA9,0x5D,0xAD,0xB1,0xDF,0xAF,0x03,0xB4,0x28}, - .pubkey={0x03,0x6F,0x9B,0xB1,0x59,0xB4,0x72,0x58,0x7E,0xCC,0xD2,0x24,0x35,0xC2,0xA8,0xB8, + "rHsP2baL7CdEjfJ89AYoWuocKBiPSikBnm"}, + {{0x3E,0x94,0x83,0x6F,0xA5,0x42,0x87,0xA9,0x5D,0xAD,0xB1,0xDF,0xAF,0x03,0xB4,0x28}, + {0x03,0x6F,0x9B,0xB1,0x59,0xB4,0x72,0x58,0x7E,0xCC,0xD2,0x24,0x35,0xC2,0xA8,0xB8, 0xC4,0xF5,0xF5,0x13,0x33,0xFA,0xAE,0xC5,0xA8,0x35,0xAE,0x58,0x34,0x68,0x97,0x8B,0x4B}, - .seckey={0xD1,0xB4,0xE7,0xFE,0x29,0x19,0xF9,0x7E,0x41,0x3F,0x41,0x74,0x4D,0x29,0x1B,0x46, + {0xD1,0xB4,0xE7,0xFE,0x29,0x19,0xF9,0x7E,0x41,0x3F,0x41,0x74,0x4D,0x29,0x1B,0x46, 0x77,0xD0,0x32,0xC1,0x52,0x61,0xAC,0x94,0x2A,0x9E,0x93,0x03,0x06,0x52,0x7A,0xA1}, - .addr="rpuqfwe4b4vP4ndmUBkgVXwyquPYAtGFku"}, - {.seed={0x82,0xCB,0xB5,0x75,0xC7,0x39,0xC6,0xCC,0x29,0x9E,0xC0,0x1C,0x21,0x21,0xB6,0x10}, - .pubkey={0x03,0x58,0x8B,0x56,0x6F,0x57,0x3A,0xC8,0x30,0xE5,0xEC,0xE4,0x03,0x08,0x59,0x52, + "rpuqfwe4b4vP4ndmUBkgVXwyquPYAtGFku"}, + {{0x82,0xCB,0xB5,0x75,0xC7,0x39,0xC6,0xCC,0x29,0x9E,0xC0,0x1C,0x21,0x21,0xB6,0x10}, + {0x03,0x58,0x8B,0x56,0x6F,0x57,0x3A,0xC8,0x30,0xE5,0xEC,0xE4,0x03,0x08,0x59,0x52, 0x3E,0x44,0x7A,0x5A,0xCA,0x95,0x51,0xB7,0xA1,0x18,0xB9,0x1F,0x37,0x24,0xD2,0x40,0x83}, - .seckey={0x79,0x63,0x69,0x53,0xF7,0x64,0x9B,0x82,0x39,0x86,0x31,0xCC,0x47,0xC9,0x7B,0xD8, + {0x79,0x63,0x69,0x53,0xF7,0x64,0x9B,0x82,0x39,0x86,0x31,0xCC,0x47,0xC9,0x7B,0xD8, 0xA8,0x84,0x74,0x70,0xB7,0xF7,0xFA,0x0C,0x48,0x47,0x73,0xF1,0x74,0xB7,0xA2,0x47}, - .addr="rp45fL94nhjferVtQWa9PkyydFQK6aZbEy"}, - {.seed={0x8A,0x91,0x69,0x2D,0x45,0x00,0x23,0xC4,0x65,0x0C,0xC2,0x18,0x5D,0xCF,0x0F,0x68}, - .pubkey={0x02,0x09,0x65,0xCE,0x5C,0x65,0x51,0x0C,0xC6,0xD7,0xAA,0x64,0x98,0xFD,0x0C,0xE1, + "rp45fL94nhjferVtQWa9PkyydFQK6aZbEy"}, + {{0x8A,0x91,0x69,0x2D,0x45,0x00,0x23,0xC4,0x65,0x0C,0xC2,0x18,0x5D,0xCF,0x0F,0x68}, + {0x02,0x09,0x65,0xCE,0x5C,0x65,0x51,0x0C,0xC6,0xD7,0xAA,0x64,0x98,0xFD,0x0C,0xE1, 0xD8,0xE9,0xAD,0xCD,0x72,0x00,0x12,0xA5,0x1D,0x36,0x64,0x94,0xB1,0x97,0xF6,0xB9,0x9E}, - .seckey={0xE3,0x69,0x28,0xEE,0x12,0x60,0x08,0x8D,0x47,0x90,0xB3,0x99,0x25,0x47,0x79,0xF7, + {0xE3,0x69,0x28,0xEE,0x12,0x60,0x08,0x8D,0x47,0x90,0xB3,0x99,0x25,0x47,0x79,0xF7, 0x9B,0xDD,0x48,0xA9,0xEC,0xAD,0xC1,0x3B,0xF4,0x59,0x7B,0x69,0xAD,0xE1,0x6F,0x3E}, - .addr="rfZCLUjvKSNmg5xMufb6fgq9VfP5biBDfU"}, - {.seed={0x9F,0x65,0x49,0xF5,0x89,0xA4,0x72,0x3C,0xD9,0x46,0x77,0xE2,0xCF,0xCD,0x6E,0xB9}, - .pubkey={0x03,0x95,0xE9,0x7A,0x55,0xCE,0x55,0x2E,0xC0,0xE3,0xC0,0x00,0xF6,0x05,0x53,0x63, + "rfZCLUjvKSNmg5xMufb6fgq9VfP5biBDfU"}, + {{0x9F,0x65,0x49,0xF5,0x89,0xA4,0x72,0x3C,0xD9,0x46,0x77,0xE2,0xCF,0xCD,0x6E,0xB9}, + {0x03,0x95,0xE9,0x7A,0x55,0xCE,0x55,0x2E,0xC0,0xE3,0xC0,0x00,0xF6,0x05,0x53,0x63, 0x2A,0x3E,0xEA,0xF9,0x47,0x34,0x64,0x0B,0xAB,0xD1,0x54,0x3A,0xD0,0xA6,0x90,0x05,0xCD}, - .seckey={0xB4,0xB6,0xAB,0x76,0x33,0x75,0x98,0xE2,0xBF,0x43,0x07,0x92,0xEF,0x14,0x04,0x36, + {0xB4,0xB6,0xAB,0x76,0x33,0x75,0x98,0xE2,0xBF,0x43,0x07,0x92,0xEF,0x14,0x04,0x36, 0xE2,0x5C,0x43,0xAD,0xA0,0x6B,0xED,0x8C,0xA1,0xCC,0x80,0x7F,0xEA,0x3B,0xA5,0x26}, - .addr="rpyTz8db86bWHi8E43GGexhRsLDwwMRta3"}, - {.seed={0xCE,0xEC,0xF7,0xAF,0xBF,0x34,0xEF,0xA3,0x0D,0x5C,0xBA,0x33,0xFC,0x5A,0x9A,0x83}, - .pubkey={0x02,0xD2,0x6D,0xF4,0xAC,0x1F,0x19,0x04,0xD2,0x05,0x85,0xDC,0x21,0x9F,0xB3,0xE4, + "rpyTz8db86bWHi8E43GGexhRsLDwwMRta3"}, + {{0xCE,0xEC,0xF7,0xAF,0xBF,0x34,0xEF,0xA3,0x0D,0x5C,0xBA,0x33,0xFC,0x5A,0x9A,0x83}, + {0x02,0xD2,0x6D,0xF4,0xAC,0x1F,0x19,0x04,0xD2,0x05,0x85,0xDC,0x21,0x9F,0xB3,0xE4, 0x35,0xAC,0xAE,0x14,0x0B,0xCF,0x59,0xBE,0x5E,0x91,0xD8,0xDC,0xCD,0xB7,0x41,0xB2,0xF3}, - .seckey={0x23,0x89,0x7A,0x4F,0xDD,0xD2,0x40,0xF7,0x3D,0x2F,0xA3,0x26,0xC5,0xBC,0x41,0x06, + {0x23,0x89,0x7A,0x4F,0xDD,0xD2,0x40,0xF7,0x3D,0x2F,0xA3,0x26,0xC5,0xBC,0x41,0x06, 0xD8,0x22,0xEA,0x2A,0x01,0x1D,0x7E,0x8E,0xDF,0xE8,0xC6,0xFE,0xAA,0x76,0x41,0x41}, - .addr="rfwGiMcsffk9TcwQu1KMYYvkPq4cdHdMik"}, - {.seed={0xFC,0x0D,0x60,0xC9,0xBF,0x88,0x71,0x32,0x49,0x5A,0xD7,0x53,0xA5,0x19,0x97,0xED}, - .pubkey={0x03,0x90,0x69,0x2D,0x7C,0x32,0x6C,0x90,0xA7,0xF3,0x2B,0xA6,0x71,0xDB,0x1E,0x28, + "rfwGiMcsffk9TcwQu1KMYYvkPq4cdHdMik"}, + {{0xFC,0x0D,0x60,0xC9,0xBF,0x88,0x71,0x32,0x49,0x5A,0xD7,0x53,0xA5,0x19,0x97,0xED}, + {0x03,0x90,0x69,0x2D,0x7C,0x32,0x6C,0x90,0xA7,0xF3,0x2B,0xA6,0x71,0xDB,0x1E,0x28, 0x29,0xC9,0xBB,0xA6,0x8B,0x95,0x6E,0x88,0x19,0x13,0x59,0xEE,0x7E,0x85,0x67,0xCC,0x35}, - .seckey={0x39,0x43,0x83,0x14,0xC3,0x6E,0x24,0x7B,0x66,0x3F,0x65,0x60,0x5A,0xA5,0xE2,0x0C, + {0x39,0x43,0x83,0x14,0xC3,0x6E,0x24,0x7B,0x66,0x3F,0x65,0x60,0x5A,0xA5,0xE2,0x0C, 0x71,0xAF,0x8D,0xBD,0x9A,0x04,0xBB,0x1D,0x3B,0x67,0xFC,0x63,0x0A,0x3D,0x74,0xB6}, - .addr="rNYp97qFzBZ5SLfXRtRMwFNxHrGR9cQyGL"}, - {.seed={0x57,0x44,0x63,0xB8,0x56,0x88,0x76,0xC7,0x58,0x2B,0x91,0xC9,0x82,0xF6,0xE4,0x6F}, - .pubkey={0x03,0x00,0xF4,0x84,0x0C,0xD6,0x00,0xD1,0xC7,0x54,0x5D,0x2D,0xBD,0x1B,0xB7,0x9A, + "rNYp97qFzBZ5SLfXRtRMwFNxHrGR9cQyGL"}, + {{0x57,0x44,0x63,0xB8,0x56,0x88,0x76,0xC7,0x58,0x2B,0x91,0xC9,0x82,0xF6,0xE4,0x6F}, + {0x03,0x00,0xF4,0x84,0x0C,0xD6,0x00,0xD1,0xC7,0x54,0x5D,0x2D,0xBD,0x1B,0xB7,0x9A, 0xE3,0x55,0x58,0x67,0x98,0x2E,0x2D,0x38,0x7C,0x3B,0x9C,0xE8,0x1D,0x85,0x76,0x94,0x6E}, - .seckey={0x12,0x8F,0xA4,0xE0,0x64,0xA3,0x06,0x90,0x3E,0xC7,0x33,0x44,0xF6,0x10,0xB3,0x8B, + {0x12,0x8F,0xA4,0xE0,0x64,0xA3,0x06,0x90,0x3E,0xC7,0x33,0x44,0xF6,0x10,0xB3,0x8B, 0xA4,0xDA,0x20,0x97,0x6C,0x46,0x91,0x9B,0xA7,0x81,0x05,0xCA,0x1E,0x8E,0x58,0xE6}, - .addr="r9U2Q5oiKTxp643G8gh6okmToJL6xVhqUn"}, - {.seed={0x6D,0xDD,0x5C,0xC5,0x55,0x90,0x7E,0x56,0x08,0x7D,0x08,0xAA,0xD0,0xCD,0xEB,0x85}, - .pubkey={0x02,0xA1,0x82,0x14,0xBF,0xF9,0xA9,0x64,0xE3,0x52,0x60,0x5F,0xA3,0x7C,0xB4,0xE4, + "r9U2Q5oiKTxp643G8gh6okmToJL6xVhqUn"}, + {{0x6D,0xDD,0x5C,0xC5,0x55,0x90,0x7E,0x56,0x08,0x7D,0x08,0xAA,0xD0,0xCD,0xEB,0x85}, + {0x02,0xA1,0x82,0x14,0xBF,0xF9,0xA9,0x64,0xE3,0x52,0x60,0x5F,0xA3,0x7C,0xB4,0xE4, 0x47,0x08,0xBE,0x9E,0xDF,0x3A,0xC7,0x9E,0x59,0xBC,0x09,0x7B,0x58,0x24,0xC8,0x43,0x78}, - .seckey={0x6E,0x46,0x58,0x1D,0x14,0x4D,0xA5,0x0A,0xEB,0xBE,0xD4,0xF5,0x24,0x9C,0x6E,0x7B, + {0x6E,0x46,0x58,0x1D,0x14,0x4D,0xA5,0x0A,0xEB,0xBE,0xD4,0xF5,0x24,0x9C,0x6E,0x7B, 0x63,0x00,0xA3,0xAB,0xFE,0x5B,0x64,0x23,0xE1,0x9A,0x31,0x82,0x8E,0xAD,0x03,0xFF}, - .addr="raYyxUC2RFpNnoYcpd8u9yRcRUofg1VU1i"}, - {.seed={0x21,0xE4,0xC8,0x8B,0x52,0x28,0x7A,0xF8,0x98,0x5C,0x86,0x20,0xB8,0xD6,0x12,0xA6}, - .pubkey={0x03,0xBD,0x83,0x65,0x5D,0x79,0xDF,0x33,0xE8,0x47,0x28,0xA1,0xBC,0xD1,0x1E,0x9A, + "raYyxUC2RFpNnoYcpd8u9yRcRUofg1VU1i"}, + {{0x21,0xE4,0xC8,0x8B,0x52,0x28,0x7A,0xF8,0x98,0x5C,0x86,0x20,0xB8,0xD6,0x12,0xA6}, + {0x03,0xBD,0x83,0x65,0x5D,0x79,0xDF,0x33,0xE8,0x47,0x28,0xA1,0xBC,0xD1,0x1E,0x9A, 0xD7,0x4E,0x03,0xDF,0x2E,0x77,0x12,0xA0,0x88,0xD1,0x90,0x4A,0x36,0xF1,0x0B,0xA5,0xC1}, - .seckey={0xED,0x14,0x67,0x13,0xDD,0x51,0xF0,0xF1,0x7F,0x9A,0x46,0xA3,0x2C,0x5E,0xA9,0x8A, + {0xED,0x14,0x67,0x13,0xDD,0x51,0xF0,0xF1,0x7F,0x9A,0x46,0xA3,0x2C,0x5E,0xA9,0x8A, 0xC6,0xF5,0xA8,0x1C,0x2F,0x41,0x7F,0x81,0x99,0x9B,0xFF,0x1C,0xBA,0x2A,0xF6,0x77}, - .addr="raTGiNwu2Rrv33y1Ssv7BqhbRiyjPQLze4"}, - {.seed={0x78,0x36,0xB1,0x6B,0x67,0x4D,0x8A,0xF1,0x2D,0xDC,0x09,0xF7,0x4D,0x56,0xAC,0x8A}, - .pubkey={0x03,0x57,0xEE,0x1D,0x13,0x73,0x48,0xD5,0xA2,0x2C,0x9D,0x1F,0x31,0x25,0x4C,0x19, + "raTGiNwu2Rrv33y1Ssv7BqhbRiyjPQLze4"}, + {{0x78,0x36,0xB1,0x6B,0x67,0x4D,0x8A,0xF1,0x2D,0xDC,0x09,0xF7,0x4D,0x56,0xAC,0x8A}, + {0x03,0x57,0xEE,0x1D,0x13,0x73,0x48,0xD5,0xA2,0x2C,0x9D,0x1F,0x31,0x25,0x4C,0x19, 0x5B,0x70,0xBE,0x48,0x08,0xCC,0xF0,0xF1,0xE6,0x39,0x98,0x69,0x81,0x65,0x8E,0xFB,0xEB}, - .seckey={0x5B,0x6E,0x55,0x4A,0x2D,0x42,0xDA,0x3E,0x9D,0x23,0x57,0xC2,0x69,0xD0,0x0D,0xDF, + {0x5B,0x6E,0x55,0x4A,0x2D,0x42,0xDA,0x3E,0x9D,0x23,0x57,0xC2,0x69,0xD0,0x0D,0xDF, 0xA8,0xFC,0x67,0x51,0x4F,0xE7,0xC4,0xE5,0xEB,0x36,0x90,0xF2,0x10,0x62,0xE9,0x02}, - .addr="rJ9UHCYDkUrBrJK6Hr24BraygxKzpVG5LJ"}, - {.seed={0x43,0x84,0x27,0x4F,0x79,0xE4,0xCF,0xBB,0x4B,0x10,0xFA,0x6C,0x1D,0xA9,0xFD,0xBD}, - .pubkey={0x02,0x59,0xCE,0x86,0xBA,0xB6,0xF5,0x4E,0x6A,0xB8,0x83,0xD0,0x9C,0x05,0x98,0x8D, + "rJ9UHCYDkUrBrJK6Hr24BraygxKzpVG5LJ"}, + {{0x43,0x84,0x27,0x4F,0x79,0xE4,0xCF,0xBB,0x4B,0x10,0xFA,0x6C,0x1D,0xA9,0xFD,0xBD}, + {0x02,0x59,0xCE,0x86,0xBA,0xB6,0xF5,0x4E,0x6A,0xB8,0x83,0xD0,0x9C,0x05,0x98,0x8D, 0x9E,0x8A,0x71,0x53,0x88,0x32,0xB5,0x0B,0xD4,0xDE,0x1E,0xFA,0x8B,0x13,0x50,0xF8,0xBC}, - .seckey={0x97,0x33,0xA7,0x37,0x8B,0x17,0x85,0x80,0x5B,0x16,0x3A,0x72,0xA0,0x13,0x2E,0xFE, + {0x97,0x33,0xA7,0x37,0x8B,0x17,0x85,0x80,0x5B,0x16,0x3A,0x72,0xA0,0x13,0x2E,0xFE, 0xF6,0x52,0x57,0x35,0x39,0x5F,0x4F,0xE8,0x3C,0xC0,0x3C,0x61,0x63,0xA3,0xA3,0x86}, - .addr="r37FSSzFWe2FtR6kYfKdPeeZ8i6NZ8uDBU"}, - {.seed={0x90,0x6F,0xF5,0xDF,0xA6,0x06,0xE2,0x6D,0xED,0x61,0xC5,0xFE,0x41,0x6F,0xAA,0x09}, - .pubkey={0x03,0x71,0x70,0x38,0x45,0x72,0x99,0x33,0xA2,0xAB,0xF8,0x4C,0x51,0x82,0x9E,0x34, + "r37FSSzFWe2FtR6kYfKdPeeZ8i6NZ8uDBU"}, + {{0x90,0x6F,0xF5,0xDF,0xA6,0x06,0xE2,0x6D,0xED,0x61,0xC5,0xFE,0x41,0x6F,0xAA,0x09}, + {0x03,0x71,0x70,0x38,0x45,0x72,0x99,0x33,0xA2,0xAB,0xF8,0x4C,0x51,0x82,0x9E,0x34, 0x00,0xA7,0x41,0x0F,0x9E,0x57,0x66,0x5C,0x65,0xD1,0xD6,0x07,0xF2,0xD1,0x67,0x52,0x2F}, - .seckey={0x55,0x80,0x14,0xCD,0xC8,0x08,0xB5,0x9A,0x6A,0x32,0x2D,0x61,0xB9,0xEA,0xE1,0x7B, + {0x55,0x80,0x14,0xCD,0xC8,0x08,0xB5,0x9A,0x6A,0x32,0x2D,0x61,0xB9,0xEA,0xE1,0x7B, 0xDD,0x73,0xCD,0x52,0x4A,0xDA,0x8B,0x7C,0x55,0x2E,0xAE,0x90,0xDB,0x65,0x18,0x9B}, - .addr="rK5rBKf8uDunrTTNY7GWmB3Jnasg2CEuiE"}, - {.seed={0x85,0x3C,0x3B,0xE4,0xD9,0x9F,0xF2,0x03,0x3D,0xF0,0xE2,0x35,0x40,0xA4,0xF3,0x7D}, - .pubkey={0x03,0x44,0xB4,0x5E,0x37,0xCD,0xD1,0x73,0x88,0xD6,0xE0,0x20,0xED,0x0A,0x52,0x8D, + "rK5rBKf8uDunrTTNY7GWmB3Jnasg2CEuiE"}, + {{0x85,0x3C,0x3B,0xE4,0xD9,0x9F,0xF2,0x03,0x3D,0xF0,0xE2,0x35,0x40,0xA4,0xF3,0x7D}, + {0x03,0x44,0xB4,0x5E,0x37,0xCD,0xD1,0x73,0x88,0xD6,0xE0,0x20,0xED,0x0A,0x52,0x8D, 0x94,0x0D,0x43,0x84,0x86,0x36,0x3B,0x5D,0x1D,0x6A,0xB0,0x3C,0x5E,0xDD,0xEC,0x1D,0x1E}, - .seckey={0xD4,0x88,0x5F,0x26,0xE9,0xB9,0x8F,0x46,0xAA,0x3C,0xD2,0x26,0x6A,0x57,0x32,0x48, + {0xD4,0x88,0x5F,0x26,0xE9,0xB9,0x8F,0x46,0xAA,0x3C,0xD2,0x26,0x6A,0x57,0x32,0x48, 0x61,0x03,0xD5,0x7B,0x5F,0x52,0xB3,0x49,0xC1,0xAA,0x4F,0xF6,0xDC,0x63,0xEE,0x28}, - .addr="rB9xKaxuHXDxe3fYQSoTGTBN5LkMsXp7vB"}, - {.seed={0x15,0x6F,0x19,0xDA,0xC4,0x69,0x5A,0x47,0x9C,0x8F,0x2D,0x59,0x90,0xC7,0x7A,0x96}, - .pubkey={0x03,0x51,0x5A,0xAA,0x83,0x0A,0xDA,0xB9,0xD8,0xA5,0x1C,0x35,0x41,0xD0,0x0A,0xF8, + "rB9xKaxuHXDxe3fYQSoTGTBN5LkMsXp7vB"}, + {{0x15,0x6F,0x19,0xDA,0xC4,0x69,0x5A,0x47,0x9C,0x8F,0x2D,0x59,0x90,0xC7,0x7A,0x96}, + {0x03,0x51,0x5A,0xAA,0x83,0x0A,0xDA,0xB9,0xD8,0xA5,0x1C,0x35,0x41,0xD0,0x0A,0xF8, 0x25,0x05,0x15,0x0A,0xD4,0x5B,0x9D,0x0A,0x66,0x79,0x97,0xCE,0x01,0x88,0xE7,0x57,0xA8}, - .seckey={0xEE,0x73,0xBC,0xC7,0xEA,0x9E,0x93,0x2D,0xA1,0x7A,0x28,0xD6,0x7E,0x2A,0x85,0x99, + {0xEE,0x73,0xBC,0xC7,0xEA,0x9E,0x93,0x2D,0xA1,0x7A,0x28,0xD6,0x7E,0x2A,0x85,0x99, 0x97,0x6D,0x18,0x29,0x60,0x1F,0x7D,0x17,0xD8,0x6D,0x68,0x53,0x82,0x2E,0x4D,0xF2}, - .addr="rM83yYQQN6aLjfobwvfYMR2r6xo9bE66ZY"}, - {.seed={0x95,0xCF,0x0F,0x72,0xD7,0xF6,0x87,0x8A,0x76,0xE6,0xF8,0x4E,0x96,0xFD,0x34,0x2B}, - .pubkey={0x03,0xA7,0x5E,0x58,0x08,0xAB,0x79,0x48,0x34,0xAF,0xBB,0x7B,0x7C,0x14,0x3A,0x48, + "rM83yYQQN6aLjfobwvfYMR2r6xo9bE66ZY"}, + {{0x95,0xCF,0x0F,0x72,0xD7,0xF6,0x87,0x8A,0x76,0xE6,0xF8,0x4E,0x96,0xFD,0x34,0x2B}, + {0x03,0xA7,0x5E,0x58,0x08,0xAB,0x79,0x48,0x34,0xAF,0xBB,0x7B,0x7C,0x14,0x3A,0x48, 0x83,0x53,0xF5,0x03,0xB2,0xFC,0x79,0x20,0x05,0x3E,0xDA,0x92,0xE3,0xFB,0xFE,0x53,0xA8}, - .seckey={0x43,0x6F,0x3A,0x67,0xC1,0xE4,0x2F,0x61,0x05,0x20,0x46,0x7D,0xB1,0x94,0x2B,0xDB, + {0x43,0x6F,0x3A,0x67,0xC1,0xE4,0x2F,0x61,0x05,0x20,0x46,0x7D,0xB1,0x94,0x2B,0xDB, 0xE9,0xD2,0xD6,0xE1,0x14,0x13,0xEB,0xE1,0x9B,0x87,0x63,0xBC,0x7C,0xCF,0x27,0x57}, - .addr="rJ3MkKKsTAxzgW87YTZ6T5kauftDAa21hn"}, - {.seed={0x27,0x8E,0x7E,0x47,0x39,0x7D,0xCC,0xF5,0x4B,0xBF,0x52,0x79,0xD8,0x5B,0x60,0x52}, - .pubkey={0x02,0xA9,0x07,0xF0,0x09,0xFD,0x99,0xB5,0x9E,0x8C,0x90,0x46,0x99,0x59,0xCF,0xA9, + "rJ3MkKKsTAxzgW87YTZ6T5kauftDAa21hn"}, + {{0x27,0x8E,0x7E,0x47,0x39,0x7D,0xCC,0xF5,0x4B,0xBF,0x52,0x79,0xD8,0x5B,0x60,0x52}, + {0x02,0xA9,0x07,0xF0,0x09,0xFD,0x99,0xB5,0x9E,0x8C,0x90,0x46,0x99,0x59,0xCF,0xA9, 0xEE,0xB8,0xE6,0x9F,0x66,0x8C,0xE3,0x21,0x15,0xAE,0x48,0x8F,0x37,0xDA,0x4B,0x3D,0xB5}, - .seckey={0x71,0xD8,0x4B,0x78,0x69,0x6B,0x9E,0x93,0x97,0xDB,0x07,0xB2,0x3D,0x4C,0x4B,0x6D, + {0x71,0xD8,0x4B,0x78,0x69,0x6B,0x9E,0x93,0x97,0xDB,0x07,0xB2,0x3D,0x4C,0x4B,0x6D, 0x7C,0x0B,0x87,0x9D,0x18,0xB5,0x45,0x61,0x27,0xF4,0x78,0x42,0xD8,0xE7,0x20,0xB5}, - .addr="rMMn8XqJvtmn2CN3E19vvjA3Y8GLWdgwi"}, - {.seed={0x92,0xF0,0x1F,0xC7,0x8F,0x22,0x58,0xB1,0xA9,0x70,0xF4,0xA2,0xDD,0xDD,0xD3,0xA1}, - .pubkey={0x03,0x0C,0x28,0x5D,0x66,0x77,0x0A,0xFD,0x42,0xAB,0xAE,0x15,0x18,0x74,0x7A,0x64, + "rMMn8XqJvtmn2CN3E19vvjA3Y8GLWdgwi"}, + {{0x92,0xF0,0x1F,0xC7,0x8F,0x22,0x58,0xB1,0xA9,0x70,0xF4,0xA2,0xDD,0xDD,0xD3,0xA1}, + {0x03,0x0C,0x28,0x5D,0x66,0x77,0x0A,0xFD,0x42,0xAB,0xAE,0x15,0x18,0x74,0x7A,0x64, 0x33,0xB7,0xD5,0x87,0x7A,0x92,0x66,0x78,0x05,0x78,0x2C,0x36,0xDD,0xEA,0x9A,0xF3,0x8F}, - .seckey={0x44,0xC0,0x46,0xE7,0x1D,0x7E,0x99,0xAE,0x70,0xDE,0x9B,0x97,0x1A,0x48,0xCA,0xB4, + {0x44,0xC0,0x46,0xE7,0x1D,0x7E,0x99,0xAE,0x70,0xDE,0x9B,0x97,0x1A,0x48,0xCA,0xB4, 0x26,0x06,0xB4,0xD7,0x81,0xE8,0x84,0x40,0x9B,0x8C,0xC6,0xB3,0x14,0xE1,0xA5,0xCA}, - .addr="rMRLSmwj5SPYidP7UG6vLVmZm849vj9Boy"}, - {.seed={0x4D,0x0A,0x15,0x15,0x19,0x8D,0xAC,0xF3,0xAA,0x74,0x70,0x06,0x24,0x75,0xE1,0x71}, - .pubkey={0x02,0x3F,0xBA,0x9F,0xF3,0x33,0x71,0x35,0x12,0xE9,0xA3,0x16,0xA8,0x7A,0xBE,0x5E, + "rMRLSmwj5SPYidP7UG6vLVmZm849vj9Boy"}, + {{0x4D,0x0A,0x15,0x15,0x19,0x8D,0xAC,0xF3,0xAA,0x74,0x70,0x06,0x24,0x75,0xE1,0x71}, + {0x02,0x3F,0xBA,0x9F,0xF3,0x33,0x71,0x35,0x12,0xE9,0xA3,0x16,0xA8,0x7A,0xBE,0x5E, 0x22,0x2D,0xE0,0xE1,0x82,0xE1,0x8F,0x4B,0xE8,0x05,0xC7,0xE4,0xE1,0x95,0xA8,0x58,0x27}, - .seckey={0x62,0x76,0x1B,0xC1,0xD8,0x79,0x83,0xC7,0xA5,0x49,0x1E,0x7F,0x4A,0x0F,0x6C,0x04, + {0x62,0x76,0x1B,0xC1,0xD8,0x79,0x83,0xC7,0xA5,0x49,0x1E,0x7F,0x4A,0x0F,0x6C,0x04, 0xC1,0xB4,0x36,0x17,0x31,0x99,0xFF,0x78,0x07,0x36,0xD4,0x58,0x3F,0xA9,0x24,0xA5}, - .addr="rEwu1cBZ37WaTF6aJDMQKTKxBBok4bkeW9"}, - {.seed={0xF9,0x3E,0x0D,0xFE,0xEB,0xFC,0x30,0x3B,0x2F,0x13,0x7C,0xF8,0xCF,0x9F,0x25,0x3B}, - .pubkey={0x03,0x1B,0x7E,0xEC,0x18,0x2A,0xEA,0x64,0xB9,0x1F,0xF6,0x13,0x31,0x28,0x6F,0xC9, + "rEwu1cBZ37WaTF6aJDMQKTKxBBok4bkeW9"}, + {{0xF9,0x3E,0x0D,0xFE,0xEB,0xFC,0x30,0x3B,0x2F,0x13,0x7C,0xF8,0xCF,0x9F,0x25,0x3B}, + {0x03,0x1B,0x7E,0xEC,0x18,0x2A,0xEA,0x64,0xB9,0x1F,0xF6,0x13,0x31,0x28,0x6F,0xC9, 0xC5,0xFA,0x62,0x91,0x8F,0x06,0xFF,0x04,0x84,0xF2,0x2C,0x7D,0x9B,0x11,0xBB,0xA2,0xC4}, - .seckey={0x4D,0x79,0xBC,0x7F,0x52,0x29,0x8C,0xEB,0x31,0x37,0xE9,0x83,0x31,0x28,0x8B,0x62, + {0x4D,0x79,0xBC,0x7F,0x52,0x29,0x8C,0xEB,0x31,0x37,0xE9,0x83,0x31,0x28,0x8B,0x62, 0xDE,0xB6,0x4C,0xCD,0x41,0x28,0x4B,0x59,0xBF,0xA7,0x3F,0xFA,0x99,0xE5,0x95,0xB4}, - .addr="raaSAqSnLbGGyfpxgk7jNfyc3BwVdv6YFS"}, - {.seed={0xFC,0xB2,0x17,0xA7,0xD4,0xE6,0x6A,0x5C,0x27,0x9F,0xED,0xFF,0x22,0xAD,0x35,0x8A}, - .pubkey={0x02,0xB9,0xCE,0x1E,0xC9,0x4F,0x42,0x20,0x6E,0xCD,0xC0,0x11,0x65,0xAE,0xC9,0x28, + "raaSAqSnLbGGyfpxgk7jNfyc3BwVdv6YFS"}, + {{0xFC,0xB2,0x17,0xA7,0xD4,0xE6,0x6A,0x5C,0x27,0x9F,0xED,0xFF,0x22,0xAD,0x35,0x8A}, + {0x02,0xB9,0xCE,0x1E,0xC9,0x4F,0x42,0x20,0x6E,0xCD,0xC0,0x11,0x65,0xAE,0xC9,0x28, 0x65,0xAB,0x84,0x97,0x59,0x6F,0x03,0x37,0xCA,0xEF,0xE1,0xF1,0x86,0xA5,0x6B,0xF9,0x24}, - .seckey={0x95,0x2E,0xBD,0xC1,0x1E,0xCB,0x7C,0x67,0xE6,0x90,0xF7,0x9D,0x7B,0xB9,0x72,0x3C, + {0x95,0x2E,0xBD,0xC1,0x1E,0xCB,0x7C,0x67,0xE6,0x90,0xF7,0x9D,0x7B,0xB9,0x72,0x3C, 0xCE,0x84,0xD6,0x0C,0x37,0x23,0xDE,0x71,0x66,0x9E,0xD8,0xF5,0xCA,0x7D,0xE5,0x60}, - .addr="raCkMBRoTrd41BuoAQq6f54E8iA97Fgwiq"}, - {.seed={0x20,0xE6,0xD1,0xE2,0x10,0x0D,0xF4,0x2C,0x39,0x81,0x03,0x61,0xEB,0x54,0xFA,0x6B}, - .pubkey={0x02,0x51,0x6D,0xF5,0x75,0xF9,0x9E,0x61,0xB4,0xBE,0x78,0xFD,0xCC,0x7D,0x2E,0x53, + "raCkMBRoTrd41BuoAQq6f54E8iA97Fgwiq"}, + {{0x20,0xE6,0xD1,0xE2,0x10,0x0D,0xF4,0x2C,0x39,0x81,0x03,0x61,0xEB,0x54,0xFA,0x6B}, + {0x02,0x51,0x6D,0xF5,0x75,0xF9,0x9E,0x61,0xB4,0xBE,0x78,0xFD,0xCC,0x7D,0x2E,0x53, 0x9E,0x3A,0x59,0xD4,0x6B,0x2E,0xA9,0xEA,0x90,0x2F,0x5C,0xBE,0x3C,0xC3,0xA1,0x71,0xA9}, - .seckey={0x4F,0x50,0xD3,0x78,0x7F,0x50,0x4D,0x4E,0xCF,0xD8,0xAE,0x40,0xD8,0xA0,0xB1,0xBE, + {0x4F,0x50,0xD3,0x78,0x7F,0x50,0x4D,0x4E,0xCF,0xD8,0xAE,0x40,0xD8,0xA0,0xB1,0xBE, 0x92,0x2E,0xD1,0x0F,0x1B,0x26,0x8A,0x97,0xF3,0x36,0xB2,0x1D,0xCB,0x9F,0x87,0x92}, - .addr="rnqPbY4BaFVNrbt2YwLQUSwxk7CPRJChf2"}, - {.seed={0x63,0x09,0x81,0x8C,0xB7,0xE1,0xFC,0x55,0x77,0xBE,0xC7,0xDE,0x6C,0x5A,0x2B,0x73}, - .pubkey={0x03,0x64,0x7B,0x2F,0xF7,0xD8,0xC0,0x56,0xFC,0x19,0x0F,0xF1,0x5B,0x6F,0x51,0x53, + "rnqPbY4BaFVNrbt2YwLQUSwxk7CPRJChf2"}, + {{0x63,0x09,0x81,0x8C,0xB7,0xE1,0xFC,0x55,0x77,0xBE,0xC7,0xDE,0x6C,0x5A,0x2B,0x73}, + {0x03,0x64,0x7B,0x2F,0xF7,0xD8,0xC0,0x56,0xFC,0x19,0x0F,0xF1,0x5B,0x6F,0x51,0x53, 0x00,0x1F,0xF7,0x9C,0x44,0x98,0xD7,0x34,0x72,0x21,0x89,0xD3,0xE8,0x00,0xBC,0x01,0xDA}, - .seckey={0xC5,0x0C,0x5C,0x92,0xB4,0xFB,0x2D,0x6A,0xC0,0xC6,0xCA,0xC0,0xD5,0xB4,0x26,0xC5, + {0xC5,0x0C,0x5C,0x92,0xB4,0xFB,0x2D,0x6A,0xC0,0xC6,0xCA,0xC0,0xD5,0xB4,0x26,0xC5, 0x03,0xAE,0xE7,0x72,0xEA,0xF1,0x71,0x3C,0xDC,0xE4,0xE4,0x78,0xFF,0x28,0x22,0xAF}, - .addr="rsBwJKLppzK5XK6WscKXW96NT4ajjYN4oV"}, - {.seed={0xBE,0x60,0x25,0x4D,0xB3,0xED,0xDE,0xE2,0x47,0x69,0x25,0x83,0x80,0xA6,0xF7,0x94}, - .pubkey={0x02,0xD8,0x4C,0x88,0xBF,0x11,0x7E,0x9E,0xFB,0x30,0xC9,0x63,0x08,0x87,0x04,0x9A, + "rsBwJKLppzK5XK6WscKXW96NT4ajjYN4oV"}, + {{0xBE,0x60,0x25,0x4D,0xB3,0xED,0xDE,0xE2,0x47,0x69,0x25,0x83,0x80,0xA6,0xF7,0x94}, + {0x02,0xD8,0x4C,0x88,0xBF,0x11,0x7E,0x9E,0xFB,0x30,0xC9,0x63,0x08,0x87,0x04,0x9A, 0xF2,0xB2,0x33,0x52,0xBC,0x77,0x81,0x3B,0x76,0x5B,0x56,0x0D,0xC5,0x49,0x21,0x20,0xE3}, - .seckey={0xAC,0x21,0xC4,0x05,0xED,0x57,0x17,0xB0,0xB7,0x20,0x6C,0x0A,0x59,0x1C,0x6A,0x32, + {0xAC,0x21,0xC4,0x05,0xED,0x57,0x17,0xB0,0xB7,0x20,0x6C,0x0A,0x59,0x1C,0x6A,0x32, 0xCF,0xD1,0x61,0xC2,0x18,0x2D,0xE4,0x24,0x88,0xA0,0xE2,0xE9,0xC5,0x7E,0x72,0xDB}, - .addr="rGh8eA3PAbpXF2i4YuWdJGknvXxjLs7UFn"}, - {.seed={0x92,0x9A,0x69,0xD1,0xA4,0x72,0x50,0xA4,0x40,0x58,0x00,0xB6,0x93,0xC4,0x0F,0x65}, - .pubkey={0x03,0xB4,0xCE,0x74,0x68,0x26,0x64,0x2B,0xD9,0x2F,0x7E,0xC0,0xB3,0x6A,0x25,0xAA, + "rGh8eA3PAbpXF2i4YuWdJGknvXxjLs7UFn"}, + {{0x92,0x9A,0x69,0xD1,0xA4,0x72,0x50,0xA4,0x40,0x58,0x00,0xB6,0x93,0xC4,0x0F,0x65}, + {0x03,0xB4,0xCE,0x74,0x68,0x26,0x64,0x2B,0xD9,0x2F,0x7E,0xC0,0xB3,0x6A,0x25,0xAA, 0xA8,0x72,0xE0,0x91,0x2A,0x2F,0x09,0x49,0x6B,0x5D,0x08,0xDD,0x0D,0xC3,0x29,0x7A,0xEA}, - .seckey={0x3D,0x6A,0x38,0x3A,0xCC,0x5D,0x22,0xD9,0x44,0xD2,0x84,0xE7,0xA2,0x73,0x34,0xE4, + {0x3D,0x6A,0x38,0x3A,0xCC,0x5D,0x22,0xD9,0x44,0xD2,0x84,0xE7,0xA2,0x73,0x34,0xE4, 0xE3,0x01,0x2A,0x0B,0x0C,0x5B,0x7E,0xAA,0x64,0xD0,0x41,0xE4,0x1E,0xE3,0x1D,0x38}, - .addr="rPWb2cxWuXV39hFBJgEup4enkiBXDMMuPs"}, - {.seed={0x72,0xF2,0x97,0x35,0x2E,0x8F,0x35,0xB3,0x4D,0x2E,0x6B,0xC7,0x3A,0x42,0xDD,0xC9}, - .pubkey={0x02,0xB5,0x28,0xB7,0x7B,0x4E,0xA1,0xFC,0xC5,0x0D,0x00,0x72,0xD9,0x0B,0x69,0x46, + "rPWb2cxWuXV39hFBJgEup4enkiBXDMMuPs"}, + {{0x72,0xF2,0x97,0x35,0x2E,0x8F,0x35,0xB3,0x4D,0x2E,0x6B,0xC7,0x3A,0x42,0xDD,0xC9}, + {0x02,0xB5,0x28,0xB7,0x7B,0x4E,0xA1,0xFC,0xC5,0x0D,0x00,0x72,0xD9,0x0B,0x69,0x46, 0x58,0x60,0xD6,0xD1,0x81,0xC1,0x1B,0xC4,0x8D,0xDD,0x01,0xAA,0x35,0x53,0x85,0x6E,0xBA}, - .seckey={0xA9,0x21,0xF9,0x54,0xF4,0xF7,0x78,0xA6,0xC9,0x78,0x90,0x46,0xED,0x12,0xCC,0xBA, + {0xA9,0x21,0xF9,0x54,0xF4,0xF7,0x78,0xA6,0xC9,0x78,0x90,0x46,0xED,0x12,0xCC,0xBA, 0x06,0x9C,0x79,0x71,0x8D,0x24,0xA0,0x33,0xC4,0x7B,0x91,0xDF,0x41,0xEC,0x17,0x00}, - .addr="rMMikVEYA9b7cyA82F4Lezpccti8coi39u"}, - {.seed={0xC8,0x55,0x71,0x45,0x38,0xC5,0xF7,0xAA,0xC4,0x62,0x05,0xDC,0xC5,0x4E,0x49,0xCC}, - .pubkey={0x02,0xBB,0xD4,0x85,0x34,0x2E,0x89,0xEA,0x33,0x31,0xE7,0xC8,0x1C,0xAE,0x1D,0xE6, + "rMMikVEYA9b7cyA82F4Lezpccti8coi39u"}, + {{0xC8,0x55,0x71,0x45,0x38,0xC5,0xF7,0xAA,0xC4,0x62,0x05,0xDC,0xC5,0x4E,0x49,0xCC}, + {0x02,0xBB,0xD4,0x85,0x34,0x2E,0x89,0xEA,0x33,0x31,0xE7,0xC8,0x1C,0xAE,0x1D,0xE6, 0x64,0x7C,0xE5,0xBE,0x2A,0xA2,0xF8,0xB9,0xAD,0x6E,0x44,0x66,0xD4,0xD8,0x3E,0xDC,0x71}, - .seckey={0x52,0xB9,0x26,0x2D,0xED,0xD5,0x1D,0xB5,0xA0,0x48,0x1A,0x64,0x32,0xD2,0xAE,0x2E, + {0x52,0xB9,0x26,0x2D,0xED,0xD5,0x1D,0xB5,0xA0,0x48,0x1A,0x64,0x32,0xD2,0xAE,0x2E, 0x95,0x12,0x66,0x0F,0xF1,0x04,0x99,0xBD,0xE2,0xA9,0x4A,0x7D,0x42,0x64,0x84,0xC0}, - .addr="r4cJGjZb7v6u9oAG5vZHbzAZeKjG3oubhT"}, - {.seed={0xA7,0x8F,0xA2,0xA0,0x01,0xEE,0xD7,0xC9,0xE4,0x8D,0x36,0x1B,0xBA,0xDD,0xB3,0x8C}, - .pubkey={0x02,0x0D,0xAA,0xC3,0x5A,0xB5,0xEB,0x1D,0x24,0xFA,0xE0,0x10,0x8D,0xBC,0xE8,0xEA, + "r4cJGjZb7v6u9oAG5vZHbzAZeKjG3oubhT"}, + {{0xA7,0x8F,0xA2,0xA0,0x01,0xEE,0xD7,0xC9,0xE4,0x8D,0x36,0x1B,0xBA,0xDD,0xB3,0x8C}, + {0x02,0x0D,0xAA,0xC3,0x5A,0xB5,0xEB,0x1D,0x24,0xFA,0xE0,0x10,0x8D,0xBC,0xE8,0xEA, 0x37,0xD4,0xEE,0xA7,0x1C,0xFA,0xF2,0x0C,0x24,0xAF,0xA1,0xF9,0x92,0x1E,0xD4,0x9B,0x67}, - .seckey={0xE8,0xFA,0x0D,0xEC,0x05,0x35,0xE5,0x46,0x5D,0x75,0x24,0x93,0x84,0x48,0x9B,0x55, + {0xE8,0xFA,0x0D,0xEC,0x05,0x35,0xE5,0x46,0x5D,0x75,0x24,0x93,0x84,0x48,0x9B,0x55, 0x16,0xA5,0x1D,0x9F,0xBF,0xB8,0xC3,0x9A,0x91,0xA8,0x63,0xF8,0xED,0x2C,0xC9,0x41}, - .addr="rLEDPnaJhjcDYzFvYufDTaJvXBokJka1Wf"}, - {.seed={0x8D,0x3B,0xC5,0x48,0x77,0x83,0x56,0x43,0xB9,0xA7,0x6A,0xBE,0xBE,0x16,0xEA,0xE9}, - .pubkey={0x03,0x54,0x44,0x02,0x4A,0x23,0x22,0x3A,0xCB,0xA9,0x71,0xD5,0x7C,0x74,0xF4,0x25, + "rLEDPnaJhjcDYzFvYufDTaJvXBokJka1Wf"}, + {{0x8D,0x3B,0xC5,0x48,0x77,0x83,0x56,0x43,0xB9,0xA7,0x6A,0xBE,0xBE,0x16,0xEA,0xE9}, + {0x03,0x54,0x44,0x02,0x4A,0x23,0x22,0x3A,0xCB,0xA9,0x71,0xD5,0x7C,0x74,0xF4,0x25, 0x49,0x77,0x9D,0x33,0xDC,0x3A,0x8E,0x61,0xF8,0xE7,0x34,0x5E,0x25,0x5D,0x8B,0x81,0x40}, - .seckey={0xCB,0x6F,0x1C,0xA0,0x22,0x68,0x5F,0xF1,0x4E,0x0C,0xBF,0xB7,0x90,0x4F,0x3A,0x13, + {0xCB,0x6F,0x1C,0xA0,0x22,0x68,0x5F,0xF1,0x4E,0x0C,0xBF,0xB7,0x90,0x4F,0x3A,0x13, 0x17,0x5E,0xEF,0x08,0x47,0x44,0xD3,0xA3,0x0A,0x21,0x75,0x9B,0x8A,0xB7,0xDD,0x94}, - .addr="rnxJTkqbxpbdoC1nPQvAfPDi8zpmsschsR"}, - {.seed={0x27,0x1B,0xEA,0xD4,0xBF,0x66,0x55,0x06,0xCE,0x06,0x7D,0xA6,0xF8,0xAF,0xFC,0xF3}, - .pubkey={0x03,0x01,0xC3,0xBE,0xA1,0xD1,0xA8,0x57,0x5E,0x29,0x85,0x56,0x93,0x81,0x12,0xD0, + "rnxJTkqbxpbdoC1nPQvAfPDi8zpmsschsR"}, + {{0x27,0x1B,0xEA,0xD4,0xBF,0x66,0x55,0x06,0xCE,0x06,0x7D,0xA6,0xF8,0xAF,0xFC,0xF3}, + {0x03,0x01,0xC3,0xBE,0xA1,0xD1,0xA8,0x57,0x5E,0x29,0x85,0x56,0x93,0x81,0x12,0xD0, 0x41,0x7F,0x08,0x57,0xCC,0x7C,0x15,0xCC,0x75,0x22,0x5E,0x51,0xEC,0x3A,0x1A,0xAF,0x17}, - .seckey={0xA3,0x2A,0x64,0x81,0xC8,0xFA,0xFB,0xD0,0xF6,0x7C,0x80,0xD6,0xD4,0x30,0x98,0x4E, + {0xA3,0x2A,0x64,0x81,0xC8,0xFA,0xFB,0xD0,0xF6,0x7C,0x80,0xD6,0xD4,0x30,0x98,0x4E, 0xC1,0xDA,0x9E,0x63,0x8E,0xDE,0x69,0x3C,0xE1,0xFA,0xD0,0x63,0xCA,0xA8,0x62,0xD9}, - .addr="rENrUzb4cctMQApEcDRLRNkwHbVencPYSn"}, - {.seed={0x3B,0x1A,0x33,0x24,0x72,0xF4,0x1A,0xF6,0xDA,0x71,0x5F,0x02,0x0E,0x90,0x96,0xAE}, - .pubkey={0x03,0x5C,0x34,0x4A,0x9B,0x4A,0xE2,0xFF,0x1B,0xF4,0x5C,0xDE,0x91,0x92,0xA2,0xF6, + "rENrUzb4cctMQApEcDRLRNkwHbVencPYSn"}, + {{0x3B,0x1A,0x33,0x24,0x72,0xF4,0x1A,0xF6,0xDA,0x71,0x5F,0x02,0x0E,0x90,0x96,0xAE}, + {0x03,0x5C,0x34,0x4A,0x9B,0x4A,0xE2,0xFF,0x1B,0xF4,0x5C,0xDE,0x91,0x92,0xA2,0xF6, 0x23,0x27,0x0E,0x0B,0xC0,0x0C,0xB3,0x31,0x9B,0x18,0x33,0x11,0x1A,0x37,0x76,0xCE,0x57}, - .seckey={0x51,0xBD,0x74,0x0F,0xCD,0xEC,0x6D,0x96,0x36,0xB4,0xC8,0x53,0x11,0x00,0xD7,0xB5, + {0x51,0xBD,0x74,0x0F,0xCD,0xEC,0x6D,0x96,0x36,0xB4,0xC8,0x53,0x11,0x00,0xD7,0xB5, 0xD6,0xE9,0x9B,0xED,0x27,0x85,0x6C,0x48,0x22,0xE7,0x13,0x94,0xCD,0x85,0x7D,0xA9}, - .addr="rraNgbPXeioSQyDw9gq1otuJURr4tkrVbR"}, - {.seed={0xC6,0xC2,0x5B,0x54,0xB5,0xF3,0x67,0x54,0xE5,0xE1,0x3E,0x07,0xFB,0x8B,0x9A,0x12}, - .pubkey={0x02,0x44,0x78,0x11,0x6A,0x52,0x0F,0x16,0xCD,0xD9,0x0E,0x73,0xFF,0xDD,0x73,0x50, + "rraNgbPXeioSQyDw9gq1otuJURr4tkrVbR"}, + {{0xC6,0xC2,0x5B,0x54,0xB5,0xF3,0x67,0x54,0xE5,0xE1,0x3E,0x07,0xFB,0x8B,0x9A,0x12}, + {0x02,0x44,0x78,0x11,0x6A,0x52,0x0F,0x16,0xCD,0xD9,0x0E,0x73,0xFF,0xDD,0x73,0x50, 0xAE,0x40,0x3F,0x70,0xAF,0x1C,0xC6,0xB6,0xC9,0x07,0xE3,0x49,0x9D,0xF0,0x86,0xBB,0x01}, - .seckey={0x0C,0x13,0x9C,0x31,0x96,0xAB,0xCD,0x88,0x76,0x4F,0x75,0x28,0xCE,0xCC,0x17,0x4A, + {0x0C,0x13,0x9C,0x31,0x96,0xAB,0xCD,0x88,0x76,0x4F,0x75,0x28,0xCE,0xCC,0x17,0x4A, 0x02,0xA7,0x75,0xF5,0x9A,0xA7,0xA7,0x03,0x01,0x38,0xD4,0xFD,0x1D,0x2B,0x57,0x82}, - .addr="rraDh9AGcTXLCZ6mX6v1vXT8kTpZ9A2E4o"}, - {.seed={0x82,0x34,0xCA,0xC5,0x2D,0x12,0x9E,0xAC,0x87,0xA8,0xA3,0x96,0x25,0x24,0x7C,0x3C}, - .pubkey={0x03,0xA0,0x24,0xFA,0xB8,0x0C,0x29,0x10,0x22,0xE8,0x3E,0xEE,0xD0,0xBB,0xA1,0x0C, + "rraDh9AGcTXLCZ6mX6v1vXT8kTpZ9A2E4o"}, + {{0x82,0x34,0xCA,0xC5,0x2D,0x12,0x9E,0xAC,0x87,0xA8,0xA3,0x96,0x25,0x24,0x7C,0x3C}, + {0x03,0xA0,0x24,0xFA,0xB8,0x0C,0x29,0x10,0x22,0xE8,0x3E,0xEE,0xD0,0xBB,0xA1,0x0C, 0x58,0x2D,0x7F,0x74,0x99,0x87,0xE4,0x86,0x3D,0xCD,0xFD,0x4C,0x97,0xEB,0xEF,0xF1,0x88}, - .seckey={0x8C,0xA9,0x94,0xCD,0xF0,0x44,0xD1,0xE0,0x3C,0xC2,0xD8,0x81,0xE5,0x88,0x41,0xF8, + {0x8C,0xA9,0x94,0xCD,0xF0,0x44,0xD1,0xE0,0x3C,0xC2,0xD8,0x81,0xE5,0x88,0x41,0xF8, 0xD6,0x2F,0xDF,0x28,0x23,0x04,0x7A,0x9A,0x9D,0x1E,0x53,0x35,0x56,0x12,0xD1,0x9E}, - .addr="rfHFE2euELEfCS1jSqSZbZct7K3rDYxJiA"}, - {.seed={0x60,0x31,0x24,0xCB,0xD1,0xD6,0xFF,0xCB,0x2A,0xC0,0x07,0x0E,0xC2,0x34,0x84,0xE0}, - .pubkey={0x03,0x08,0xE5,0x04,0xD0,0x1D,0xB2,0x94,0xB0,0xDB,0xD1,0xD6,0x9F,0xCF,0xE7,0x87, + "rfHFE2euELEfCS1jSqSZbZct7K3rDYxJiA"}, + {{0x60,0x31,0x24,0xCB,0xD1,0xD6,0xFF,0xCB,0x2A,0xC0,0x07,0x0E,0xC2,0x34,0x84,0xE0}, + {0x03,0x08,0xE5,0x04,0xD0,0x1D,0xB2,0x94,0xB0,0xDB,0xD1,0xD6,0x9F,0xCF,0xE7,0x87, 0x70,0x83,0x81,0xF4,0x99,0x04,0xE9,0x51,0x12,0x6F,0xAF,0x27,0x51,0xF7,0x26,0xC0,0xCC}, - .seckey={0xD1,0x76,0x39,0xE8,0x2D,0xDB,0x35,0x67,0x24,0x19,0xFE,0x65,0x25,0x5B,0xE2,0x43, + {0xD1,0x76,0x39,0xE8,0x2D,0xDB,0x35,0x67,0x24,0x19,0xFE,0x65,0x25,0x5B,0xE2,0x43, 0x56,0x45,0xE0,0x20,0x69,0xCF,0xD9,0x32,0x21,0xB6,0xD0,0xEF,0x3A,0x3E,0xBD,0xD9}, - .addr="rh1KG2QmCBwZiNJpVzJxw2mDR7bQz6QeeA"}, - {.seed={0xF3,0x8C,0xD6,0x55,0x1D,0xCF,0x05,0xC1,0x09,0xFD,0x04,0xDD,0x06,0xCF,0x04,0xDB}, - .pubkey={0x02,0xDA,0xBD,0xB1,0x5F,0x23,0xB9,0x23,0xD6,0x3D,0x6F,0xC3,0x96,0x68,0xB3,0xAC, + "rh1KG2QmCBwZiNJpVzJxw2mDR7bQz6QeeA"}, + {{0xF3,0x8C,0xD6,0x55,0x1D,0xCF,0x05,0xC1,0x09,0xFD,0x04,0xDD,0x06,0xCF,0x04,0xDB}, + {0x02,0xDA,0xBD,0xB1,0x5F,0x23,0xB9,0x23,0xD6,0x3D,0x6F,0xC3,0x96,0x68,0xB3,0xAC, 0x77,0x58,0xA2,0x17,0x46,0xE9,0xE8,0xC3,0x91,0x91,0xCB,0xFA,0x89,0x43,0xB1,0x77,0xF4}, - .seckey={0x29,0x59,0xF0,0xAF,0x1B,0xDB,0x52,0x16,0xB8,0x26,0x42,0xEB,0x87,0x1C,0x90,0xBC, + {0x29,0x59,0xF0,0xAF,0x1B,0xDB,0x52,0x16,0xB8,0x26,0x42,0xEB,0x87,0x1C,0x90,0xBC, 0x96,0xCC,0xE9,0xE4,0x95,0xBF,0xE6,0x02,0x5D,0xDB,0x26,0x2E,0x1B,0x6D,0xC6,0x8E}, - .addr="rfsgasx89kAvYvqhLmJt8Pn5JsHFnZadwm"}, - {.seed={0x30,0x9F,0xC8,0x61,0x10,0x78,0xE1,0x2C,0x0B,0x3F,0x80,0x01,0x16,0x0D,0x00,0xB0}, - .pubkey={0x02,0x23,0xE5,0x05,0xAD,0x30,0x89,0x32,0x66,0x12,0x0F,0xCD,0xDE,0xB8,0xFD,0xF9, + "rfsgasx89kAvYvqhLmJt8Pn5JsHFnZadwm"}, + {{0x30,0x9F,0xC8,0x61,0x10,0x78,0xE1,0x2C,0x0B,0x3F,0x80,0x01,0x16,0x0D,0x00,0xB0}, + {0x02,0x23,0xE5,0x05,0xAD,0x30,0x89,0x32,0x66,0x12,0x0F,0xCD,0xDE,0xB8,0xFD,0xF9, 0xC2,0xFA,0xE0,0x6D,0xCE,0xBA,0x67,0x1B,0xEB,0xE1,0x25,0x85,0xD0,0xB6,0x23,0xE7,0xE0}, - .seckey={0xCE,0xD8,0xD9,0xEB,0x26,0xB5,0xD2,0x5A,0xD1,0xC7,0xDD,0x84,0xA3,0xD1,0x4F,0x07, + {0xCE,0xD8,0xD9,0xEB,0x26,0xB5,0xD2,0x5A,0xD1,0xC7,0xDD,0x84,0xA3,0xD1,0x4F,0x07, 0xB4,0xBC,0xE0,0x1A,0xA7,0xA1,0xBD,0xBD,0x41,0x7B,0x2C,0xF1,0x72,0xC3,0xD8,0x6E}, - .addr="rMnU6UGDbmG4FNHPwY8KZaiY96fJWA8uqN"}, - {.seed={0x03,0x09,0x10,0x63,0x99,0xE1,0x71,0x0E,0xE7,0xC2,0x4E,0xC2,0xD3,0x07,0x11,0x55}, - .pubkey={0x03,0x4F,0x9D,0x3A,0x5B,0x58,0x4C,0x9F,0x1C,0xF6,0x8C,0x5D,0xB0,0x0E,0x3F,0xB9, + "rMnU6UGDbmG4FNHPwY8KZaiY96fJWA8uqN"}, + {{0x03,0x09,0x10,0x63,0x99,0xE1,0x71,0x0E,0xE7,0xC2,0x4E,0xC2,0xD3,0x07,0x11,0x55}, + {0x03,0x4F,0x9D,0x3A,0x5B,0x58,0x4C,0x9F,0x1C,0xF6,0x8C,0x5D,0xB0,0x0E,0x3F,0xB9, 0xC9,0xDC,0x91,0xFF,0x4E,0x43,0xAA,0x6C,0x9E,0x49,0x77,0x83,0xDE,0x51,0x17,0x0F,0x96}, - .seckey={0x2E,0xF1,0x99,0x7B,0x37,0xCE,0x08,0x4B,0x04,0x8D,0x18,0x47,0x10,0x9B,0xA6,0xF8, + {0x2E,0xF1,0x99,0x7B,0x37,0xCE,0x08,0x4B,0x04,0x8D,0x18,0x47,0x10,0x9B,0xA6,0xF8, 0xA9,0xED,0x24,0x91,0x9A,0x3B,0x03,0xB2,0x32,0x09,0x0E,0x60,0x6B,0x08,0x63,0xD3}, - .addr="rPDive23VFL8tBzwSsh5VfxYM69EhFYUmV"}, - {.seed={0xC4,0x43,0x48,0xC9,0xFE,0x00,0xC4,0x9F,0x60,0xA0,0x6D,0xE5,0x67,0xB8,0x2C,0x1A}, - .pubkey={0x02,0xF9,0x76,0xF3,0x6E,0x24,0x6D,0x65,0x79,0x76,0xE8,0x05,0xCF,0x65,0xEC,0x84, + "rPDive23VFL8tBzwSsh5VfxYM69EhFYUmV"}, + {{0xC4,0x43,0x48,0xC9,0xFE,0x00,0xC4,0x9F,0x60,0xA0,0x6D,0xE5,0x67,0xB8,0x2C,0x1A}, + {0x02,0xF9,0x76,0xF3,0x6E,0x24,0x6D,0x65,0x79,0x76,0xE8,0x05,0xCF,0x65,0xEC,0x84, 0xC9,0x17,0x94,0x2C,0x04,0xBA,0x68,0x0B,0x42,0xB2,0x2C,0x6B,0x02,0x13,0xF8,0xD8,0x4E}, - .seckey={0x75,0x56,0xCF,0x71,0x82,0x3C,0xA4,0x93,0xEB,0x0B,0xD9,0xAE,0xEF,0x89,0xE4,0xE7, + {0x75,0x56,0xCF,0x71,0x82,0x3C,0xA4,0x93,0xEB,0x0B,0xD9,0xAE,0xEF,0x89,0xE4,0xE7, 0xCE,0x09,0x0F,0x50,0x67,0xD8,0x5D,0x95,0xA4,0x26,0x52,0x17,0x0B,0x1A,0xFF,0x18}, - .addr="rNxe7tnN6gAjov9RERrbqPQmQZX5XDo5BJ"}, - {.seed={0x44,0x7A,0x7B,0xEF,0x65,0x8D,0x23,0x7A,0x3E,0x43,0x33,0x49,0x63,0x66,0x97,0x5B}, - .pubkey={0x03,0xC3,0xAD,0x1A,0xFF,0x40,0x0C,0x0B,0xCA,0x4C,0x30,0x45,0xB6,0x58,0xE3,0x7F, + "rNxe7tnN6gAjov9RERrbqPQmQZX5XDo5BJ"}, + {{0x44,0x7A,0x7B,0xEF,0x65,0x8D,0x23,0x7A,0x3E,0x43,0x33,0x49,0x63,0x66,0x97,0x5B}, + {0x03,0xC3,0xAD,0x1A,0xFF,0x40,0x0C,0x0B,0xCA,0x4C,0x30,0x45,0xB6,0x58,0xE3,0x7F, 0x34,0xE7,0x6C,0x2A,0x80,0xD8,0xE0,0x99,0x29,0x83,0x39,0xED,0x3C,0x2C,0x0C,0x86,0x49}, - .seckey={0x6D,0x74,0x5A,0xDE,0xCC,0x4E,0xC9,0x80,0xFD,0x23,0x81,0xE3,0xE6,0x53,0x6F,0x97, + {0x6D,0x74,0x5A,0xDE,0xCC,0x4E,0xC9,0x80,0xFD,0x23,0x81,0xE3,0xE6,0x53,0x6F,0x97, 0x7E,0xD1,0x9B,0x28,0x41,0x61,0x6E,0xB8,0x4D,0x00,0x3D,0x97,0x6B,0x8C,0xE3,0xBD}, - .addr="rMun2HwdoraftsxG3JoHXKYhBnCfwmWjyK"}, - {.seed={0x34,0xE3,0x6E,0xC3,0x13,0x76,0xC4,0xB0,0x11,0x94,0x81,0x90,0x89,0xB1,0x24,0x92}, - .pubkey={0x02,0x89,0x33,0x7D,0x4D,0x1D,0xD8,0x72,0x8F,0x8F,0xF4,0x1B,0xC6,0xDE,0x73,0x0F, + "rMun2HwdoraftsxG3JoHXKYhBnCfwmWjyK"}, + {{0x34,0xE3,0x6E,0xC3,0x13,0x76,0xC4,0xB0,0x11,0x94,0x81,0x90,0x89,0xB1,0x24,0x92}, + {0x02,0x89,0x33,0x7D,0x4D,0x1D,0xD8,0x72,0x8F,0x8F,0xF4,0x1B,0xC6,0xDE,0x73,0x0F, 0x21,0x35,0x85,0x4D,0xA9,0x8E,0xA2,0x08,0xC3,0x2C,0xD2,0x50,0x7C,0x57,0x39,0xB4,0xBC}, - .seckey={0xCA,0x68,0x9E,0x9C,0x73,0x76,0x0F,0x91,0x37,0xC6,0x41,0x4C,0xBA,0x88,0x44,0xBD, + {0xCA,0x68,0x9E,0x9C,0x73,0x76,0x0F,0x91,0x37,0xC6,0x41,0x4C,0xBA,0x88,0x44,0xBD, 0x23,0x28,0xD8,0x5C,0x77,0x40,0x81,0x6B,0xB9,0xD8,0xF3,0x3A,0x0A,0x8F,0x0E,0xA0}, - .addr="rEFR7fgCegzeKBSJYGgvxMVuUcw1QmYrqm"}, - {.seed={0x60,0x08,0x22,0x98,0x97,0xAA,0xB6,0x7E,0x1B,0x24,0x63,0x50,0xA8,0x6A,0x5D,0x40}, - .pubkey={0x03,0x61,0x72,0xB2,0x19,0x99,0xC8,0x7D,0xE4,0x4B,0x0B,0x93,0x42,0x4F,0x46,0xB0, + "rEFR7fgCegzeKBSJYGgvxMVuUcw1QmYrqm"}, + {{0x60,0x08,0x22,0x98,0x97,0xAA,0xB6,0x7E,0x1B,0x24,0x63,0x50,0xA8,0x6A,0x5D,0x40}, + {0x03,0x61,0x72,0xB2,0x19,0x99,0xC8,0x7D,0xE4,0x4B,0x0B,0x93,0x42,0x4F,0x46,0xB0, 0x8B,0x3F,0x45,0xA0,0xEC,0xF3,0xE1,0xE4,0x14,0x87,0x99,0x6C,0x42,0xD1,0x2E,0x1C,0xC4}, - .seckey={0x5B,0x65,0x66,0x3C,0x23,0xF9,0x4A,0x85,0x26,0x02,0x7E,0x99,0xEC,0xDB,0xB9,0x0A, + {0x5B,0x65,0x66,0x3C,0x23,0xF9,0x4A,0x85,0x26,0x02,0x7E,0x99,0xEC,0xDB,0xB9,0x0A, 0x7F,0xA2,0xB5,0x6F,0x80,0x92,0x1A,0x2E,0xE9,0x74,0x80,0x0C,0xF5,0x32,0x31,0x72}, - .addr="rMyoPQ4P86M5PYUd9y63muzy28dJ6oS9zk"}, - {.seed={0xE3,0x47,0x3F,0xB0,0xDC,0x1D,0x26,0x01,0xCE,0xF4,0x36,0x7C,0xA6,0xCF,0x65,0xD7}, - .pubkey={0x02,0x20,0x9F,0xF0,0xB0,0x08,0x49,0x66,0xF9,0xAA,0xD6,0x41,0xDD,0xC3,0x9C,0x7B, + "rMyoPQ4P86M5PYUd9y63muzy28dJ6oS9zk"}, + {{0xE3,0x47,0x3F,0xB0,0xDC,0x1D,0x26,0x01,0xCE,0xF4,0x36,0x7C,0xA6,0xCF,0x65,0xD7}, + {0x02,0x20,0x9F,0xF0,0xB0,0x08,0x49,0x66,0xF9,0xAA,0xD6,0x41,0xDD,0xC3,0x9C,0x7B, 0xAE,0x6A,0xAF,0x87,0xF1,0x29,0xDC,0x19,0x7E,0x62,0xD1,0x15,0xF2,0x9D,0xE8,0xE2,0xF7}, - .seckey={0xDF,0xF6,0x37,0x4B,0xFC,0x42,0x2C,0x2C,0xF3,0x48,0xC2,0xF1,0xBF,0x4B,0x30,0xB1, + {0xDF,0xF6,0x37,0x4B,0xFC,0x42,0x2C,0x2C,0xF3,0x48,0xC2,0xF1,0xBF,0x4B,0x30,0xB1, 0x66,0x0E,0xCB,0xA9,0x0C,0xA9,0x32,0x77,0x71,0xB8,0x4A,0xB0,0xDC,0x24,0x69,0x86}, - .addr="rKD4abu3RY94MdoZXG4SrUBxdkQcUJLKFq"}, - {.seed={0xB1,0x25,0x1E,0xC0,0x39,0xFD,0xA9,0xD1,0x84,0x3A,0x08,0xE8,0x38,0xD6,0xE7,0xDA}, - .pubkey={0x03,0xEC,0x13,0x79,0x7E,0x49,0xE2,0x01,0x11,0xB0,0x0E,0x04,0xCA,0xA9,0x05,0xE3, + "rKD4abu3RY94MdoZXG4SrUBxdkQcUJLKFq"}, + {{0xB1,0x25,0x1E,0xC0,0x39,0xFD,0xA9,0xD1,0x84,0x3A,0x08,0xE8,0x38,0xD6,0xE7,0xDA}, + {0x03,0xEC,0x13,0x79,0x7E,0x49,0xE2,0x01,0x11,0xB0,0x0E,0x04,0xCA,0xA9,0x05,0xE3, 0x03,0xF3,0xEB,0x93,0xE5,0x07,0xC0,0xA9,0xAD,0xBA,0xD3,0xA0,0x14,0x8D,0x24,0x0E,0x5F}, - .seckey={0x9F,0xF4,0x31,0xC9,0x16,0xAF,0xAB,0x6A,0xCA,0x80,0xC1,0x2D,0xE6,0x76,0xEF,0x86, + {0x9F,0xF4,0x31,0xC9,0x16,0xAF,0xAB,0x6A,0xCA,0x80,0xC1,0x2D,0xE6,0x76,0xEF,0x86, 0x94,0xB4,0xE4,0x8B,0xFD,0x31,0x77,0x5C,0x2D,0xCD,0x9D,0x17,0x71,0x5B,0x95,0x3F}, - .addr="rnvVe22GM2vweXRNuqggRXoEx3XAZs9knV"}, - {.seed={0x84,0x22,0xC2,0xF7,0x26,0xF0,0xAA,0xBE,0x8A,0xDB,0x36,0xF3,0xE0,0xCC,0x68,0x3E}, - .pubkey={0x03,0xEB,0x3C,0xE9,0xB6,0xFB,0xD1,0xDF,0x71,0x13,0x5E,0x06,0xA3,0x2F,0x42,0x9B, + "rnvVe22GM2vweXRNuqggRXoEx3XAZs9knV"}, + {{0x84,0x22,0xC2,0xF7,0x26,0xF0,0xAA,0xBE,0x8A,0xDB,0x36,0xF3,0xE0,0xCC,0x68,0x3E}, + {0x03,0xEB,0x3C,0xE9,0xB6,0xFB,0xD1,0xDF,0x71,0x13,0x5E,0x06,0xA3,0x2F,0x42,0x9B, 0x1C,0x4F,0xBC,0xA5,0xB4,0x89,0xA7,0x22,0x4B,0x0F,0x91,0xAD,0x6F,0x6C,0x3B,0x98,0x02}, - .seckey={0xAF,0xA4,0x70,0x55,0xA0,0x5B,0xE6,0x7C,0x99,0x62,0x4F,0xB8,0xCE,0xE1,0x62,0x48, + {0xAF,0xA4,0x70,0x55,0xA0,0x5B,0xE6,0x7C,0x99,0x62,0x4F,0xB8,0xCE,0xE1,0x62,0x48, 0x19,0xD4,0xE9,0xEF,0x86,0x10,0x67,0x97,0x0E,0x8E,0x37,0x6B,0xB5,0x82,0xA4,0x6D}, - .addr="r4UZeovKZA8evpNM8AEkodxUPE759ZJx6K"}, - {.seed={0xE4,0x0B,0x92,0x07,0x46,0x0F,0x30,0xC6,0x5D,0xB3,0xB0,0xFE,0xA6,0x8E,0x9C,0x88}, - .pubkey={0x03,0x14,0x17,0x68,0xD2,0xEE,0x03,0x9D,0xCE,0xB4,0xB1,0x25,0x1F,0x09,0x21,0xBE, + "r4UZeovKZA8evpNM8AEkodxUPE759ZJx6K"}, + {{0xE4,0x0B,0x92,0x07,0x46,0x0F,0x30,0xC6,0x5D,0xB3,0xB0,0xFE,0xA6,0x8E,0x9C,0x88}, + {0x03,0x14,0x17,0x68,0xD2,0xEE,0x03,0x9D,0xCE,0xB4,0xB1,0x25,0x1F,0x09,0x21,0xBE, 0x82,0xA1,0xDB,0xED,0x44,0xAE,0x20,0x88,0xD4,0x93,0xDB,0xF4,0x29,0xDB,0x8B,0xCA,0xB1}, - .seckey={0x1A,0xBD,0xD6,0xB1,0x15,0x03,0x3D,0x43,0xED,0xD7,0x71,0x22,0x7D,0xA1,0xEC,0x59, + {0x1A,0xBD,0xD6,0xB1,0x15,0x03,0x3D,0x43,0xED,0xD7,0x71,0x22,0x7D,0xA1,0xEC,0x59, 0x17,0x6B,0xC5,0x56,0x85,0x22,0x68,0x2A,0x3A,0x84,0x0B,0x76,0x96,0x07,0x32,0xB3}, - .addr="rfxzt744qLZjaupkaMz6Vyg9HfAqhAxHuN"}, - {.seed={0xE0,0xA1,0xA6,0xA2,0xF8,0x4E,0xE7,0x83,0x37,0x67,0x93,0xF6,0x9B,0xAB,0x6A,0x1C}, - .pubkey={0x02,0x14,0x45,0xE1,0xB9,0x85,0x3A,0x10,0xFB,0x3D,0x19,0x51,0x06,0x29,0x89,0x86, + "rfxzt744qLZjaupkaMz6Vyg9HfAqhAxHuN"}, + {{0xE0,0xA1,0xA6,0xA2,0xF8,0x4E,0xE7,0x83,0x37,0x67,0x93,0xF6,0x9B,0xAB,0x6A,0x1C}, + {0x02,0x14,0x45,0xE1,0xB9,0x85,0x3A,0x10,0xFB,0x3D,0x19,0x51,0x06,0x29,0x89,0x86, 0xD3,0x21,0xFC,0xD6,0xEA,0xA4,0xA2,0x1F,0x0C,0x21,0x99,0xF4,0xB9,0x17,0xEF,0x9A,0x98}, - .seckey={0xC1,0xFC,0x56,0xB0,0xE6,0x3F,0x27,0xC4,0xB3,0x3D,0x83,0x8D,0x3F,0x51,0xBB,0x30, + {0xC1,0xFC,0x56,0xB0,0xE6,0x3F,0x27,0xC4,0xB3,0x3D,0x83,0x8D,0x3F,0x51,0xBB,0x30, 0xBD,0xF0,0x1B,0x79,0xD2,0x39,0x17,0xFE,0x81,0xEB,0x4F,0xB4,0x4B,0x2B,0x68,0x4E}, - .addr="rGmqckB9JMAtx4qgW8kJzvnftRcm3He4pC"}, - {.seed={0x08,0x89,0x4E,0x50,0x14,0xC7,0x4B,0x29,0x0A,0x92,0x8E,0x49,0x7A,0x41,0x03,0x94}, - .pubkey={0x03,0xC9,0xAB,0x0B,0x23,0x91,0x7F,0x68,0x93,0x4F,0x05,0x5C,0x22,0x9B,0x84,0x9F, + "rGmqckB9JMAtx4qgW8kJzvnftRcm3He4pC"}, + {{0x08,0x89,0x4E,0x50,0x14,0xC7,0x4B,0x29,0x0A,0x92,0x8E,0x49,0x7A,0x41,0x03,0x94}, + {0x03,0xC9,0xAB,0x0B,0x23,0x91,0x7F,0x68,0x93,0x4F,0x05,0x5C,0x22,0x9B,0x84,0x9F, 0xFD,0x39,0x27,0x45,0x1F,0x2A,0x91,0x29,0xD1,0x7D,0x89,0x35,0xF7,0xA5,0xC4,0x7C,0x68}, - .seckey={0xCD,0x24,0x10,0xF6,0xB3,0x4F,0xC9,0xBA,0xC5,0x12,0xEB,0x65,0xFB,0xB2,0x69,0xFB, + {0xCD,0x24,0x10,0xF6,0xB3,0x4F,0xC9,0xBA,0xC5,0x12,0xEB,0x65,0xFB,0xB2,0x69,0xFB, 0x9F,0xC5,0x10,0xA8,0x64,0xF3,0xA8,0x65,0x1E,0x7B,0xF4,0x54,0xD4,0xDD,0xE7,0x48}, - .addr="rBUZAvsXZJfUHCc9tWhEqDJUnDGdPTbA61"}, - {.seed={0xA9,0xEA,0x18,0x15,0x9C,0x7E,0x1B,0xF4,0xCB,0xD7,0x2D,0x3E,0x16,0xF1,0x1A,0x45}, - .pubkey={0x02,0x3F,0xF7,0x7D,0x42,0x2D,0xE7,0x08,0xA1,0xB8,0xC5,0x56,0x55,0x2C,0xE8,0x74, + "rBUZAvsXZJfUHCc9tWhEqDJUnDGdPTbA61"}, + {{0xA9,0xEA,0x18,0x15,0x9C,0x7E,0x1B,0xF4,0xCB,0xD7,0x2D,0x3E,0x16,0xF1,0x1A,0x45}, + {0x02,0x3F,0xF7,0x7D,0x42,0x2D,0xE7,0x08,0xA1,0xB8,0xC5,0x56,0x55,0x2C,0xE8,0x74, 0xF4,0x40,0x9A,0xA8,0x84,0xD7,0x44,0x0C,0x4D,0x03,0xC9,0x99,0xD2,0x9D,0xF9,0xEF,0x89}, - .seckey={0x73,0xEA,0xB1,0xD5,0x7E,0xC8,0x36,0x1C,0x41,0x53,0x94,0x2F,0xBC,0x30,0xB7,0x1A, + {0x73,0xEA,0xB1,0xD5,0x7E,0xC8,0x36,0x1C,0x41,0x53,0x94,0x2F,0xBC,0x30,0xB7,0x1A, 0xA2,0xA0,0x75,0x39,0xD9,0x59,0x4A,0x66,0x7E,0xF3,0xB3,0x41,0xA9,0x5C,0x11,0xD0}, - .addr="rBxAYvkEfc9LwqvNDuij3PnVPtf2LeZvZG"}, - {.seed={0x85,0x12,0xCF,0xA4,0xB8,0xAB,0x77,0x60,0x1A,0xAF,0xB0,0x16,0x22,0xFD,0xF7,0xE0}, - .pubkey={0x02,0xA0,0x25,0x79,0x1A,0x75,0x9B,0xDE,0x29,0xB6,0x0A,0xA1,0x55,0x82,0xF6,0x3D, + "rBxAYvkEfc9LwqvNDuij3PnVPtf2LeZvZG"}, + {{0x85,0x12,0xCF,0xA4,0xB8,0xAB,0x77,0x60,0x1A,0xAF,0xB0,0x16,0x22,0xFD,0xF7,0xE0}, + {0x02,0xA0,0x25,0x79,0x1A,0x75,0x9B,0xDE,0x29,0xB6,0x0A,0xA1,0x55,0x82,0xF6,0x3D, 0x7E,0x59,0x9A,0x1C,0xD3,0x30,0x28,0x44,0xF1,0x51,0x8A,0xA8,0x2D,0x9B,0x64,0x7B,0x12}, - .seckey={0xEA,0x04,0x9E,0xBC,0x5E,0xCB,0xEB,0x71,0xD9,0xC1,0x3E,0x00,0xA4,0x53,0x1F,0xFA, + {0xEA,0x04,0x9E,0xBC,0x5E,0xCB,0xEB,0x71,0xD9,0xC1,0x3E,0x00,0xA4,0x53,0x1F,0xFA, 0x88,0x32,0x9D,0xC2,0xA2,0x6F,0x9B,0x38,0xDC,0xDC,0xA7,0xDF,0xAE,0x60,0xCF,0xC8}, - .addr="rwqKXTVGf6DqKKHKtVYTqiyTi9Utj4dtUg"}, - {.seed={0xDB,0xB2,0x21,0xA2,0x30,0xF8,0xDE,0x09,0xCB,0x4A,0xD7,0xA3,0x4D,0xCF,0x65,0x8F}, - .pubkey={0x02,0x24,0x93,0x14,0x32,0xAB,0x9B,0xAD,0x1C,0xCB,0x55,0x48,0x52,0x86,0xD8,0x53, + "rwqKXTVGf6DqKKHKtVYTqiyTi9Utj4dtUg"}, + {{0xDB,0xB2,0x21,0xA2,0x30,0xF8,0xDE,0x09,0xCB,0x4A,0xD7,0xA3,0x4D,0xCF,0x65,0x8F}, + {0x02,0x24,0x93,0x14,0x32,0xAB,0x9B,0xAD,0x1C,0xCB,0x55,0x48,0x52,0x86,0xD8,0x53, 0xAD,0xFE,0x69,0x63,0x35,0x85,0x7D,0xF7,0xBE,0xBB,0xC2,0x38,0x37,0xC5,0x16,0xDB,0x85}, - .seckey={0xCC,0x3F,0x07,0xB0,0x02,0xCF,0x11,0x8C,0x6E,0x16,0x52,0xA9,0x0E,0x53,0xB3,0xE4, + {0xCC,0x3F,0x07,0xB0,0x02,0xCF,0x11,0x8C,0x6E,0x16,0x52,0xA9,0x0E,0x53,0xB3,0xE4, 0x9A,0x02,0x59,0xB0,0x85,0x55,0x66,0x12,0xE7,0x64,0x24,0x5C,0xC9,0x87,0x68,0x94}, - .addr="rwUVvqHuUdHHbaUgRL2tboAT8BtfnLKzu7"}, - {.seed={0x13,0x13,0xED,0xD6,0xA9,0x99,0xEC,0x78,0x41,0xB9,0xAF,0x7B,0x63,0x4C,0x72,0x40}, - .pubkey={0x03,0xAB,0x57,0x27,0x14,0xC7,0x64,0xBD,0x16,0xCC,0xC3,0xEC,0xCC,0x73,0xB8,0xC5, + "rwUVvqHuUdHHbaUgRL2tboAT8BtfnLKzu7"}, + {{0x13,0x13,0xED,0xD6,0xA9,0x99,0xEC,0x78,0x41,0xB9,0xAF,0x7B,0x63,0x4C,0x72,0x40}, + {0x03,0xAB,0x57,0x27,0x14,0xC7,0x64,0xBD,0x16,0xCC,0xC3,0xEC,0xCC,0x73,0xB8,0xC5, 0x25,0xDC,0xD0,0xAE,0x44,0x7D,0xE5,0xE6,0x99,0xFC,0xA1,0x77,0xEB,0x6D,0x8A,0x3D,0x68}, - .seckey={0xCE,0xEA,0x88,0x81,0x86,0x7C,0xB8,0x75,0xEA,0x2E,0xE6,0x3D,0x16,0xDC,0x31,0x45, + {0xCE,0xEA,0x88,0x81,0x86,0x7C,0xB8,0x75,0xEA,0x2E,0xE6,0x3D,0x16,0xDC,0x31,0x45, 0xA0,0x6B,0xF9,0x84,0xD5,0xBC,0x9F,0x9C,0x3D,0xF6,0x0E,0x70,0xDC,0x4E,0x45,0xEA}, - .addr="r4JubQs7WVESYxYbF4Uvsf7sUpJ7awzC4v"}, - {.seed={0xC6,0x4B,0x3E,0xF6,0x4B,0x44,0x46,0xBA,0x46,0x86,0x8D,0x60,0x68,0xFD,0xBA,0x79}, - .pubkey={0x02,0xDC,0xC5,0x44,0xEF,0xAF,0x0B,0xAD,0x8C,0x12,0x0F,0xA7,0xC7,0x9B,0xB9,0xF3, + "r4JubQs7WVESYxYbF4Uvsf7sUpJ7awzC4v"}, + {{0xC6,0x4B,0x3E,0xF6,0x4B,0x44,0x46,0xBA,0x46,0x86,0x8D,0x60,0x68,0xFD,0xBA,0x79}, + {0x02,0xDC,0xC5,0x44,0xEF,0xAF,0x0B,0xAD,0x8C,0x12,0x0F,0xA7,0xC7,0x9B,0xB9,0xF3, 0xC8,0x8A,0x2A,0x7B,0x9C,0xB0,0x87,0xDD,0x1D,0x06,0x77,0x01,0x05,0x1D,0x77,0x92,0x34}, - .seckey={0x0E,0x26,0x89,0x9C,0xED,0xB1,0x4E,0xD2,0x90,0x99,0x2D,0x38,0xAD,0xCD,0x48,0xA2, + {0x0E,0x26,0x89,0x9C,0xED,0xB1,0x4E,0xD2,0x90,0x99,0x2D,0x38,0xAD,0xCD,0x48,0xA2, 0xCA,0x76,0x13,0xEE,0x42,0xCC,0x0E,0x00,0xEC,0xCC,0x72,0xEE,0x20,0xCE,0xF2,0x82}, - .addr="rGpXpDnhPMqgNR2yxhiAbW2H15mJrxhfVp"}, - {.seed={0xCE,0x2A,0x1F,0xEC,0xCE,0x8D,0x4F,0xEF,0x4D,0x33,0xCE,0x57,0xF2,0xC8,0x4E,0x6E}, - .pubkey={0x02,0x14,0x57,0xE0,0x7D,0xBF,0x3A,0x09,0x07,0x30,0x10,0x57,0x64,0x5C,0x9F,0xCD, + "rGpXpDnhPMqgNR2yxhiAbW2H15mJrxhfVp"}, + {{0xCE,0x2A,0x1F,0xEC,0xCE,0x8D,0x4F,0xEF,0x4D,0x33,0xCE,0x57,0xF2,0xC8,0x4E,0x6E}, + {0x02,0x14,0x57,0xE0,0x7D,0xBF,0x3A,0x09,0x07,0x30,0x10,0x57,0x64,0x5C,0x9F,0xCD, 0xE0,0x57,0x2E,0xAB,0x73,0x24,0x34,0x6C,0x1D,0x93,0xC4,0xD3,0xBB,0xF1,0x52,0x66,0x1D}, - .seckey={0x9A,0xF2,0x85,0x67,0x64,0x0B,0x12,0x29,0x45,0x2D,0xC8,0x51,0xBC,0x86,0x1C,0x24, + {0x9A,0xF2,0x85,0x67,0x64,0x0B,0x12,0x29,0x45,0x2D,0xC8,0x51,0xBC,0x86,0x1C,0x24, 0x30,0x18,0x8E,0xF8,0xFB,0x11,0x5D,0x45,0xDA,0x1F,0x67,0xE6,0xBC,0x5B,0x94,0x92}, - .addr="r3qch21RVHuqAHapjovBW5owVHRFoiN8xB"}, - {.seed={0xF4,0x78,0x3A,0x98,0xA3,0x8E,0x79,0xF1,0xC4,0x26,0x0C,0x04,0x6F,0xB4,0x28,0xD8}, - .pubkey={0x02,0xA3,0x68,0x74,0x6B,0x3D,0x7D,0x10,0xFC,0x5C,0x51,0x8E,0x44,0xBE,0x95,0xD3, + "r3qch21RVHuqAHapjovBW5owVHRFoiN8xB"}, + {{0xF4,0x78,0x3A,0x98,0xA3,0x8E,0x79,0xF1,0xC4,0x26,0x0C,0x04,0x6F,0xB4,0x28,0xD8}, + {0x02,0xA3,0x68,0x74,0x6B,0x3D,0x7D,0x10,0xFC,0x5C,0x51,0x8E,0x44,0xBE,0x95,0xD3, 0xAB,0x09,0x94,0x97,0x8C,0xD5,0x3E,0x0D,0x1B,0x4B,0x8F,0x41,0x08,0x67,0x0B,0x15,0x50}, - .seckey={0x3C,0xCC,0x43,0x41,0xDC,0x14,0x8F,0xB6,0x65,0x1E,0x47,0x6F,0xA5,0x57,0x53,0xBA, + {0x3C,0xCC,0x43,0x41,0xDC,0x14,0x8F,0xB6,0x65,0x1E,0x47,0x6F,0xA5,0x57,0x53,0xBA, 0x15,0xF1,0x14,0x4E,0x45,0x5F,0x15,0x52,0x30,0xBB,0xCD,0x4E,0x49,0x6A,0x76,0x77}, - .addr="rs1b7fDHFMxovR6czQVekuYnRrBQJs2JjG"}, - {.seed={0x16,0x7C,0x0B,0xB3,0xC7,0x9D,0x2B,0xC4,0x45,0xCA,0x0F,0x0C,0x16,0x20,0xF2,0xC0}, - .pubkey={0x02,0x4F,0xA3,0xA0,0x8A,0xA4,0x00,0xFC,0x9D,0xC4,0x43,0x6C,0xB3,0x5F,0xC5,0x9B, + "rs1b7fDHFMxovR6czQVekuYnRrBQJs2JjG"}, + {{0x16,0x7C,0x0B,0xB3,0xC7,0x9D,0x2B,0xC4,0x45,0xCA,0x0F,0x0C,0x16,0x20,0xF2,0xC0}, + {0x02,0x4F,0xA3,0xA0,0x8A,0xA4,0x00,0xFC,0x9D,0xC4,0x43,0x6C,0xB3,0x5F,0xC5,0x9B, 0xEB,0x96,0x6A,0x06,0x95,0x1C,0x90,0x78,0x87,0xD0,0xC1,0x3C,0x36,0xC8,0x9E,0xA6,0xF0}, - .seckey={0x1F,0x3F,0xBE,0xDD,0xFD,0xA4,0x79,0xA5,0xA0,0x01,0x8B,0x88,0x86,0x46,0x0C,0xC4, + {0x1F,0x3F,0xBE,0xDD,0xFD,0xA4,0x79,0xA5,0xA0,0x01,0x8B,0x88,0x86,0x46,0x0C,0xC4, 0x02,0x6A,0x62,0x14,0x42,0x02,0xA8,0x9A,0x4C,0x2B,0x1C,0x73,0xBA,0x02,0xDB,0x4E}, - .addr="rNoQNeoYjCBQHUBhpmNi43yNVc3hQnYPGK"}, - {.seed={0x5C,0x30,0xD9,0xEF,0xDF,0x24,0x77,0xA3,0x7C,0x1B,0x14,0x06,0xE2,0xF6,0x10,0x7A}, - .pubkey={0x02,0xA1,0xEC,0x81,0xC0,0xBE,0xBC,0x84,0x78,0x09,0xD8,0x49,0x20,0x39,0x3A,0xE8, + "rNoQNeoYjCBQHUBhpmNi43yNVc3hQnYPGK"}, + {{0x5C,0x30,0xD9,0xEF,0xDF,0x24,0x77,0xA3,0x7C,0x1B,0x14,0x06,0xE2,0xF6,0x10,0x7A}, + {0x02,0xA1,0xEC,0x81,0xC0,0xBE,0xBC,0x84,0x78,0x09,0xD8,0x49,0x20,0x39,0x3A,0xE8, 0x6C,0x2E,0x8E,0xF1,0x9F,0xFB,0x46,0xB8,0xD3,0x98,0x67,0x9F,0xA6,0x76,0x41,0x21,0x9B}, - .seckey={0xA2,0xE3,0x24,0xD9,0x10,0xA4,0x50,0x4A,0x6E,0x03,0x2F,0x93,0x30,0xB9,0xF7,0xFE, + {0xA2,0xE3,0x24,0xD9,0x10,0xA4,0x50,0x4A,0x6E,0x03,0x2F,0x93,0x30,0xB9,0xF7,0xFE, 0xAE,0x1D,0xEB,0x05,0x95,0x15,0xEA,0x72,0x1C,0xF0,0x0E,0xFA,0x23,0x6F,0x3D,0xA5}, - .addr="rhPf4tS9DK2BTbUrbCqn4TpTWMC9WrgFWA"}, - {.seed={0xD2,0xA7,0xDE,0x9A,0x73,0x18,0x28,0x05,0x99,0x2D,0x56,0x44,0xBC,0xF3,0x01,0xA9}, - .pubkey={0x03,0x35,0x3C,0x34,0x9E,0x96,0x28,0xEF,0xEE,0x83,0x6E,0x74,0x03,0xF9,0x41,0xA2, + "rhPf4tS9DK2BTbUrbCqn4TpTWMC9WrgFWA"}, + {{0xD2,0xA7,0xDE,0x9A,0x73,0x18,0x28,0x05,0x99,0x2D,0x56,0x44,0xBC,0xF3,0x01,0xA9}, + {0x03,0x35,0x3C,0x34,0x9E,0x96,0x28,0xEF,0xEE,0x83,0x6E,0x74,0x03,0xF9,0x41,0xA2, 0xBF,0xAA,0x33,0x51,0x49,0x52,0xA5,0xAE,0x90,0xE9,0x3C,0x86,0x23,0xA6,0x5E,0xF4,0x68}, - .seckey={0x75,0x8F,0xE1,0x17,0x2F,0x22,0xB7,0xC9,0x8B,0xF8,0x45,0xB2,0x2C,0x60,0x3D,0xF3, + {0x75,0x8F,0xE1,0x17,0x2F,0x22,0xB7,0xC9,0x8B,0xF8,0x45,0xB2,0x2C,0x60,0x3D,0xF3, 0xDB,0xB1,0xE6,0x16,0x55,0x38,0x18,0x7F,0x0A,0xE6,0x7A,0xCF,0x7D,0x59,0x1B,0xC9}, - .addr="rKysepUdRUS3mSsb1F5qFKmwQiA2j7N6Rp"}, - {.seed={0xDB,0xC5,0xFE,0x60,0xD5,0x0B,0xD3,0x17,0x6A,0x6E,0x17,0xF3,0x50,0x3C,0xD3,0x44}, - .pubkey={0x02,0x08,0xE0,0x68,0xD4,0x94,0x17,0xE6,0xA1,0xA7,0xF2,0x20,0x99,0xA9,0xFF,0xD3, + "rKysepUdRUS3mSsb1F5qFKmwQiA2j7N6Rp"}, + {{0xDB,0xC5,0xFE,0x60,0xD5,0x0B,0xD3,0x17,0x6A,0x6E,0x17,0xF3,0x50,0x3C,0xD3,0x44}, + {0x02,0x08,0xE0,0x68,0xD4,0x94,0x17,0xE6,0xA1,0xA7,0xF2,0x20,0x99,0xA9,0xFF,0xD3, 0x02,0xA1,0x1F,0xD1,0xD3,0x06,0xED,0x61,0xCF,0x3A,0xA0,0xC3,0x50,0x79,0x7C,0xFE,0x21}, - .seckey={0x56,0xEF,0x3F,0xAF,0xFC,0xDD,0x12,0x60,0xEE,0xC3,0xB7,0xC6,0xE4,0x26,0x48,0xA2, + {0x56,0xEF,0x3F,0xAF,0xFC,0xDD,0x12,0x60,0xEE,0xC3,0xB7,0xC6,0xE4,0x26,0x48,0xA2, 0x58,0x7D,0xF4,0x85,0xC8,0x18,0x8B,0x7A,0xF8,0x35,0x8D,0xF5,0x14,0x73,0xBE,0xA0}, - .addr="rECdVqueE3m1oUn2GBuwZap6M8ohGUPi3"}, - {.seed={0x02,0xD0,0x7A,0xEE,0xF2,0x0F,0x48,0x49,0xE0,0x8E,0x59,0x0B,0xE5,0x0F,0x8A,0xC1}, - .pubkey={0x03,0x2D,0x3C,0x65,0x57,0x78,0xB4,0xE1,0x6F,0x29,0xCD,0x06,0x7F,0x7A,0x3F,0xFE, + "rECdVqueE3m1oUn2GBuwZap6M8ohGUPi3"}, + {{0x02,0xD0,0x7A,0xEE,0xF2,0x0F,0x48,0x49,0xE0,0x8E,0x59,0x0B,0xE5,0x0F,0x8A,0xC1}, + {0x03,0x2D,0x3C,0x65,0x57,0x78,0xB4,0xE1,0x6F,0x29,0xCD,0x06,0x7F,0x7A,0x3F,0xFE, 0xD0,0x66,0xB5,0x2A,0x69,0x28,0x42,0xB9,0xD3,0x46,0xB6,0xD7,0xC3,0xFE,0x41,0xA3,0x4E}, - .seckey={0x18,0x2C,0x95,0x96,0x1D,0x22,0x9C,0x2C,0xF1,0x3F,0xD6,0x06,0x41,0x87,0x8C,0x04, + {0x18,0x2C,0x95,0x96,0x1D,0x22,0x9C,0x2C,0xF1,0x3F,0xD6,0x06,0x41,0x87,0x8C,0x04, 0x43,0x31,0x0D,0xAA,0x0B,0x41,0x89,0xF5,0x6C,0xBA,0xBC,0xE5,0xF7,0xA1,0xD5,0xB0}, - .addr="rwmvZKoC8nPtyggfBBXcAwgVs5vnDX6pQu"}, - {.seed={0xEB,0xC8,0xC9,0xA3,0xC0,0x39,0xB2,0x10,0x49,0x6C,0x95,0x3C,0xC9,0x47,0xD4,0x13}, - .pubkey={0x03,0xAA,0x10,0xE0,0xA3,0x1A,0x3F,0x49,0x07,0xCF,0x96,0xA8,0x3E,0x4A,0x4C,0x26, + "rwmvZKoC8nPtyggfBBXcAwgVs5vnDX6pQu"}, + {{0xEB,0xC8,0xC9,0xA3,0xC0,0x39,0xB2,0x10,0x49,0x6C,0x95,0x3C,0xC9,0x47,0xD4,0x13}, + {0x03,0xAA,0x10,0xE0,0xA3,0x1A,0x3F,0x49,0x07,0xCF,0x96,0xA8,0x3E,0x4A,0x4C,0x26, 0xA2,0xA0,0x03,0x33,0x7A,0x76,0x4D,0xFB,0x9C,0xFA,0x0C,0x9E,0x61,0x68,0x4E,0xCD,0x83}, - .seckey={0xC1,0x17,0x0A,0x11,0x40,0xCD,0x86,0xB1,0xE0,0x8D,0x00,0x1E,0x36,0x96,0xDA,0x35, + {0xC1,0x17,0x0A,0x11,0x40,0xCD,0x86,0xB1,0xE0,0x8D,0x00,0x1E,0x36,0x96,0xDA,0x35, 0x37,0x92,0x09,0x73,0xC9,0xEA,0x0B,0x88,0x72,0xA7,0xEC,0x3A,0xA0,0x00,0x70,0x5F}, - .addr="raCPJGiwzZUP9Kq2dUEtegMFVFqPYvYUnJ"}, - {.seed={0x58,0x17,0x37,0x52,0x1F,0x1B,0x9F,0x6D,0xFC,0xBB,0xE4,0xC8,0xE6,0x71,0x0F,0x57}, - .pubkey={0x03,0xB3,0x7D,0x66,0x22,0x5B,0x46,0x1A,0xC1,0xB3,0x34,0x87,0x70,0x52,0x32,0xB7, + "raCPJGiwzZUP9Kq2dUEtegMFVFqPYvYUnJ"}, + {{0x58,0x17,0x37,0x52,0x1F,0x1B,0x9F,0x6D,0xFC,0xBB,0xE4,0xC8,0xE6,0x71,0x0F,0x57}, + {0x03,0xB3,0x7D,0x66,0x22,0x5B,0x46,0x1A,0xC1,0xB3,0x34,0x87,0x70,0x52,0x32,0xB7, 0x8F,0x26,0x56,0x3B,0x9B,0xE7,0x0D,0x3A,0x49,0xCA,0xF1,0xC4,0x24,0x91,0x44,0xD1,0x93}, - .seckey={0xE3,0x40,0x86,0xA5,0x1A,0xBE,0xBE,0x68,0x6B,0x6B,0x3C,0x1F,0x8D,0xE9,0x72,0x40, + {0xE3,0x40,0x86,0xA5,0x1A,0xBE,0xBE,0x68,0x6B,0x6B,0x3C,0x1F,0x8D,0xE9,0x72,0x40, 0x4C,0x44,0x98,0xC3,0x20,0x5C,0x73,0xBF,0x7E,0x41,0x89,0xF8,0x4A,0x5C,0x34,0x71}, - .addr="rGUdJNjYKPTscEdv32PBA3sLHFGgNJvKZw"}, - {.seed={0xCD,0x63,0x23,0xF6,0xBB,0xAF,0xB2,0xF7,0x57,0x43,0xD0,0xA4,0x2E,0x4E,0x6F,0xC6}, - .pubkey={0x02,0xB4,0x24,0x17,0xAD,0x45,0xA7,0xA2,0x53,0xC0,0x6A,0x14,0x37,0x5F,0x66,0xFF, + "rGUdJNjYKPTscEdv32PBA3sLHFGgNJvKZw"}, + {{0xCD,0x63,0x23,0xF6,0xBB,0xAF,0xB2,0xF7,0x57,0x43,0xD0,0xA4,0x2E,0x4E,0x6F,0xC6}, + {0x02,0xB4,0x24,0x17,0xAD,0x45,0xA7,0xA2,0x53,0xC0,0x6A,0x14,0x37,0x5F,0x66,0xFF, 0x1E,0xFA,0xC0,0x45,0x9E,0x1E,0x95,0xCE,0x4C,0x37,0x0B,0x2B,0x09,0xE0,0x9D,0x69,0xA2}, - .seckey={0x78,0x6E,0xE9,0x7A,0xB1,0x4E,0x9D,0x14,0x67,0x92,0x2E,0xB2,0x4C,0xEB,0xAD,0x95, + {0x78,0x6E,0xE9,0x7A,0xB1,0x4E,0x9D,0x14,0x67,0x92,0x2E,0xB2,0x4C,0xEB,0xAD,0x95, 0x71,0x7F,0x09,0xBA,0xD9,0xF7,0x47,0xBB,0x6F,0x45,0xDC,0x0A,0x4B,0x7A,0x12,0x9C}, - .addr="rK98g4BtQRoFGich8iakyB9as6twXb99bi"}, - {.seed={0x67,0x0C,0x12,0x8C,0xE5,0x2A,0x14,0x34,0x13,0x26,0xFA,0xFB,0xDA,0x88,0x9C,0x7E}, - .pubkey={0x03,0x09,0x7E,0xED,0x79,0x95,0xE2,0x52,0xDC,0x01,0xF8,0x6D,0x6C,0x88,0x63,0x60, + "rK98g4BtQRoFGich8iakyB9as6twXb99bi"}, + {{0x67,0x0C,0x12,0x8C,0xE5,0x2A,0x14,0x34,0x13,0x26,0xFA,0xFB,0xDA,0x88,0x9C,0x7E}, + {0x03,0x09,0x7E,0xED,0x79,0x95,0xE2,0x52,0xDC,0x01,0xF8,0x6D,0x6C,0x88,0x63,0x60, 0x8B,0xF0,0x69,0xC7,0x99,0x30,0xFF,0x7C,0xA2,0x09,0xC1,0x58,0x0B,0x49,0xF1,0xDA,0xCA}, - .seckey={0x35,0x19,0x45,0x94,0x2E,0x70,0xDB,0x5E,0xC6,0x87,0xD8,0xFF,0xE8,0xBA,0x1F,0x9D, + {0x35,0x19,0x45,0x94,0x2E,0x70,0xDB,0x5E,0xC6,0x87,0xD8,0xFF,0xE8,0xBA,0x1F,0x9D, 0xF3,0xC7,0xF9,0x84,0xC3,0x3A,0x46,0x63,0xA1,0x0D,0x21,0x49,0x30,0xF9,0x95,0xA4}, - .addr="raFXt1LJkm732epPXyTE1xW3DrEb7oUt6m"}, - {.seed={0xF8,0x1F,0xAB,0xD1,0x2A,0x1E,0x8B,0x8B,0xF4,0x24,0x88,0xC0,0xCB,0x95,0xF4,0x5F}, - .pubkey={0x02,0x8E,0xEA,0xEC,0x17,0xD8,0xAF,0x7E,0x2F,0x06,0xE4,0xA4,0xE1,0x2C,0x3F,0x41, + "raFXt1LJkm732epPXyTE1xW3DrEb7oUt6m"}, + {{0xF8,0x1F,0xAB,0xD1,0x2A,0x1E,0x8B,0x8B,0xF4,0x24,0x88,0xC0,0xCB,0x95,0xF4,0x5F}, + {0x02,0x8E,0xEA,0xEC,0x17,0xD8,0xAF,0x7E,0x2F,0x06,0xE4,0xA4,0xE1,0x2C,0x3F,0x41, 0x42,0xA0,0x29,0x69,0x45,0x2D,0x94,0xF7,0x18,0xEE,0x47,0x80,0x1F,0x86,0x40,0x25,0x12}, - .seckey={0x53,0x1F,0xDE,0xDB,0xEB,0x50,0xC0,0x49,0x37,0xFF,0x57,0xE5,0x7E,0x8A,0x59,0x6C, + {0x53,0x1F,0xDE,0xDB,0xEB,0x50,0xC0,0x49,0x37,0xFF,0x57,0xE5,0x7E,0x8A,0x59,0x6C, 0xC3,0x75,0xF1,0xA0,0x69,0x82,0x62,0xF0,0x06,0xF3,0x1E,0xA0,0xEC,0xA7,0x14,0xEB}, - .addr="rpCWmksupngLFRiYd7Dwn2v9qLr2ipHAFA"}, - {.seed={0x55,0x9F,0x01,0xFB,0x87,0x06,0x8F,0x68,0xB2,0x42,0x5B,0x83,0xC8,0xFE,0x98,0xE3}, - .pubkey={0x03,0x8F,0x99,0x37,0x38,0xFA,0xA0,0xA4,0x1A,0x07,0xDF,0x9D,0xE9,0x8F,0x5E,0x16, + "rpCWmksupngLFRiYd7Dwn2v9qLr2ipHAFA"}, + {{0x55,0x9F,0x01,0xFB,0x87,0x06,0x8F,0x68,0xB2,0x42,0x5B,0x83,0xC8,0xFE,0x98,0xE3}, + {0x03,0x8F,0x99,0x37,0x38,0xFA,0xA0,0xA4,0x1A,0x07,0xDF,0x9D,0xE9,0x8F,0x5E,0x16, 0xBC,0x75,0x98,0xC7,0x51,0x39,0x96,0x63,0x47,0xE5,0x78,0xAB,0xE6,0x1E,0x56,0x5A,0xB8}, - .seckey={0x4E,0xC4,0x2C,0x51,0x67,0x8D,0x99,0xC2,0xA3,0x81,0x5F,0x83,0x93,0x4C,0xD6,0xC6, + {0x4E,0xC4,0x2C,0x51,0x67,0x8D,0x99,0xC2,0xA3,0x81,0x5F,0x83,0x93,0x4C,0xD6,0xC6, 0x23,0x68,0x00,0xE9,0x23,0x83,0xD0,0x5D,0xC6,0x06,0xF9,0xB5,0xA2,0x68,0xB2,0x0C}, - .addr="r9y3WKMydDKLxN3YyxHZi4fNvm2kqMJcCb"}, - {.seed={0x49,0x27,0x9B,0x34,0x0D,0xFF,0xFC,0xF8,0xD7,0x42,0x04,0x66,0x7E,0xF3,0xEC,0x4C}, - .pubkey={0x03,0x16,0x76,0xEF,0x9A,0xED,0xE0,0x96,0xDA,0x3F,0x97,0xF3,0xF4,0x86,0x66,0xBA, + "r9y3WKMydDKLxN3YyxHZi4fNvm2kqMJcCb"}, + {{0x49,0x27,0x9B,0x34,0x0D,0xFF,0xFC,0xF8,0xD7,0x42,0x04,0x66,0x7E,0xF3,0xEC,0x4C}, + {0x03,0x16,0x76,0xEF,0x9A,0xED,0xE0,0x96,0xDA,0x3F,0x97,0xF3,0xF4,0x86,0x66,0xBA, 0x73,0x41,0x03,0xBD,0xBE,0x7A,0x72,0x27,0xEF,0xC3,0x55,0xA3,0x32,0x76,0x7F,0x28,0x60}, - .seckey={0xD0,0x36,0x6F,0x72,0xF5,0x3E,0x30,0x54,0x66,0xAB,0x5E,0x8E,0x90,0x00,0xDA,0x4B, + {0xD0,0x36,0x6F,0x72,0xF5,0x3E,0x30,0x54,0x66,0xAB,0x5E,0x8E,0x90,0x00,0xDA,0x4B, 0x3C,0x29,0x18,0xA8,0x33,0xD3,0x6D,0x1C,0x36,0x61,0xF3,0x89,0x86,0x3B,0x40,0x3F}, - .addr="rL6so6e6amZa5whfyERVc5xPS5T67AMKKS"}, - {.seed={0xFC,0x36,0x64,0x43,0xE6,0x7B,0x56,0xD0,0xB8,0x37,0xE2,0xF4,0x04,0x38,0xD3,0xCF}, - .pubkey={0x03,0xA2,0xB4,0xEA,0x91,0xE4,0x79,0x11,0xDB,0xA3,0x58,0x08,0x52,0x25,0x73,0x4F, + "rL6so6e6amZa5whfyERVc5xPS5T67AMKKS"}, + {{0xFC,0x36,0x64,0x43,0xE6,0x7B,0x56,0xD0,0xB8,0x37,0xE2,0xF4,0x04,0x38,0xD3,0xCF}, + {0x03,0xA2,0xB4,0xEA,0x91,0xE4,0x79,0x11,0xDB,0xA3,0x58,0x08,0x52,0x25,0x73,0x4F, 0xF4,0xD2,0xCB,0xF2,0xE9,0x3F,0x11,0xC7,0x65,0xA5,0x91,0x39,0x7E,0x43,0xA1,0x26,0xCC}, - .seckey={0x84,0x00,0xD2,0x01,0x17,0x8E,0x9D,0x59,0xFD,0xBE,0x42,0xB3,0x03,0x22,0x5F,0x5F, + {0x84,0x00,0xD2,0x01,0x17,0x8E,0x9D,0x59,0xFD,0xBE,0x42,0xB3,0x03,0x22,0x5F,0x5F, 0x6C,0x1E,0x5B,0x44,0x8B,0xEE,0x09,0xE0,0x28,0x38,0x9D,0x9A,0xE3,0xC6,0xBA,0x81}, - .addr="rCDbqPiELAx4yWT6tzxSsLPpRjMAk6Fch"}, - {.seed={0xF6,0x89,0x85,0xC1,0x1D,0x7D,0x8D,0x7D,0xC7,0xE4,0xA0,0x4C,0x6C,0xE4,0x14,0x57}, - .pubkey={0x02,0xCB,0x96,0xE5,0xBF,0xB8,0x22,0xCB,0x83,0xF3,0xB9,0x0C,0x17,0xB0,0x2F,0x6B, + "rCDbqPiELAx4yWT6tzxSsLPpRjMAk6Fch"}, + {{0xF6,0x89,0x85,0xC1,0x1D,0x7D,0x8D,0x7D,0xC7,0xE4,0xA0,0x4C,0x6C,0xE4,0x14,0x57}, + {0x02,0xCB,0x96,0xE5,0xBF,0xB8,0x22,0xCB,0x83,0xF3,0xB9,0x0C,0x17,0xB0,0x2F,0x6B, 0x20,0x9B,0xFD,0x8C,0x50,0x3C,0x18,0x52,0xB4,0xD1,0xE9,0x63,0xD8,0x49,0xAD,0x21,0x90}, - .seckey={0x6B,0xCD,0x18,0x4E,0x5B,0x3D,0x86,0x49,0x1A,0x7E,0xFD,0x20,0x1B,0x23,0xB7,0x26, + {0x6B,0xCD,0x18,0x4E,0x5B,0x3D,0x86,0x49,0x1A,0x7E,0xFD,0x20,0x1B,0x23,0xB7,0x26, 0xCB,0x11,0x97,0x25,0x03,0xF9,0x74,0x2C,0x2D,0x4F,0x98,0xD3,0x39,0xA2,0x50,0x7E}, - .addr="rUYQbfFYyPmSqmoy4B81MR8hZ6AfFGQRdw"}, - {.seed={0xB2,0x2F,0x75,0xE7,0x47,0x95,0xB9,0xBE,0x63,0x05,0xD0,0xBE,0x63,0x62,0xBC,0xDE}, - .pubkey={0x03,0xA2,0xA9,0x69,0x7F,0x83,0x3D,0x36,0x50,0xB0,0x34,0x4A,0xD1,0x0D,0xD9,0x58, + "rUYQbfFYyPmSqmoy4B81MR8hZ6AfFGQRdw"}, + {{0xB2,0x2F,0x75,0xE7,0x47,0x95,0xB9,0xBE,0x63,0x05,0xD0,0xBE,0x63,0x62,0xBC,0xDE}, + {0x03,0xA2,0xA9,0x69,0x7F,0x83,0x3D,0x36,0x50,0xB0,0x34,0x4A,0xD1,0x0D,0xD9,0x58, 0x34,0xC5,0xA8,0x49,0x06,0xA5,0x1F,0x97,0x11,0x39,0x4C,0xFE,0xA9,0x5A,0xBF,0xD3,0x1B}, - .seckey={0x97,0x91,0xE1,0xE5,0x89,0x57,0x43,0x49,0x09,0x1C,0xB7,0xF1,0x00,0xC4,0xBE,0x3B, + {0x97,0x91,0xE1,0xE5,0x89,0x57,0x43,0x49,0x09,0x1C,0xB7,0xF1,0x00,0xC4,0xBE,0x3B, 0xA4,0xD6,0x7F,0x46,0x2F,0x4E,0x3D,0xE7,0x0B,0x3C,0x6F,0xE1,0xFB,0x49,0x9C,0x63}, - .addr="rML4d4KyRFaCS6r77TtzvEQB6WGExUqcv9"}, - {.seed={0x4B,0xAE,0xC7,0x44,0xC6,0x88,0xC1,0x32,0x64,0x5D,0x84,0x64,0x30,0x70,0x34,0x33}, - .pubkey={0x03,0x22,0x46,0x84,0xAB,0xA5,0xB0,0x09,0x17,0x01,0xC3,0xAB,0x50,0xCA,0x14,0xA2, + "rML4d4KyRFaCS6r77TtzvEQB6WGExUqcv9"}, + {{0x4B,0xAE,0xC7,0x44,0xC6,0x88,0xC1,0x32,0x64,0x5D,0x84,0x64,0x30,0x70,0x34,0x33}, + {0x03,0x22,0x46,0x84,0xAB,0xA5,0xB0,0x09,0x17,0x01,0xC3,0xAB,0x50,0xCA,0x14,0xA2, 0x68,0xC6,0xFA,0xDA,0xAF,0x60,0xD1,0xC9,0xD1,0xAC,0x7D,0x35,0x6B,0xDA,0x37,0xC4,0xBF}, - .seckey={0x32,0x76,0x88,0xBF,0xAE,0x1F,0x3D,0xCF,0xF4,0x3A,0xBC,0xFA,0xB2,0xD3,0x0C,0xF8, + {0x32,0x76,0x88,0xBF,0xAE,0x1F,0x3D,0xCF,0xF4,0x3A,0xBC,0xFA,0xB2,0xD3,0x0C,0xF8, 0xD8,0x98,0x11,0x64,0x2F,0x3A,0x3F,0xDC,0x47,0x45,0x41,0xDA,0x29,0x1D,0xB4,0x16}, - .addr="rhuSsVQ4xKy2vDo54usSAKqfwqJPGw6G9F"}, - {.seed={0xE4,0x35,0x2C,0xEF,0x61,0x98,0x0C,0x0D,0x96,0x43,0x37,0x1B,0x15,0x36,0x4C,0x7F}, - .pubkey={0x03,0xB6,0xBF,0x72,0x89,0xCA,0x30,0x20,0xD3,0xD7,0x7F,0xB5,0x16,0x43,0x41,0x3C, + "rhuSsVQ4xKy2vDo54usSAKqfwqJPGw6G9F"}, + {{0xE4,0x35,0x2C,0xEF,0x61,0x98,0x0C,0x0D,0x96,0x43,0x37,0x1B,0x15,0x36,0x4C,0x7F}, + {0x03,0xB6,0xBF,0x72,0x89,0xCA,0x30,0x20,0xD3,0xD7,0x7F,0xB5,0x16,0x43,0x41,0x3C, 0xCC,0x43,0x68,0x8D,0x78,0xB4,0xEE,0x34,0x27,0x1D,0x5C,0x75,0x8F,0xB4,0x08,0x5B,0xA4}, - .seckey={0x5A,0x30,0x70,0x43,0x3F,0x4A,0x6A,0x86,0x8A,0x26,0x44,0xAC,0x26,0xCA,0x96,0xCB, + {0x5A,0x30,0x70,0x43,0x3F,0x4A,0x6A,0x86,0x8A,0x26,0x44,0xAC,0x26,0xCA,0x96,0xCB, 0xAF,0x44,0x2D,0x62,0xBB,0xE4,0x87,0x99,0x51,0x2D,0xA8,0xCF,0xD1,0x38,0xDB,0x95}, - .addr="rJrJVxcGtPvr9FpVdpAGZfvvjGHUKApbni"}, - {.seed={0xD0,0x0C,0xCA,0xD5,0x2B,0x2C,0x4C,0x35,0xA6,0x2F,0x02,0x3B,0xC8,0x11,0xEE,0xA5}, - .pubkey={0x03,0xAB,0x25,0xBD,0x7F,0x32,0x6C,0xCB,0x08,0x44,0xFF,0x70,0x4C,0xD1,0x22,0x09, + "rJrJVxcGtPvr9FpVdpAGZfvvjGHUKApbni"}, + {{0xD0,0x0C,0xCA,0xD5,0x2B,0x2C,0x4C,0x35,0xA6,0x2F,0x02,0x3B,0xC8,0x11,0xEE,0xA5}, + {0x03,0xAB,0x25,0xBD,0x7F,0x32,0x6C,0xCB,0x08,0x44,0xFF,0x70,0x4C,0xD1,0x22,0x09, 0x52,0x67,0x0B,0x7D,0x7C,0x3E,0xE4,0xD1,0x2B,0x05,0x0B,0x5F,0x3D,0xC8,0x2A,0x16,0xE7}, - .seckey={0x55,0xA2,0x8E,0x3B,0xA9,0xA1,0x33,0xA1,0x6F,0xA2,0x0E,0x6A,0x5F,0x50,0x47,0x74, + {0x55,0xA2,0x8E,0x3B,0xA9,0xA1,0x33,0xA1,0x6F,0xA2,0x0E,0x6A,0x5F,0x50,0x47,0x74, 0x85,0xFC,0x39,0xD5,0x21,0x23,0x5B,0x46,0x18,0x94,0x37,0x1C,0x90,0x22,0x07,0x70}, - .addr="rLsjU161cWg3apNv1tPeQ3FKs3MSYUsieW"}, - {.seed={0x08,0x86,0xA3,0x91,0x6D,0xD5,0xF6,0x36,0xCF,0xFD,0x4E,0xD6,0x90,0x64,0x1C,0xA5}, - .pubkey={0x02,0x3B,0x48,0xD2,0x6E,0xAE,0xF4,0x29,0x4F,0x29,0xA7,0x05,0xB8,0x3A,0x67,0x36, + "rLsjU161cWg3apNv1tPeQ3FKs3MSYUsieW"}, + {{0x08,0x86,0xA3,0x91,0x6D,0xD5,0xF6,0x36,0xCF,0xFD,0x4E,0xD6,0x90,0x64,0x1C,0xA5}, + {0x02,0x3B,0x48,0xD2,0x6E,0xAE,0xF4,0x29,0x4F,0x29,0xA7,0x05,0xB8,0x3A,0x67,0x36, 0xDA,0xCF,0xEB,0x72,0x34,0x3A,0xA5,0x13,0x9A,0xF5,0x2E,0x91,0xC8,0xED,0x27,0x8B,0xE7}, - .seckey={0xB4,0x67,0x02,0xDA,0xD6,0xBB,0x10,0x74,0x38,0x0D,0xFB,0xA7,0x5E,0x1F,0xD4,0x07, + {0xB4,0x67,0x02,0xDA,0xD6,0xBB,0x10,0x74,0x38,0x0D,0xFB,0xA7,0x5E,0x1F,0xD4,0x07, 0x37,0xCA,0x86,0x03,0x42,0x81,0xF7,0x88,0x81,0x86,0xF7,0xFF,0x04,0xE0,0xD5,0xA9}, - .addr="rEvTZcokycXRHtvhvNphV6z3792SxGqXXL"}, - {.seed={0x96,0x14,0x14,0xBE,0xCC,0x47,0xFF,0xD8,0x5B,0x6A,0x58,0x7A,0x07,0x32,0x3B,0x81}, - .pubkey={0x03,0x58,0x9F,0xAB,0x0E,0xE6,0xA2,0x4C,0x5F,0x69,0x5E,0xD3,0xB5,0xD7,0x55,0x84, + "rEvTZcokycXRHtvhvNphV6z3792SxGqXXL"}, + {{0x96,0x14,0x14,0xBE,0xCC,0x47,0xFF,0xD8,0x5B,0x6A,0x58,0x7A,0x07,0x32,0x3B,0x81}, + {0x03,0x58,0x9F,0xAB,0x0E,0xE6,0xA2,0x4C,0x5F,0x69,0x5E,0xD3,0xB5,0xD7,0x55,0x84, 0x8D,0xAE,0xB0,0x95,0x48,0xEB,0x87,0xE8,0x51,0xF4,0x5C,0xB2,0x52,0x50,0x81,0x5E,0xAE}, - .seckey={0xDC,0x68,0x56,0x7F,0x75,0x88,0x8D,0xB3,0xB9,0xD2,0x53,0x07,0x34,0x94,0xA3,0xDD, + {0xDC,0x68,0x56,0x7F,0x75,0x88,0x8D,0xB3,0xB9,0xD2,0x53,0x07,0x34,0x94,0xA3,0xDD, 0x0E,0x54,0xBD,0x25,0x21,0x08,0x9B,0xEA,0x1D,0x3F,0xA7,0x81,0x2E,0x01,0xFB,0x12}, - .addr="rLmR9oBFB9dk7xzshrRtCaLQqB35ZnFR7u"}, - {.seed={0xD0,0x73,0x46,0x77,0x1B,0x7C,0xDD,0xF5,0xB8,0xC6,0xAD,0x6D,0x61,0xFA,0x39,0x5A}, - .pubkey={0x03,0x2C,0x6E,0x59,0xED,0x4C,0xED,0x4F,0xDF,0x99,0x3A,0x81,0x38,0xA0,0x82,0x49, + "rLmR9oBFB9dk7xzshrRtCaLQqB35ZnFR7u"}, + {{0xD0,0x73,0x46,0x77,0x1B,0x7C,0xDD,0xF5,0xB8,0xC6,0xAD,0x6D,0x61,0xFA,0x39,0x5A}, + {0x03,0x2C,0x6E,0x59,0xED,0x4C,0xED,0x4F,0xDF,0x99,0x3A,0x81,0x38,0xA0,0x82,0x49, 0xA9,0x08,0xCB,0x5F,0x4D,0x09,0x77,0x8A,0xF2,0xAD,0x2E,0xDE,0x21,0x71,0xC4,0x68,0x0D}, - .seckey={0xA7,0x19,0x7C,0x70,0xAC,0x21,0xB5,0x88,0xB5,0xB5,0x30,0x5E,0x35,0x80,0x6F,0x18, + {0xA7,0x19,0x7C,0x70,0xAC,0x21,0xB5,0x88,0xB5,0xB5,0x30,0x5E,0x35,0x80,0x6F,0x18, 0xA6,0x74,0x3F,0x2F,0x55,0x5A,0xDE,0xF7,0x9A,0xAC,0xAC,0xE9,0x5D,0x5B,0x02,0xD2}, - .addr="rfJ21METXMqkygW1qWJHZnBPhXHAmjSKwn"}, - {.seed={0xE6,0x8F,0x9A,0xA4,0x0E,0x73,0x2B,0x57,0x13,0xEE,0x4D,0xC3,0xDD,0xB8,0xB9,0x75}, - .pubkey={0x02,0x20,0x8D,0x14,0xE1,0x30,0xF2,0x50,0xC3,0xDD,0x37,0xBF,0x89,0x13,0x46,0xF2, + "rfJ21METXMqkygW1qWJHZnBPhXHAmjSKwn"}, + {{0xE6,0x8F,0x9A,0xA4,0x0E,0x73,0x2B,0x57,0x13,0xEE,0x4D,0xC3,0xDD,0xB8,0xB9,0x75}, + {0x02,0x20,0x8D,0x14,0xE1,0x30,0xF2,0x50,0xC3,0xDD,0x37,0xBF,0x89,0x13,0x46,0xF2, 0x35,0xE2,0x75,0x52,0x91,0x0C,0x1F,0x16,0x0A,0x1A,0x3B,0xF7,0xD1,0x8F,0xF9,0x87,0xBF}, - .seckey={0x17,0x49,0xCE,0xFB,0xA1,0xD2,0x03,0xBC,0x53,0x4C,0x66,0x6F,0x9B,0x4E,0x88,0x5A, + {0x17,0x49,0xCE,0xFB,0xA1,0xD2,0x03,0xBC,0x53,0x4C,0x66,0x6F,0x9B,0x4E,0x88,0x5A, 0xCB,0xBB,0x25,0x96,0x59,0x48,0x72,0xC5,0xD3,0x8C,0x35,0x29,0x44,0x6F,0x02,0xB0}, - .addr="rKtzApfAhyETwX6uhgAxPHXELzd9snNNQp"}, - {.seed={0x00,0x5B,0x64,0x20,0x65,0xF1,0x78,0x8D,0x52,0x3B,0x14,0x8C,0x72,0xB3,0x36,0x95}, - .pubkey={0x02,0xFB,0xF2,0xC9,0x46,0x4A,0x2D,0x61,0xF0,0xD6,0x3A,0x26,0x10,0xD2,0x1E,0xAC, + "rKtzApfAhyETwX6uhgAxPHXELzd9snNNQp"}, + {{0x00,0x5B,0x64,0x20,0x65,0xF1,0x78,0x8D,0x52,0x3B,0x14,0x8C,0x72,0xB3,0x36,0x95}, + {0x02,0xFB,0xF2,0xC9,0x46,0x4A,0x2D,0x61,0xF0,0xD6,0x3A,0x26,0x10,0xD2,0x1E,0xAC, 0xD3,0xAB,0x13,0xF1,0x22,0xB5,0x67,0xBD,0xA5,0xF8,0x22,0x3D,0x2A,0xE0,0x92,0x17,0xCE}, - .seckey={0xDF,0xCB,0xE0,0x55,0xF4,0x02,0x89,0x24,0xF0,0x8E,0xE0,0x7E,0x5E,0x1E,0xCA,0x70, + {0xDF,0xCB,0xE0,0x55,0xF4,0x02,0x89,0x24,0xF0,0x8E,0xE0,0x7E,0x5E,0x1E,0xCA,0x70, 0x5B,0x27,0x05,0x1C,0xAF,0x2B,0xA9,0x04,0xA4,0xCC,0x4A,0x41,0x69,0xCE,0xF3,0x56}, - .addr="rfZGGsJvDoKuQugtqe6F3gYF2acVsakwpN"}, - {.seed={0x04,0x85,0xFB,0x73,0xE3,0x20,0x9F,0x46,0x61,0x24,0xD7,0x0B,0x73,0x01,0x3B,0x7F}, - .pubkey={0x03,0xD6,0x4A,0xFF,0x62,0x93,0xC5,0xF2,0xAB,0x1E,0x49,0xD9,0x43,0x87,0x4E,0x9D, + "rfZGGsJvDoKuQugtqe6F3gYF2acVsakwpN"}, + {{0x04,0x85,0xFB,0x73,0xE3,0x20,0x9F,0x46,0x61,0x24,0xD7,0x0B,0x73,0x01,0x3B,0x7F}, + {0x03,0xD6,0x4A,0xFF,0x62,0x93,0xC5,0xF2,0xAB,0x1E,0x49,0xD9,0x43,0x87,0x4E,0x9D, 0x8C,0x1C,0x8E,0x31,0x0D,0xE3,0x12,0x9B,0xDA,0x1C,0xBE,0x68,0x35,0x67,0x10,0xCB,0x7E}, - .seckey={0xB8,0x75,0xD8,0x38,0xF9,0x8E,0xEE,0x21,0x52,0x08,0x52,0xD1,0xE6,0x8D,0x1D,0x24, + {0xB8,0x75,0xD8,0x38,0xF9,0x8E,0xEE,0x21,0x52,0x08,0x52,0xD1,0xE6,0x8D,0x1D,0x24, 0x57,0x4D,0x3D,0xD1,0x17,0xA9,0xD4,0x03,0xE3,0xB5,0xD5,0x71,0x75,0x0D,0x43,0xFE}, - .addr="rrpPqHKZZirhRZXERvhd4uaNviXFxPfAqL"}, - {.seed={0x6E,0x3B,0xA9,0x5A,0x9B,0x01,0x25,0x68,0x72,0xC6,0x92,0x0B,0x8E,0x41,0x66,0xC1}, - .pubkey={0x03,0xA5,0x99,0x0F,0xC7,0x1B,0x92,0xB3,0x07,0x0C,0x45,0xBC,0x84,0x31,0x61,0x9C, + "rrpPqHKZZirhRZXERvhd4uaNviXFxPfAqL"}, + {{0x6E,0x3B,0xA9,0x5A,0x9B,0x01,0x25,0x68,0x72,0xC6,0x92,0x0B,0x8E,0x41,0x66,0xC1}, + {0x03,0xA5,0x99,0x0F,0xC7,0x1B,0x92,0xB3,0x07,0x0C,0x45,0xBC,0x84,0x31,0x61,0x9C, 0xF8,0x86,0x20,0x90,0x20,0x16,0x26,0xB9,0xCC,0x55,0x96,0x1E,0x6B,0x90,0xE0,0x5C,0x04}, - .seckey={0x47,0xC2,0xE3,0xBB,0x91,0xC2,0xBD,0x02,0x63,0x11,0xC6,0x9D,0x09,0x6D,0x1E,0xE0, + {0x47,0xC2,0xE3,0xBB,0x91,0xC2,0xBD,0x02,0x63,0x11,0xC6,0x9D,0x09,0x6D,0x1E,0xE0, 0xD3,0x15,0x78,0x14,0xF5,0x0A,0x20,0x8C,0xF1,0x58,0xB4,0x98,0xF6,0xF5,0x45,0x61}, - .addr="rLK3rs3qjCoMEZ4NymVLn3xQ48Y3HWxSJT"}, - {.seed={0xDC,0x53,0x22,0x9E,0x30,0x02,0xAF,0xFB,0x9B,0x78,0x97,0xD5,0x74,0x02,0x40,0x11}, - .pubkey={0x02,0xD1,0xA5,0x65,0x10,0x30,0xE8,0xE8,0x49,0x1E,0x4C,0xCB,0xDA,0xDD,0xC1,0x6D, + "rLK3rs3qjCoMEZ4NymVLn3xQ48Y3HWxSJT"}, + {{0xDC,0x53,0x22,0x9E,0x30,0x02,0xAF,0xFB,0x9B,0x78,0x97,0xD5,0x74,0x02,0x40,0x11}, + {0x02,0xD1,0xA5,0x65,0x10,0x30,0xE8,0xE8,0x49,0x1E,0x4C,0xCB,0xDA,0xDD,0xC1,0x6D, 0x77,0x2B,0xBA,0x2D,0x66,0x77,0x5C,0xB7,0xF7,0x5F,0xE2,0xD8,0x17,0x68,0x93,0x36,0x0A}, - .seckey={0xF7,0x7C,0x0B,0x27,0x03,0xB6,0xEE,0x18,0x47,0x32,0x32,0x60,0xC0,0x41,0x57,0x6D, + {0xF7,0x7C,0x0B,0x27,0x03,0xB6,0xEE,0x18,0x47,0x32,0x32,0x60,0xC0,0x41,0x57,0x6D, 0x67,0xB0,0x1A,0x88,0x7E,0x14,0x35,0xF3,0xCB,0xDC,0x80,0xE3,0x63,0x4B,0xE2,0xE6}, - .addr="rQDdUbPvEMn2GyZaHcaoLA5kb3tc2Hmcjw"}, - {.seed={0x28,0x60,0x32,0xD1,0x23,0x21,0x4B,0xBB,0xC2,0x9A,0x46,0x47,0x6F,0x44,0x23,0xD6}, - .pubkey={0x03,0xC6,0xB0,0x71,0x0D,0x59,0x5B,0x3D,0xE9,0x45,0x69,0x08,0x86,0x7C,0x7B,0x4C, + "rQDdUbPvEMn2GyZaHcaoLA5kb3tc2Hmcjw"}, + {{0x28,0x60,0x32,0xD1,0x23,0x21,0x4B,0xBB,0xC2,0x9A,0x46,0x47,0x6F,0x44,0x23,0xD6}, + {0x03,0xC6,0xB0,0x71,0x0D,0x59,0x5B,0x3D,0xE9,0x45,0x69,0x08,0x86,0x7C,0x7B,0x4C, 0x0B,0x1A,0x0C,0x3D,0xDE,0x6B,0x50,0x80,0xCA,0x74,0x03,0x6A,0xBC,0x9D,0x45,0x31,0x21}, - .seckey={0xD5,0xAC,0xDA,0x20,0xD0,0x09,0xEF,0x93,0xD3,0xC0,0xF7,0xB9,0x08,0x20,0x3A,0xFA, + {0xD5,0xAC,0xDA,0x20,0xD0,0x09,0xEF,0x93,0xD3,0xC0,0xF7,0xB9,0x08,0x20,0x3A,0xFA, 0x6D,0x5C,0xDC,0xD6,0x5F,0xC3,0xD6,0x02,0x66,0x5D,0x63,0x11,0x02,0x23,0x56,0xD4}, - .addr="rsaHcnSaQqyUh3ZHbfBXoVA2kU5DcsoLev"}, - {.seed={0x41,0x21,0xFA,0x4A,0xDC,0x02,0xF0,0xF9,0x49,0x08,0x95,0xEA,0xF0,0x4A,0xEC,0x39}, - .pubkey={0x03,0x56,0x5B,0x47,0xFF,0x02,0x01,0x64,0x64,0x0B,0x6F,0xE3,0x45,0x63,0xC6,0xD6, + "rsaHcnSaQqyUh3ZHbfBXoVA2kU5DcsoLev"}, + {{0x41,0x21,0xFA,0x4A,0xDC,0x02,0xF0,0xF9,0x49,0x08,0x95,0xEA,0xF0,0x4A,0xEC,0x39}, + {0x03,0x56,0x5B,0x47,0xFF,0x02,0x01,0x64,0x64,0x0B,0x6F,0xE3,0x45,0x63,0xC6,0xD6, 0xD8,0xC7,0x95,0xFB,0x28,0x2F,0xD0,0x16,0x3E,0xDE,0xB5,0x05,0x89,0xCE,0x91,0x87,0xDA}, - .seckey={0x92,0x91,0x84,0x4E,0x08,0x44,0x8F,0x8D,0x38,0xAE,0xF8,0xB3,0xC3,0xD8,0x3A,0xF3, + {0x92,0x91,0x84,0x4E,0x08,0x44,0x8F,0x8D,0x38,0xAE,0xF8,0xB3,0xC3,0xD8,0x3A,0xF3, 0x6B,0x6C,0xD5,0x64,0x59,0x7F,0x5C,0x31,0x82,0x05,0xE7,0x38,0x82,0xF7,0xB1,0x9D}, - .addr="rfD992xwtGE81HFt63FJ9GrmjqpMmE9DjX"}, - {.seed={0x51,0x47,0x8C,0x21,0xB8,0xBA,0x1A,0x79,0x79,0x3E,0x4E,0x1F,0x84,0xC5,0xF2,0xAF}, - .pubkey={0x02,0xBD,0xD3,0xCE,0x87,0xE0,0x71,0xD1,0x43,0x12,0x78,0x09,0x27,0x13,0x93,0x3A, + "rfD992xwtGE81HFt63FJ9GrmjqpMmE9DjX"}, + {{0x51,0x47,0x8C,0x21,0xB8,0xBA,0x1A,0x79,0x79,0x3E,0x4E,0x1F,0x84,0xC5,0xF2,0xAF}, + {0x02,0xBD,0xD3,0xCE,0x87,0xE0,0x71,0xD1,0x43,0x12,0x78,0x09,0x27,0x13,0x93,0x3A, 0xB0,0xE8,0xAC,0x70,0x50,0x20,0x7E,0x03,0xC7,0x25,0xCA,0xF2,0x2C,0xE3,0x56,0xF0,0x80}, - .seckey={0xBD,0x3F,0xDA,0x5C,0x4B,0xB2,0xAA,0x89,0xD2,0x31,0x70,0x07,0xDF,0x2A,0x20,0xBB, + {0xBD,0x3F,0xDA,0x5C,0x4B,0xB2,0xAA,0x89,0xD2,0x31,0x70,0x07,0xDF,0x2A,0x20,0xBB, 0xD3,0x12,0x96,0xC1,0xCC,0x6F,0xDD,0xCB,0xC4,0xFD,0x71,0xCA,0xDC,0xAE,0x3B,0xFA}, - .addr="rfvXs2SzVri4gK7iLo89V1VagjZFxXo9Yy"}, - {.seed={0x7B,0x12,0x69,0x74,0x33,0xD8,0x99,0x4D,0x1E,0xBF,0x98,0x69,0x0D,0x57,0xA4,0x1C}, - .pubkey={0x03,0x3A,0x6B,0x78,0x60,0x0C,0x0B,0x47,0xB2,0x81,0x63,0x47,0x3C,0x9A,0x48,0x23, + "rfvXs2SzVri4gK7iLo89V1VagjZFxXo9Yy"}, + {{0x7B,0x12,0x69,0x74,0x33,0xD8,0x99,0x4D,0x1E,0xBF,0x98,0x69,0x0D,0x57,0xA4,0x1C}, + {0x03,0x3A,0x6B,0x78,0x60,0x0C,0x0B,0x47,0xB2,0x81,0x63,0x47,0x3C,0x9A,0x48,0x23, 0x5C,0xC0,0x86,0xDE,0xAF,0x92,0xA5,0xC6,0x99,0xA0,0xA9,0x66,0xBB,0xA6,0x43,0x79,0x1F}, - .seckey={0x9A,0xD7,0x7A,0xEF,0x71,0x7B,0x26,0x32,0x3C,0xCC,0xE4,0xDE,0x74,0xAB,0x69,0x0C, + {0x9A,0xD7,0x7A,0xEF,0x71,0x7B,0x26,0x32,0x3C,0xCC,0xE4,0xDE,0x74,0xAB,0x69,0x0C, 0x65,0x00,0xEE,0x33,0x43,0x73,0xA4,0xA3,0x29,0x3F,0x78,0x15,0x76,0xF7,0x43,0xB2}, - .addr="rfPrK4Wd87KNxS8sHY4YwWvhcWafGUr6MA"}, - {.seed={0x8F,0x94,0xC3,0xE1,0xD5,0xFF,0xBB,0x25,0x8B,0xF0,0xA1,0xF5,0xD9,0x3D,0xAE,0x95}, - .pubkey={0x02,0x48,0x25,0x2D,0x93,0x06,0x30,0x16,0xD4,0xF6,0xCF,0xCB,0x4B,0xA4,0xCA,0x21, + "rfPrK4Wd87KNxS8sHY4YwWvhcWafGUr6MA"}, + {{0x8F,0x94,0xC3,0xE1,0xD5,0xFF,0xBB,0x25,0x8B,0xF0,0xA1,0xF5,0xD9,0x3D,0xAE,0x95}, + {0x02,0x48,0x25,0x2D,0x93,0x06,0x30,0x16,0xD4,0xF6,0xCF,0xCB,0x4B,0xA4,0xCA,0x21, 0x7C,0x91,0x92,0x62,0x19,0x41,0x97,0xDD,0x91,0x15,0x05,0x72,0x64,0x3A,0xBB,0xA6,0x67}, - .seckey={0x86,0xD3,0x84,0xF4,0x45,0xF9,0xF7,0xA0,0x73,0x8C,0xB8,0xE1,0xAB,0xE0,0xFA,0xAB, + {0x86,0xD3,0x84,0xF4,0x45,0xF9,0xF7,0xA0,0x73,0x8C,0xB8,0xE1,0xAB,0xE0,0xFA,0xAB, 0x09,0x8B,0xDE,0xD4,0x82,0x76,0x49,0xCA,0x31,0xC0,0xB8,0x75,0xD0,0x9D,0x1C,0x33}, - .addr="rJ7VtUxctZEXqeYud3Caakv21UJksrXouq"}, - {.seed={0xD0,0x2B,0xFC,0x58,0xC1,0xF6,0xCC,0xEC,0x84,0xB4,0x2D,0x2A,0x80,0xD2,0x51,0x78}, - .pubkey={0x03,0xBB,0xF0,0xD5,0x04,0x63,0xFE,0x0E,0x28,0x9F,0x1D,0x4F,0xF3,0x0F,0x14,0x82, + "rJ7VtUxctZEXqeYud3Caakv21UJksrXouq"}, + {{0xD0,0x2B,0xFC,0x58,0xC1,0xF6,0xCC,0xEC,0x84,0xB4,0x2D,0x2A,0x80,0xD2,0x51,0x78}, + {0x03,0xBB,0xF0,0xD5,0x04,0x63,0xFE,0x0E,0x28,0x9F,0x1D,0x4F,0xF3,0x0F,0x14,0x82, 0x23,0x00,0xDB,0x6B,0x90,0x9F,0x9A,0x52,0x78,0x82,0x26,0x1F,0x72,0x18,0xF5,0x49,0xDD}, - .seckey={0x7B,0xA2,0x53,0x96,0x22,0x33,0x6E,0x49,0xD7,0xCA,0xE8,0x15,0x46,0xD1,0xD5,0xDA, + {0x7B,0xA2,0x53,0x96,0x22,0x33,0x6E,0x49,0xD7,0xCA,0xE8,0x15,0x46,0xD1,0xD5,0xDA, 0xB5,0x84,0xBD,0x35,0x68,0xEB,0x6C,0x00,0x8F,0xE4,0xDA,0xC7,0x11,0x07,0x62,0xED}, - .addr="rPp3JQPodyon8FS3Xi7vmj7eLkVuQG3DNw"}, - {.seed={0x70,0xD0,0xFA,0x4C,0xE3,0x0E,0xBD,0x73,0x7B,0x1E,0xEE,0x48,0x25,0x2F,0xAC,0xAE}, - .pubkey={0x03,0x29,0x71,0xCB,0xB1,0x40,0xBF,0xCB,0x43,0x1D,0x23,0xDC,0x29,0x30,0x71,0x3B, + "rPp3JQPodyon8FS3Xi7vmj7eLkVuQG3DNw"}, + {{0x70,0xD0,0xFA,0x4C,0xE3,0x0E,0xBD,0x73,0x7B,0x1E,0xEE,0x48,0x25,0x2F,0xAC,0xAE}, + {0x03,0x29,0x71,0xCB,0xB1,0x40,0xBF,0xCB,0x43,0x1D,0x23,0xDC,0x29,0x30,0x71,0x3B, 0xEC,0xA3,0x23,0xC3,0x65,0x98,0x52,0x27,0x5D,0x2A,0x6E,0x79,0xD2,0x43,0xC1,0xE7,0xB7}, - .seckey={0x03,0xFD,0x46,0xBA,0xC2,0x9F,0x06,0x73,0x31,0x47,0x7B,0x94,0x81,0x20,0x54,0x78, + {0x03,0xFD,0x46,0xBA,0xC2,0x9F,0x06,0x73,0x31,0x47,0x7B,0x94,0x81,0x20,0x54,0x78, 0x0D,0x48,0x81,0x6A,0x89,0xBD,0x9D,0xA2,0xF0,0x85,0xDA,0x2F,0x1D,0x01,0xC7,0x22}, - .addr="rLj3kdAoNSaLbM78rZL4sxPzLUmnD6TJx9"}, - {.seed={0x09,0xD8,0x00,0x1B,0xF3,0xED,0x9D,0x61,0x37,0xAA,0xF9,0x2A,0x59,0xB7,0xE5,0x83}, - .pubkey={0x03,0x3F,0x4D,0x07,0xBC,0xEA,0x06,0xB8,0x52,0xD0,0x42,0xDC,0x2B,0x18,0x5E,0xAD, + "rLj3kdAoNSaLbM78rZL4sxPzLUmnD6TJx9"}, + {{0x09,0xD8,0x00,0x1B,0xF3,0xED,0x9D,0x61,0x37,0xAA,0xF9,0x2A,0x59,0xB7,0xE5,0x83}, + {0x03,0x3F,0x4D,0x07,0xBC,0xEA,0x06,0xB8,0x52,0xD0,0x42,0xDC,0x2B,0x18,0x5E,0xAD, 0xEA,0xF1,0x42,0x5A,0x2B,0x73,0xD4,0xF5,0x74,0x1B,0x05,0xD4,0x9C,0x1B,0xE6,0xDF,0x59}, - .seckey={0x5B,0x6A,0x89,0x0A,0x3C,0x10,0xA9,0xAE,0x72,0x89,0xC2,0x9A,0x4D,0xFA,0xE9,0xFE, + {0x5B,0x6A,0x89,0x0A,0x3C,0x10,0xA9,0xAE,0x72,0x89,0xC2,0x9A,0x4D,0xFA,0xE9,0xFE, 0x36,0x8C,0xDA,0xE5,0x57,0x9A,0x39,0xF6,0xB6,0xE3,0xDB,0x27,0x46,0xFE,0x64,0xB1}, - .addr="rU39rkKyaPEDdSmyqTiwAzMWHXvFDjtgvB"}, - {.seed={0x31,0x4D,0x49,0x2B,0x8D,0x6A,0x2A,0xCC,0x18,0x6C,0x4D,0xEF,0x51,0xC7,0x5A,0x88}, - .pubkey={0x03,0x7A,0x92,0xC7,0x9E,0xC2,0x64,0xFA,0x7E,0x8B,0x27,0x80,0xB1,0x43,0xF2,0x78, + "rU39rkKyaPEDdSmyqTiwAzMWHXvFDjtgvB"}, + {{0x31,0x4D,0x49,0x2B,0x8D,0x6A,0x2A,0xCC,0x18,0x6C,0x4D,0xEF,0x51,0xC7,0x5A,0x88}, + {0x03,0x7A,0x92,0xC7,0x9E,0xC2,0x64,0xFA,0x7E,0x8B,0x27,0x80,0xB1,0x43,0xF2,0x78, 0x98,0x42,0xF5,0x11,0xB9,0x83,0x2D,0xEA,0xB2,0x80,0x11,0x36,0x78,0x27,0xF6,0x4C,0x06}, - .seckey={0x10,0xF6,0x70,0xA7,0x7C,0x5F,0x7C,0x47,0x35,0xE0,0x83,0xA0,0x42,0x4E,0xF2,0x9F, + {0x10,0xF6,0x70,0xA7,0x7C,0x5F,0x7C,0x47,0x35,0xE0,0x83,0xA0,0x42,0x4E,0xF2,0x9F, 0x17,0x6E,0xA8,0xEA,0xD3,0x5B,0x0B,0x4C,0x09,0xB8,0x8C,0x5B,0xFF,0x1C,0x67,0xF1}, - .addr="rstDhfAJHDmJ6bJWMo6cmRR4BqDDBtfVZY"}, - {.seed={0x44,0x21,0x1C,0x1C,0xAB,0x78,0x83,0xA4,0x62,0x56,0xA6,0x2D,0x59,0x39,0x47,0x7B}, - .pubkey={0x02,0x88,0xEC,0xDF,0x6A,0x6C,0x38,0x63,0x4D,0xF9,0xA1,0x02,0x82,0xDD,0x65,0x5A, + "rstDhfAJHDmJ6bJWMo6cmRR4BqDDBtfVZY"}, + {{0x44,0x21,0x1C,0x1C,0xAB,0x78,0x83,0xA4,0x62,0x56,0xA6,0x2D,0x59,0x39,0x47,0x7B}, + {0x02,0x88,0xEC,0xDF,0x6A,0x6C,0x38,0x63,0x4D,0xF9,0xA1,0x02,0x82,0xDD,0x65,0x5A, 0x84,0x50,0x26,0x12,0x6F,0xA9,0x60,0x66,0x20,0x25,0xD9,0xBC,0xC4,0x42,0x1C,0xE0,0x76}, - .seckey={0x31,0x7D,0x2F,0x06,0xFA,0xBC,0xC2,0xE1,0x37,0x89,0x58,0x57,0x76,0x62,0xDB,0x76, + {0x31,0x7D,0x2F,0x06,0xFA,0xBC,0xC2,0xE1,0x37,0x89,0x58,0x57,0x76,0x62,0xDB,0x76, 0x4D,0x5F,0x43,0x19,0x35,0xA4,0xB6,0x95,0x64,0xBA,0x98,0x53,0xCA,0x9C,0x94,0xAF}, - .addr="rLdLivptphqe4SLAEWaTYoD9ur5af5dnJ1"}, - {.seed={0xDB,0xEB,0xF6,0xC6,0x1D,0x64,0x25,0xAF,0xB4,0x52,0x85,0x83,0xA4,0x21,0x2E,0x57}, - .pubkey={0x02,0x20,0x87,0xC0,0xBA,0xCD,0x25,0xEC,0x51,0x4B,0xE7,0x73,0x5E,0x1C,0x28,0x39, + "rLdLivptphqe4SLAEWaTYoD9ur5af5dnJ1"}, + {{0xDB,0xEB,0xF6,0xC6,0x1D,0x64,0x25,0xAF,0xB4,0x52,0x85,0x83,0xA4,0x21,0x2E,0x57}, + {0x02,0x20,0x87,0xC0,0xBA,0xCD,0x25,0xEC,0x51,0x4B,0xE7,0x73,0x5E,0x1C,0x28,0x39, 0xA1,0x82,0xFB,0xC6,0x81,0x2B,0xE8,0xC4,0x0F,0x22,0xF4,0xE5,0x27,0x97,0x7E,0x31,0xFC}, - .seckey={0xFF,0x37,0xB9,0xD1,0x0E,0x21,0x52,0x35,0x18,0x76,0x37,0xA7,0xB8,0x96,0xB9,0x69, + {0xFF,0x37,0xB9,0xD1,0x0E,0x21,0x52,0x35,0x18,0x76,0x37,0xA7,0xB8,0x96,0xB9,0x69, 0xB9,0xA3,0x5B,0xC9,0xB1,0x6A,0x18,0x14,0x9F,0xDB,0xE2,0x69,0xEF,0x59,0x28,0x70}, - .addr="rsYryUWhbYRiQivh693pgjnseAwPHezNj1"} + "rsYryUWhbYRiQivh693pgjnseAwPHezNj1"} }; inline static TestKeyData const ed25519TestVectors[] = { - {.seed={0xAF,0x41,0xFF,0x66,0xF7,0x5E,0xBD,0x3A,0x6B,0x18,0xFB,0x7A,0x1D,0xF6,0x1C,0x97}, - .pubkey={0xED,0x48,0xCB,0xBB,0xE0,0xEE,0x7B,0x86,0x86,0xA7,0xDE,0x9F,0x0A,0x01,0x59,0x73, + {{0xAF,0x41,0xFF,0x66,0xF7,0x5E,0xBD,0x3A,0x6B,0x18,0xFB,0x7A,0x1D,0xF6,0x1C,0x97}, + {0xED,0x48,0xCB,0xBB,0xE0,0xEE,0x7B,0x86,0x86,0xA7,0xDE,0x9F,0x0A,0x01,0x59,0x73, 0x4E,0x65,0xF9,0xC3,0x69,0x94,0x7F,0x2E,0x26,0x96,0x23,0x2B,0x46,0x1E,0x55,0x32,0x13}, - .seckey={0x1A,0x10,0x97,0xFC,0xD9,0xCE,0x4E,0x1D,0xA2,0x46,0x66,0xB6,0x98,0x87,0x97,0x66, + {0x1A,0x10,0x97,0xFC,0xD9,0xCE,0x4E,0x1D,0xA2,0x46,0x66,0xB6,0x98,0x87,0x97,0x66, 0xE1,0x75,0x75,0x47,0xD1,0xD4,0xE3,0x64,0xB6,0x43,0x55,0xF7,0xC8,0x4B,0xA0,0xF3}, - .addr="rVAEQBhWT6nZ4woEifdN3TMMdUZaxeXnR"}, - {.seed={0x14,0x0C,0x1D,0x08,0x13,0x19,0x33,0x9C,0x79,0x9D,0xC6,0xA1,0x65,0x95,0x1B,0xE1}, - .pubkey={0xED,0x3B,0xC8,0x2E,0xF4,0x5F,0x89,0x09,0xCC,0x00,0xF8,0xB7,0xAA,0xF0,0x59,0x31, + "rVAEQBhWT6nZ4woEifdN3TMMdUZaxeXnR"}, + {{0x14,0x0C,0x1D,0x08,0x13,0x19,0x33,0x9C,0x79,0x9D,0xC6,0xA1,0x65,0x95,0x1B,0xE1}, + {0xED,0x3B,0xC8,0x2E,0xF4,0x5F,0x89,0x09,0xCC,0x00,0xF8,0xB7,0xAA,0xF0,0x59,0x31, 0x68,0x14,0x11,0x75,0x8C,0x11,0x71,0x24,0x87,0x50,0x66,0xC2,0x83,0x98,0xFE,0x15,0x6D}, - .seckey={0xFE,0x3E,0x5A,0x82,0xB8,0x0D,0xD8,0x2E,0x91,0x5F,0x76,0x38,0x94,0x2A,0x33,0x2C, + {0xFE,0x3E,0x5A,0x82,0xB8,0x0D,0xD8,0x2E,0x91,0x5F,0x76,0x38,0x94,0x2A,0x33,0x2C, 0xE3,0x06,0x88,0x79,0x74,0x0C,0x7E,0x90,0xE2,0x20,0xA4,0xFB,0x0B,0x37,0xCE,0xC8}, - .addr="rK57dJ9533WtoY8NNwVWGY7ffuAc8WCcPE"}, - {.seed={0x86,0x53,0x23,0xB6,0xE4,0x5A,0xD6,0xEE,0xFA,0x27,0x9F,0xA5,0x84,0x85,0x2E,0xD4}, - .pubkey={0xED,0xE8,0x34,0x22,0xEB,0xE0,0x75,0x70,0x73,0x12,0x66,0x1E,0x4B,0x03,0x3A,0x29, + "rK57dJ9533WtoY8NNwVWGY7ffuAc8WCcPE"}, + {{0x86,0x53,0x23,0xB6,0xE4,0x5A,0xD6,0xEE,0xFA,0x27,0x9F,0xA5,0x84,0x85,0x2E,0xD4}, + {0xED,0xE8,0x34,0x22,0xEB,0xE0,0x75,0x70,0x73,0x12,0x66,0x1E,0x4B,0x03,0x3A,0x29, 0xBA,0x86,0x38,0x62,0x30,0x50,0x0C,0xF2,0x8C,0xF1,0x65,0xF3,0xC2,0x1E,0x90,0x6D,0x00}, - .seckey={0xA3,0xC4,0xE2,0x43,0xA4,0x64,0x4E,0x73,0x8A,0x24,0x7A,0x59,0xAA,0xBB,0x5C,0x89, + {0xA3,0xC4,0xE2,0x43,0xA4,0x64,0x4E,0x73,0x8A,0x24,0x7A,0x59,0xAA,0xBB,0x5C,0x89, 0xE4,0x09,0x0D,0x1B,0x73,0x02,0xF2,0x45,0x82,0x64,0x87,0xC8,0x38,0xDA,0x69,0x89}, - .addr="rfZiEDieHSHsQJ1UNfv2jYDuQawdRSBFwz"}, - {.seed={0xC3,0x90,0x0B,0x26,0x1C,0x5E,0x7D,0x50,0xBA,0xC7,0x12,0x2D,0x97,0x35,0xDB,0xF9}, - .pubkey={0xED,0x8D,0x64,0x8A,0x7B,0xD5,0xAD,0x7E,0xF2,0x41,0x5A,0x5D,0x38,0xA9,0xC1,0x3A, + "rfZiEDieHSHsQJ1UNfv2jYDuQawdRSBFwz"}, + {{0xC3,0x90,0x0B,0x26,0x1C,0x5E,0x7D,0x50,0xBA,0xC7,0x12,0x2D,0x97,0x35,0xDB,0xF9}, + {0xED,0x8D,0x64,0x8A,0x7B,0xD5,0xAD,0x7E,0xF2,0x41,0x5A,0x5D,0x38,0xA9,0xC1,0x3A, 0x82,0xF0,0xD2,0x51,0x4B,0x7F,0xDC,0x47,0x57,0x04,0xC0,0x89,0x42,0x40,0x0C,0x69,0x38}, - .seckey={0x79,0xE6,0x10,0x38,0xA3,0x7E,0xB1,0x37,0xA7,0x7F,0xE0,0xDF,0x17,0xC8,0x44,0x9E, + {0x79,0xE6,0x10,0x38,0xA3,0x7E,0xB1,0x37,0xA7,0x7F,0xE0,0xDF,0x17,0xC8,0x44,0x9E, 0xA1,0x7A,0x85,0x71,0xD5,0x7D,0x33,0x15,0x4B,0x09,0x2D,0x39,0x38,0xAD,0x6A,0x0D}, - .addr="r9Ug1JMQjGH92gpgh7kZJgF2dvwXpfmVXL"}, - {.seed={0x63,0x9B,0x6A,0xE7,0x62,0x76,0x40,0x6D,0xBB,0x95,0x0F,0x39,0xA4,0xC2,0x77,0x27}, - .pubkey={0xED,0x48,0x69,0x7E,0x9B,0x17,0x43,0x8B,0x30,0xB2,0x8C,0xBE,0x9E,0x88,0xEB,0xEE, + "r9Ug1JMQjGH92gpgh7kZJgF2dvwXpfmVXL"}, + {{0x63,0x9B,0x6A,0xE7,0x62,0x76,0x40,0x6D,0xBB,0x95,0x0F,0x39,0xA4,0xC2,0x77,0x27}, + {0xED,0x48,0x69,0x7E,0x9B,0x17,0x43,0x8B,0x30,0xB2,0x8C,0xBE,0x9E,0x88,0xEB,0xEE, 0x32,0xC7,0xC8,0x64,0xAE,0x99,0x5C,0x96,0x8D,0x68,0x84,0xAD,0x1D,0x64,0xCB,0xAD,0xAA}, - .seckey={0x0D,0xC3,0xB8,0x2D,0xDA,0xA5,0x86,0x49,0x03,0x41,0xAA,0x5E,0xDF,0x0B,0x45,0x7B, + {0x0D,0xC3,0xB8,0x2D,0xDA,0xA5,0x86,0x49,0x03,0x41,0xAA,0x5E,0xDF,0x0B,0x45,0x7B, 0xCE,0x45,0x3F,0x2E,0xDC,0x0F,0x1F,0xFE,0xE1,0x2E,0xD1,0x50,0x26,0xCB,0x23,0x64}, - .addr="rGTbZBCD2UrFooY8F7Q6dnxSpp12xX13ZE"}, - {.seed={0xA3,0x8D,0x1E,0xB3,0x79,0x31,0x63,0xEF,0x28,0x3C,0xB9,0x88,0x85,0x80,0xFE,0xF8}, - .pubkey={0xED,0x05,0xA1,0x49,0x6B,0x70,0x20,0x8C,0x26,0xDA,0x92,0xFF,0x97,0x8A,0x1C,0x69, + "rGTbZBCD2UrFooY8F7Q6dnxSpp12xX13ZE"}, + {{0xA3,0x8D,0x1E,0xB3,0x79,0x31,0x63,0xEF,0x28,0x3C,0xB9,0x88,0x85,0x80,0xFE,0xF8}, + {0xED,0x05,0xA1,0x49,0x6B,0x70,0x20,0x8C,0x26,0xDA,0x92,0xFF,0x97,0x8A,0x1C,0x69, 0xAC,0xEC,0xFE,0x16,0x5A,0x1B,0x41,0x82,0xBA,0xD9,0xDC,0x13,0x17,0x21,0x7D,0xE3,0x75}, - .seckey={0xA8,0x6D,0x59,0x90,0xE1,0x63,0xEA,0x86,0x27,0x6D,0x8A,0x30,0x74,0x83,0x15,0xD4, + {0xA8,0x6D,0x59,0x90,0xE1,0x63,0xEA,0x86,0x27,0x6D,0x8A,0x30,0x74,0x83,0x15,0xD4, 0x35,0x6D,0x0B,0x65,0x10,0xE4,0xC8,0xE3,0xA4,0xA7,0xD9,0xA9,0x3E,0xE7,0x29,0x4D}, - .addr="rDxumR1RE4rVUHHy1fHwURFw1ZLHkqqhXj"}, - {.seed={0xF9,0x57,0x52,0x2C,0x0C,0xF4,0x93,0x67,0xF9,0x0D,0xCF,0x67,0x4D,0x26,0x31,0x47}, - .pubkey={0xED,0x26,0x9F,0xD9,0xAF,0xE4,0xA5,0xC4,0x52,0x54,0x3F,0x92,0x27,0xAE,0xB2,0x93, + "rDxumR1RE4rVUHHy1fHwURFw1ZLHkqqhXj"}, + {{0xF9,0x57,0x52,0x2C,0x0C,0xF4,0x93,0x67,0xF9,0x0D,0xCF,0x67,0x4D,0x26,0x31,0x47}, + {0xED,0x26,0x9F,0xD9,0xAF,0xE4,0xA5,0xC4,0x52,0x54,0x3F,0x92,0x27,0xAE,0xB2,0x93, 0xE8,0xEB,0xC4,0xC0,0x74,0x30,0x12,0x75,0xC6,0xA2,0x61,0x1D,0xC8,0x52,0xEC,0x11,0x76}, - .seckey={0x57,0xD1,0x51,0x01,0xA4,0x20,0x78,0x76,0xA2,0xFE,0xF5,0xC4,0x71,0x17,0x3E,0x48, + {0x57,0xD1,0x51,0x01,0xA4,0x20,0x78,0x76,0xA2,0xFE,0xF5,0xC4,0x71,0x17,0x3E,0x48, 0xC7,0x18,0x1B,0x52,0x10,0xA2,0xFD,0x1B,0x32,0xEE,0xF8,0xF5,0x33,0x58,0xAC,0x44}, - .addr="rL2eCZwE2ziPN6LCLQc2NqzhEkyWSe9aYw"}, - {.seed={0x47,0x94,0x2C,0x2D,0x0F,0xE1,0x64,0x2D,0xC5,0x23,0x6D,0x08,0x3D,0x61,0xA4,0x78}, - .pubkey={0xED,0x33,0x3A,0xEC,0x09,0x30,0x3C,0x01,0x0F,0x34,0x17,0xEB,0xD3,0x21,0x36,0xC3, + "rL2eCZwE2ziPN6LCLQc2NqzhEkyWSe9aYw"}, + {{0x47,0x94,0x2C,0x2D,0x0F,0xE1,0x64,0x2D,0xC5,0x23,0x6D,0x08,0x3D,0x61,0xA4,0x78}, + {0xED,0x33,0x3A,0xEC,0x09,0x30,0x3C,0x01,0x0F,0x34,0x17,0xEB,0xD3,0x21,0x36,0xC3, 0xF3,0x8C,0xF5,0x2C,0x9B,0x14,0xAF,0xB0,0xAB,0x6E,0x82,0x05,0xDB,0xEE,0x61,0x06,0x53}, - .seckey={0x76,0x73,0x6B,0x24,0xB6,0xD1,0x16,0xCD,0xCC,0x6F,0x4B,0x85,0x05,0x0B,0xBA,0x67, + {0x76,0x73,0x6B,0x24,0xB6,0xD1,0x16,0xCD,0xCC,0x6F,0x4B,0x85,0x05,0x0B,0xBA,0x67, 0xDE,0x79,0xB6,0x93,0xD0,0x57,0x10,0x35,0x18,0x71,0x6D,0x03,0x3A,0xB8,0x58,0xFE}, - .addr="rGvzhRmWqvC67oZyAqrJqgo3MNeXahkBzj"}, - {.seed={0xBA,0xFE,0x17,0x25,0x21,0x89,0x1D,0xDB,0x2D,0xE5,0x10,0x24,0xA7,0x21,0x9F,0xB6}, - .pubkey={0xED,0x1A,0x37,0x9C,0xD6,0x6B,0x0A,0x85,0xDB,0x9F,0x0E,0xAE,0xA5,0x9E,0x8D,0xEE, + "rGvzhRmWqvC67oZyAqrJqgo3MNeXahkBzj"}, + {{0xBA,0xFE,0x17,0x25,0x21,0x89,0x1D,0xDB,0x2D,0xE5,0x10,0x24,0xA7,0x21,0x9F,0xB6}, + {0xED,0x1A,0x37,0x9C,0xD6,0x6B,0x0A,0x85,0xDB,0x9F,0x0E,0xAE,0xA5,0x9E,0x8D,0xEE, 0xDC,0xA2,0x53,0x45,0xCB,0xC2,0x67,0x0E,0xFC,0x3C,0x34,0xA4,0x96,0x9F,0x80,0xDA,0x84}, - .seckey={0x8C,0x95,0x46,0x34,0xD6,0xD3,0x98,0x96,0x6B,0x28,0xBF,0xA6,0xB7,0xE2,0xEB,0x78, + {0x8C,0x95,0x46,0x34,0xD6,0xD3,0x98,0x96,0x6B,0x28,0xBF,0xA6,0xB7,0xE2,0xEB,0x78, 0x14,0x4B,0x5A,0x87,0xF6,0x64,0x91,0x01,0x3B,0xCB,0x9B,0x8C,0xCE,0xEE,0x9F,0x44}, - .addr="r95fjtovjRNhUEuv2JJnPBFyhgXyX5p8wD"}, - {.seed={0xD8,0x0F,0x6B,0xB7,0x88,0xBA,0x01,0xEC,0x66,0xA0,0x7A,0x74,0xA4,0xA8,0xC6,0x35}, - .pubkey={0xED,0x01,0xDD,0xD2,0x59,0x15,0x86,0xBC,0x53,0x44,0x0B,0xB3,0x65,0xA9,0x33,0x04, + "r95fjtovjRNhUEuv2JJnPBFyhgXyX5p8wD"}, + {{0xD8,0x0F,0x6B,0xB7,0x88,0xBA,0x01,0xEC,0x66,0xA0,0x7A,0x74,0xA4,0xA8,0xC6,0x35}, + {0xED,0x01,0xDD,0xD2,0x59,0x15,0x86,0xBC,0x53,0x44,0x0B,0xB3,0x65,0xA9,0x33,0x04, 0x01,0x1E,0xD9,0x4E,0x17,0x2C,0xC3,0xB8,0x1C,0x1B,0x9A,0x40,0xFA,0x6B,0x17,0xD4,0x91}, - .seckey={0x17,0xDB,0xCC,0x50,0x27,0xAF,0xE2,0x42,0x30,0xA4,0xE7,0x98,0xA4,0xE9,0x76,0x39, + {0x17,0xDB,0xCC,0x50,0x27,0xAF,0xE2,0x42,0x30,0xA4,0xE7,0x98,0xA4,0xE9,0x76,0x39, 0x9A,0x8F,0x86,0xB3,0x5B,0x5D,0xEB,0x70,0x34,0x1B,0x8E,0x95,0x31,0x9D,0x69,0xDC}, - .addr="rnBDWLjCaA6q9phZCqdEp7hjqAPfwHnfPA"}, - {.seed={0x6B,0x5D,0x6A,0xC6,0x16,0xE9,0x2E,0x67,0x75,0xCC,0xAA,0x9D,0x7E,0x0B,0x06,0xEE}, - .pubkey={0xED,0xE9,0xF8,0x84,0x0B,0x73,0x6B,0xC9,0x21,0xDF,0xAF,0xF5,0x69,0x8C,0x55,0xA1, + "rnBDWLjCaA6q9phZCqdEp7hjqAPfwHnfPA"}, + {{0x6B,0x5D,0x6A,0xC6,0x16,0xE9,0x2E,0x67,0x75,0xCC,0xAA,0x9D,0x7E,0x0B,0x06,0xEE}, + {0xED,0xE9,0xF8,0x84,0x0B,0x73,0x6B,0xC9,0x21,0xDF,0xAF,0xF5,0x69,0x8C,0x55,0xA1, 0xB4,0xF6,0xFD,0x4F,0xA9,0xB6,0x6C,0xC2,0x2F,0x8E,0x98,0x5B,0x6F,0xD6,0x45,0x74,0x89}, - .seckey={0x67,0x4D,0xB7,0x06,0xEC,0xC0,0xB6,0xA0,0xA7,0xF9,0x5D,0xA6,0xE4,0x30,0x68,0x54, + {0x67,0x4D,0xB7,0x06,0xEC,0xC0,0xB6,0xA0,0xA7,0xF9,0x5D,0xA6,0xE4,0x30,0x68,0x54, 0x4D,0x12,0x35,0x17,0x78,0xA7,0x55,0xC1,0x55,0x23,0xD1,0xED,0x22,0x91,0xC8,0x01}, - .addr="ra4G5d8mvtNJyZYFdo11BrWrgAz9AvP3Gz"}, - {.seed={0x00,0xFB,0x91,0x86,0x81,0xE9,0x7E,0xF1,0x9D,0xF0,0x95,0x74,0x55,0xC2,0x06,0xA8}, - .pubkey={0xED,0x07,0x88,0x61,0x92,0x19,0x34,0xBA,0xF4,0x20,0xCC,0x6F,0x7F,0xC5,0x90,0xE5, + "ra4G5d8mvtNJyZYFdo11BrWrgAz9AvP3Gz"}, + {{0x00,0xFB,0x91,0x86,0x81,0xE9,0x7E,0xF1,0x9D,0xF0,0x95,0x74,0x55,0xC2,0x06,0xA8}, + {0xED,0x07,0x88,0x61,0x92,0x19,0x34,0xBA,0xF4,0x20,0xCC,0x6F,0x7F,0xC5,0x90,0xE5, 0x1A,0x8F,0xF7,0x59,0x07,0x05,0x3B,0x0C,0xD1,0xF6,0x99,0x52,0xE1,0x22,0x8F,0x02,0x08}, - .seckey={0xB1,0x8D,0xCE,0x19,0xF5,0xFD,0xA0,0x3E,0x92,0xEA,0x23,0x8A,0x35,0xB3,0x40,0xF2, + {0xB1,0x8D,0xCE,0x19,0xF5,0xFD,0xA0,0x3E,0x92,0xEA,0x23,0x8A,0x35,0xB3,0x40,0xF2, 0xA9,0x16,0xAF,0xEE,0x16,0x8B,0x9B,0xA4,0x44,0xBC,0x6E,0x59,0xC3,0x71,0x87,0x03}, - .addr="rDaKYn9RrKrLHdeZAixuyi24uKnxSU5odT"}, - {.seed={0x9A,0xF1,0x00,0x6A,0x00,0x74,0x91,0x8C,0x6A,0x0F,0xFB,0xD8,0x5E,0xD5,0xCA,0x1F}, - .pubkey={0xED,0x19,0x23,0x72,0xA2,0xD8,0xB4,0x80,0x23,0x5A,0x74,0x69,0x39,0xDB,0x54,0xBF, + "rDaKYn9RrKrLHdeZAixuyi24uKnxSU5odT"}, + {{0x9A,0xF1,0x00,0x6A,0x00,0x74,0x91,0x8C,0x6A,0x0F,0xFB,0xD8,0x5E,0xD5,0xCA,0x1F}, + {0xED,0x19,0x23,0x72,0xA2,0xD8,0xB4,0x80,0x23,0x5A,0x74,0x69,0x39,0xDB,0x54,0xBF, 0x7E,0xCF,0x3A,0x52,0xBB,0xE8,0xFC,0xB1,0x74,0x04,0xAE,0x2D,0x62,0x69,0x7B,0x33,0x4A}, - .seckey={0x21,0x79,0xBF,0x60,0xD5,0xF4,0xAB,0x6A,0x1D,0x72,0xB9,0xC4,0xAD,0xEE,0xFB,0x04, + {0x21,0x79,0xBF,0x60,0xD5,0xF4,0xAB,0x6A,0x1D,0x72,0xB9,0xC4,0xAD,0xEE,0xFB,0x04, 0x39,0x3D,0xD0,0xB3,0x17,0xAF,0xEC,0xE3,0x6D,0xB6,0xC1,0x1E,0xE1,0x73,0x98,0xDF}, - .addr="rUyMe6fvoJ4Lm1PnPquFabP3VSKzqjBkkw"}, - {.seed={0xCA,0x67,0x89,0xD8,0x5A,0x4F,0x15,0x1F,0xF5,0x1C,0x9B,0x1B,0x66,0xC2,0xFD,0xE0}, - .pubkey={0xED,0x6A,0x17,0x41,0x82,0xEF,0x33,0xF7,0xC3,0x68,0x3C,0x0C,0x61,0xF0,0x17,0xDB, + "rUyMe6fvoJ4Lm1PnPquFabP3VSKzqjBkkw"}, + {{0xCA,0x67,0x89,0xD8,0x5A,0x4F,0x15,0x1F,0xF5,0x1C,0x9B,0x1B,0x66,0xC2,0xFD,0xE0}, + {0xED,0x6A,0x17,0x41,0x82,0xEF,0x33,0xF7,0xC3,0x68,0x3C,0x0C,0x61,0xF0,0x17,0xDB, 0x12,0x68,0xE3,0x27,0x3F,0x39,0xE5,0x39,0x63,0x59,0x17,0x84,0xAF,0x08,0x71,0xAF,0x6E}, - .seckey={0x05,0xF2,0x19,0x7C,0xCB,0x44,0xD3,0x9E,0x60,0x88,0xA3,0x57,0x38,0x04,0x9E,0x23, + {0x05,0xF2,0x19,0x7C,0xCB,0x44,0xD3,0x9E,0x60,0x88,0xA3,0x57,0x38,0x04,0x9E,0x23, 0xD8,0x8F,0x42,0xDC,0x5A,0xB2,0x10,0x16,0xB1,0x07,0xF5,0x8F,0x0D,0x26,0xAB,0x09}, - .addr="rN9pVkhR6qUeT73hkPCKyDHsuWWyarWRK"}, - {.seed={0x31,0x95,0xC9,0x48,0x17,0x51,0xA8,0x9E,0xC5,0x6F,0xE1,0xC9,0x63,0x30,0x78,0xAF}, - .pubkey={0xED,0x9C,0xEF,0xC2,0xF4,0xB3,0xC9,0x2D,0xC8,0xC2,0x01,0xE5,0xC5,0x21,0x0C,0x6B, + "rN9pVkhR6qUeT73hkPCKyDHsuWWyarWRK"}, + {{0x31,0x95,0xC9,0x48,0x17,0x51,0xA8,0x9E,0xC5,0x6F,0xE1,0xC9,0x63,0x30,0x78,0xAF}, + {0xED,0x9C,0xEF,0xC2,0xF4,0xB3,0xC9,0x2D,0xC8,0xC2,0x01,0xE5,0xC5,0x21,0x0C,0x6B, 0x27,0x77,0x91,0xF8,0x6D,0x8F,0xE1,0x7B,0x8D,0x45,0xBB,0x70,0x56,0x7F,0x59,0xB5,0xFA}, - .seckey={0x8D,0x29,0xBE,0x69,0x84,0xF2,0x49,0x7E,0xE6,0xE1,0x6F,0xB1,0xD7,0x40,0x6A,0x78, + {0x8D,0x29,0xBE,0x69,0x84,0xF2,0x49,0x7E,0xE6,0xE1,0x6F,0xB1,0xD7,0x40,0x6A,0x78, 0x93,0x5C,0xDF,0x01,0xB5,0xBB,0xE2,0xB7,0xAA,0x0B,0x44,0x08,0x82,0x56,0xC6,0xD2}, - .addr="rJcfnmHiPFzbn5gqQYdDk3aziuNztmGLcv"}, - {.seed={0x29,0x03,0x13,0x97,0x68,0x4B,0xD2,0x9A,0x2A,0x09,0xF8,0xFF,0xC7,0x5A,0x87,0x07}, - .pubkey={0xED,0xCA,0x63,0x21,0xD4,0xA9,0xDB,0x02,0x5E,0xE9,0x2A,0x2D,0xF3,0xCD,0x12,0xFD, + "rJcfnmHiPFzbn5gqQYdDk3aziuNztmGLcv"}, + {{0x29,0x03,0x13,0x97,0x68,0x4B,0xD2,0x9A,0x2A,0x09,0xF8,0xFF,0xC7,0x5A,0x87,0x07}, + {0xED,0xCA,0x63,0x21,0xD4,0xA9,0xDB,0x02,0x5E,0xE9,0x2A,0x2D,0xF3,0xCD,0x12,0xFD, 0x75,0x69,0x7B,0xA4,0x39,0x4F,0xE4,0xA5,0x08,0xE0,0x8E,0xAD,0x21,0x83,0xAC,0x58,0xFD}, - .seckey={0x07,0x71,0x01,0xB4,0x34,0xA8,0x2D,0xCF,0x05,0x2D,0xD6,0x8E,0x08,0x14,0xCA,0x25, + {0x07,0x71,0x01,0xB4,0x34,0xA8,0x2D,0xCF,0x05,0x2D,0xD6,0x8E,0x08,0x14,0xCA,0x25, 0x1A,0xCB,0x12,0x62,0x25,0x2D,0x7B,0x14,0xA0,0x09,0xF0,0x6C,0x82,0x57,0xF9,0x24}, - .addr="rU619NnNQQGiyPXLCGRcuXP7MhZR1TxFmP"}, - {.seed={0xBA,0x63,0xEC,0x83,0x0F,0x51,0x96,0x76,0x67,0xC6,0x00,0x1C,0x9C,0x23,0x76,0xCB}, - .pubkey={0xED,0xB7,0x37,0xBD,0xAD,0x90,0x48,0x85,0xDE,0xF9,0xBE,0x25,0x2D,0xA4,0x59,0x77, + "rU619NnNQQGiyPXLCGRcuXP7MhZR1TxFmP"}, + {{0xBA,0x63,0xEC,0x83,0x0F,0x51,0x96,0x76,0x67,0xC6,0x00,0x1C,0x9C,0x23,0x76,0xCB}, + {0xED,0xB7,0x37,0xBD,0xAD,0x90,0x48,0x85,0xDE,0xF9,0xBE,0x25,0x2D,0xA4,0x59,0x77, 0xC7,0x5E,0xD7,0x8B,0x47,0x39,0x83,0xCC,0x66,0xA0,0x3F,0x5D,0x22,0x4F,0x17,0x60,0x9C}, - .seckey={0x1B,0x52,0xBB,0x05,0x64,0x2E,0x9B,0x06,0xB9,0x72,0xAF,0xE0,0x77,0x5B,0x1B,0xE5, + {0x1B,0x52,0xBB,0x05,0x64,0x2E,0x9B,0x06,0xB9,0x72,0xAF,0xE0,0x77,0x5B,0x1B,0xE5, 0x68,0x92,0x14,0xCB,0x32,0xC8,0x1A,0x46,0xB3,0x99,0xDC,0x52,0xDA,0x7B,0xD2,0x4D}, - .addr="rP7ywfUBLDeAk1uV1RnWhu1pyJnG3sQL9h"}, - {.seed={0x60,0x4C,0x3E,0x3D,0xA8,0xB3,0xF5,0xD7,0x67,0x8A,0xA7,0xAD,0xBB,0xBE,0x54,0xCB}, - .pubkey={0xED,0x51,0xD2,0x7A,0x66,0x94,0xB6,0x09,0xE4,0xE4,0x76,0xFD,0x3E,0x67,0xB6,0x52, + "rP7ywfUBLDeAk1uV1RnWhu1pyJnG3sQL9h"}, + {{0x60,0x4C,0x3E,0x3D,0xA8,0xB3,0xF5,0xD7,0x67,0x8A,0xA7,0xAD,0xBB,0xBE,0x54,0xCB}, + {0xED,0x51,0xD2,0x7A,0x66,0x94,0xB6,0x09,0xE4,0xE4,0x76,0xFD,0x3E,0x67,0xB6,0x52, 0x5C,0x76,0x83,0x75,0x4E,0x8C,0x82,0x36,0xA9,0xBC,0x5E,0x5F,0xBE,0xEC,0x2B,0xCB,0x7F}, - .seckey={0xE8,0x47,0xB6,0xE5,0xE8,0xC4,0x0F,0x70,0x92,0xC7,0x2E,0xE4,0xFD,0xF6,0x94,0xC4, + {0xE8,0x47,0xB6,0xE5,0xE8,0xC4,0x0F,0x70,0x92,0xC7,0x2E,0xE4,0xFD,0xF6,0x94,0xC4, 0x9E,0xB4,0x07,0x6D,0x93,0xD0,0xE7,0xCF,0x3C,0x54,0xCD,0x3C,0xC5,0x89,0x14,0xBA}, - .addr="rDrShqPhNLn9e1yP7UTNZCty2ghfEgQMNa"}, - {.seed={0x98,0xCC,0x63,0x7E,0x7C,0xE8,0x3C,0xD9,0xE2,0xDF,0xFA,0xC5,0xF2,0x32,0x84,0xA0}, - .pubkey={0xED,0x22,0x7A,0xF8,0x21,0x57,0x3B,0xCC,0xCB,0x17,0xD9,0xD9,0x02,0x2D,0x20,0xFF, + "rDrShqPhNLn9e1yP7UTNZCty2ghfEgQMNa"}, + {{0x98,0xCC,0x63,0x7E,0x7C,0xE8,0x3C,0xD9,0xE2,0xDF,0xFA,0xC5,0xF2,0x32,0x84,0xA0}, + {0xED,0x22,0x7A,0xF8,0x21,0x57,0x3B,0xCC,0xCB,0x17,0xD9,0xD9,0x02,0x2D,0x20,0xFF, 0xB4,0x35,0x1C,0x86,0xFF,0x3F,0xE6,0x34,0xB4,0xB1,0xB2,0x72,0x81,0x0A,0x76,0x98,0x32}, - .seckey={0x38,0xD3,0x62,0x0A,0xB9,0x25,0xD6,0x14,0xCF,0x7D,0x14,0x9B,0x68,0x31,0x46,0xF5, + {0x38,0xD3,0x62,0x0A,0xB9,0x25,0xD6,0x14,0xCF,0x7D,0x14,0x9B,0x68,0x31,0x46,0xF5, 0xB0,0xAE,0x35,0x6F,0xDA,0x00,0xFD,0x85,0x8F,0xC4,0x1F,0x26,0x9B,0xCC,0x54,0x84}, - .addr="r3uekKMfuYuxuYkZjsrmYgJG8K39VE4VJY"}, - {.seed={0x78,0x60,0x6D,0xAF,0x5A,0x6E,0xB5,0xD5,0xBF,0x54,0x65,0xD5,0xCB,0x85,0x69,0x07}, - .pubkey={0xED,0x99,0x8D,0x93,0x23,0x7C,0x18,0x9A,0x18,0xA9,0x3C,0xB7,0xA0,0x0E,0xD7,0x70, + "r3uekKMfuYuxuYkZjsrmYgJG8K39VE4VJY"}, + {{0x78,0x60,0x6D,0xAF,0x5A,0x6E,0xB5,0xD5,0xBF,0x54,0x65,0xD5,0xCB,0x85,0x69,0x07}, + {0xED,0x99,0x8D,0x93,0x23,0x7C,0x18,0x9A,0x18,0xA9,0x3C,0xB7,0xA0,0x0E,0xD7,0x70, 0x1C,0xE3,0x58,0x9A,0xDA,0x7D,0x72,0xDE,0xE2,0x38,0x26,0xB3,0xFC,0x0F,0x3E,0x4A,0xD7}, - .seckey={0xA9,0x43,0xF9,0x80,0xC7,0x65,0x70,0x41,0x90,0xB1,0x19,0xEC,0x1B,0x8A,0xE1,0xAA, + {0xA9,0x43,0xF9,0x80,0xC7,0x65,0x70,0x41,0x90,0xB1,0x19,0xEC,0x1B,0x8A,0xE1,0xAA, 0x00,0xB3,0x34,0xC7,0x36,0x64,0x5A,0xB4,0x94,0xB4,0x88,0x14,0x23,0x4B,0xFF,0xD9}, - .addr="rNUXnPHuuwqftzNbwosussmnFcUePnbwjQ"}, - {.seed={0x3F,0x2C,0xE1,0xDF,0x92,0x1B,0xD3,0xFE,0xA3,0x1B,0x4C,0x00,0xE1,0x2D,0x7F,0x3D}, - .pubkey={0xED,0x31,0x8C,0x56,0x0E,0x69,0x41,0x7D,0x2E,0xCF,0x9F,0xDB,0x61,0xAC,0xB3,0xE0, + "rNUXnPHuuwqftzNbwosussmnFcUePnbwjQ"}, + {{0x3F,0x2C,0xE1,0xDF,0x92,0x1B,0xD3,0xFE,0xA3,0x1B,0x4C,0x00,0xE1,0x2D,0x7F,0x3D}, + {0xED,0x31,0x8C,0x56,0x0E,0x69,0x41,0x7D,0x2E,0xCF,0x9F,0xDB,0x61,0xAC,0xB3,0xE0, 0x7B,0x99,0xC3,0x93,0x44,0x72,0xAC,0x5E,0x7B,0xE0,0xED,0x53,0xCB,0x3D,0x92,0x76,0x18}, - .seckey={0xD9,0xF7,0x8C,0x20,0x08,0xEB,0xBF,0xFF,0x76,0xA7,0xA9,0x32,0x3E,0x7E,0x7E,0x6A, + {0xD9,0xF7,0x8C,0x20,0x08,0xEB,0xBF,0xFF,0x76,0xA7,0xA9,0x32,0x3E,0x7E,0x7E,0x6A, 0x35,0x18,0x4F,0x2F,0xB5,0xE9,0xE5,0xF1,0xE9,0x3B,0x3F,0x00,0x33,0x49,0xB8,0x42}, - .addr="rnj6vSuUXmMW8qwdXwUKWEezmBUWjf8krG"}, - {.seed={0x98,0x3F,0x64,0x6B,0x02,0xDB,0xE9,0x4A,0x46,0x52,0x2D,0xA5,0x5C,0x73,0x04,0x66}, - .pubkey={0xED,0x26,0x87,0xDB,0x80,0x3B,0xE4,0x35,0x5F,0x19,0xC1,0x57,0x74,0xDB,0x80,0x0A, + "rnj6vSuUXmMW8qwdXwUKWEezmBUWjf8krG"}, + {{0x98,0x3F,0x64,0x6B,0x02,0xDB,0xE9,0x4A,0x46,0x52,0x2D,0xA5,0x5C,0x73,0x04,0x66}, + {0xED,0x26,0x87,0xDB,0x80,0x3B,0xE4,0x35,0x5F,0x19,0xC1,0x57,0x74,0xDB,0x80,0x0A, 0xD7,0xB4,0xB8,0xA9,0xA1,0x4D,0x41,0xCE,0x4B,0xFC,0xE5,0x13,0x4E,0x69,0x6A,0x2B,0xD3}, - .seckey={0x1D,0xF8,0x5C,0xFF,0xA0,0x11,0x59,0x99,0xB6,0xF4,0x33,0xE5,0xAA,0x2A,0x92,0x5D, + {0x1D,0xF8,0x5C,0xFF,0xA0,0x11,0x59,0x99,0xB6,0xF4,0x33,0xE5,0xAA,0x2A,0x92,0x5D, 0x8E,0x12,0x63,0xD3,0xD0,0x3C,0x65,0x6E,0xA2,0x7E,0x53,0xCE,0xC0,0x4B,0x87,0x0C}, - .addr="rLwPm1MKU645YKtuEUCtUBfaKLuUafZKpK"}, - {.seed={0x1E,0x03,0x9B,0x04,0x57,0xC1,0x9E,0xE3,0xA9,0xBF,0x48,0x1C,0x78,0x54,0x6C,0x3A}, - .pubkey={0xED,0x1C,0x54,0xB7,0x64,0x7D,0xD8,0xD3,0x59,0x4D,0x9E,0x08,0xAA,0xF0,0x22,0xC2, + "rLwPm1MKU645YKtuEUCtUBfaKLuUafZKpK"}, + {{0x1E,0x03,0x9B,0x04,0x57,0xC1,0x9E,0xE3,0xA9,0xBF,0x48,0x1C,0x78,0x54,0x6C,0x3A}, + {0xED,0x1C,0x54,0xB7,0x64,0x7D,0xD8,0xD3,0x59,0x4D,0x9E,0x08,0xAA,0xF0,0x22,0xC2, 0x85,0xCD,0xC6,0x54,0x76,0xD6,0x77,0x44,0x94,0x9A,0x7D,0x0F,0xDB,0x07,0xC1,0xAA,0x44}, - .seckey={0x18,0xE9,0xD0,0xA8,0xDE,0xA7,0x55,0x3E,0xA7,0xD2,0x88,0x6F,0x49,0xBB,0x0C,0xCD, + {0x18,0xE9,0xD0,0xA8,0xDE,0xA7,0x55,0x3E,0xA7,0xD2,0x88,0x6F,0x49,0xBB,0x0C,0xCD, 0xA4,0x46,0x42,0x9D,0x88,0xE8,0x3D,0xF0,0x38,0xC5,0x47,0xD8,0x95,0xF2,0x21,0x34}, - .addr="r4JxbSBo2LNGLLkYF7D3waf3Nhcz2wJVPD"}, - {.seed={0x3A,0x11,0x4E,0x5D,0xE8,0xBB,0x4E,0x17,0x9C,0x9E,0x31,0x92,0xD9,0x94,0x4E,0x88}, - .pubkey={0xED,0x90,0x0E,0x5C,0xF1,0xED,0xCB,0xC3,0x8E,0xE2,0x40,0x1D,0x51,0xB4,0x1E,0x19, + "r4JxbSBo2LNGLLkYF7D3waf3Nhcz2wJVPD"}, + {{0x3A,0x11,0x4E,0x5D,0xE8,0xBB,0x4E,0x17,0x9C,0x9E,0x31,0x92,0xD9,0x94,0x4E,0x88}, + {0xED,0x90,0x0E,0x5C,0xF1,0xED,0xCB,0xC3,0x8E,0xE2,0x40,0x1D,0x51,0xB4,0x1E,0x19, 0x8D,0xFC,0xA8,0x2C,0x6E,0x23,0xB4,0x28,0x2D,0xBA,0xF4,0x44,0xF2,0x86,0xE0,0x9A,0xC2}, - .seckey={0x64,0x21,0xB4,0x02,0x02,0x63,0x68,0xD5,0xEB,0xFB,0xA6,0x15,0x29,0x03,0x04,0x2D, + {0x64,0x21,0xB4,0x02,0x02,0x63,0x68,0xD5,0xEB,0xFB,0xA6,0x15,0x29,0x03,0x04,0x2D, 0x05,0xC6,0xB2,0x7C,0xCD,0x52,0x2C,0x21,0xBE,0x93,0xEE,0x3F,0x13,0xB0,0x0D,0x0F}, - .addr="rPowZBd6n845AtJsjTnpMQQ4go4aE5rSrU"}, - {.seed={0x27,0x2C,0x1B,0x39,0x6F,0x36,0x48,0xC8,0x45,0x68,0x7E,0x27,0x0C,0x31,0xD1,0x38}, - .pubkey={0xED,0x98,0xBB,0xF9,0x98,0x65,0xED,0xAF,0x1A,0x03,0x81,0xE7,0x14,0x9E,0x49,0xC1, + "rPowZBd6n845AtJsjTnpMQQ4go4aE5rSrU"}, + {{0x27,0x2C,0x1B,0x39,0x6F,0x36,0x48,0xC8,0x45,0x68,0x7E,0x27,0x0C,0x31,0xD1,0x38}, + {0xED,0x98,0xBB,0xF9,0x98,0x65,0xED,0xAF,0x1A,0x03,0x81,0xE7,0x14,0x9E,0x49,0xC1, 0x29,0x03,0x99,0x63,0xD4,0x60,0xB1,0x65,0xF5,0x9F,0x1D,0xDA,0xA9,0x5B,0x31,0xA9,0x25}, - .seckey={0x03,0x2C,0x27,0x61,0xB0,0x0F,0xA4,0xAB,0x89,0xB4,0x03,0x67,0x83,0x42,0x12,0x94, + {0x03,0x2C,0x27,0x61,0xB0,0x0F,0xA4,0xAB,0x89,0xB4,0x03,0x67,0x83,0x42,0x12,0x94, 0x16,0xAA,0xB1,0x3A,0x39,0x5F,0x3D,0x02,0x87,0xE4,0x4C,0xC9,0xDF,0x36,0x91,0xFD}, - .addr="rsdP5KvUtanQDrDZ7gebdSMQN2zJveJL7n"}, - {.seed={0x22,0xA2,0x2B,0xCA,0xB7,0xC7,0xD2,0x27,0xEC,0xD2,0x72,0x6A,0x4E,0xF2,0x8A,0x60}, - .pubkey={0xED,0x75,0xBC,0x6C,0x7D,0x63,0x18,0x08,0x5F,0xEE,0xE3,0x66,0x81,0x34,0x3B,0x25, + "rsdP5KvUtanQDrDZ7gebdSMQN2zJveJL7n"}, + {{0x22,0xA2,0x2B,0xCA,0xB7,0xC7,0xD2,0x27,0xEC,0xD2,0x72,0x6A,0x4E,0xF2,0x8A,0x60}, + {0xED,0x75,0xBC,0x6C,0x7D,0x63,0x18,0x08,0x5F,0xEE,0xE3,0x66,0x81,0x34,0x3B,0x25, 0xB5,0x23,0xD9,0x59,0xE7,0x1C,0xF8,0x93,0x08,0xD6,0xD6,0xF9,0xEF,0x10,0xF9,0xD7,0x23}, - .seckey={0x87,0xD1,0x07,0xAD,0x10,0x12,0x58,0x85,0xEA,0xF1,0xCD,0x2D,0x48,0x96,0xE2,0xA7, + {0x87,0xD1,0x07,0xAD,0x10,0x12,0x58,0x85,0xEA,0xF1,0xCD,0x2D,0x48,0x96,0xE2,0xA7, 0x17,0x11,0x28,0x4F,0xC1,0xCC,0x33,0x5E,0x83,0x6A,0x31,0xBD,0xB2,0xBD,0xA0,0xFE}, - .addr="rwpWQzs9x9tZofsf1PdZA7E7LBzjgzC5DD"}, - {.seed={0xF7,0xDA,0xC7,0x2E,0x0A,0x0B,0x75,0xB9,0x04,0x0C,0xFB,0xE9,0xAA,0x5B,0x96,0xAE}, - .pubkey={0xED,0x82,0xE4,0x7D,0xF7,0xC4,0x6B,0xBF,0x23,0x43,0x65,0x51,0xB8,0xD0,0xF6,0x21, + "rwpWQzs9x9tZofsf1PdZA7E7LBzjgzC5DD"}, + {{0xF7,0xDA,0xC7,0x2E,0x0A,0x0B,0x75,0xB9,0x04,0x0C,0xFB,0xE9,0xAA,0x5B,0x96,0xAE}, + {0xED,0x82,0xE4,0x7D,0xF7,0xC4,0x6B,0xBF,0x23,0x43,0x65,0x51,0xB8,0xD0,0xF6,0x21, 0x8B,0x98,0xE5,0x92,0x9E,0x57,0xDB,0x82,0x52,0x43,0xDB,0x74,0x77,0x7B,0x7A,0x6D,0x86}, - .seckey={0xA7,0x53,0xFD,0x0F,0xCC,0x59,0xA7,0xCA,0x47,0x74,0x46,0x5C,0xAC,0x2C,0x3C,0x5D, + {0xA7,0x53,0xFD,0x0F,0xCC,0x59,0xA7,0xCA,0x47,0x74,0x46,0x5C,0xAC,0x2C,0x3C,0x5D, 0x3E,0x59,0x8E,0x7C,0x68,0x99,0x81,0x91,0x09,0x15,0x3D,0x40,0x7A,0x3E,0xA5,0x11}, - .addr="rfSP8muPdQGdevuRZmt1SDRWbzuLAk2S4C"}, - {.seed={0x4B,0xC7,0x86,0x0F,0x05,0x33,0xEA,0x29,0xF0,0x17,0x45,0x94,0xB1,0x80,0x79,0xD9}, - .pubkey={0xED,0x09,0xE6,0x5E,0xFA,0xD0,0x39,0x72,0x82,0x33,0xA6,0xE4,0x3D,0xDB,0xD5,0x97, + "rfSP8muPdQGdevuRZmt1SDRWbzuLAk2S4C"}, + {{0x4B,0xC7,0x86,0x0F,0x05,0x33,0xEA,0x29,0xF0,0x17,0x45,0x94,0xB1,0x80,0x79,0xD9}, + {0xED,0x09,0xE6,0x5E,0xFA,0xD0,0x39,0x72,0x82,0x33,0xA6,0xE4,0x3D,0xDB,0xD5,0x97, 0x17,0x56,0xB8,0xB3,0xAA,0xE4,0x0C,0x37,0x28,0x3E,0x21,0x73,0x4B,0x2C,0x31,0x3C,0x4E}, - .seckey={0x07,0xC0,0x48,0xA5,0x27,0x72,0xCC,0xC0,0xCD,0x49,0xF3,0xE9,0xFC,0xEB,0x0A,0x89, + {0x07,0xC0,0x48,0xA5,0x27,0x72,0xCC,0xC0,0xCD,0x49,0xF3,0xE9,0xFC,0xEB,0x0A,0x89, 0xAC,0xCD,0x70,0xB0,0x72,0x43,0x60,0xFA,0x4E,0xBD,0x87,0x49,0x7A,0x43,0x3A,0x1F}, - .addr="rhPpCGk6r6f1bLHaBvT1fc4sCknWLi6Kyd"}, - {.seed={0x64,0x66,0x2B,0xCD,0x83,0x06,0x43,0xCC,0x2B,0x59,0x07,0x2F,0x3B,0x6C,0x6C,0xF7}, - .pubkey={0xED,0xC8,0x1E,0x2D,0x5B,0xF8,0x3E,0xEB,0x9A,0x70,0x46,0x56,0x67,0x37,0x05,0xD0, + "rhPpCGk6r6f1bLHaBvT1fc4sCknWLi6Kyd"}, + {{0x64,0x66,0x2B,0xCD,0x83,0x06,0x43,0xCC,0x2B,0x59,0x07,0x2F,0x3B,0x6C,0x6C,0xF7}, + {0xED,0xC8,0x1E,0x2D,0x5B,0xF8,0x3E,0xEB,0x9A,0x70,0x46,0x56,0x67,0x37,0x05,0xD0, 0x27,0xAC,0x07,0xDC,0x33,0x37,0xC2,0xD1,0x67,0x30,0xB6,0xEC,0x6D,0x6D,0x3B,0xD8,0x39}, - .seckey={0x8E,0xE8,0xF0,0x87,0x00,0x3E,0xA3,0x2E,0x94,0x62,0x2A,0x6F,0x3E,0x38,0xCC,0x1B, + {0x8E,0xE8,0xF0,0x87,0x00,0x3E,0xA3,0x2E,0x94,0x62,0x2A,0x6F,0x3E,0x38,0xCC,0x1B, 0xA9,0xFD,0x2E,0x19,0x7A,0x71,0x3C,0xB6,0x12,0x54,0x1A,0x1F,0x8F,0xBD,0xBC,0x57}, - .addr="rMBy6xJfbGV4RNDy8mdBVDYTpoGArkEu95"}, - {.seed={0xC2,0xBB,0x19,0xF7,0x2A,0x8B,0x59,0x5A,0xAF,0x57,0x34,0xB8,0xD0,0xCF,0x35,0x63}, - .pubkey={0xED,0xB0,0x76,0xC8,0x12,0x11,0x54,0x3C,0x9D,0x49,0xF2,0xED,0x2E,0x7D,0xD5,0xF4, + "rMBy6xJfbGV4RNDy8mdBVDYTpoGArkEu95"}, + {{0xC2,0xBB,0x19,0xF7,0x2A,0x8B,0x59,0x5A,0xAF,0x57,0x34,0xB8,0xD0,0xCF,0x35,0x63}, + {0xED,0xB0,0x76,0xC8,0x12,0x11,0x54,0x3C,0x9D,0x49,0xF2,0xED,0x2E,0x7D,0xD5,0xF4, 0x94,0x3B,0x74,0x55,0xB3,0xB1,0x93,0x73,0xF9,0x71,0x80,0x1F,0x9B,0x6D,0xC0,0xC3,0x4C}, - .seckey={0x1A,0xD7,0x16,0x90,0x7D,0x6A,0xDA,0x1A,0x27,0xD9,0x3C,0xB9,0xC6,0x29,0x90,0x24, + {0x1A,0xD7,0x16,0x90,0x7D,0x6A,0xDA,0x1A,0x27,0xD9,0x3C,0xB9,0xC6,0x29,0x90,0x24, 0x59,0x38,0x0B,0x5C,0x62,0xC0,0x91,0x19,0x70,0x45,0x57,0xA1,0x48,0xB3,0x57,0x55}, - .addr="rDoEhMUA33qViCmhx69WxvmtfFXC55Avah"}, - {.seed={0xCF,0xE0,0x00,0x67,0x9F,0x8E,0x7F,0xEC,0x63,0xDA,0x7C,0x9E,0x59,0xFB,0xD5,0xE9}, - .pubkey={0xED,0x2A,0x83,0x43,0xF3,0x6B,0xCC,0x64,0xB3,0x9A,0x24,0xAD,0xE1,0xCB,0x94,0x39, + "rDoEhMUA33qViCmhx69WxvmtfFXC55Avah"}, + {{0xCF,0xE0,0x00,0x67,0x9F,0x8E,0x7F,0xEC,0x63,0xDA,0x7C,0x9E,0x59,0xFB,0xD5,0xE9}, + {0xED,0x2A,0x83,0x43,0xF3,0x6B,0xCC,0x64,0xB3,0x9A,0x24,0xAD,0xE1,0xCB,0x94,0x39, 0x77,0xFC,0x33,0x66,0xE8,0xA2,0x50,0xD7,0x24,0x7D,0x06,0xE2,0xD8,0x07,0x75,0x38,0xC2}, - .seckey={0x25,0x52,0x3F,0x87,0xBB,0x6F,0x80,0x84,0x0C,0x40,0x3E,0xBA,0x50,0xE9,0x1D,0x46, + {0x25,0x52,0x3F,0x87,0xBB,0x6F,0x80,0x84,0x0C,0x40,0x3E,0xBA,0x50,0xE9,0x1D,0x46, 0x13,0x9F,0xA8,0x7F,0x25,0x0B,0x50,0x34,0x50,0xCC,0x35,0x83,0x41,0x94,0x01,0x5D}, - .addr="rJ8ry1zRxQTnp1fu9qSxPNhxfWtFb2caio"}, - {.seed={0x49,0x47,0xC6,0x34,0x42,0x84,0x19,0xC3,0x1A,0x26,0x7D,0xFF,0x87,0xDA,0x69,0xED}, - .pubkey={0xED,0xD2,0x87,0xFB,0xDA,0xC8,0x4E,0x88,0x29,0x47,0x13,0x87,0x30,0x20,0x2B,0xF9, + "rJ8ry1zRxQTnp1fu9qSxPNhxfWtFb2caio"}, + {{0x49,0x47,0xC6,0x34,0x42,0x84,0x19,0xC3,0x1A,0x26,0x7D,0xFF,0x87,0xDA,0x69,0xED}, + {0xED,0xD2,0x87,0xFB,0xDA,0xC8,0x4E,0x88,0x29,0x47,0x13,0x87,0x30,0x20,0x2B,0xF9, 0xA4,0xCA,0x90,0x10,0x38,0xC3,0x7D,0xD8,0x00,0xB5,0xD2,0xBA,0xBB,0x57,0xE6,0xED,0xD1}, - .seckey={0xBB,0xE6,0x3C,0x1F,0x2B,0x03,0x71,0xDC,0xEB,0x27,0x4E,0x64,0x48,0xE9,0x05,0xE0, + {0xBB,0xE6,0x3C,0x1F,0x2B,0x03,0x71,0xDC,0xEB,0x27,0x4E,0x64,0x48,0xE9,0x05,0xE0, 0x95,0xE2,0x04,0xB8,0xDA,0x32,0xD4,0x96,0x45,0x15,0xC3,0x77,0xA9,0xB4,0xC3,0x8A}, - .addr="rBTmbytPkthAonMoFEFdr9ewQc9d5AQdVE"}, - {.seed={0x6B,0xC3,0x37,0xB0,0x07,0x6F,0xB7,0x60,0xAF,0x78,0x58,0x9A,0xDE,0xDA,0x0D,0x71}, - .pubkey={0xED,0x7E,0x0D,0xBB,0x97,0xD6,0x0D,0xB6,0x74,0x57,0xB0,0x22,0x28,0xF0,0x20,0x34, + "rBTmbytPkthAonMoFEFdr9ewQc9d5AQdVE"}, + {{0x6B,0xC3,0x37,0xB0,0x07,0x6F,0xB7,0x60,0xAF,0x78,0x58,0x9A,0xDE,0xDA,0x0D,0x71}, + {0xED,0x7E,0x0D,0xBB,0x97,0xD6,0x0D,0xB6,0x74,0x57,0xB0,0x22,0x28,0xF0,0x20,0x34, 0x9F,0x1B,0xCD,0x89,0xA0,0xB5,0xFB,0xD3,0x2B,0xE8,0x8C,0x5B,0x2A,0x8D,0x50,0x5A,0x4F}, - .seckey={0xEE,0xC0,0x42,0x75,0x85,0x15,0x24,0xC5,0x30,0x62,0xE6,0x21,0xBA,0xC7,0x02,0xEC, + {0xEE,0xC0,0x42,0x75,0x85,0x15,0x24,0xC5,0x30,0x62,0xE6,0x21,0xBA,0xC7,0x02,0xEC, 0x3C,0x46,0x3F,0xC1,0x7D,0xDF,0x03,0xD4,0xAA,0xF4,0xF4,0x83,0xCE,0xB1,0x59,0xF2}, - .addr="r3q66ccmLGZHdsStqGDawGt8ek8DKthLU"}, - {.seed={0xD8,0xE6,0x93,0x8A,0x9F,0x79,0xDE,0x01,0x3B,0x76,0x47,0x9E,0xD5,0x1C,0xB5,0xF4}, - .pubkey={0xED,0x2A,0xCC,0x07,0xAC,0x51,0x1E,0xEB,0x5F,0x0C,0x37,0xC4,0x5B,0x4D,0x7F,0x58, + "r3q66ccmLGZHdsStqGDawGt8ek8DKthLU"}, + {{0xD8,0xE6,0x93,0x8A,0x9F,0x79,0xDE,0x01,0x3B,0x76,0x47,0x9E,0xD5,0x1C,0xB5,0xF4}, + {0xED,0x2A,0xCC,0x07,0xAC,0x51,0x1E,0xEB,0x5F,0x0C,0x37,0xC4,0x5B,0x4D,0x7F,0x58, 0xBE,0x16,0x9B,0xF7,0x30,0xE8,0x6D,0x5B,0x39,0x3F,0x61,0x7A,0xFD,0xDA,0xFA,0x6F,0xBA}, - .seckey={0x97,0x18,0xB2,0x55,0xAE,0xC6,0x25,0x34,0xE9,0xC7,0x7C,0x1F,0xC7,0xCF,0xA9,0x9A, + {0x97,0x18,0xB2,0x55,0xAE,0xC6,0x25,0x34,0xE9,0xC7,0x7C,0x1F,0xC7,0xCF,0xA9,0x9A, 0x24,0x6E,0x41,0xFF,0xB5,0x19,0x7F,0x14,0xB7,0x33,0x17,0x4A,0xBE,0x06,0x5E,0x9C}, - .addr="rMS5BvvLjC1HCDtL81M394JAbg7ymqymiV"}, - {.seed={0xB6,0x14,0xFA,0x0C,0x4A,0x18,0x83,0x96,0x5E,0x04,0x93,0x55,0x83,0xBC,0x7D,0x88}, - .pubkey={0xED,0xB0,0xD8,0xE9,0x32,0x13,0xB6,0x10,0xF9,0x0B,0xF7,0xEE,0x59,0x01,0x52,0xFD, + "rMS5BvvLjC1HCDtL81M394JAbg7ymqymiV"}, + {{0xB6,0x14,0xFA,0x0C,0x4A,0x18,0x83,0x96,0x5E,0x04,0x93,0x55,0x83,0xBC,0x7D,0x88}, + {0xED,0xB0,0xD8,0xE9,0x32,0x13,0xB6,0x10,0xF9,0x0B,0xF7,0xEE,0x59,0x01,0x52,0xFD, 0x21,0xCA,0x9D,0xC9,0x4B,0xCD,0x02,0x03,0x45,0x6C,0xF2,0x86,0xF2,0x65,0x52,0x2B,0xCA}, - .seckey={0x3B,0xD7,0x9F,0x6C,0xFC,0x9F,0x74,0x03,0x0E,0xB1,0xE9,0x1E,0xA9,0x78,0x0E,0x82, + {0x3B,0xD7,0x9F,0x6C,0xFC,0x9F,0x74,0x03,0x0E,0xB1,0xE9,0x1E,0xA9,0x78,0x0E,0x82, 0x77,0x64,0x4D,0x4B,0x9C,0x15,0xD7,0x59,0x05,0xC4,0x90,0x57,0xB1,0x61,0x04,0x43}, - .addr="rGGVv46pEy7R8G7tcYsPAsjWhR6WCA7L4T"}, - {.seed={0xA7,0xA2,0x39,0xD1,0x52,0xA2,0x89,0xE4,0xD5,0x02,0xC2,0x43,0x8E,0xFF,0x6B,0x71}, - .pubkey={0xED,0xFE,0xA6,0xAF,0x9A,0xEA,0x34,0xC8,0xA2,0x78,0x3C,0xED,0x52,0x25,0x97,0x28, + "rGGVv46pEy7R8G7tcYsPAsjWhR6WCA7L4T"}, + {{0xA7,0xA2,0x39,0xD1,0x52,0xA2,0x89,0xE4,0xD5,0x02,0xC2,0x43,0x8E,0xFF,0x6B,0x71}, + {0xED,0xFE,0xA6,0xAF,0x9A,0xEA,0x34,0xC8,0xA2,0x78,0x3C,0xED,0x52,0x25,0x97,0x28, 0x1E,0x2E,0x0E,0x47,0xC4,0x8B,0x5D,0x7E,0xDD,0x80,0xAE,0x6B,0xE7,0x30,0x05,0x14,0x84}, - .seckey={0xEA,0x8D,0x5B,0x9F,0xA2,0x5B,0x56,0x31,0x97,0x07,0x73,0x6C,0x3B,0xB2,0xA0,0x24, + {0xEA,0x8D,0x5B,0x9F,0xA2,0x5B,0x56,0x31,0x97,0x07,0x73,0x6C,0x3B,0xB2,0xA0,0x24, 0x66,0x84,0xBA,0x72,0x3E,0xA8,0x64,0x9D,0xDE,0xB7,0x66,0x33,0x54,0x49,0xCE,0xE7}, - .addr="rSZmSEymX238fWeoscc1DqvP3GuXNmNDR"}, - {.seed={0xF6,0xA6,0xE7,0x2C,0xD6,0x32,0x8B,0x7B,0xAF,0x46,0x32,0xC3,0xC5,0x08,0x6C,0xE7}, - .pubkey={0xED,0x80,0xE2,0x78,0x44,0x83,0x23,0x7B,0xE7,0x14,0xF6,0xE6,0x65,0x34,0x64,0xF2, + "rSZmSEymX238fWeoscc1DqvP3GuXNmNDR"}, + {{0xF6,0xA6,0xE7,0x2C,0xD6,0x32,0x8B,0x7B,0xAF,0x46,0x32,0xC3,0xC5,0x08,0x6C,0xE7}, + {0xED,0x80,0xE2,0x78,0x44,0x83,0x23,0x7B,0xE7,0x14,0xF6,0xE6,0x65,0x34,0x64,0xF2, 0x72,0x16,0x11,0xEF,0x4A,0xAC,0x79,0xCC,0xD9,0xA5,0x5E,0x94,0xBB,0x5C,0x8E,0x9A,0x0D}, - .seckey={0x9A,0x0F,0xB3,0x5E,0x98,0x6E,0x7C,0x86,0x6E,0xB1,0x99,0x5C,0xD6,0xFA,0xFC,0x97, + {0x9A,0x0F,0xB3,0x5E,0x98,0x6E,0x7C,0x86,0x6E,0xB1,0x99,0x5C,0xD6,0xFA,0xFC,0x97, 0xE7,0xE3,0x93,0x59,0xF8,0xA9,0x4E,0xBC,0x2C,0xA0,0x3D,0xD2,0x35,0x45,0xCE,0x75}, - .addr="rDdnbVT5k4GDWtqE8qVUTTVvj1Hpsxnm31"}, - {.seed={0x52,0x9B,0x42,0xD5,0x7F,0xC7,0x88,0x9B,0x76,0x37,0xA9,0x3A,0x78,0xF3,0x25,0xA8}, - .pubkey={0xED,0x42,0xFD,0x63,0x56,0x5F,0x4F,0xBD,0xBA,0x05,0x64,0x07,0xB0,0xD1,0xB7,0xEC, + "rDdnbVT5k4GDWtqE8qVUTTVvj1Hpsxnm31"}, + {{0x52,0x9B,0x42,0xD5,0x7F,0xC7,0x88,0x9B,0x76,0x37,0xA9,0x3A,0x78,0xF3,0x25,0xA8}, + {0xED,0x42,0xFD,0x63,0x56,0x5F,0x4F,0xBD,0xBA,0x05,0x64,0x07,0xB0,0xD1,0xB7,0xEC, 0x22,0x57,0x1F,0x40,0x16,0x88,0xA1,0xA1,0x4E,0x4F,0x64,0xF8,0xF7,0xC5,0xD1,0x75,0x75}, - .seckey={0xB0,0xC0,0x27,0x7E,0x16,0xF9,0xAD,0xEF,0x10,0xC8,0x69,0xBE,0x35,0x21,0xD2,0xE9, + {0xB0,0xC0,0x27,0x7E,0x16,0xF9,0xAD,0xEF,0x10,0xC8,0x69,0xBE,0x35,0x21,0xD2,0xE9, 0x3C,0x88,0x97,0x77,0xAD,0xE9,0xAE,0x0C,0x9E,0x54,0xDD,0xB4,0x06,0xDE,0xD3,0xF0}, - .addr="rNLiq2KbE7N4qTcuiFzTAJ34hHKgaSAp22"}, - {.seed={0x39,0xCF,0x81,0xC4,0x1F,0xD3,0xB3,0x2E,0x94,0x55,0x86,0xC7,0x6C,0xF9,0x9B,0x6E}, - .pubkey={0xED,0x79,0x65,0x13,0x48,0x56,0x93,0xFD,0xE0,0x53,0x85,0x5A,0x95,0xB9,0x17,0x6A, + "rNLiq2KbE7N4qTcuiFzTAJ34hHKgaSAp22"}, + {{0x39,0xCF,0x81,0xC4,0x1F,0xD3,0xB3,0x2E,0x94,0x55,0x86,0xC7,0x6C,0xF9,0x9B,0x6E}, + {0xED,0x79,0x65,0x13,0x48,0x56,0x93,0xFD,0xE0,0x53,0x85,0x5A,0x95,0xB9,0x17,0x6A, 0x7D,0x87,0x1D,0x1A,0xA5,0xB9,0x6A,0x5D,0x05,0x3D,0x71,0x71,0xD9,0x4B,0x8F,0xCA,0x78}, - .seckey={0x8C,0x38,0x71,0x66,0x07,0x67,0x21,0x7C,0x56,0xBD,0xC9,0xAE,0x16,0x8C,0x3C,0x20, + {0x8C,0x38,0x71,0x66,0x07,0x67,0x21,0x7C,0x56,0xBD,0xC9,0xAE,0x16,0x8C,0x3C,0x20, 0xED,0xE4,0x08,0xED,0x9E,0xF5,0xEA,0x74,0xDF,0xAA,0xE8,0xC6,0x3E,0xA0,0x16,0xF1}, - .addr="rnAiWEMNatkbaQkCeTdkwB4jeR56Ybwn8H"}, - {.seed={0xE0,0x82,0x92,0x4A,0x14,0x48,0x1B,0xE5,0x91,0xAC,0xD9,0xED,0x33,0x5C,0xDE,0xD7}, - .pubkey={0xED,0x8D,0xCE,0x64,0x63,0xCB,0xF2,0x73,0x98,0xC1,0xF3,0x5A,0x01,0x51,0xA5,0x22, + "rnAiWEMNatkbaQkCeTdkwB4jeR56Ybwn8H"}, + {{0xE0,0x82,0x92,0x4A,0x14,0x48,0x1B,0xE5,0x91,0xAC,0xD9,0xED,0x33,0x5C,0xDE,0xD7}, + {0xED,0x8D,0xCE,0x64,0x63,0xCB,0xF2,0x73,0x98,0xC1,0xF3,0x5A,0x01,0x51,0xA5,0x22, 0x71,0xD3,0xF4,0xF6,0xD7,0x1A,0x10,0x4B,0x05,0x1F,0x23,0x16,0xDD,0xE5,0x0C,0xAC,0x71}, - .seckey={0x5A,0xC1,0x39,0x8F,0x4E,0x80,0xF9,0x9D,0xCB,0xC2,0xEF,0xF4,0x16,0xDB,0x5C,0xE6, + {0x5A,0xC1,0x39,0x8F,0x4E,0x80,0xF9,0x9D,0xCB,0xC2,0xEF,0xF4,0x16,0xDB,0x5C,0xE6, 0xD1,0x62,0xDE,0xA4,0xBD,0x0D,0x99,0x66,0x3C,0xCE,0xFF,0xC9,0xF9,0x84,0xD6,0xB2}, - .addr="r8wffJxiecJuUHxFvhWK6pUP5CG7zKqJR"}, - {.seed={0xD9,0xCB,0x92,0x95,0xB6,0xE6,0xD3,0xBC,0xC9,0x07,0xF9,0x51,0x5D,0xF3,0x11,0x58}, - .pubkey={0xED,0x86,0xB3,0x5D,0x6E,0xFD,0xDE,0x1E,0x35,0x47,0x48,0x75,0xFB,0xB2,0xA7,0x5B, + "r8wffJxiecJuUHxFvhWK6pUP5CG7zKqJR"}, + {{0xD9,0xCB,0x92,0x95,0xB6,0xE6,0xD3,0xBC,0xC9,0x07,0xF9,0x51,0x5D,0xF3,0x11,0x58}, + {0xED,0x86,0xB3,0x5D,0x6E,0xFD,0xDE,0x1E,0x35,0x47,0x48,0x75,0xFB,0xB2,0xA7,0x5B, 0x27,0xC4,0x85,0x56,0xDC,0x34,0x19,0xC3,0xEA,0x2E,0xA6,0xA5,0x42,0x7B,0x5B,0x41,0x29}, - .seckey={0xB5,0x5A,0xD0,0xD9,0x93,0x95,0x8E,0xC5,0xF4,0x65,0x00,0x05,0x3F,0xA6,0xD5,0xB4, + {0xB5,0x5A,0xD0,0xD9,0x93,0x95,0x8E,0xC5,0xF4,0x65,0x00,0x05,0x3F,0xA6,0xD5,0xB4, 0x3F,0x21,0x46,0x0B,0x07,0x37,0xD1,0xD1,0x85,0xF7,0x90,0x62,0x76,0x0F,0x28,0x9B}, - .addr="rGqEtykmqM48BLYHpaX1EvLQRAsxcQdrVb"}, - {.seed={0xC0,0x48,0xD9,0x81,0x1D,0x69,0x70,0x9C,0xD5,0xCE,0x39,0x3A,0xC4,0x53,0x4F,0x10}, - .pubkey={0xED,0x03,0x77,0x2E,0x58,0x61,0xB1,0xE3,0xEE,0x00,0xDA,0xF6,0x56,0xCD,0x31,0x1B, + "rGqEtykmqM48BLYHpaX1EvLQRAsxcQdrVb"}, + {{0xC0,0x48,0xD9,0x81,0x1D,0x69,0x70,0x9C,0xD5,0xCE,0x39,0x3A,0xC4,0x53,0x4F,0x10}, + {0xED,0x03,0x77,0x2E,0x58,0x61,0xB1,0xE3,0xEE,0x00,0xDA,0xF6,0x56,0xCD,0x31,0x1B, 0x3F,0x69,0x49,0x93,0xA0,0x1C,0x57,0x82,0xD5,0x76,0x29,0xB0,0x00,0xCD,0x77,0x2E,0xDB}, - .seckey={0xD3,0xED,0x63,0x35,0x0D,0x04,0xF8,0x63,0x98,0xAF,0x78,0xBA,0xCA,0x05,0xB9,0x6F, + {0xD3,0xED,0x63,0x35,0x0D,0x04,0xF8,0x63,0x98,0xAF,0x78,0xBA,0xCA,0x05,0xB9,0x6F, 0xD4,0x77,0xCF,0x9A,0xA1,0xB4,0xC1,0xFA,0x97,0x8D,0xF9,0xCE,0xF2,0xE3,0xD8,0xE4}, - .addr="rL4NnQiQnF6c5Y1RpcmRLoDXBfhqGbXfz7"}, - {.seed={0x59,0x15,0xCB,0xBC,0xBE,0x81,0x71,0x7F,0x92,0x87,0xB4,0x9D,0xC0,0x71,0x92,0xCE}, - .pubkey={0xED,0x50,0xBF,0xA6,0x4D,0x2D,0x46,0xB6,0x37,0xCB,0xF7,0x4C,0xEB,0x0B,0xAE,0xF2, + "rL4NnQiQnF6c5Y1RpcmRLoDXBfhqGbXfz7"}, + {{0x59,0x15,0xCB,0xBC,0xBE,0x81,0x71,0x7F,0x92,0x87,0xB4,0x9D,0xC0,0x71,0x92,0xCE}, + {0xED,0x50,0xBF,0xA6,0x4D,0x2D,0x46,0xB6,0x37,0xCB,0xF7,0x4C,0xEB,0x0B,0xAE,0xF2, 0xF4,0xAF,0xB2,0x67,0xEF,0x7D,0x9B,0xE9,0x23,0x46,0x20,0x2B,0x67,0x6E,0x7B,0x96,0x68}, - .seckey={0xFB,0x75,0x27,0xE7,0xA6,0x5F,0x41,0x04,0xA4,0xFE,0x56,0xB3,0xFD,0x22,0x8A,0x38, + {0xFB,0x75,0x27,0xE7,0xA6,0x5F,0x41,0x04,0xA4,0xFE,0x56,0xB3,0xFD,0x22,0x8A,0x38, 0x73,0x28,0x1E,0x01,0x07,0xF7,0x50,0x7C,0x33,0x9B,0x64,0x53,0x01,0x65,0x1B,0x9D}, - .addr="rUxeSACZn7nT3VqubgoREY3yqnRbzKLYs"}, - {.seed={0xB9,0xE1,0x68,0xB8,0x95,0x4C,0xA3,0xB2,0x7E,0x03,0x68,0xC0,0xC8,0x45,0x13,0x47}, - .pubkey={0xED,0xB4,0x64,0xF1,0x2B,0xFB,0x7B,0x04,0x93,0x5E,0xFC,0x6E,0x46,0x40,0xBB,0x46, + "rUxeSACZn7nT3VqubgoREY3yqnRbzKLYs"}, + {{0xB9,0xE1,0x68,0xB8,0x95,0x4C,0xA3,0xB2,0x7E,0x03,0x68,0xC0,0xC8,0x45,0x13,0x47}, + {0xED,0xB4,0x64,0xF1,0x2B,0xFB,0x7B,0x04,0x93,0x5E,0xFC,0x6E,0x46,0x40,0xBB,0x46, 0x6D,0x40,0x94,0x72,0x61,0x60,0xA7,0xC2,0x08,0xF6,0x80,0x1C,0x1A,0xE8,0xEF,0xAF,0x1D}, - .seckey={0xE8,0xD3,0x03,0x76,0xA9,0x68,0x90,0x03,0xE5,0x87,0x4E,0x37,0x3C,0xD6,0x78,0xE1, + {0xE8,0xD3,0x03,0x76,0xA9,0x68,0x90,0x03,0xE5,0x87,0x4E,0x37,0x3C,0xD6,0x78,0xE1, 0x0E,0xCC,0x9C,0xB0,0xAD,0xD5,0xB6,0x6D,0xFA,0xDF,0x70,0xAA,0x68,0x86,0xED,0x07}, - .addr="rMCAnfWAwGSNCq8aBh6QdZjwvfjy1icMnA"}, - {.seed={0x35,0xD6,0x75,0x85,0x52,0xBF,0x61,0x4C,0xA7,0xEB,0xA4,0xB5,0xDD,0x03,0x01,0x75}, - .pubkey={0xED,0x9C,0xC9,0x6A,0x89,0x2E,0x2D,0x7B,0x10,0xEB,0x55,0xAD,0x5B,0xE1,0xDC,0x9B, + "rMCAnfWAwGSNCq8aBh6QdZjwvfjy1icMnA"}, + {{0x35,0xD6,0x75,0x85,0x52,0xBF,0x61,0x4C,0xA7,0xEB,0xA4,0xB5,0xDD,0x03,0x01,0x75}, + {0xED,0x9C,0xC9,0x6A,0x89,0x2E,0x2D,0x7B,0x10,0xEB,0x55,0xAD,0x5B,0xE1,0xDC,0x9B, 0x40,0xC4,0x5C,0xE8,0x5B,0x4C,0xEA,0x53,0x03,0x3B,0x96,0x58,0xBD,0x0F,0x50,0x6A,0x21}, - .seckey={0x43,0xA6,0xFB,0x04,0xA6,0xBB,0x0A,0x6E,0x8B,0x0D,0x16,0x7E,0x1F,0x4E,0x60,0xEF, + {0x43,0xA6,0xFB,0x04,0xA6,0xBB,0x0A,0x6E,0x8B,0x0D,0x16,0x7E,0x1F,0x4E,0x60,0xEF, 0x8D,0x54,0xFF,0x7F,0xCD,0x8B,0x4C,0x4B,0x67,0xAF,0x26,0x86,0x46,0xB1,0x67,0x0B}, - .addr="rB9EttAzy3mwq1snef5nZdTVrvEU7BXfmv"}, - {.seed={0xD2,0xB7,0x78,0x83,0x50,0x80,0x9B,0x83,0x32,0x01,0xBE,0xF2,0x0E,0xF4,0xA5,0x77}, - .pubkey={0xED,0x9D,0x0B,0x8F,0x08,0x35,0x7A,0xF9,0x27,0x52,0xAB,0x85,0x56,0x7A,0x6C,0xA6, + "rB9EttAzy3mwq1snef5nZdTVrvEU7BXfmv"}, + {{0xD2,0xB7,0x78,0x83,0x50,0x80,0x9B,0x83,0x32,0x01,0xBE,0xF2,0x0E,0xF4,0xA5,0x77}, + {0xED,0x9D,0x0B,0x8F,0x08,0x35,0x7A,0xF9,0x27,0x52,0xAB,0x85,0x56,0x7A,0x6C,0xA6, 0xE3,0xCC,0x6F,0xEF,0x6F,0x68,0xBE,0xEA,0xE9,0x23,0x3C,0x17,0x38,0xF3,0xFE,0x7A,0x21}, - .seckey={0x3C,0xF3,0xD7,0x99,0x8B,0x32,0xE1,0xE3,0xFD,0x4C,0x2D,0x64,0x81,0xA4,0x5B,0x37, + {0x3C,0xF3,0xD7,0x99,0x8B,0x32,0xE1,0xE3,0xFD,0x4C,0x2D,0x64,0x81,0xA4,0x5B,0x37, 0x32,0xBC,0x5E,0xF2,0x49,0x3B,0x66,0x8C,0xF7,0x09,0x7D,0xBF,0xEE,0x04,0x20,0x42}, - .addr="rHRcCSww7zrZd6YWATkHSPfB8hiY95x89W"}, - {.seed={0xE6,0xC3,0x5D,0x69,0xB0,0x5A,0xA4,0x68,0xC4,0x55,0xCF,0xBE,0x48,0x1C,0x44,0xDA}, - .pubkey={0xED,0x06,0x93,0x43,0xDF,0x20,0x7F,0x83,0x13,0x36,0x92,0x84,0xD4,0x8E,0xAA,0xD4, + "rHRcCSww7zrZd6YWATkHSPfB8hiY95x89W"}, + {{0xE6,0xC3,0x5D,0x69,0xB0,0x5A,0xA4,0x68,0xC4,0x55,0xCF,0xBE,0x48,0x1C,0x44,0xDA}, + {0xED,0x06,0x93,0x43,0xDF,0x20,0x7F,0x83,0x13,0x36,0x92,0x84,0xD4,0x8E,0xAA,0xD4, 0xDA,0xC9,0x2F,0x90,0x68,0xE5,0xFB,0x70,0xE9,0x02,0x4E,0x6C,0xD3,0x0E,0x95,0x56,0x59}, - .seckey={0xDE,0x0B,0x64,0x22,0xB7,0x27,0x23,0x17,0xC1,0xC2,0x87,0x14,0xFE,0x76,0x12,0x01, + {0xDE,0x0B,0x64,0x22,0xB7,0x27,0x23,0x17,0xC1,0xC2,0x87,0x14,0xFE,0x76,0x12,0x01, 0xE3,0x88,0x61,0xFC,0xCB,0x3C,0x6C,0xD1,0x28,0xB2,0x5F,0xE5,0xBA,0xAF,0xA1,0xF5}, - .addr="rMGb1sfstgo3wrEsaJHpUq7HnQHGB18ca4"}, - {.seed={0xBC,0xA0,0x3D,0xB1,0xC1,0xAC,0x5D,0x95,0x8A,0x0A,0x8F,0x85,0x57,0xEA,0x8F,0x3A}, - .pubkey={0xED,0x81,0xFD,0x11,0x50,0xF0,0x7E,0x30,0x8C,0x82,0x09,0xAE,0xA6,0x18,0xFA,0x00, + "rMGb1sfstgo3wrEsaJHpUq7HnQHGB18ca4"}, + {{0xBC,0xA0,0x3D,0xB1,0xC1,0xAC,0x5D,0x95,0x8A,0x0A,0x8F,0x85,0x57,0xEA,0x8F,0x3A}, + {0xED,0x81,0xFD,0x11,0x50,0xF0,0x7E,0x30,0x8C,0x82,0x09,0xAE,0xA6,0x18,0xFA,0x00, 0xDC,0xF7,0xA9,0xD8,0xCE,0xB4,0xA6,0x07,0x53,0x6F,0x3D,0x2B,0x16,0xEE,0xDD,0x27,0x27}, - .seckey={0xB4,0x02,0x85,0x56,0xD6,0xDF,0x94,0x96,0x02,0x17,0x3B,0x35,0xA4,0xF3,0x23,0xC9, + {0xB4,0x02,0x85,0x56,0xD6,0xDF,0x94,0x96,0x02,0x17,0x3B,0x35,0xA4,0xF3,0x23,0xC9, 0xB2,0x63,0x6B,0xDA,0x5A,0xC2,0xF0,0x62,0x0C,0x5E,0xBF,0x3B,0xE2,0x1B,0xDD,0x1C}, - .addr="rMd5FozFR6P5KZpdiYobDsR7pLcGYzYNNC"}, - {.seed={0x6E,0x8F,0x73,0xA9,0x4F,0x55,0xD8,0x78,0x79,0xF7,0x1F,0xDA,0x52,0xF2,0x21,0xFE}, - .pubkey={0xED,0x10,0x2F,0xF5,0xD3,0xED,0xC4,0xDB,0xB8,0xF7,0x8F,0x1B,0x76,0xF0,0xFC,0x1B, + "rMd5FozFR6P5KZpdiYobDsR7pLcGYzYNNC"}, + {{0x6E,0x8F,0x73,0xA9,0x4F,0x55,0xD8,0x78,0x79,0xF7,0x1F,0xDA,0x52,0xF2,0x21,0xFE}, + {0xED,0x10,0x2F,0xF5,0xD3,0xED,0xC4,0xDB,0xB8,0xF7,0x8F,0x1B,0x76,0xF0,0xFC,0x1B, 0x4E,0xB6,0x5A,0xFA,0xD5,0x88,0x70,0xA7,0xD0,0x97,0xB3,0x03,0x6F,0x76,0x49,0x15,0x47}, - .seckey={0xF2,0x13,0xEE,0xF6,0xF9,0x2E,0x96,0x1F,0xA3,0x07,0x9C,0xD8,0x43,0x5B,0x72,0xC9, + {0xF2,0x13,0xEE,0xF6,0xF9,0x2E,0x96,0x1F,0xA3,0x07,0x9C,0xD8,0x43,0x5B,0x72,0xC9, 0xA1,0xF9,0xDE,0xF5,0xA6,0x60,0x65,0x43,0x8E,0x43,0xE2,0x04,0xF9,0x51,0x32,0x9F}, - .addr="rQUcKBg3eHzTWRUJD4PbNcmPBNwvhbvF3o"}, - {.seed={0x1E,0x52,0x4A,0x10,0x70,0x6B,0x4C,0x92,0x71,0xAA,0x5A,0x43,0x18,0x7C,0x2B,0x63}, - .pubkey={0xED,0x57,0x58,0x44,0xBA,0x0B,0xCA,0xAE,0x24,0xB1,0xFF,0xFE,0xD9,0xA8,0x7C,0xB6, + "rQUcKBg3eHzTWRUJD4PbNcmPBNwvhbvF3o"}, + {{0x1E,0x52,0x4A,0x10,0x70,0x6B,0x4C,0x92,0x71,0xAA,0x5A,0x43,0x18,0x7C,0x2B,0x63}, + {0xED,0x57,0x58,0x44,0xBA,0x0B,0xCA,0xAE,0x24,0xB1,0xFF,0xFE,0xD9,0xA8,0x7C,0xB6, 0xE4,0xB3,0x8F,0x64,0x6C,0x91,0xBD,0x78,0x2A,0x8A,0xFA,0x82,0x99,0x2B,0x31,0x2A,0xBE}, - .seckey={0xE0,0x10,0x7E,0x8C,0x5F,0x0A,0xFE,0xAC,0xC4,0xEC,0x23,0xDD,0x19,0x2B,0x6F,0x19, + {0xE0,0x10,0x7E,0x8C,0x5F,0x0A,0xFE,0xAC,0xC4,0xEC,0x23,0xDD,0x19,0x2B,0x6F,0x19, 0x56,0xD9,0xF0,0x11,0xAE,0x78,0xE3,0x09,0xF8,0x5A,0x40,0xFF,0x55,0x28,0x70,0xDB}, - .addr="rJmrBAQs7Rw6pZiKRchGS9zySz3H9S9jRE"}, - {.seed={0x6E,0xA9,0x92,0xD3,0x42,0x3A,0x80,0x53,0x9C,0xC3,0x0C,0xFC,0x3A,0x37,0x30,0x61}, - .pubkey={0xED,0xB2,0x46,0xA6,0x54,0x0A,0xE4,0xDE,0x4E,0xB1,0xFA,0x44,0x25,0xB9,0x8E,0x8D, + "rJmrBAQs7Rw6pZiKRchGS9zySz3H9S9jRE"}, + {{0x6E,0xA9,0x92,0xD3,0x42,0x3A,0x80,0x53,0x9C,0xC3,0x0C,0xFC,0x3A,0x37,0x30,0x61}, + {0xED,0xB2,0x46,0xA6,0x54,0x0A,0xE4,0xDE,0x4E,0xB1,0xFA,0x44,0x25,0xB9,0x8E,0x8D, 0x14,0x0D,0xC5,0x4B,0x74,0xC5,0xEE,0x5F,0xFB,0x7C,0x92,0x1F,0xBE,0x65,0x2E,0xBC,0x44}, - .seckey={0xE4,0x3D,0xFE,0x62,0x4E,0x98,0x00,0x30,0x7E,0x79,0x70,0x6D,0x70,0x0E,0x6B,0xEC, + {0xE4,0x3D,0xFE,0x62,0x4E,0x98,0x00,0x30,0x7E,0x79,0x70,0x6D,0x70,0x0E,0x6B,0xEC, 0x32,0x93,0x6C,0xBB,0x99,0xC4,0x4C,0x49,0x94,0xF5,0x6C,0xC4,0x9E,0x5B,0x85,0x88}, - .addr="rMasL6hDPMB25XMh3AoTXcNE1ggQpox4sX"}, - {.seed={0xE0,0xB2,0x0C,0x61,0x5E,0x22,0x0F,0xA8,0xB7,0xC9,0xAA,0x7C,0x06,0x39,0x38,0x0E}, - .pubkey={0xED,0x1A,0x10,0xE1,0xE5,0xF6,0xBC,0x51,0x92,0xFC,0x8B,0x3B,0xBD,0x76,0x2A,0xEC, + "rMasL6hDPMB25XMh3AoTXcNE1ggQpox4sX"}, + {{0xE0,0xB2,0x0C,0x61,0x5E,0x22,0x0F,0xA8,0xB7,0xC9,0xAA,0x7C,0x06,0x39,0x38,0x0E}, + {0xED,0x1A,0x10,0xE1,0xE5,0xF6,0xBC,0x51,0x92,0xFC,0x8B,0x3B,0xBD,0x76,0x2A,0xEC, 0x16,0x09,0xE5,0x08,0xDE,0x1E,0xAE,0x33,0x37,0x47,0x0E,0xD3,0xC1,0x7C,0xA9,0x48,0x84}, - .seckey={0x59,0x94,0x21,0x92,0xEF,0x9C,0xA7,0xF8,0xD3,0x76,0xA9,0x82,0xFC,0x76,0x4B,0xF7, + {0x59,0x94,0x21,0x92,0xEF,0x9C,0xA7,0xF8,0xD3,0x76,0xA9,0x82,0xFC,0x76,0x4B,0xF7, 0x87,0x1F,0x15,0x7C,0x35,0xF0,0xB2,0xB5,0x79,0xD3,0xCE,0x5B,0xFE,0x5F,0x8B,0x9C}, - .addr="rKdzTk4JtuS6iad4WvA7vCVgNAYLd3L6R1"}, - {.seed={0x4E,0x7E,0x66,0xFF,0x98,0x41,0x44,0x82,0xC1,0x96,0xAA,0xF9,0x30,0xA9,0xC2,0x6D}, - .pubkey={0xED,0x87,0x05,0x76,0xA3,0x27,0x67,0x78,0x32,0x2D,0x46,0xF4,0x10,0x1F,0x64,0x3A, + "rKdzTk4JtuS6iad4WvA7vCVgNAYLd3L6R1"}, + {{0x4E,0x7E,0x66,0xFF,0x98,0x41,0x44,0x82,0xC1,0x96,0xAA,0xF9,0x30,0xA9,0xC2,0x6D}, + {0xED,0x87,0x05,0x76,0xA3,0x27,0x67,0x78,0x32,0x2D,0x46,0xF4,0x10,0x1F,0x64,0x3A, 0xDC,0x81,0xBC,0xE0,0xE2,0x5A,0xB3,0xB3,0x23,0x31,0x78,0x87,0x82,0xFA,0xA1,0x83,0xB0}, - .seckey={0x83,0x2D,0x28,0x6A,0xA6,0x7B,0xD6,0x31,0xDB,0x54,0x83,0x40,0x43,0xC4,0x4D,0x09, + {0x83,0x2D,0x28,0x6A,0xA6,0x7B,0xD6,0x31,0xDB,0x54,0x83,0x40,0x43,0xC4,0x4D,0x09, 0x6F,0xBD,0xFD,0x0B,0x6C,0x00,0x9E,0x27,0x28,0xC9,0x92,0xCF,0x27,0xD4,0x7B,0x9A}, - .addr="rP9f847oBmousWhxkf3FsYFmvmmDXr4U8F"}, - {.seed={0xE6,0x8D,0x1F,0xF8,0x07,0x3B,0xA3,0xFB,0x3D,0xA7,0xD0,0x21,0x09,0x0F,0x00,0xAE}, - .pubkey={0xED,0x63,0x58,0xA0,0x9A,0x6B,0x4A,0xF9,0xD8,0x8D,0xCF,0x59,0x3E,0x6C,0xB7,0x7B, + "rP9f847oBmousWhxkf3FsYFmvmmDXr4U8F"}, + {{0xE6,0x8D,0x1F,0xF8,0x07,0x3B,0xA3,0xFB,0x3D,0xA7,0xD0,0x21,0x09,0x0F,0x00,0xAE}, + {0xED,0x63,0x58,0xA0,0x9A,0x6B,0x4A,0xF9,0xD8,0x8D,0xCF,0x59,0x3E,0x6C,0xB7,0x7B, 0x6A,0x49,0x82,0x98,0x35,0x0D,0x38,0x60,0x49,0xE0,0xD2,0xDB,0xEF,0xE2,0x49,0xE7,0xF4}, - .seckey={0xB8,0x97,0xC6,0x04,0xCF,0x24,0xED,0x9D,0x2D,0x24,0x9D,0x8D,0x7A,0xD1,0xED,0x31, + {0xB8,0x97,0xC6,0x04,0xCF,0x24,0xED,0x9D,0x2D,0x24,0x9D,0x8D,0x7A,0xD1,0xED,0x31, 0x20,0x4D,0x77,0xD9,0x03,0x47,0x69,0x85,0x08,0xFA,0x88,0xFC,0xB1,0x25,0x85,0x92}, - .addr="rUU3a724prcKc7ZhPFjD2jbqi2ASTWLwb5"}, - {.seed={0x8B,0x69,0x73,0xBE,0xBE,0x79,0x14,0x81,0x0E,0x0C,0x83,0x13,0x47,0x8E,0xCF,0x3F}, - .pubkey={0xED,0x84,0x49,0xF9,0xB5,0xC9,0x0E,0xEE,0x3B,0x13,0x3B,0xBF,0x60,0x17,0x11,0x14, + "rUU3a724prcKc7ZhPFjD2jbqi2ASTWLwb5"}, + {{0x8B,0x69,0x73,0xBE,0xBE,0x79,0x14,0x81,0x0E,0x0C,0x83,0x13,0x47,0x8E,0xCF,0x3F}, + {0xED,0x84,0x49,0xF9,0xB5,0xC9,0x0E,0xEE,0x3B,0x13,0x3B,0xBF,0x60,0x17,0x11,0x14, 0xB1,0xD8,0xC4,0x9E,0x25,0xB8,0x04,0xD3,0xDC,0x3F,0xB5,0x97,0x9D,0xDE,0xB6,0x71,0xF8}, - .seckey={0xBD,0xEF,0xBD,0x40,0xC4,0x11,0x3F,0xDD,0x5C,0x7E,0xBE,0xA1,0x11,0xC5,0x23,0x59, + {0xBD,0xEF,0xBD,0x40,0xC4,0x11,0x3F,0xDD,0x5C,0x7E,0xBE,0xA1,0x11,0xC5,0x23,0x59, 0x36,0xA8,0x73,0x14,0x64,0xE5,0x8B,0x16,0x2E,0xF7,0xF8,0x46,0x83,0x28,0x84,0xF1}, - .addr="rNrAyuhowX4Lvy1qdb19CZhDe7jWjAuQQh"}, - {.seed={0x3B,0xF3,0x6E,0x7E,0xE4,0xB1,0x7E,0x2B,0xD3,0x86,0xC0,0xE6,0x81,0xED,0x07,0x07}, - .pubkey={0xED,0x99,0xBD,0x79,0xAA,0xE3,0x57,0x89,0xF0,0x1D,0xDC,0x29,0x12,0x47,0x1A,0xF7, + "rNrAyuhowX4Lvy1qdb19CZhDe7jWjAuQQh"}, + {{0x3B,0xF3,0x6E,0x7E,0xE4,0xB1,0x7E,0x2B,0xD3,0x86,0xC0,0xE6,0x81,0xED,0x07,0x07}, + {0xED,0x99,0xBD,0x79,0xAA,0xE3,0x57,0x89,0xF0,0x1D,0xDC,0x29,0x12,0x47,0x1A,0xF7, 0xC0,0x05,0xB1,0xD9,0xD5,0xAC,0x3A,0xA7,0x76,0x57,0x7C,0x49,0xEC,0xF3,0xCC,0xFB,0xD2}, - .seckey={0x1D,0x87,0x3A,0x2F,0xCE,0x48,0xFF,0xD4,0xEF,0x13,0xCE,0x83,0x94,0x88,0x75,0xF5, + {0x1D,0x87,0x3A,0x2F,0xCE,0x48,0xFF,0xD4,0xEF,0x13,0xCE,0x83,0x94,0x88,0x75,0xF5, 0x58,0x39,0x82,0x50,0x7D,0x46,0xBF,0x6C,0x25,0xAB,0x1F,0xDB,0x42,0xB3,0x54,0x5C}, - .addr="rDMWBAzDeam8BvJEpjntHBczHPQeppR9nx"}, - {.seed={0x68,0x52,0x0F,0x9F,0xB9,0x6E,0xB5,0x01,0x10,0xC3,0x6C,0x13,0x83,0x78,0xE9,0x14}, - .pubkey={0xED,0x17,0xA9,0x94,0x74,0x77,0x89,0x18,0x02,0xE0,0xE9,0x48,0xAE,0xC4,0x31,0x7E, + "rDMWBAzDeam8BvJEpjntHBczHPQeppR9nx"}, + {{0x68,0x52,0x0F,0x9F,0xB9,0x6E,0xB5,0x01,0x10,0xC3,0x6C,0x13,0x83,0x78,0xE9,0x14}, + {0xED,0x17,0xA9,0x94,0x74,0x77,0x89,0x18,0x02,0xE0,0xE9,0x48,0xAE,0xC4,0x31,0x7E, 0x1E,0xE0,0xEC,0x45,0xBC,0xC5,0x69,0x6E,0x94,0x07,0x00,0xEB,0x0B,0x26,0x6B,0xF5,0x0D}, - .seckey={0x02,0xE9,0xBC,0x25,0xB7,0x1F,0xA4,0x8A,0x3D,0x35,0xA2,0xDB,0x89,0xF2,0xAE,0xE0, + {0x02,0xE9,0xBC,0x25,0xB7,0x1F,0xA4,0x8A,0x3D,0x35,0xA2,0xDB,0x89,0xF2,0xAE,0xE0, 0x5C,0x15,0xA1,0xA3,0x31,0x28,0x53,0xFF,0x43,0xD1,0xC8,0x66,0x74,0x14,0x3B,0xE6}, - .addr="rBAzfmZZqjPFK7TzjHfCMhV8aHLDgr6wBC"}, - {.seed={0x8A,0x6D,0x4F,0xF7,0x60,0xD3,0xDB,0xD1,0xE5,0xF7,0x3E,0xA5,0x4A,0xC3,0x8B,0xA5}, - .pubkey={0xED,0x66,0x4B,0x49,0x86,0xBD,0x84,0x6F,0x8E,0x6F,0x79,0x43,0x5C,0x45,0x38,0xF7, + "rBAzfmZZqjPFK7TzjHfCMhV8aHLDgr6wBC"}, + {{0x8A,0x6D,0x4F,0xF7,0x60,0xD3,0xDB,0xD1,0xE5,0xF7,0x3E,0xA5,0x4A,0xC3,0x8B,0xA5}, + {0xED,0x66,0x4B,0x49,0x86,0xBD,0x84,0x6F,0x8E,0x6F,0x79,0x43,0x5C,0x45,0x38,0xF7, 0x12,0xC8,0x7F,0xCE,0xF4,0xD0,0x29,0xD8,0x23,0x03,0xCE,0x69,0x22,0x41,0xFB,0x93,0x1F}, - .seckey={0x07,0x20,0xDB,0x0A,0xBC,0x3D,0x1F,0xB5,0x83,0x80,0x97,0x13,0xE0,0x64,0xAD,0x6B, + {0x07,0x20,0xDB,0x0A,0xBC,0x3D,0x1F,0xB5,0x83,0x80,0x97,0x13,0xE0,0x64,0xAD,0x6B, 0xAD,0x9A,0x88,0xD1,0x3A,0x94,0xC2,0x63,0xE9,0x54,0x9D,0x1E,0x61,0xB6,0x20,0xF5}, - .addr="rGvs6gtwzf6JM1emzYDftUHngJ4CjTmnjz"}, - {.seed={0xEA,0xD6,0xF2,0x74,0x7C,0x69,0x18,0xB3,0x24,0x18,0xF6,0xAE,0x68,0x32,0xC2,0x3B}, - .pubkey={0xED,0xC9,0x61,0xB8,0xFE,0xB0,0x67,0x63,0xC6,0xCD,0x26,0x44,0x12,0xBD,0xEC,0xEE, + "rGvs6gtwzf6JM1emzYDftUHngJ4CjTmnjz"}, + {{0xEA,0xD6,0xF2,0x74,0x7C,0x69,0x18,0xB3,0x24,0x18,0xF6,0xAE,0x68,0x32,0xC2,0x3B}, + {0xED,0xC9,0x61,0xB8,0xFE,0xB0,0x67,0x63,0xC6,0xCD,0x26,0x44,0x12,0xBD,0xEC,0xEE, 0x8E,0xD4,0x6F,0x9E,0x75,0x13,0xF5,0xDB,0x0D,0x7D,0x1D,0x8C,0xD4,0x2C,0xAE,0xD0,0x0C}, - .seckey={0x80,0x46,0x0F,0x71,0xF0,0x51,0x2C,0xF7,0xFB,0x33,0x1A,0xF2,0x7D,0x18,0xD4,0x33, + {0x80,0x46,0x0F,0x71,0xF0,0x51,0x2C,0xF7,0xFB,0x33,0x1A,0xF2,0x7D,0x18,0xD4,0x33, 0x2E,0xC6,0x1E,0xD8,0x54,0x2E,0x6C,0x04,0x40,0xB4,0xE1,0xCC,0xC4,0x0E,0x18,0x93}, - .addr="rsQcFiFTAHgY8JEssbG9daaz7YV8XeFMK4"}, - {.seed={0x00,0xF7,0xAD,0xB8,0x65,0xE9,0x3A,0x29,0xD0,0x16,0xEC,0x90,0x5B,0x26,0xA4,0x36}, - .pubkey={0xED,0xF9,0x3C,0x87,0xD0,0x9D,0x31,0xA7,0x19,0x18,0xC3,0x5E,0xDC,0xD3,0x1E,0x87, + "rsQcFiFTAHgY8JEssbG9daaz7YV8XeFMK4"}, + {{0x00,0xF7,0xAD,0xB8,0x65,0xE9,0x3A,0x29,0xD0,0x16,0xEC,0x90,0x5B,0x26,0xA4,0x36}, + {0xED,0xF9,0x3C,0x87,0xD0,0x9D,0x31,0xA7,0x19,0x18,0xC3,0x5E,0xDC,0xD3,0x1E,0x87, 0x44,0x1A,0xA8,0x11,0xA8,0x07,0x6B,0xCB,0x0E,0xED,0xBA,0x44,0x28,0x33,0xE0,0x9E,0x65}, - .seckey={0x64,0xAB,0xE9,0xFE,0x6D,0x4F,0x82,0x70,0x7D,0xEF,0x9A,0xF4,0x81,0x88,0x16,0x95, + {0x64,0xAB,0xE9,0xFE,0x6D,0x4F,0x82,0x70,0x7D,0xEF,0x9A,0xF4,0x81,0x88,0x16,0x95, 0x49,0x42,0x8D,0x8A,0xD9,0x7E,0x62,0x81,0xF4,0x4A,0x35,0x01,0xD3,0x4B,0xFA,0xF0}, - .addr="r58iT3yfxxeLZvLevRcWcDgNFrSUyBieP"}, - {.seed={0x83,0x6D,0xFD,0xE4,0x9A,0xCA,0xAA,0xDA,0x08,0xA4,0xBD,0xB0,0x65,0xE6,0x84,0x10}, - .pubkey={0xED,0xE1,0x2C,0x6C,0x9B,0x70,0x0B,0x1D,0xBA,0x49,0x49,0x1F,0xEF,0x72,0x4D,0x46, + "r58iT3yfxxeLZvLevRcWcDgNFrSUyBieP"}, + {{0x83,0x6D,0xFD,0xE4,0x9A,0xCA,0xAA,0xDA,0x08,0xA4,0xBD,0xB0,0x65,0xE6,0x84,0x10}, + {0xED,0xE1,0x2C,0x6C,0x9B,0x70,0x0B,0x1D,0xBA,0x49,0x49,0x1F,0xEF,0x72,0x4D,0x46, 0xE8,0x72,0xB5,0x2B,0x16,0xDC,0xC6,0xC1,0xB6,0x7D,0xC4,0x5B,0xA1,0xAA,0x99,0x43,0x9E}, - .seckey={0x8F,0xD8,0x72,0x25,0x43,0x5E,0xD6,0x6B,0xD0,0x6A,0x21,0x2D,0x11,0x81,0xCD,0xE9, + {0x8F,0xD8,0x72,0x25,0x43,0x5E,0xD6,0x6B,0xD0,0x6A,0x21,0x2D,0x11,0x81,0xCD,0xE9, 0x3C,0x58,0xA7,0x91,0xDC,0x29,0x79,0x3F,0x29,0xB1,0x23,0x80,0xBE,0x6C,0xAB,0x3D}, - .addr="rhUqESrPkP75maWRrpGqAAVda6HsR9wQbR"}, - {.seed={0xD1,0xB7,0x57,0x48,0xD2,0x27,0x31,0x3B,0x43,0x15,0xA2,0x6D,0x30,0x8A,0xB4,0x2A}, - .pubkey={0xED,0x02,0xBB,0x15,0x41,0x52,0x62,0xE0,0xA6,0xDA,0xCD,0x5E,0xA7,0xF1,0x64,0xBA, + "rhUqESrPkP75maWRrpGqAAVda6HsR9wQbR"}, + {{0xD1,0xB7,0x57,0x48,0xD2,0x27,0x31,0x3B,0x43,0x15,0xA2,0x6D,0x30,0x8A,0xB4,0x2A}, + {0xED,0x02,0xBB,0x15,0x41,0x52,0x62,0xE0,0xA6,0xDA,0xCD,0x5E,0xA7,0xF1,0x64,0xBA, 0x5E,0x45,0xB9,0x6A,0xFA,0x62,0xE0,0xF1,0x82,0x6B,0x94,0x10,0x8A,0xD9,0xDB,0xD6,0xDC}, - .seckey={0x18,0xFE,0xAD,0x09,0x91,0xFB,0x01,0xDF,0xFB,0x98,0x3B,0xB3,0x52,0xB8,0xB8,0xA4, + {0x18,0xFE,0xAD,0x09,0x91,0xFB,0x01,0xDF,0xFB,0x98,0x3B,0xB3,0x52,0xB8,0xB8,0xA4, 0x0E,0x81,0x84,0xBC,0x04,0xD8,0x69,0xC0,0x0C,0x2C,0xD4,0x0F,0x28,0x49,0xFC,0x11}, - .addr="r9iuLmgHRCbUaA9AMybjBuBjNYTN34viiK"}, - {.seed={0xBE,0x60,0x4D,0x3F,0x85,0x07,0x3B,0x0E,0x0C,0xD7,0xD5,0xDB,0x69,0x9E,0x2A,0xAC}, - .pubkey={0xED,0xD8,0xB2,0x19,0x60,0xC3,0xA0,0x27,0x24,0x3C,0x01,0x4E,0x07,0x39,0x17,0xF3, + "r9iuLmgHRCbUaA9AMybjBuBjNYTN34viiK"}, + {{0xBE,0x60,0x4D,0x3F,0x85,0x07,0x3B,0x0E,0x0C,0xD7,0xD5,0xDB,0x69,0x9E,0x2A,0xAC}, + {0xED,0xD8,0xB2,0x19,0x60,0xC3,0xA0,0x27,0x24,0x3C,0x01,0x4E,0x07,0x39,0x17,0xF3, 0xC9,0x93,0x7B,0xB5,0x5E,0xF4,0x55,0xEB,0xD0,0xD0,0xB7,0x62,0x82,0xC7,0xD7,0xA9,0xAE}, - .seckey={0x07,0x3C,0x18,0x34,0x37,0xCA,0xE4,0xCE,0x3B,0xD6,0xBD,0xB0,0x5D,0xB0,0x2A,0xE1, + {0x07,0x3C,0x18,0x34,0x37,0xCA,0xE4,0xCE,0x3B,0xD6,0xBD,0xB0,0x5D,0xB0,0x2A,0xE1, 0x31,0xBD,0x95,0x9A,0x9D,0xC7,0x3E,0x4C,0xEA,0x18,0x44,0x05,0xF4,0xE9,0x31,0xB2}, - .addr="rnrYBExFRbfamRgyrTo7uFhG2r1XzjgL8Y"}, - {.seed={0x3A,0xAC,0x26,0x07,0xC1,0xAD,0x65,0x58,0xDE,0x12,0x6B,0x94,0xB9,0x4F,0x5F,0x68}, - .pubkey={0xED,0x26,0x42,0xE5,0xF8,0x41,0x5B,0x28,0x2C,0x7B,0x32,0x19,0x73,0x31,0xFB,0x44, + "rnrYBExFRbfamRgyrTo7uFhG2r1XzjgL8Y"}, + {{0x3A,0xAC,0x26,0x07,0xC1,0xAD,0x65,0x58,0xDE,0x12,0x6B,0x94,0xB9,0x4F,0x5F,0x68}, + {0xED,0x26,0x42,0xE5,0xF8,0x41,0x5B,0x28,0x2C,0x7B,0x32,0x19,0x73,0x31,0xFB,0x44, 0x89,0xBD,0x3E,0xA9,0xCC,0x82,0x5D,0xC9,0x18,0x7D,0x0A,0xF8,0x4D,0x2E,0xA2,0xA4,0x20}, - .seckey={0x1E,0x8C,0x09,0x43,0x9A,0x3E,0x23,0x7B,0x54,0x73,0x75,0x67,0xCE,0x6C,0x56,0xCD, + {0x1E,0x8C,0x09,0x43,0x9A,0x3E,0x23,0x7B,0x54,0x73,0x75,0x67,0xCE,0x6C,0x56,0xCD, 0x6E,0x1B,0x26,0xCC,0xE6,0x7D,0x69,0x9F,0x00,0xE5,0x10,0x2F,0x36,0xFC,0xC5,0xF7}, - .addr="r3YdsPCvfJ5AVbaWyd2oK7fy7zFnSiyA8a"}, - {.seed={0xF0,0x42,0x36,0x84,0xA4,0xC3,0xF7,0xED,0x27,0x0F,0x8E,0x99,0x8C,0x62,0x6A,0x01}, - .pubkey={0xED,0xEA,0xCE,0xD9,0x7E,0xF9,0x59,0x6D,0x7D,0x3A,0x82,0x24,0x42,0x2A,0x1C,0xF5, + "r3YdsPCvfJ5AVbaWyd2oK7fy7zFnSiyA8a"}, + {{0xF0,0x42,0x36,0x84,0xA4,0xC3,0xF7,0xED,0x27,0x0F,0x8E,0x99,0x8C,0x62,0x6A,0x01}, + {0xED,0xEA,0xCE,0xD9,0x7E,0xF9,0x59,0x6D,0x7D,0x3A,0x82,0x24,0x42,0x2A,0x1C,0xF5, 0xF8,0x1A,0xBF,0xD0,0x62,0x23,0x0D,0xDF,0x18,0x4F,0x5A,0xD7,0x1E,0x1E,0x2B,0x05,0xED}, - .seckey={0x39,0xBC,0xA3,0x9D,0x64,0xCB,0x30,0x5B,0x7A,0x9F,0xFC,0x0B,0xD0,0x01,0x4C,0xEB, + {0x39,0xBC,0xA3,0x9D,0x64,0xCB,0x30,0x5B,0x7A,0x9F,0xFC,0x0B,0xD0,0x01,0x4C,0xEB, 0xF8,0x26,0x5F,0x03,0x04,0x7D,0xF2,0x29,0x6E,0x21,0xF3,0x70,0xE3,0xCD,0x92,0x08}, - .addr="rNMgmiC2hzF6Qe5NRb4Nfd2r14hx3sc2v5"}, - {.seed={0x32,0x68,0x6A,0x27,0x24,0xDC,0xFA,0x84,0xFE,0xB8,0x70,0xC0,0xCD,0xB3,0x4C,0x91}, - .pubkey={0xED,0xB2,0xF1,0xFB,0xDC,0x26,0x17,0x49,0x0D,0x9D,0x6B,0x4B,0xEC,0xFA,0xC7,0xCE, + "rNMgmiC2hzF6Qe5NRb4Nfd2r14hx3sc2v5"}, + {{0x32,0x68,0x6A,0x27,0x24,0xDC,0xFA,0x84,0xFE,0xB8,0x70,0xC0,0xCD,0xB3,0x4C,0x91}, + {0xED,0xB2,0xF1,0xFB,0xDC,0x26,0x17,0x49,0x0D,0x9D,0x6B,0x4B,0xEC,0xFA,0xC7,0xCE, 0x37,0x8F,0x90,0x98,0x87,0x88,0x34,0xE3,0x85,0x12,0xD4,0x82,0xC8,0x61,0xCD,0xA7,0x25}, - .seckey={0xFF,0x49,0x97,0x28,0x69,0xD9,0x20,0x49,0x9A,0x5D,0x67,0x1D,0xB7,0x25,0x68,0x23, + {0xFF,0x49,0x97,0x28,0x69,0xD9,0x20,0x49,0x9A,0x5D,0x67,0x1D,0xB7,0x25,0x68,0x23, 0x5C,0x4A,0x53,0xAB,0xFB,0xED,0xDB,0x50,0x30,0xDC,0x4B,0xED,0xF8,0x81,0xBD,0x9C}, - .addr="rMCRWBFcdcC36Nvams6VfztDbVe7TNYh1j"}, - {.seed={0x88,0x8B,0x76,0x7B,0x59,0x28,0x21,0x47,0xAA,0xF3,0xB4,0x88,0x99,0x4B,0x55,0xC1}, - .pubkey={0xED,0x08,0x56,0x1B,0x8F,0x67,0x6F,0xC1,0xE1,0x7F,0xF2,0xF1,0x18,0xA6,0x1A,0x94, + "rMCRWBFcdcC36Nvams6VfztDbVe7TNYh1j"}, + {{0x88,0x8B,0x76,0x7B,0x59,0x28,0x21,0x47,0xAA,0xF3,0xB4,0x88,0x99,0x4B,0x55,0xC1}, + {0xED,0x08,0x56,0x1B,0x8F,0x67,0x6F,0xC1,0xE1,0x7F,0xF2,0xF1,0x18,0xA6,0x1A,0x94, 0x60,0xAB,0x6E,0xE2,0x2B,0xEB,0x15,0xBB,0xBA,0x51,0x2D,0x99,0x1B,0xDE,0x30,0xDC,0x41}, - .seckey={0x73,0xA8,0xE8,0xDC,0xCD,0x83,0xB6,0x7C,0xA7,0x3A,0x4B,0x3C,0xF1,0x11,0x0A,0x01, + {0x73,0xA8,0xE8,0xDC,0xCD,0x83,0xB6,0x7C,0xA7,0x3A,0x4B,0x3C,0xF1,0x11,0x0A,0x01, 0x13,0x69,0x6E,0x07,0x6C,0x6C,0xFF,0x23,0xE2,0x7B,0x16,0xAC,0x50,0xED,0x2A,0x9F}, - .addr="rM6iPDQ7RkieWJdU9vUxM4ynhFNScHWszZ"}, - {.seed={0xA5,0x94,0x33,0x40,0xE0,0x33,0xC9,0xF8,0x37,0x11,0x7A,0xB7,0xA5,0xD1,0xD2,0x90}, - .pubkey={0xED,0x9E,0x74,0x80,0x3B,0xFF,0x2A,0xD4,0x02,0xE4,0x81,0xD0,0x1A,0x98,0xAA,0x51, + "rM6iPDQ7RkieWJdU9vUxM4ynhFNScHWszZ"}, + {{0xA5,0x94,0x33,0x40,0xE0,0x33,0xC9,0xF8,0x37,0x11,0x7A,0xB7,0xA5,0xD1,0xD2,0x90}, + {0xED,0x9E,0x74,0x80,0x3B,0xFF,0x2A,0xD4,0x02,0xE4,0x81,0xD0,0x1A,0x98,0xAA,0x51, 0x84,0xC0,0x7F,0x5D,0xC4,0x69,0xC1,0x76,0xAE,0x81,0x2B,0xC9,0x5E,0xA0,0xE7,0x12,0x53}, - .seckey={0x46,0x8F,0x5A,0x8B,0x56,0x92,0xE8,0x12,0xC9,0x48,0x60,0xAF,0x8F,0xDF,0xDA,0x15, + {0x46,0x8F,0x5A,0x8B,0x56,0x92,0xE8,0x12,0xC9,0x48,0x60,0xAF,0x8F,0xDF,0xDA,0x15, 0xEC,0x4C,0xF4,0xA1,0x0C,0x56,0x2B,0x8A,0x6B,0xFA,0xF9,0x9D,0xF1,0x1A,0xEC,0x4B}, - .addr="rEfpJHQrcCyps27bjHL4kvvousu1UDHWVA"}, - {.seed={0xF2,0x5D,0x4B,0x04,0xDD,0xD0,0xF6,0x59,0x89,0xC7,0x02,0xF6,0x17,0x24,0x6D,0x0D}, - .pubkey={0xED,0xE6,0x37,0x43,0x60,0xF5,0xDF,0x14,0xCE,0x95,0xC9,0x80,0xDD,0xF5,0x14,0x31, + "rEfpJHQrcCyps27bjHL4kvvousu1UDHWVA"}, + {{0xF2,0x5D,0x4B,0x04,0xDD,0xD0,0xF6,0x59,0x89,0xC7,0x02,0xF6,0x17,0x24,0x6D,0x0D}, + {0xED,0xE6,0x37,0x43,0x60,0xF5,0xDF,0x14,0xCE,0x95,0xC9,0x80,0xDD,0xF5,0x14,0x31, 0xD6,0xE2,0x4F,0xFD,0x75,0x17,0x4E,0xDE,0xC6,0x70,0x63,0x7F,0xB2,0x88,0x22,0xD7,0xD6}, - .seckey={0xA4,0x46,0xD7,0xBA,0x7C,0x56,0x3C,0x72,0xE9,0xD8,0x4C,0x0D,0x5A,0x06,0xBE,0xBB, + {0xA4,0x46,0xD7,0xBA,0x7C,0x56,0x3C,0x72,0xE9,0xD8,0x4C,0x0D,0x5A,0x06,0xBE,0xBB, 0xF2,0xD2,0x5C,0x27,0x7E,0x44,0x97,0x8A,0x5B,0x57,0x0C,0xC9,0x45,0x53,0xD8,0x09}, - .addr="rDzNPeQPwy67Q64PHi759dLdrJZGZ6Fam6"}, - {.seed={0x1B,0x3B,0xA6,0xA3,0x34,0xAC,0xF1,0x2F,0x1F,0x56,0xA3,0xC4,0xAF,0x43,0xE4,0x69}, - .pubkey={0xED,0x99,0xC0,0x65,0x5D,0xBA,0x42,0x4E,0x53,0x0F,0xF8,0x92,0x4F,0x6B,0x41,0xEC, + "rDzNPeQPwy67Q64PHi759dLdrJZGZ6Fam6"}, + {{0x1B,0x3B,0xA6,0xA3,0x34,0xAC,0xF1,0x2F,0x1F,0x56,0xA3,0xC4,0xAF,0x43,0xE4,0x69}, + {0xED,0x99,0xC0,0x65,0x5D,0xBA,0x42,0x4E,0x53,0x0F,0xF8,0x92,0x4F,0x6B,0x41,0xEC, 0xDD,0x94,0xB6,0xF9,0x27,0xF8,0xCA,0xE7,0x79,0xAD,0x0A,0xA4,0x02,0x98,0x8D,0xA6,0x6B}, - .seckey={0x81,0x8D,0xD1,0x46,0xE8,0xEE,0x60,0x6E,0x18,0x7E,0xDF,0x41,0xC4,0xFE,0x64,0x9B, + {0x81,0x8D,0xD1,0x46,0xE8,0xEE,0x60,0x6E,0x18,0x7E,0xDF,0x41,0xC4,0xFE,0x64,0x9B, 0x8D,0x96,0xF8,0x1A,0xB4,0x1D,0x67,0xE3,0x03,0xB2,0x7E,0x63,0xAC,0x31,0x98,0x17}, - .addr="r99hrhMgWrzUssGoLUttkmVFoERgf9fB56"}, - {.seed={0x21,0x06,0xF7,0xF1,0xEB,0xF6,0xA6,0xFE,0x11,0x1E,0x58,0x3D,0x01,0x1E,0xD9,0x6D}, - .pubkey={0xED,0x36,0xD8,0x7E,0x9F,0x16,0xC4,0xA5,0x36,0x8F,0xBF,0x20,0x8C,0x4C,0x19,0x19, + "r99hrhMgWrzUssGoLUttkmVFoERgf9fB56"}, + {{0x21,0x06,0xF7,0xF1,0xEB,0xF6,0xA6,0xFE,0x11,0x1E,0x58,0x3D,0x01,0x1E,0xD9,0x6D}, + {0xED,0x36,0xD8,0x7E,0x9F,0x16,0xC4,0xA5,0x36,0x8F,0xBF,0x20,0x8C,0x4C,0x19,0x19, 0x55,0x33,0x28,0xEC,0x16,0xA3,0xAB,0xAE,0xD4,0x75,0x4D,0xCC,0x53,0x5C,0xB2,0x4A,0x53}, - .seckey={0x9F,0xCE,0x33,0x4E,0x5D,0x8A,0x5F,0xAE,0x98,0x99,0x8A,0x2B,0x31,0x22,0x49,0x53, + {0x9F,0xCE,0x33,0x4E,0x5D,0x8A,0x5F,0xAE,0x98,0x99,0x8A,0x2B,0x31,0x22,0x49,0x53, 0x5A,0xA3,0x00,0x89,0x53,0x4C,0xFE,0x35,0xBE,0x15,0xD1,0xD3,0xE7,0x5E,0xBB,0x90}, - .addr="rHkZ4ddVoyrkEcANucjXDXouZ8GYVmG9R2"}, - {.seed={0x76,0xE4,0x37,0x07,0x61,0x85,0x64,0x5E,0x78,0x0F,0xAA,0xC3,0x4F,0x22,0x52,0x12}, - .pubkey={0xED,0x0E,0xFD,0x87,0xB2,0x99,0xE2,0xD2,0x68,0x11,0xFE,0xE6,0x16,0x46,0xF9,0x2D, + "rHkZ4ddVoyrkEcANucjXDXouZ8GYVmG9R2"}, + {{0x76,0xE4,0x37,0x07,0x61,0x85,0x64,0x5E,0x78,0x0F,0xAA,0xC3,0x4F,0x22,0x52,0x12}, + {0xED,0x0E,0xFD,0x87,0xB2,0x99,0xE2,0xD2,0x68,0x11,0xFE,0xE6,0x16,0x46,0xF9,0x2D, 0xEF,0x64,0x2E,0x77,0x83,0x3A,0x0D,0xC7,0xFF,0x70,0xDD,0x21,0xEA,0x51,0x1A,0xCB,0xB8}, - .seckey={0x8F,0x3C,0xD2,0x22,0x84,0xAE,0xE0,0x91,0x3D,0x11,0x0B,0x29,0xE1,0xAE,0x43,0x12, + {0x8F,0x3C,0xD2,0x22,0x84,0xAE,0xE0,0x91,0x3D,0x11,0x0B,0x29,0xE1,0xAE,0x43,0x12, 0x8D,0xF6,0xD1,0x2C,0x5F,0x2F,0x1E,0xCD,0xB8,0x93,0xE5,0x69,0x4F,0xA9,0x90,0x40}, - .addr="rB4z3FJgPhFGBKsCvAY6bpN6dbychpAzZm"}, - {.seed={0x7D,0x9A,0x2F,0x52,0xF8,0x5F,0x65,0x6A,0xFC,0x30,0x68,0xFE,0x3A,0xB2,0xDA,0x88}, - .pubkey={0xED,0x21,0xDC,0x2B,0x58,0x3E,0xE9,0x24,0x89,0x53,0xA6,0xB2,0x37,0xC5,0x97,0xB6, + "rB4z3FJgPhFGBKsCvAY6bpN6dbychpAzZm"}, + {{0x7D,0x9A,0x2F,0x52,0xF8,0x5F,0x65,0x6A,0xFC,0x30,0x68,0xFE,0x3A,0xB2,0xDA,0x88}, + {0xED,0x21,0xDC,0x2B,0x58,0x3E,0xE9,0x24,0x89,0x53,0xA6,0xB2,0x37,0xC5,0x97,0xB6, 0x46,0xBC,0xAB,0xD7,0xB0,0xCE,0x73,0xCD,0xE1,0x68,0xA7,0xAC,0x20,0x9A,0x94,0xDF,0xC4}, - .seckey={0x2E,0x55,0x98,0xA9,0xA3,0xDD,0x00,0xAF,0xDB,0x2A,0xB0,0x04,0xFA,0x20,0x1E,0xEA, + {0x2E,0x55,0x98,0xA9,0xA3,0xDD,0x00,0xAF,0xDB,0x2A,0xB0,0x04,0xFA,0x20,0x1E,0xEA, 0x9D,0xB9,0x9F,0xD8,0xB4,0xCC,0xA9,0x30,0x52,0x6A,0x4D,0x97,0x43,0xD2,0x31,0xE1}, - .addr="rjFtnLNUWENruoRZd7WTZxvh2qrNrQEir"}, - {.seed={0xB7,0xFC,0x52,0xEC,0x34,0x1F,0x62,0x2F,0xCF,0xBF,0x90,0x38,0x6F,0x12,0x4D,0x1C}, - .pubkey={0xED,0xF4,0x8C,0xBC,0xC5,0xEA,0x1A,0xA7,0x1F,0x79,0xC7,0xFB,0x44,0x97,0x3D,0x9A, + "rjFtnLNUWENruoRZd7WTZxvh2qrNrQEir"}, + {{0xB7,0xFC,0x52,0xEC,0x34,0x1F,0x62,0x2F,0xCF,0xBF,0x90,0x38,0x6F,0x12,0x4D,0x1C}, + {0xED,0xF4,0x8C,0xBC,0xC5,0xEA,0x1A,0xA7,0x1F,0x79,0xC7,0xFB,0x44,0x97,0x3D,0x9A, 0x60,0xDD,0xA3,0xD4,0x83,0x68,0x31,0xE8,0xF8,0xA3,0x77,0xC8,0x98,0x2C,0x5F,0x64,0x26}, - .seckey={0x81,0xD7,0x7D,0x1F,0xE3,0xC0,0xAE,0xD6,0x2C,0x13,0x3A,0xBF,0x7E,0x63,0x20,0x9D, + {0x81,0xD7,0x7D,0x1F,0xE3,0xC0,0xAE,0xD6,0x2C,0x13,0x3A,0xBF,0x7E,0x63,0x20,0x9D, 0xF6,0x04,0x50,0xD6,0xCC,0x6F,0x6D,0xED,0xC3,0x35,0x10,0x32,0x23,0x36,0x1D,0x74}, - .addr="r4iFodQDmVS27jsvHoa1c58d5MQjHCFCzr"}, - {.seed={0x6B,0xD9,0x01,0xBA,0x68,0xCF,0xAA,0xB3,0x2E,0x58,0x72,0xCC,0x4A,0xD3,0xAC,0xFA}, - .pubkey={0xED,0x6A,0xF4,0xE2,0x9D,0xFD,0x47,0x5B,0x62,0x2C,0x50,0x17,0x3E,0x70,0x08,0x27, + "r4iFodQDmVS27jsvHoa1c58d5MQjHCFCzr"}, + {{0x6B,0xD9,0x01,0xBA,0x68,0xCF,0xAA,0xB3,0x2E,0x58,0x72,0xCC,0x4A,0xD3,0xAC,0xFA}, + {0xED,0x6A,0xF4,0xE2,0x9D,0xFD,0x47,0x5B,0x62,0x2C,0x50,0x17,0x3E,0x70,0x08,0x27, 0x0D,0x78,0x72,0x91,0x3B,0x9D,0xD2,0xA5,0x0F,0xFD,0x92,0x18,0xC5,0x21,0xAA,0xB5,0xDB}, - .seckey={0x6A,0x4D,0x06,0xBE,0xB6,0xA6,0x24,0x63,0x93,0x94,0x86,0x5D,0xF3,0xCD,0x21,0x79, + {0x6A,0x4D,0x06,0xBE,0xB6,0xA6,0x24,0x63,0x93,0x94,0x86,0x5D,0xF3,0xCD,0x21,0x79, 0x36,0xF1,0x60,0x42,0x36,0x8F,0xD4,0xE7,0xE3,0x4E,0x6F,0x48,0xC7,0x5F,0xF5,0x49}, - .addr="raXmHhhDutvNXtZijEds9YkiuRrGSGBu32"}, - {.seed={0x06,0x6E,0xCB,0xEA,0x65,0xA8,0x14,0x8F,0xBB,0x06,0x4B,0x57,0xB3,0x6D,0x53,0x5C}, - .pubkey={0xED,0x71,0x36,0xFF,0xA4,0xF9,0x41,0xB4,0x99,0x94,0xD4,0x28,0xD6,0xAF,0xE8,0xEF, + "raXmHhhDutvNXtZijEds9YkiuRrGSGBu32"}, + {{0x06,0x6E,0xCB,0xEA,0x65,0xA8,0x14,0x8F,0xBB,0x06,0x4B,0x57,0xB3,0x6D,0x53,0x5C}, + {0xED,0x71,0x36,0xFF,0xA4,0xF9,0x41,0xB4,0x99,0x94,0xD4,0x28,0xD6,0xAF,0xE8,0xEF, 0xE4,0xD4,0x18,0x8D,0xC9,0xFB,0xF4,0x9D,0x8A,0x00,0x10,0x3A,0x62,0xEA,0x5A,0xF6,0x20}, - .seckey={0xEA,0x33,0xE3,0xD1,0x8B,0x96,0x82,0x5D,0x88,0xC0,0x43,0x78,0xC3,0x54,0x32,0x09, + {0xEA,0x33,0xE3,0xD1,0x8B,0x96,0x82,0x5D,0x88,0xC0,0x43,0x78,0xC3,0x54,0x32,0x09, 0xAA,0x6F,0xBB,0xDC,0xFB,0x5A,0x8B,0xFE,0xCF,0x8C,0xF6,0x2D,0x9D,0xA9,0xA1,0xE1}, - .addr="rPxBkKtFFZHJT71r3AFdAN4pU89PLQJ1QG"}, - {.seed={0xDC,0x30,0xE4,0xB2,0x30,0xBA,0x1A,0x0C,0xF1,0xA4,0x92,0x7B,0x16,0x58,0xB9,0xA1}, - .pubkey={0xED,0x82,0x91,0xCA,0xBF,0x4A,0x95,0x59,0x0F,0x32,0x92,0xE5,0x0C,0x3B,0x26,0x2D, + "rPxBkKtFFZHJT71r3AFdAN4pU89PLQJ1QG"}, + {{0xDC,0x30,0xE4,0xB2,0x30,0xBA,0x1A,0x0C,0xF1,0xA4,0x92,0x7B,0x16,0x58,0xB9,0xA1}, + {0xED,0x82,0x91,0xCA,0xBF,0x4A,0x95,0x59,0x0F,0x32,0x92,0xE5,0x0C,0x3B,0x26,0x2D, 0x9F,0xF8,0xBE,0xC3,0x61,0x91,0x0E,0xE5,0xAD,0x67,0x0D,0x22,0x56,0xF6,0xB3,0x98,0xB7}, - .seckey={0x1D,0x7A,0x60,0x86,0xB7,0xB4,0x96,0x1B,0xFC,0x9D,0x49,0x5C,0x40,0x5D,0x05,0x4C, + {0x1D,0x7A,0x60,0x86,0xB7,0xB4,0x96,0x1B,0xFC,0x9D,0x49,0x5C,0x40,0x5D,0x05,0x4C, 0x51,0x26,0x55,0x01,0xCC,0xAC,0x6D,0x24,0x55,0xAE,0x87,0x74,0x6C,0xE2,0x45,0xDB}, - .addr="rKFEmeByntzm5pti2qAVvpbTpK8S7sEsV4"}, - {.seed={0xE7,0x17,0xCA,0x1B,0xFC,0x0D,0x50,0xFD,0x7D,0xD7,0x56,0x3C,0x8A,0xDE,0x1B,0xCB}, - .pubkey={0xED,0x76,0x1C,0xE5,0x81,0xD1,0xB0,0x8F,0xE5,0x3C,0x79,0x18,0xC0,0xB6,0xE6,0x8B, + "rKFEmeByntzm5pti2qAVvpbTpK8S7sEsV4"}, + {{0xE7,0x17,0xCA,0x1B,0xFC,0x0D,0x50,0xFD,0x7D,0xD7,0x56,0x3C,0x8A,0xDE,0x1B,0xCB}, + {0xED,0x76,0x1C,0xE5,0x81,0xD1,0xB0,0x8F,0xE5,0x3C,0x79,0x18,0xC0,0xB6,0xE6,0x8B, 0x95,0xA1,0x37,0x32,0xD4,0x2B,0x36,0xBB,0x63,0x4E,0xE6,0x32,0xF8,0xCE,0x4B,0xF1,0x1E}, - .seckey={0x9A,0xCF,0x55,0xF4,0xAD,0x1C,0xDE,0xB7,0x6A,0xE8,0x44,0xD5,0x3E,0x15,0x2A,0x20, + {0x9A,0xCF,0x55,0xF4,0xAD,0x1C,0xDE,0xB7,0x6A,0xE8,0x44,0xD5,0x3E,0x15,0x2A,0x20, 0xF6,0x38,0x59,0xBF,0xB4,0x98,0x2F,0xC7,0x69,0xF2,0x70,0x51,0x2C,0x40,0xBC,0x43}, - .addr="rM7P6ouMaCkvHpCPANcXrhnXcQZUuwHLhT"}, - {.seed={0x6A,0x2E,0xBE,0xE7,0xD7,0x89,0x85,0xB2,0xF6,0x09,0xEE,0x5C,0x23,0x0C,0xE0,0xCB}, - .pubkey={0xED,0x6A,0xE8,0x90,0x42,0x56,0xFF,0x41,0x90,0xAB,0x1E,0xBE,0x6B,0x7D,0xC7,0x53, + "rM7P6ouMaCkvHpCPANcXrhnXcQZUuwHLhT"}, + {{0x6A,0x2E,0xBE,0xE7,0xD7,0x89,0x85,0xB2,0xF6,0x09,0xEE,0x5C,0x23,0x0C,0xE0,0xCB}, + {0xED,0x6A,0xE8,0x90,0x42,0x56,0xFF,0x41,0x90,0xAB,0x1E,0xBE,0x6B,0x7D,0xC7,0x53, 0x7E,0x36,0xB3,0x6A,0x41,0xD0,0x42,0x46,0x22,0x51,0x9D,0x73,0x76,0x0B,0x74,0xE6,0x6A}, - .seckey={0x01,0xDD,0x0D,0x7C,0xB3,0xF1,0xF7,0x58,0x0B,0xD9,0x08,0x39,0xE7,0x5F,0x15,0x85, + {0x01,0xDD,0x0D,0x7C,0xB3,0xF1,0xF7,0x58,0x0B,0xD9,0x08,0x39,0xE7,0x5F,0x15,0x85, 0xE5,0xE4,0x68,0xCC,0x11,0xB3,0x96,0x6A,0x78,0x0F,0xB8,0xBE,0x8A,0xDC,0xF9,0x89}, - .addr="rLGH2vSxgeeM5QynNK8qmcdFtTP1rfg4Tg"}, - {.seed={0x00,0xCC,0xB8,0xC5,0x68,0x56,0x59,0xAD,0x75,0xEF,0x34,0xAF,0x9D,0xEA,0xCF,0x77}, - .pubkey={0xED,0xF8,0x15,0x47,0x9F,0xFC,0x3F,0x8F,0x60,0xF8,0xE2,0x97,0xD4,0x90,0x5F,0x0D, + "rLGH2vSxgeeM5QynNK8qmcdFtTP1rfg4Tg"}, + {{0x00,0xCC,0xB8,0xC5,0x68,0x56,0x59,0xAD,0x75,0xEF,0x34,0xAF,0x9D,0xEA,0xCF,0x77}, + {0xED,0xF8,0x15,0x47,0x9F,0xFC,0x3F,0x8F,0x60,0xF8,0xE2,0x97,0xD4,0x90,0x5F,0x0D, 0x7A,0x7D,0x34,0x5A,0x1E,0x49,0x1B,0x27,0x7F,0x49,0x9E,0x80,0xB0,0xDE,0x3A,0x9D,0xDD}, - .seckey={0x27,0x2D,0x1E,0xF0,0xD6,0xE0,0xE1,0x03,0x1E,0xEC,0xE9,0x71,0x4E,0x74,0x5E,0xEF, + {0x27,0x2D,0x1E,0xF0,0xD6,0xE0,0xE1,0x03,0x1E,0xEC,0xE9,0x71,0x4E,0x74,0x5E,0xEF, 0xCC,0x97,0xA4,0xF0,0x98,0xC7,0x5D,0x1D,0x2B,0xDB,0xDA,0x02,0xAC,0x92,0xE9,0x17}, - .addr="r3sq3TsjtadXRzt7N5bUCkJCBCrR26zNZJ"}, - {.seed={0xB4,0xBC,0x80,0x7F,0xDA,0x31,0xB0,0xD1,0x69,0x7B,0xEB,0x0F,0xE9,0x9A,0x32,0x4B}, - .pubkey={0xED,0xD6,0x6A,0x27,0x23,0x52,0xAB,0x9B,0xD4,0x72,0xC0,0xD6,0x88,0xA2,0x75,0x68, + "r3sq3TsjtadXRzt7N5bUCkJCBCrR26zNZJ"}, + {{0xB4,0xBC,0x80,0x7F,0xDA,0x31,0xB0,0xD1,0x69,0x7B,0xEB,0x0F,0xE9,0x9A,0x32,0x4B}, + {0xED,0xD6,0x6A,0x27,0x23,0x52,0xAB,0x9B,0xD4,0x72,0xC0,0xD6,0x88,0xA2,0x75,0x68, 0x0A,0xAC,0x21,0x8B,0xAB,0x3C,0x99,0xDA,0xAE,0x89,0xCF,0x27,0xDD,0x7D,0x04,0x80,0xA3}, - .seckey={0x10,0xA2,0xBA,0xF1,0xBA,0xDB,0x75,0x0C,0x71,0x79,0xAC,0x82,0x95,0x81,0x2E,0xFA, + {0x10,0xA2,0xBA,0xF1,0xBA,0xDB,0x75,0x0C,0x71,0x79,0xAC,0x82,0x95,0x81,0x2E,0xFA, 0x83,0x7C,0x63,0x7C,0x9C,0x45,0x67,0x4C,0x59,0x49,0x7B,0x17,0x0C,0x2A,0xF3,0x91}, - .addr="rPbwRy2SXuYjHBpamBttr73degia9aLTJV"}, - {.seed={0x1F,0x79,0x56,0x35,0x2E,0x46,0x34,0xFD,0x32,0xDA,0xF2,0xE1,0xE7,0xA5,0xF8,0x6D}, - .pubkey={0xED,0x6A,0xB7,0x3A,0x06,0xC0,0x29,0x6D,0x38,0x4F,0xC1,0xFE,0x79,0xF1,0xCA,0xBB, + "rPbwRy2SXuYjHBpamBttr73degia9aLTJV"}, + {{0x1F,0x79,0x56,0x35,0x2E,0x46,0x34,0xFD,0x32,0xDA,0xF2,0xE1,0xE7,0xA5,0xF8,0x6D}, + {0xED,0x6A,0xB7,0x3A,0x06,0xC0,0x29,0x6D,0x38,0x4F,0xC1,0xFE,0x79,0xF1,0xCA,0xBB, 0x1A,0xBD,0xAE,0xCF,0xA4,0x49,0xE5,0x52,0x68,0xB6,0x16,0xF5,0x05,0xF7,0xE0,0x1D,0xE0}, - .seckey={0x67,0x22,0xC5,0xC3,0x26,0xEF,0x52,0x22,0xE5,0x03,0xFA,0x61,0x01,0x64,0x49,0x63, + {0x67,0x22,0xC5,0xC3,0x26,0xEF,0x52,0x22,0xE5,0x03,0xFA,0x61,0x01,0x64,0x49,0x63, 0xF0,0x54,0x84,0x01,0x34,0x43,0xF5,0xF0,0xCA,0x72,0x55,0xE5,0xDB,0xA7,0xCE,0xD6}, - .addr="rfS18n1hbRaEaJw79nbV2ZTHSmMuRUsDdN"}, - {.seed={0xD1,0xF7,0x94,0xBE,0xFD,0x48,0x18,0x3F,0xA8,0x00,0x0C,0xCE,0x91,0x93,0x65,0xD5}, - .pubkey={0xED,0xEA,0x05,0x86,0x7C,0x18,0x83,0x59,0x07,0x2C,0xA7,0x82,0x09,0xB1,0xF5,0x63, + "rfS18n1hbRaEaJw79nbV2ZTHSmMuRUsDdN"}, + {{0xD1,0xF7,0x94,0xBE,0xFD,0x48,0x18,0x3F,0xA8,0x00,0x0C,0xCE,0x91,0x93,0x65,0xD5}, + {0xED,0xEA,0x05,0x86,0x7C,0x18,0x83,0x59,0x07,0x2C,0xA7,0x82,0x09,0xB1,0xF5,0x63, 0x3B,0x52,0x1D,0xF3,0x2A,0x6C,0x95,0x44,0xE1,0xD8,0xD8,0x07,0x06,0xA0,0x7B,0x24,0xCD}, - .seckey={0x5E,0x8E,0xCA,0xB0,0xC2,0xA3,0x33,0x8C,0x21,0xDF,0xEC,0xC3,0x34,0xF6,0x48,0x3A, + {0x5E,0x8E,0xCA,0xB0,0xC2,0xA3,0x33,0x8C,0x21,0xDF,0xEC,0xC3,0x34,0xF6,0x48,0x3A, 0x87,0x83,0xEB,0xD9,0x9F,0xF3,0x45,0xBC,0x3F,0xFE,0x13,0x54,0x35,0x5F,0xF8,0x92}, - .addr="rKj6PKqZAtChGkjspvRCP9SR5JkqUvzrnY"}, - {.seed={0x3D,0x77,0x10,0x8C,0x0D,0x8D,0xE3,0xB6,0x78,0xC2,0x44,0x42,0x39,0xB8,0xD2,0xD6}, - .pubkey={0xED,0x90,0x0C,0xCE,0x77,0xC7,0x19,0xAF,0x5A,0xF2,0xEF,0xBE,0x4B,0xC1,0xA4,0xF6, + "rKj6PKqZAtChGkjspvRCP9SR5JkqUvzrnY"}, + {{0x3D,0x77,0x10,0x8C,0x0D,0x8D,0xE3,0xB6,0x78,0xC2,0x44,0x42,0x39,0xB8,0xD2,0xD6}, + {0xED,0x90,0x0C,0xCE,0x77,0xC7,0x19,0xAF,0x5A,0xF2,0xEF,0xBE,0x4B,0xC1,0xA4,0xF6, 0xA7,0x66,0x11,0xBF,0x6D,0x57,0xA5,0xAE,0xAC,0x18,0x12,0x3E,0x76,0x5A,0xCC,0x5B,0x10}, - .seckey={0x6E,0x32,0x83,0xAB,0x90,0xCB,0xA6,0x69,0xF1,0xD8,0xF9,0xED,0xCF,0x0A,0xF4,0x11, + {0x6E,0x32,0x83,0xAB,0x90,0xCB,0xA6,0x69,0xF1,0xD8,0xF9,0xED,0xCF,0x0A,0xF4,0x11, 0xC3,0x67,0x15,0xF5,0xA3,0x0E,0x29,0x26,0x2E,0xC9,0xB2,0x9F,0xCB,0x08,0x2B,0xAF}, - .addr="rn7ddvAPRroTMaF3fGh4DUw3H5h1u4CdCP"}, - {.seed={0xB4,0x7E,0x80,0x90,0xFD,0xCC,0xD9,0x90,0xC2,0x66,0x7A,0x92,0xDF,0x29,0x36,0xAE}, - .pubkey={0xED,0x83,0xDD,0xE0,0x7B,0xFE,0xC4,0x4F,0x53,0xB9,0x78,0x79,0xFD,0xC3,0xFF,0x47, + "rn7ddvAPRroTMaF3fGh4DUw3H5h1u4CdCP"}, + {{0xB4,0x7E,0x80,0x90,0xFD,0xCC,0xD9,0x90,0xC2,0x66,0x7A,0x92,0xDF,0x29,0x36,0xAE}, + {0xED,0x83,0xDD,0xE0,0x7B,0xFE,0xC4,0x4F,0x53,0xB9,0x78,0x79,0xFD,0xC3,0xFF,0x47, 0xDD,0xB5,0x09,0xCF,0x3B,0xFC,0xB4,0x49,0x7E,0x8E,0x8A,0x83,0x1D,0xD8,0x80,0x36,0x83}, - .seckey={0x03,0x54,0x27,0x82,0x38,0x85,0x9B,0xBD,0x07,0xB7,0xE7,0xBE,0xF4,0xC7,0x20,0xE4, + {0x03,0x54,0x27,0x82,0x38,0x85,0x9B,0xBD,0x07,0xB7,0xE7,0xBE,0xF4,0xC7,0x20,0xE4, 0xB8,0x74,0xAD,0x77,0xC9,0xA5,0x8A,0x8A,0x62,0xD4,0xA4,0x5F,0xB0,0x62,0xE7,0x7F}, - .addr="rfTHpX7jyQgVL4T5ErYvTVMfYEiQmrhpdu"}, - {.seed={0xDF,0x89,0xC9,0xA7,0xB6,0xFB,0xB5,0x03,0xFF,0xD3,0x16,0xA0,0xBF,0x57,0xED,0xD1}, - .pubkey={0xED,0x03,0x48,0x03,0x06,0x47,0x50,0xC9,0xB6,0xE9,0x7B,0x9F,0xD0,0x53,0x50,0xAE, + "rfTHpX7jyQgVL4T5ErYvTVMfYEiQmrhpdu"}, + {{0xDF,0x89,0xC9,0xA7,0xB6,0xFB,0xB5,0x03,0xFF,0xD3,0x16,0xA0,0xBF,0x57,0xED,0xD1}, + {0xED,0x03,0x48,0x03,0x06,0x47,0x50,0xC9,0xB6,0xE9,0x7B,0x9F,0xD0,0x53,0x50,0xAE, 0x5F,0x92,0xEF,0xDA,0x63,0xBB,0xF7,0xD7,0x81,0x69,0x96,0x43,0x71,0xCF,0x97,0xD4,0xCD}, - .seckey={0xBA,0xA9,0x3D,0x91,0xEE,0xEE,0x96,0xBD,0x0C,0x53,0xEF,0x0F,0xF2,0x8C,0xD6,0xA2, + {0xBA,0xA9,0x3D,0x91,0xEE,0xEE,0x96,0xBD,0x0C,0x53,0xEF,0x0F,0xF2,0x8C,0xD6,0xA2, 0x48,0xDD,0xF8,0x9F,0xC1,0x22,0x45,0x70,0x0C,0xD5,0x3C,0xA2,0x20,0x65,0x8F,0x7B}, - .addr="rM84gaT9yh6TXS51xsTawH2CDrEZeuffgZ"}, - {.seed={0x88,0x2D,0xB9,0x2E,0x15,0xCC,0x70,0xB0,0xE0,0xD7,0x82,0x06,0x4E,0x7F,0x06,0xA4}, - .pubkey={0xED,0x30,0xC8,0x1F,0x58,0x63,0x63,0xD4,0x61,0xFF,0x8C,0x21,0x18,0xF9,0x2F,0x19, + "rM84gaT9yh6TXS51xsTawH2CDrEZeuffgZ"}, + {{0x88,0x2D,0xB9,0x2E,0x15,0xCC,0x70,0xB0,0xE0,0xD7,0x82,0x06,0x4E,0x7F,0x06,0xA4}, + {0xED,0x30,0xC8,0x1F,0x58,0x63,0x63,0xD4,0x61,0xFF,0x8C,0x21,0x18,0xF9,0x2F,0x19, 0x9A,0xDA,0x24,0x94,0xA7,0xD1,0x9C,0xC5,0x19,0xAD,0xC6,0x5D,0xA5,0x95,0xD9,0x56,0xEA}, - .seckey={0x69,0x2D,0xDE,0xE4,0xD0,0x31,0xF3,0x30,0x1D,0xDC,0x17,0x1F,0x40,0x1F,0xB5,0xDF, + {0x69,0x2D,0xDE,0xE4,0xD0,0x31,0xF3,0x30,0x1D,0xDC,0x17,0x1F,0x40,0x1F,0xB5,0xDF, 0x41,0xEA,0xD3,0x8B,0x45,0x94,0x8D,0x79,0x81,0xCD,0x6B,0x84,0xE8,0x25,0x43,0xCF}, - .addr="rH2q2kVDnmazJUGuEJrskgPdMZehdLzeUA"}, - {.seed={0x84,0xB7,0xB5,0x7E,0x48,0x52,0x17,0xDA,0xDD,0xF9,0x33,0xBA,0x5A,0x04,0x38,0xF4}, - .pubkey={0xED,0x16,0x8A,0x23,0xDB,0x39,0x5C,0x84,0x6D,0xC1,0x5A,0x68,0x44,0xE3,0x51,0xAC, + "rH2q2kVDnmazJUGuEJrskgPdMZehdLzeUA"}, + {{0x84,0xB7,0xB5,0x7E,0x48,0x52,0x17,0xDA,0xDD,0xF9,0x33,0xBA,0x5A,0x04,0x38,0xF4}, + {0xED,0x16,0x8A,0x23,0xDB,0x39,0x5C,0x84,0x6D,0xC1,0x5A,0x68,0x44,0xE3,0x51,0xAC, 0x9A,0xD8,0x18,0x02,0x34,0xC5,0xAC,0xAF,0x02,0xB6,0xEB,0x3A,0x7E,0x9D,0x51,0x7B,0x82}, - .seckey={0x5E,0xEB,0x85,0xCE,0xD3,0x5D,0x95,0x77,0x66,0x4A,0x8D,0x6B,0x2B,0xE0,0x71,0x61, + {0x5E,0xEB,0x85,0xCE,0xD3,0x5D,0x95,0x77,0x66,0x4A,0x8D,0x6B,0x2B,0xE0,0x71,0x61, 0xF3,0x46,0x2C,0x43,0x20,0x09,0xEB,0x8E,0x1A,0x45,0x4D,0x27,0x28,0x5C,0x7A,0x4C}, - .addr="rsHuiJJnnhyGf4vtT3wVt4ZnsxdA8P7sZm"}, - {.seed={0xBC,0x7C,0x5D,0x12,0x55,0x64,0xD2,0x5C,0xD0,0x70,0xA9,0xDE,0x04,0x61,0xAA,0x9E}, - .pubkey={0xED,0x86,0xD3,0xD8,0x44,0x91,0xA7,0x8F,0x78,0xA8,0x16,0x8E,0x92,0x6C,0x0A,0x72, + "rsHuiJJnnhyGf4vtT3wVt4ZnsxdA8P7sZm"}, + {{0xBC,0x7C,0x5D,0x12,0x55,0x64,0xD2,0x5C,0xD0,0x70,0xA9,0xDE,0x04,0x61,0xAA,0x9E}, + {0xED,0x86,0xD3,0xD8,0x44,0x91,0xA7,0x8F,0x78,0xA8,0x16,0x8E,0x92,0x6C,0x0A,0x72, 0x84,0x4B,0xD4,0xEB,0x15,0x9C,0xF7,0xB8,0x3F,0xF1,0x4E,0xC6,0x54,0x3D,0xB1,0xE3,0x2A}, - .seckey={0x16,0x22,0xF0,0x6D,0xB9,0x22,0xF8,0xA1,0x27,0x46,0x0E,0xF9,0x9C,0x31,0x3E,0xA9, + {0x16,0x22,0xF0,0x6D,0xB9,0x22,0xF8,0xA1,0x27,0x46,0x0E,0xF9,0x9C,0x31,0x3E,0xA9, 0x34,0xE9,0xC7,0x7D,0xC3,0x5F,0x02,0x6D,0x1C,0xEF,0x71,0x64,0x75,0x97,0x46,0x83}, - .addr="rnesu4gx539Q7CwFkZQtG1AuGsjHNZro46"}, - {.seed={0x4B,0x58,0x3A,0xF8,0xAF,0x5C,0xFF,0xC3,0xFD,0x39,0x74,0xBE,0x05,0x62,0x23,0x5F}, - .pubkey={0xED,0x5B,0x64,0x25,0xC7,0x8D,0xEE,0xF6,0x4A,0x97,0x9C,0xF9,0xAF,0xFF,0xD3,0x8C, + "rnesu4gx539Q7CwFkZQtG1AuGsjHNZro46"}, + {{0x4B,0x58,0x3A,0xF8,0xAF,0x5C,0xFF,0xC3,0xFD,0x39,0x74,0xBE,0x05,0x62,0x23,0x5F}, + {0xED,0x5B,0x64,0x25,0xC7,0x8D,0xEE,0xF6,0x4A,0x97,0x9C,0xF9,0xAF,0xFF,0xD3,0x8C, 0x57,0x15,0x6B,0x73,0xD9,0xB4,0xB0,0xDB,0x6C,0xAC,0x5F,0xA1,0x25,0x79,0xDA,0xA8,0x53}, - .seckey={0xF5,0x40,0x53,0x15,0xA2,0x34,0x9E,0xCE,0x4E,0x1E,0xE5,0x19,0x78,0x99,0xB3,0xE4, + {0xF5,0x40,0x53,0x15,0xA2,0x34,0x9E,0xCE,0x4E,0x1E,0xE5,0x19,0x78,0x99,0xB3,0xE4, 0x0D,0xB7,0x84,0x05,0xCF,0x60,0x78,0x3E,0x82,0x23,0x22,0x2A,0x0D,0xE2,0x34,0xAB}, - .addr="rHYvTtFVVm7fed5no7JjXQnVJz3vMV2dRV"}, - {.seed={0x13,0xB4,0x06,0x1F,0x0E,0xB1,0xE6,0x94,0xC3,0x1A,0x4A,0x73,0x2E,0x6B,0x26,0xA7}, - .pubkey={0xED,0x61,0x7A,0x04,0xF7,0xC3,0xBA,0x23,0xF0,0x1B,0x93,0x57,0x25,0x1B,0x6E,0x42, + "rHYvTtFVVm7fed5no7JjXQnVJz3vMV2dRV"}, + {{0x13,0xB4,0x06,0x1F,0x0E,0xB1,0xE6,0x94,0xC3,0x1A,0x4A,0x73,0x2E,0x6B,0x26,0xA7}, + {0xED,0x61,0x7A,0x04,0xF7,0xC3,0xBA,0x23,0xF0,0x1B,0x93,0x57,0x25,0x1B,0x6E,0x42, 0x63,0x18,0x72,0x1B,0x55,0x32,0xEC,0x81,0x03,0x17,0x6A,0x65,0xB9,0xCE,0x49,0xEA,0x09}, - .seckey={0xC5,0xF4,0xEB,0x19,0x28,0xD6,0x80,0xFA,0x85,0x59,0xC5,0xC1,0xB1,0x15,0x68,0x03, + {0xC5,0xF4,0xEB,0x19,0x28,0xD6,0x80,0xFA,0x85,0x59,0xC5,0xC1,0xB1,0x15,0x68,0x03, 0x9C,0x8C,0xF4,0x38,0x9E,0x5B,0x62,0x98,0x3A,0x05,0x2E,0x69,0x17,0x0B,0x5C,0x52}, - .addr="rKggDDftQLRV2sSrYexWZXhA5nMwLzguZq"}, - {.seed={0xE2,0xCE,0x8C,0xE1,0x86,0xDF,0x83,0x43,0x40,0x1F,0x78,0x6E,0xA0,0x17,0x9D,0x2D}, - .pubkey={0xED,0x49,0xEA,0x8C,0x43,0x5F,0xB1,0xBC,0xC0,0xC9,0x59,0xD8,0xAF,0x24,0x24,0xFC, + "rKggDDftQLRV2sSrYexWZXhA5nMwLzguZq"}, + {{0xE2,0xCE,0x8C,0xE1,0x86,0xDF,0x83,0x43,0x40,0x1F,0x78,0x6E,0xA0,0x17,0x9D,0x2D}, + {0xED,0x49,0xEA,0x8C,0x43,0x5F,0xB1,0xBC,0xC0,0xC9,0x59,0xD8,0xAF,0x24,0x24,0xFC, 0xDB,0xA4,0x96,0x92,0xD6,0xA2,0x58,0xB3,0xA3,0xFD,0xEB,0x86,0xBE,0x3E,0x71,0x3F,0x29}, - .seckey={0x1D,0x75,0xE3,0xFB,0x07,0x54,0xEA,0x72,0x69,0xAD,0xBA,0x37,0x20,0x7B,0xFB,0xEF, + {0x1D,0x75,0xE3,0xFB,0x07,0x54,0xEA,0x72,0x69,0xAD,0xBA,0x37,0x20,0x7B,0xFB,0xEF, 0x81,0x22,0x88,0x94,0xBB,0x8B,0xDA,0x0F,0x1E,0x37,0xC6,0xF8,0x0D,0x46,0xA5,0x5B}, - .addr="rwgf6e2bg4a8vPadtsgZ6HJuNsorufBwzZ"}, - {.seed={0xDE,0x5E,0xDD,0x25,0x80,0x44,0x31,0x37,0xF8,0x38,0x72,0xC4,0x39,0x69,0x9C,0x51}, - .pubkey={0xED,0x39,0x3B,0x1C,0x26,0x8C,0x24,0x11,0x4B,0xD5,0xD4,0xB5,0xAB,0xA7,0xAE,0x48, + "rwgf6e2bg4a8vPadtsgZ6HJuNsorufBwzZ"}, + {{0xDE,0x5E,0xDD,0x25,0x80,0x44,0x31,0x37,0xF8,0x38,0x72,0xC4,0x39,0x69,0x9C,0x51}, + {0xED,0x39,0x3B,0x1C,0x26,0x8C,0x24,0x11,0x4B,0xD5,0xD4,0xB5,0xAB,0xA7,0xAE,0x48, 0xED,0x5E,0xF0,0x0B,0x2F,0x53,0x1C,0x49,0x64,0xF8,0xEA,0x16,0x76,0xDA,0xDF,0xE0,0x51}, - .seckey={0xBC,0xFD,0x2C,0x3D,0x65,0x97,0x83,0x64,0x04,0x42,0x2E,0x5C,0x72,0x5C,0xC4,0xCF, + {0xBC,0xFD,0x2C,0x3D,0x65,0x97,0x83,0x64,0x04,0x42,0x2E,0x5C,0x72,0x5C,0xC4,0xCF, 0x28,0x92,0x81,0xE3,0xAB,0xF2,0x22,0xA4,0x2A,0xCF,0xE1,0xB5,0xDE,0x5F,0x70,0x10}, - .addr="rD7xAXQhKidGjkVtzo7ixZr3c3PCEiiDRS"}, - {.seed={0xC7,0x41,0xF5,0x5E,0x62,0x2D,0x4F,0x10,0xAE,0xCA,0xA5,0x0D,0x91,0xA7,0xD3,0x66}, - .pubkey={0xED,0x36,0x81,0xFA,0xD1,0xF5,0xCF,0xBB,0x60,0x28,0x88,0x6D,0x51,0xB1,0xC7,0x75, + "rD7xAXQhKidGjkVtzo7ixZr3c3PCEiiDRS"}, + {{0xC7,0x41,0xF5,0x5E,0x62,0x2D,0x4F,0x10,0xAE,0xCA,0xA5,0x0D,0x91,0xA7,0xD3,0x66}, + {0xED,0x36,0x81,0xFA,0xD1,0xF5,0xCF,0xBB,0x60,0x28,0x88,0x6D,0x51,0xB1,0xC7,0x75, 0xD1,0xCA,0xB7,0x10,0xED,0x86,0x75,0xA1,0x71,0x9C,0x41,0x81,0xC8,0x9D,0xB9,0x04,0xC7}, - .seckey={0xA3,0x5A,0xBA,0xF9,0xB2,0xE5,0x61,0x92,0xAC,0x22,0x67,0x8F,0x5A,0x5E,0x61,0x35, + {0xA3,0x5A,0xBA,0xF9,0xB2,0xE5,0x61,0x92,0xAC,0x22,0x67,0x8F,0x5A,0x5E,0x61,0x35, 0xAE,0x67,0x96,0xDD,0x75,0xFB,0x00,0xB1,0xF8,0x4F,0xC4,0x48,0x4A,0xEA,0xFA,0xFC}, - .addr="rwdo3TEgC2uS173RasWvhBouuWfTSFEPhD"}, - {.seed={0xF5,0x73,0xD8,0xDE,0xA2,0x07,0xDB,0x93,0x96,0x9A,0x92,0x2E,0xE6,0xE7,0x3C,0xBA}, - .pubkey={0xED,0x61,0x55,0xF1,0xD3,0xDA,0xD3,0x19,0xCF,0xB3,0xDE,0xB1,0xCA,0xCB,0x65,0xDC, + "rwdo3TEgC2uS173RasWvhBouuWfTSFEPhD"}, + {{0xF5,0x73,0xD8,0xDE,0xA2,0x07,0xDB,0x93,0x96,0x9A,0x92,0x2E,0xE6,0xE7,0x3C,0xBA}, + {0xED,0x61,0x55,0xF1,0xD3,0xDA,0xD3,0x19,0xCF,0xB3,0xDE,0xB1,0xCA,0xCB,0x65,0xDC, 0x63,0xAD,0x61,0x67,0xB6,0x1C,0xFA,0x52,0xCF,0x2B,0x07,0x7C,0x15,0xF0,0xCD,0x41,0x6A}, - .seckey={0x0C,0x87,0x0A,0x05,0x07,0x25,0x95,0x4D,0x66,0x4E,0xE0,0x01,0x0C,0x58,0x0A,0xD6, + {0x0C,0x87,0x0A,0x05,0x07,0x25,0x95,0x4D,0x66,0x4E,0xE0,0x01,0x0C,0x58,0x0A,0xD6, 0x28,0x52,0x03,0x05,0x6A,0xAF,0x6F,0x59,0x43,0x02,0xCB,0x98,0xE0,0x3E,0x56,0xE3}, - .addr="rNXHq25tNB23Ce6fbPw2wakxnmdzE3Fq6Q"} + "rNXHq25tNB23Ce6fbPw2wakxnmdzE3Fq6Q"} }; // clang-format on diff --git a/src/test/protocol/Seed_test.cpp b/src/test/protocol/Seed_test.cpp index ee4709a780..75c7e402a1 100644 --- a/src/test/protocol/Seed_test.cpp +++ b/src/test/protocol/Seed_test.cpp @@ -1,18 +1,11 @@ -#include -#include #include -#include +#include #include -#include -#include #include #include #include -#include #include -#include -#include namespace xrpl { diff --git a/src/test/protocol/SeqProxy_test.cpp b/src/test/protocol/SeqProxy_test.cpp index d0764d7399..7e7a21ab6e 100644 --- a/src/test/protocol/SeqProxy_test.cpp +++ b/src/test/protocol/SeqProxy_test.cpp @@ -1,10 +1,8 @@ -#include +#include #include -#include #include #include -#include namespace xrpl { @@ -54,7 +52,7 @@ struct SeqProxy_test : public beast::unit_test::suite ss << seqProx; std::string str{ss.str()}; - return str.starts_with(type) && str[type.size()] == ' ' && + return str.find(type) == 0 && str[type.size()] == ' ' && str.find(value) == (type.size() + 1); } diff --git a/src/test/protocol/Serializer_test.cpp b/src/test/protocol/Serializer_test.cpp index 7cf27b4348..e4eaac8a58 100644 --- a/src/test/protocol/Serializer_test.cpp +++ b/src/test/protocol/Serializer_test.cpp @@ -1,8 +1,6 @@ -#include +#include #include -#include -#include #include namespace xrpl { diff --git a/src/test/protocol/TER_test.cpp b/src/test/protocol/TER_test.cpp index 5b83a7905b..2ad4b634aa 100644 --- a/src/test/protocol/TER_test.cpp +++ b/src/test/protocol/TER_test.cpp @@ -1,8 +1,6 @@ -#include +#include #include -#include -#include #include #include @@ -51,18 +49,20 @@ struct TER_test : public beast::unit_test::suite using To_t = std::decay_t(tup))>; using From_t = std::decay_t(tup))>; static_assert( - std::is_same_v == std::is_convertible_v, "Convert err"); + std::is_same::value == std::is_convertible::value, + "Convert err"); static_assert( - std::is_same_v == std::is_constructible_v, + std::is_same::value == std::is_constructible::value, "Construct err"); static_assert( - std::is_same_v == std::is_assignable_v, + std::is_same::value == + std::is_assignable::value, "Assign err"); // Assignment or conversion from integer to type should never work. - static_assert(!std::is_convertible_v, "Convert err"); - static_assert(!std::is_constructible_v, "Construct err"); - static_assert(!std::is_assignable_v, "Assign err"); + static_assert(!std::is_convertible::value, "Convert err"); + static_assert(!std::is_constructible::value, "Construct err"); + static_assert(!std::is_assignable::value, "Assign err"); } }; @@ -91,7 +91,7 @@ struct TER_test : public beast::unit_test::suite { Func const func; func(tup, s); - testIterate - 1, I2 - 1, Func>(tup, s); + testIterate::value - 1, I2 - 1, Func>(tup, s); } // Finish iteration over the tuple. @@ -116,7 +116,7 @@ struct TER_test : public beast::unit_test::suite // Examples of each kind of enum. static auto const terEnums = std::make_tuple( telLOCAL_ERROR, temMALFORMED, tefFAILURE, terRETRY, tesSUCCESS, tecCLAIM); - static int const hiIndex{std::tuple_size_v - 1}; + static int const hiIndex{std::tuple_size::value - 1}; // Verify that enums cannot be converted to other enum types. testIterate(terEnums, *this); @@ -125,9 +125,9 @@ struct TER_test : public beast::unit_test::suite auto isConvertible = [](auto from, auto to) { using From_t = std::decay_t; using To_t = std::decay_t; - static_assert(std::is_convertible_v, "Convert err"); - static_assert(std::is_constructible_v, "Construct err"); - static_assert(std::is_assignable_v, "Assign err"); + static_assert(std::is_convertible::value, "Convert err"); + static_assert(std::is_constructible::value, "Construct err"); + static_assert(std::is_assignable::value, "Assign err"); }; // Verify the right types convert to NotTEC. @@ -143,9 +143,9 @@ struct TER_test : public beast::unit_test::suite auto notConvertible = [](auto from, auto to) { using To_t = std::decay_t; using From_t = std::decay_t; - static_assert(!std::is_convertible_v, "Convert err"); - static_assert(!std::is_constructible_v, "Construct err"); - static_assert(!std::is_assignable_v, "Assign err"); + static_assert(!std::is_convertible::value, "Convert err"); + static_assert(!std::is_constructible::value, "Construct err"); + static_assert(!std::is_assignable::value, "Assign err"); }; // Verify types that shouldn't convert to NotTEC. @@ -187,17 +187,17 @@ struct TER_test : public beast::unit_test::suite auto const lhs = std::get(tup); auto const rhs = std::get(tup); - static_assert(std::is_same_v, "== err"); + static_assert(std::is_same::value, "== err"); - static_assert(std::is_same_v, "!= err"); + static_assert(std::is_same::value, "!= err"); - static_assert(std::is_same_v, "< err"); + static_assert(std::is_same::value, "< err"); - static_assert(std::is_same_v, "<= err"); + static_assert(std::is_same::value, "<= err"); - static_assert(std::is_same_v(lhs, rhs)), bool>, "> err"); + static_assert(std::is_same(lhs, rhs)), bool>::value, "> err"); - static_assert(std::is_same_v=(lhs, rhs)), bool>, ">= err"); + static_assert(std::is_same=(lhs, rhs)), bool>::value, ">= err"); // Make sure a sampling of TER types exhibit the expected behavior // for all comparison operators. @@ -225,7 +225,7 @@ struct TER_test : public beast::unit_test::suite tecCLAIM, NotTEC{telLOCAL_ERROR}, TER{tecCLAIM}); - static int const hiIndex{std::tuple_size_v - 1}; + static int const hiIndex{std::tuple_size::value - 1}; // Verify that all types in the ters tuple can be compared with all // the other types in ters. diff --git a/src/test/resource/Logic_test.cpp b/src/test/resource/Logic_test.cpp index f6da313b22..12c1e631e2 100644 --- a/src/test/resource/Logic_test.cpp +++ b/src/test/resource/Logic_test.cpp @@ -1,27 +1,18 @@ #include -#include #include #include -#include -#include -#include -#include -#include +#include #include -#include -#include +#include #include -#include #include -#include -#include #include -#include -namespace xrpl::Resource { +namespace xrpl { +namespace Resource { class ResourceManager_test : public beast::unit_test::suite { @@ -291,4 +282,5 @@ public: BEAST_DEFINE_TESTSUITE(ResourceManager, resource, xrpl); -} // namespace xrpl::Resource +} // namespace Resource +} // namespace xrpl diff --git a/src/test/rpc/AMMInfo_test.cpp b/src/test/rpc/AMMInfo_test.cpp index 876c9b66f1..ccad7032e4 100644 --- a/src/test/rpc/AMMInfo_test.cpp +++ b/src/test/rpc/AMMInfo_test.cpp @@ -1,30 +1,13 @@ +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class AMMInfo_test : public jtx::AMMTestBase { @@ -376,4 +359,5 @@ public: BEAST_DEFINE_TESTSUITE(AMMInfo, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/AccountCurrencies_test.cpp b/src/test/rpc/AccountCurrencies_test.cpp index c3b9135f07..009af9d454 100644 --- a/src/test/rpc/AccountCurrencies_test.cpp +++ b/src/test/rpc/AccountCurrencies_test.cpp @@ -1,21 +1,8 @@ +#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include - namespace xrpl { class AccountCurrencies_test : public beast::unit_test::suite @@ -127,7 +114,7 @@ class AccountCurrencies_test : public beast::unit_test::suite env.fund(XRP(10000), alice, gw); char currencySuffix{'A'}; std::vector> gwCurrencies(26); // A - Z - std::ranges::generate(gwCurrencies, [&]() { + std::generate(gwCurrencies.begin(), gwCurrencies.end(), [&]() { auto gwc = gw[std::string("US") + currencySuffix++]; env(trust(alice, gwc(100))); return gwc; diff --git a/src/test/rpc/AccountInfo_test.cpp b/src/test/rpc/AccountInfo_test.cpp index a8f849b6d2..518398f9ea 100644 --- a/src/test/rpc/AccountInfo_test.cpp +++ b/src/test/rpc/AccountInfo_test.cpp @@ -1,26 +1,12 @@ +#include +#include +#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class AccountInfo_test : public beast::unit_test::suite { @@ -641,4 +627,5 @@ public: BEAST_DEFINE_TESTSUITE(AccountInfo, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/AccountLines_test.cpp b/src/test/rpc/AccountLines_test.cpp index 6f50c93bd8..f91b2aed1c 100644 --- a/src/test/rpc/AccountLines_test.cpp +++ b/src/test/rpc/AccountLines_test.cpp @@ -1,40 +1,12 @@ +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include #include #include -#include -#include -#include -#include - -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { class AccountLines_test : public beast::unit_test::suite { @@ -1286,4 +1258,5 @@ public: BEAST_DEFINE_TESTSUITE(AccountLines, rpc, xrpl); -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/test/rpc/AccountObjects_test.cpp b/src/test/rpc/AccountObjects_test.cpp index 6f3ae2e2b3..b6e8f6fa76 100644 --- a/src/test/rpc/AccountObjects_test.cpp +++ b/src/test/rpc/AccountObjects_test.cpp @@ -1,40 +1,20 @@ +#include #include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include #include -#include -#include -#include #include #include #include -#include -#include -#include -#include #include #include #include -#include -#include -#include -#include -#include +#include -namespace xrpl::test { +#include + +namespace xrpl { +namespace test { static char const* bob_account_objects[] = { R"json({ @@ -941,7 +921,7 @@ public: jss::RippleState.c_str(), jss::PayChannel.c_str(), jss::PermissionedDomain.c_str()}; - std::ranges::sort(v); + std::sort(v.begin(), v.end()); return v; }(); @@ -957,7 +937,7 @@ public: { gotLedgerTypes.push_back(aobjs[i]["LedgerEntryType"].asString()); } - std::ranges::sort(gotLedgerTypes); + std::sort(gotLedgerTypes.begin(), gotLedgerTypes.end()); BEAST_EXPECT(gotLedgerTypes == expectedLedgerTypes); } } @@ -982,7 +962,7 @@ public: auto const objs = resp[jss::result][jss::account_objects]; for (auto const& obj : resp[jss::result][jss::account_objects]) typesOut.push_back(obj[sfLedgerEntryType.fieldName].asString()); - std::ranges::sort(typesOut); + std::sort(typesOut.begin(), typesOut.end()); }; // Make a lambda we can use to check the number of fetched // account objects and their ledger type @@ -1366,4 +1346,5 @@ public: BEAST_DEFINE_TESTSUITE(AccountObjects, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/AccountOffers_test.cpp b/src/test/rpc/AccountOffers_test.cpp index 8c93b15c4a..6b93e0570f 100644 --- a/src/test/rpc/AccountOffers_test.cpp +++ b/src/test/rpc/AccountOffers_test.cpp @@ -1,20 +1,9 @@ +#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include - -#include -#include -#include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class AccountOffers_test : public beast::unit_test::suite { @@ -299,4 +288,5 @@ public: BEAST_DEFINE_TESTSUITE(AccountOffers, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/AccountTx_test.cpp b/src/test/rpc/AccountTx_test.cpp index 60ad83934a..2470ec3c4c 100644 --- a/src/test/rpc/AccountTx_test.cpp +++ b/src/test/rpc/AccountTx_test.cpp @@ -1,54 +1,17 @@ -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +namespace xrpl { -namespace xrpl::test { +namespace test { class AccountTx_test : public beast::unit_test::suite { @@ -900,4 +863,5 @@ public: }; BEAST_DEFINE_TESTSUITE(AccountTx, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/AmendmentBlocked_test.cpp b/src/test/rpc/AmendmentBlocked_test.cpp index 0476b7406a..e61f22fa0e 100644 --- a/src/test/rpc/AmendmentBlocked_test.cpp +++ b/src/test/rpc/AmendmentBlocked_test.cpp @@ -1,26 +1,11 @@ -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include #include -#include - namespace xrpl { class AmendmentBlocked_test : public beast::unit_test::suite diff --git a/src/test/rpc/BookChanges_test.cpp b/src/test/rpc/BookChanges_test.cpp index d6881217b5..0618f4e7d0 100644 --- a/src/test/rpc/BookChanges_test.cpp +++ b/src/test/rpc/BookChanges_test.cpp @@ -1,21 +1,11 @@ -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "xrpl/beast/unit_test/suite.h" +#include "xrpl/protocol/jss.h" -namespace xrpl::test { +namespace xrpl { +namespace test { class BookChanges_test : public beast::unit_test::suite { @@ -128,4 +118,5 @@ public: BEAST_DEFINE_TESTSUITE(BookChanges, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/Book_test.cpp b/src/test/rpc/Book_test.cpp index 90a621c693..ed5ecce388 100644 --- a/src/test/rpc/Book_test.cpp +++ b/src/test/rpc/Book_test.cpp @@ -1,39 +1,17 @@ -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include +#include #include -#include -#include #include -#include #include -#include #include #include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class Book_test : public beast::unit_test::suite { @@ -1847,4 +1825,5 @@ public: BEAST_DEFINE_TESTSUITE_PRIO(Book, rpc, xrpl, 1); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/Connect_test.cpp b/src/test/rpc/Connect_test.cpp index a37c36d907..c029356bf6 100644 --- a/src/test/rpc/Connect_test.cpp +++ b/src/test/rpc/Connect_test.cpp @@ -1,7 +1,5 @@ +#include -#include - -#include #include namespace xrpl { diff --git a/src/test/rpc/DeliveredAmount_test.cpp b/src/test/rpc/DeliveredAmount_test.cpp index 133c5771b7..167027006a 100644 --- a/src/test/rpc/DeliveredAmount_test.cpp +++ b/src/test/rpc/DeliveredAmount_test.cpp @@ -1,30 +1,12 @@ -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { // Helper class to track the expected number `delivered_amount` results. class CheckDeliveredAmount @@ -421,4 +403,5 @@ public: BEAST_DEFINE_TESTSUITE(DeliveredAmount, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/DepositAuthorized_test.cpp b/src/test/rpc/DepositAuthorized_test.cpp index 900adb5c7e..7921d063c9 100644 --- a/src/test/rpc/DepositAuthorized_test.cpp +++ b/src/test/rpc/DepositAuthorized_test.cpp @@ -1,24 +1,9 @@ +#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include #include -#include -#include -#include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class DepositAuthorized_test : public beast::unit_test::suite { @@ -545,4 +530,5 @@ public: BEAST_DEFINE_TESTSUITE(DepositAuthorized, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/Feature_test.cpp b/src/test/rpc/Feature_test.cpp index cdeff57131..db9b25cfd4 100644 --- a/src/test/rpc/Feature_test.cpp +++ b/src/test/rpc/Feature_test.cpp @@ -1,25 +1,10 @@ +#include -#include -#include - -#include - -#include -#include -#include -#include #include -#include #include #include #include -#include -#include -#include -#include -#include - namespace xrpl { class Feature_test : public beast::unit_test::suite @@ -521,9 +506,10 @@ class Feature_test : public beast::unit_test::suite Env env{*this}; auto const& supportedAmendments = xrpl::detail::supportedAmendments(); - auto obsoleteFeature = std::ranges::find_if(supportedAmendments, [](auto const& pair) { - return pair.second == VoteBehavior::Obsolete; - }); + auto obsoleteFeature = std::find_if( + std::begin(supportedAmendments), std::end(supportedAmendments), [](auto const& pair) { + return pair.second == VoteBehavior::Obsolete; + }); if (obsoleteFeature == std::end(supportedAmendments)) { diff --git a/src/test/rpc/GatewayBalances_test.cpp b/src/test/rpc/GatewayBalances_test.cpp index be51f60f02..35514ec093 100644 --- a/src/test/rpc/GatewayBalances_test.cpp +++ b/src/test/rpc/GatewayBalances_test.cpp @@ -1,21 +1,12 @@ -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class GatewayBalances_test : public beast::unit_test::suite { @@ -288,4 +279,5 @@ public: BEAST_DEFINE_TESTSUITE(GatewayBalances, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/GetAggregatePrice_test.cpp b/src/test/rpc/GetAggregatePrice_test.cpp index f4473c0aa3..1d14678f76 100644 --- a/src/test/rpc/GetAggregatePrice_test.cpp +++ b/src/test/rpc/GetAggregatePrice_test.cpp @@ -1,19 +1,14 @@ -#include -#include +#include #include -#include -#include -#include -#include +#include + #include -#include -#include -#include -#include - -namespace xrpl::test::jtx::oracle { +namespace xrpl { +namespace test { +namespace jtx { +namespace oracle { class GetAggregatePrice_test : public beast::unit_test::suite { @@ -322,4 +317,7 @@ public: BEAST_DEFINE_TESTSUITE(GetAggregatePrice, rpc, xrpl); -} // namespace xrpl::test::jtx::oracle +} // namespace oracle +} // namespace jtx +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/GetCounts_test.cpp b/src/test/rpc/GetCounts_test.cpp index 62e2aadfe6..d0729b3f56 100644 --- a/src/test/rpc/GetCounts_test.cpp +++ b/src/test/rpc/GetCounts_test.cpp @@ -1,16 +1,10 @@ - -#include -#include -#include -#include +#include #include -#include -#include +#include +#include #include -#include - namespace xrpl { class GetCounts_test : public beast::unit_test::suite diff --git a/src/test/rpc/Handler_test.cpp b/src/test/rpc/Handler_test.cpp index bb9b72c63f..30ea8831ff 100644 --- a/src/test/rpc/Handler_test.cpp +++ b/src/test/rpc/Handler_test.cpp @@ -1,20 +1,13 @@ - -#include +#include #include -#include +#include -#include -#include -#include #include -#include -#include #include +#include #include -#include -#include // cspell: words stdev namespace xrpl::test { @@ -64,7 +57,7 @@ class Handler_test : public beast::unit_test::suite samples[k] = (std::chrono::steady_clock::now() - start).count(); } - std::ranges::sort(samples); + std::sort(samples.begin(), samples.end()); for (std::size_t k = 35; k < 65; ++k) { j += 1; diff --git a/src/test/rpc/JSONRPC_test.cpp b/src/test/rpc/JSONRPC_test.cpp index 40c2389617..b9d4ee4a98 100644 --- a/src/test/rpc/JSONRPC_test.cpp +++ b/src/test/rpc/JSONRPC_test.cpp @@ -1,42 +1,19 @@ -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include #include -#include #include #include -#include +#include #include -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +namespace xrpl { -namespace xrpl::RPC { +namespace RPC { struct TxnTestData { @@ -2847,4 +2824,5 @@ public: BEAST_DEFINE_TESTSUITE(JSONRPC, rpc, xrpl); -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/test/rpc/KeyGeneration_test.cpp b/src/test/rpc/KeyGeneration_test.cpp index a496664ef0..6a6d71ca10 100644 --- a/src/test/rpc/KeyGeneration_test.cpp +++ b/src/test/rpc/KeyGeneration_test.cpp @@ -3,19 +3,14 @@ #include #include -#include #include #include -#include #include -#include #include -#include -#include -#include +namespace xrpl { -namespace xrpl::RPC { +namespace RPC { struct key_strings { @@ -38,48 +33,45 @@ static char const* master_seed_hex = "BE6A670A19B209E112146D0A7ED2AAD7"; } // namespace common static key_strings const secp256k1_strings = { - .account_id = "r4Vtj2jrfmTVZGfSP3gH9hQPMqFPQFin8f", - .master_key = common::master_key, - .master_seed = common::master_seed, - .master_seed_hex = common::master_seed_hex, - .public_key = "aBQxK2YFNqzmAaXNczYcjqDjfiKkLsJUizsr1UBf44RCF8FHdrmX", - .public_key_hex = "038AAE247B2344B1837FBED8F57389C8C11774510A3F7D784F2A09F0CB6843236C", - .secret_key_hex = "1949ECD889EA71324BC7A30C8E81F4E93CB73EE19D59E9082111E78CC3DDABC2", - .passphrase = common::passphrase, - .passphrase_warning = - "This wallet was generated using a user-supplied " - "passphrase that has low entropy and is vulnerable " - "to brute-force attacks.", + "r4Vtj2jrfmTVZGfSP3gH9hQPMqFPQFin8f", + common::master_key, + common::master_seed, + common::master_seed_hex, + "aBQxK2YFNqzmAaXNczYcjqDjfiKkLsJUizsr1UBf44RCF8FHdrmX", + "038AAE247B2344B1837FBED8F57389C8C11774510A3F7D784F2A09F0CB6843236C", + "1949ECD889EA71324BC7A30C8E81F4E93CB73EE19D59E9082111E78CC3DDABC2", + common::passphrase, + "This wallet was generated using a user-supplied " + "passphrase that has low entropy and is vulnerable " + "to brute-force attacks.", }; static key_strings const ed25519_strings = { - .account_id = "r4qV6xTXerqaZav3MJfSY79ynmc1BSBev1", - .master_key = common::master_key, - .master_seed = common::master_seed, - .master_seed_hex = common::master_seed_hex, - .public_key = "aKEQmgLMyZPMruJFejUuedp169LgW6DbJt1rej1DJ5hWUMH4pHJ7", - .public_key_hex = "ED54C3F5BEDA8BD588B203D23A27398FAD9D20F88A974007D6994659CD7273FE1D", - .secret_key_hex = "77AAED2698D56D6676323629160F4EEF21CFD9EE3D0745CC78FA291461F98278", - .passphrase = common::passphrase, - .passphrase_warning = - "This wallet was generated using a user-supplied " - "passphrase that has low entropy and is vulnerable " - "to brute-force attacks.", + "r4qV6xTXerqaZav3MJfSY79ynmc1BSBev1", + common::master_key, + common::master_seed, + common::master_seed_hex, + "aKEQmgLMyZPMruJFejUuedp169LgW6DbJt1rej1DJ5hWUMH4pHJ7", + "ED54C3F5BEDA8BD588B203D23A27398FAD9D20F88A974007D6994659CD7273FE1D", + "77AAED2698D56D6676323629160F4EEF21CFD9EE3D0745CC78FA291461F98278", + common::passphrase, + "This wallet was generated using a user-supplied " + "passphrase that has low entropy and is vulnerable " + "to brute-force attacks.", }; static key_strings const strong_brain_strings = { - .account_id = "rBcvXmNb7KPkNdMkpckdWPpbvkWgcV3nir", - .master_key = "TED AVON CAVE HOUR BRAG JEFF RIFT NEAL TOLD FAT SEW SAN", - .master_seed = "shKdhWka8hS7Es3bpctCZXBiAwfUN", - .master_seed_hex = "74BA8389B44F98CF41E795CD91F9C93F", - .public_key = "aBRL2sqVuzrsM6zikPB4v8UBHGn1aKkrsxhYEffhcQxB2LKyywE5", - .public_key_hex = "03BD334FB9E06C58D69603E9922686528B18A754BC2F2E1ADA095FFE67DE952C64", - .secret_key_hex = "84262FB16AA25BE407174C7EDAB531220C30FA4D8A28AA9D564673FB3D34502C", - .passphrase = "A4yKIRGdzrw0YQ$2%TFKYG9HP*&ok^!sy7E@RwICs", - .passphrase_warning = - "This wallet was generated using a user-supplied " - "passphrase. It may be vulnerable to brute-force " - "attacks.", + "rBcvXmNb7KPkNdMkpckdWPpbvkWgcV3nir", + "TED AVON CAVE HOUR BRAG JEFF RIFT NEAL TOLD FAT SEW SAN", + "shKdhWka8hS7Es3bpctCZXBiAwfUN", + "74BA8389B44F98CF41E795CD91F9C93F", + "aBRL2sqVuzrsM6zikPB4v8UBHGn1aKkrsxhYEffhcQxB2LKyywE5", + "03BD334FB9E06C58D69603E9922686528B18A754BC2F2E1ADA095FFE67DE952C64", + "84262FB16AA25BE407174C7EDAB531220C30FA4D8A28AA9D564673FB3D34502C", + "A4yKIRGdzrw0YQ$2%TFKYG9HP*&ok^!sy7E@RwICs", + "This wallet was generated using a user-supplied " + "passphrase. It may be vulnerable to brute-force " + "attacks.", }; class WalletPropose_test : public xrpl::TestSuite @@ -800,4 +792,5 @@ public: BEAST_DEFINE_TESTSUITE(WalletPropose, rpc, xrpl); -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/test/rpc/LedgerClosed_test.cpp b/src/test/rpc/LedgerClosed_test.cpp index efe7c2a815..2bc5c2b0c9 100644 --- a/src/test/rpc/LedgerClosed_test.cpp +++ b/src/test/rpc/LedgerClosed_test.cpp @@ -1,16 +1,8 @@ +#include -#include -#include -#include -#include - -#include #include -#include #include -#include - namespace xrpl { class LedgerClosed_test : public beast::unit_test::suite diff --git a/src/test/rpc/LedgerData_test.cpp b/src/test/rpc/LedgerData_test.cpp index 612899e47d..472f5b2aa2 100644 --- a/src/test/rpc/LedgerData_test.cpp +++ b/src/test/rpc/LedgerData_test.cpp @@ -1,31 +1,8 @@ - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include - namespace xrpl { class LedgerData_test : public beast::unit_test::suite diff --git a/src/test/rpc/LedgerEntry_test.cpp b/src/test/rpc/LedgerEntry_test.cpp index d208d718f4..7688c09fa7 100644 --- a/src/test/rpc/LedgerEntry_test.cpp +++ b/src/test/rpc/LedgerEntry_test.cpp @@ -1,68 +1,22 @@ -#include -#include -#include +#include #include -#include -#include #include -#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { + +namespace test { enum class FieldType { AccountField, @@ -2926,12 +2880,12 @@ class LedgerEntry_XChain_test : public beast::unit_test::suite, a[i].isMember(jss::Destination) && a[i][jss::Destination] == scCarol.human()); BEAST_EXPECT( a[i].isMember(sfAttestationSignerAccount.jsonName) && - std::ranges::any_of(signers, [&](signer const& s) { + std::any_of(signers.begin(), signers.end(), [&](signer const& s) { return a[i][sfAttestationSignerAccount.jsonName] == s.account.human(); })); BEAST_EXPECT( a[i].isMember(sfAttestationRewardAccount.jsonName) && - std::ranges::any_of(payee, [&](Account const& account) { + std::any_of(payee.begin(), payee.end(), [&](Account const& account) { return a[i][sfAttestationRewardAccount.jsonName] == account.human(); })); BEAST_EXPECT( @@ -2975,4 +2929,5 @@ public: BEAST_DEFINE_TESTSUITE(LedgerEntry, rpc, xrpl); BEAST_DEFINE_TESTSUITE(LedgerEntry_XChain, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/LedgerHeader_test.cpp b/src/test/rpc/LedgerHeader_test.cpp index bb1ce8b51f..8b460fe6a4 100644 --- a/src/test/rpc/LedgerHeader_test.cpp +++ b/src/test/rpc/LedgerHeader_test.cpp @@ -1,8 +1,6 @@ #include #include -#include -#include #include namespace xrpl { diff --git a/src/test/rpc/LedgerRPC_test.cpp b/src/test/rpc/LedgerRPC_test.cpp index c8c40ce0cc..8f965aa2cf 100644 --- a/src/test/rpc/LedgerRPC_test.cpp +++ b/src/test/rpc/LedgerRPC_test.cpp @@ -1,31 +1,20 @@ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include #include -#include #include -#include #include -#include -#include -#include +namespace xrpl { -namespace xrpl::test { +namespace test { class LedgerRPC_test : public beast::unit_test::suite { @@ -707,4 +696,5 @@ public: BEAST_DEFINE_TESTSUITE(LedgerRPC, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/LedgerRequest_test.cpp b/src/test/rpc/LedgerRequest_test.cpp index 496cd9478a..4462c1f039 100644 --- a/src/test/rpc/LedgerRequest_test.cpp +++ b/src/test/rpc/LedgerRequest_test.cpp @@ -1,22 +1,16 @@ +#include +#include -#include -#include -#include -#include - -#include -#include -#include +#include #include #include #include -#include -#include -#include -namespace xrpl::RPC { +namespace xrpl { + +namespace RPC { class LedgerRequest_test : public beast::unit_test::suite { @@ -358,4 +352,5 @@ public: BEAST_DEFINE_TESTSUITE(LedgerRequest, rpc, xrpl); -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/test/rpc/ManifestRPC_test.cpp b/src/test/rpc/ManifestRPC_test.cpp index aa27c67ca9..f42fdd7164 100644 --- a/src/test/rpc/ManifestRPC_test.cpp +++ b/src/test/rpc/ManifestRPC_test.cpp @@ -1,18 +1,16 @@ // Copyright (c) 2020 Dev Null Productions -#include -#include +#include -#include #include -#include +#include #include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class ManifestRPC_test : public beast::unit_test::suite { @@ -72,4 +70,5 @@ public: }; BEAST_DEFINE_TESTSUITE(ManifestRPC, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/NoRippleCheck_test.cpp b/src/test/rpc/NoRippleCheck_test.cpp index ac283a54b1..54a2931ba5 100644 --- a/src/test/rpc/NoRippleCheck_test.cpp +++ b/src/test/rpc/NoRippleCheck_test.cpp @@ -1,37 +1,17 @@ -#include -#include -#include // IWYU pragma: keep +#include #include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include #include #include #include #include -#include -#include - namespace xrpl { class NoRippleCheck_test : public beast::unit_test::suite diff --git a/src/test/rpc/NoRipple_test.cpp b/src/test/rpc/NoRipple_test.cpp index 75d26ca208..fcf412bbd4 100644 --- a/src/test/rpc/NoRipple_test.cpp +++ b/src/test/rpc/NoRipple_test.cpp @@ -1,27 +1,11 @@ +#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include - -#include -#include -#include -#include #include -#include -#include #include -#include +namespace xrpl { -namespace xrpl::test { +namespace test { class NoRipple_test : public beast::unit_test::suite { @@ -281,4 +265,5 @@ public: BEAST_DEFINE_TESTSUITE(NoRipple, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/OwnerInfo_test.cpp b/src/test/rpc/OwnerInfo_test.cpp index fb0cc47995..8a09fed467 100644 --- a/src/test/rpc/OwnerInfo_test.cpp +++ b/src/test/rpc/OwnerInfo_test.cpp @@ -1,18 +1,8 @@ +#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include - -#include -#include -#include +#include #include -#include #include -#include #include namespace xrpl { diff --git a/src/test/rpc/Peers_test.cpp b/src/test/rpc/Peers_test.cpp index 3e36ddb5d7..984e767516 100644 --- a/src/test/rpc/Peers_test.cpp +++ b/src/test/rpc/Peers_test.cpp @@ -1,18 +1,12 @@ +#include #include #include +#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include namespace xrpl { diff --git a/src/test/rpc/RPCCall_test.cpp b/src/test/rpc/RPCCall_test.cpp index 3ece97344c..ae876dded4 100644 --- a/src/test/rpc/RPCCall_test.cpp +++ b/src/test/rpc/RPCCall_test.cpp @@ -1,27 +1,21 @@ -#include -#include +#include #include -#include +#include -#include +#include #include -#include #include -#include +#include -#include +#include -#include -#include #include #include -#include -#include -#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { struct RPCCallTestData { @@ -5933,4 +5927,5 @@ public: BEAST_DEFINE_TESTSUITE(RPCCall, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/RPCHelpers_test.cpp b/src/test/rpc/RPCHelpers_test.cpp index e87ac50bcf..f180bd5c1a 100644 --- a/src/test/rpc/RPCHelpers_test.cpp +++ b/src/test/rpc/RPCHelpers_test.cpp @@ -1,13 +1,10 @@ -#include #include -#include -#include -#include -#include +#include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class RPCHelpers_test : public beast::unit_test::suite { @@ -75,4 +72,5 @@ public: BEAST_DEFINE_TESTSUITE(RPCHelpers, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/RPCOverload_test.cpp b/src/test/rpc/RPCOverload_test.cpp index a49b52578a..e5558af82c 100644 --- a/src/test/rpc/RPCOverload_test.cpp +++ b/src/test/rpc/RPCOverload_test.cpp @@ -1,24 +1,14 @@ -#include -#include -#include +#include #include #include -#include -#include -#include -#include #include -#include -#include -#include +#include #include -#include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class RPCOverload_test : public beast::unit_test::suite { @@ -82,4 +72,5 @@ public: BEAST_DEFINE_TESTSUITE(RPCOverload, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/RobustTransaction_test.cpp b/src/test/rpc/RobustTransaction_test.cpp index 96a8c5f869..0d47a39573 100644 --- a/src/test/rpc/RobustTransaction_test.cpp +++ b/src/test/rpc/RobustTransaction_test.cpp @@ -1,20 +1,12 @@ -#include +#include #include -#include -#include // IWYU pragma: keep -#include -#include -#include +#include #include -#include -#include -#include #include -#include - -namespace xrpl::test { +namespace xrpl { +namespace test { class RobustTransaction_test : public beast::unit_test::suite { @@ -441,4 +433,5 @@ public: BEAST_DEFINE_TESTSUITE(RobustTransaction, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/Roles_test.cpp b/src/test/rpc/Roles_test.cpp index eaf6143f5d..314d0972d2 100644 --- a/src/test/rpc/Roles_test.cpp +++ b/src/test/rpc/Roles_test.cpp @@ -1,16 +1,14 @@ -#include +#include #include -#include -#include - -#include -#include +#include #include #include -namespace xrpl::test { +namespace xrpl { + +namespace test { class Roles_test : public beast::unit_test::suite { @@ -347,4 +345,6 @@ public: BEAST_DEFINE_TESTSUITE(Roles, rpc, xrpl); -} // namespace xrpl::test +} // namespace test + +} // namespace xrpl diff --git a/src/test/rpc/ServerDefinitions_test.cpp b/src/test/rpc/ServerDefinitions_test.cpp index 60312d470d..a2c45cfa65 100644 --- a/src/test/rpc/ServerDefinitions_test.cpp +++ b/src/test/rpc/ServerDefinitions_test.cpp @@ -1,13 +1,14 @@ +#include -#include - -#include +#include #include #include #include #include -namespace xrpl::test { +namespace xrpl { + +namespace test { class ServerDefinitions_test : public beast::unit_test::suite { @@ -460,4 +461,5 @@ public: BEAST_DEFINE_TESTSUITE(ServerDefinitions, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/ServerInfo_test.cpp b/src/test/rpc/ServerInfo_test.cpp index f94fe51d5d..495bb8ba1b 100644 --- a/src/test/rpc/ServerInfo_test.cpp +++ b/src/test/rpc/ServerInfo_test.cpp @@ -1,19 +1,16 @@ +#include -#include -#include - -#include #include -#include +#include #include #include -#include +#include -#include +namespace xrpl { -namespace xrpl::test { +namespace test { namespace validator_data { static auto const public_key = "nHBt9fsb4849WmZiCds4r5TXyBeQjqnH5kzPtqgMAQMgi39YZRPa"; @@ -160,4 +157,5 @@ admin = 127.0.0.1 BEAST_DEFINE_TESTSUITE(ServerInfo, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/Simulate_test.cpp b/src/test/rpc/Simulate_test.cpp index 0ef66d67d9..0581313e7a 100644 --- a/src/test/rpc/Simulate_test.cpp +++ b/src/test/rpc/Simulate_test.cpp @@ -1,46 +1,22 @@ -#include +#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include +#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include #include -#include -#include -#include #include +#include -#include -#include -#include -#include #include -#include +#include -namespace xrpl::test { +namespace xrpl { + +namespace test { class Simulate_test : public beast::unit_test::suite { @@ -1191,4 +1167,6 @@ public: BEAST_DEFINE_TESTSUITE(Simulate, rpc, xrpl); -} // namespace xrpl::test +} // namespace test + +} // namespace xrpl diff --git a/src/test/rpc/Status_test.cpp b/src/test/rpc/Status_test.cpp index d1a5684262..a4a7b8c961 100644 --- a/src/test/rpc/Status_test.cpp +++ b/src/test/rpc/Status_test.cpp @@ -1,18 +1,10 @@ #include #include -#include -#include -#include -#include -#include +#include -#include -#include -#include -#include - -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { class codeString_test : public beast::unit_test::suite { @@ -204,4 +196,5 @@ public: BEAST_DEFINE_TESTSUITE(fillJson, rpc, RPC); -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/test/rpc/Subscribe_test.cpp b/src/test/rpc/Subscribe_test.cpp index 02c4fd8c8d..080c9232de 100644 --- a/src/test/rpc/Subscribe_test.cpp +++ b/src/test/rpc/Subscribe_test.cpp @@ -1,60 +1,22 @@ -#include +#include #include -#include -#include #include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include +#include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class Subscribe_test : public beast::unit_test::suite { @@ -1369,8 +1331,8 @@ public: return nftID; }); // Sort both array to prepare for comparison - std::ranges::sort(metaIDs); - std::ranges::sort(actualNftIDs); + std::sort(metaIDs.begin(), metaIDs.end()); + std::sort(actualNftIDs.begin(), actualNftIDs.end()); // Make sure the expect number of NFTs is correct BEAST_EXPECT(metaIDs.size() == actualNftIDs.size()); @@ -1531,4 +1493,5 @@ public: BEAST_DEFINE_TESTSUITE(Subscribe, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/TransactionEntry_test.cpp b/src/test/rpc/TransactionEntry_test.cpp index 1940194937..6421587478 100644 --- a/src/test/rpc/TransactionEntry_test.cpp +++ b/src/test/rpc/TransactionEntry_test.cpp @@ -1,26 +1,11 @@ -#include +#include #include -#include -#include -#include -#include -#include - -#include -#include -#include #include #include -#include -#include -#include #include #include -#include -#include -#include namespace xrpl { diff --git a/src/test/rpc/TransactionHistory_test.cpp b/src/test/rpc/TransactionHistory_test.cpp index bc6d2910d9..1d555ecd8c 100644 --- a/src/test/rpc/TransactionHistory_test.cpp +++ b/src/test/rpc/TransactionHistory_test.cpp @@ -1,20 +1,12 @@ -#include +#include #include -#include #include -#include -#include -#include -#include -#include #include #include -#include -#include -#include +#include namespace xrpl { diff --git a/src/test/rpc/Transaction_test.cpp b/src/test/rpc/Transaction_test.cpp index fdb0ed1c8f..9f06607729 100644 --- a/src/test/rpc/Transaction_test.cpp +++ b/src/test/rpc/Transaction_test.cpp @@ -1,42 +1,19 @@ -#include +#include #include -#include #include -#include -#include -#include -#include #include #include -#include -#include -#include #include -#include -#include -#include #include -#include -#include #include -#include -#include -#include #include #include -#include #include -#include -#include -#include -#include #include -#include #include -#include namespace xrpl { @@ -660,7 +637,7 @@ class Transaction_test : public beast::unit_test::suite // Change the first upper case letter to lower case. std::string mixedCase = ctid; { - auto const iter = std::ranges::find_if(mixedCase, isUpper); + auto const iter = std::find_if(mixedCase.begin(), mixedCase.end(), isUpper); *iter = std::tolower(*iter); } BEAST_EXPECT(ctid != mixedCase); diff --git a/src/test/rpc/ValidatorInfo_test.cpp b/src/test/rpc/ValidatorInfo_test.cpp index 71760b601b..d4769f40fb 100644 --- a/src/test/rpc/ValidatorInfo_test.cpp +++ b/src/test/rpc/ValidatorInfo_test.cpp @@ -1,19 +1,17 @@ // Copyright (c) 2020 Dev Null Productions -#include -#include +#include -#include #include -#include +#include #include -#include #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { class ValidatorInfo_test : public beast::unit_test::suite { @@ -91,4 +89,5 @@ public: }; BEAST_DEFINE_TESTSUITE(ValidatorInfo, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/ValidatorRPC_test.cpp b/src/test/rpc/ValidatorRPC_test.cpp index 2d8a73e31d..6c6a75dd01 100644 --- a/src/test/rpc/ValidatorRPC_test.cpp +++ b/src/test/rpc/ValidatorRPC_test.cpp @@ -1,34 +1,19 @@ -#include +#include #include -#include #include #include -#include #include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { + +namespace test { class ValidatorRPC_test : public beast::unit_test::suite { @@ -545,4 +530,5 @@ public: BEAST_DEFINE_TESTSUITE(ValidatorRPC, rpc, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/rpc/Version_test.cpp b/src/test/rpc/Version_test.cpp index 39983ac09e..c12e397459 100644 --- a/src/test/rpc/Version_test.cpp +++ b/src/test/rpc/Version_test.cpp @@ -1,16 +1,8 @@ +#include -#include -#include - -#include -#include #include #include -#include -#include -#include - namespace xrpl { class Version_test : public beast::unit_test::suite @@ -53,8 +45,7 @@ class Version_test : public beast::unit_test::suite { if (re["error_what"].isString()) { - return re["error_what"].asString().starts_with( - jss::invalid_API_version.c_str()); + return re["error_what"].asString().find(jss::invalid_API_version.c_str()) == 0; } } return false; diff --git a/src/test/server/ServerStatus_test.cpp b/src/test/server/ServerStatus_test.cpp index 09282c9d14..b7c9825a55 100644 --- a/src/test/server/ServerStatus_test.cpp +++ b/src/test/server/ServerStatus_test.cpp @@ -1,50 +1,31 @@ -#include +#include #include #include #include #include +#include #include #include -#include #include -#include -#include -#include -#include #include #include #include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include #include #include -#include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { class ServerStatus_test : public beast::unit_test::suite, public beast::test::enable_yield_to { @@ -594,7 +575,8 @@ class ServerStatus_test : public beast::unit_test::suite, public beast::test::en int const testTo = (limit == 0) ? 50 : limit + 1; while (connectionCount < testTo) { - clients.emplace_back(ip::tcp::socket{ios}, boost::beast::multi_buffer{}); + clients.emplace_back( + std::make_pair(ip::tcp::socket{ios}, boost::beast::multi_buffer{})); async_connect(clients.back().first, it, yield[ec]); BEAST_EXPECT(!ec); auto req = makeHTTPRequest(ip, port, to_string(jr), {}); @@ -1170,4 +1152,5 @@ public: BEAST_DEFINE_TESTSUITE(ServerStatus, server, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/server/Server_test.cpp b/src/test/server/Server_test.cpp index 462df0d707..97a822fd76 100644 --- a/src/test/server/Server_test.cpp +++ b/src/test/server/Server_test.cpp @@ -1,43 +1,29 @@ +#include #include -#include #include #include -#include #include +#include #include -#include -#include -#include -#include +#include #include #include -#include -#include -#include +#include #include -#include -#include -#include -#include #include #include -#include +#include #include -#include -#include #include -#include #include -#include #include -#include -#include -namespace xrpl::test { +namespace xrpl { +namespace test { using socket_type = boost::beast::tcp_stream; using stream_type = boost::beast::ssl_stream; @@ -515,4 +501,5 @@ public: BEAST_DEFINE_TESTSUITE(Server, server, xrpl); -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/shamap/FetchPack_test.cpp b/src/test/shamap/FetchPack_test.cpp index fd44423ba8..1cf7d97b33 100644 --- a/src/test/shamap/FetchPack_test.cpp +++ b/src/test/shamap/FetchPack_test.cpp @@ -1,34 +1,20 @@ #include #include -#include -#include -#include -#include #include #include #include -#include -#include +#include #include -#include #include #include -#include -#include #include -#include -#include - -#include -#include -#include -#include -#include +#include #include -namespace xrpl::tests { +namespace xrpl { +namespace tests { class FetchPack_test : public beast::unit_test::suite { @@ -165,4 +151,5 @@ public: BEAST_DEFINE_TESTSUITE(FetchPack, shamap, xrpl); -} // namespace xrpl::tests +} // namespace tests +} // namespace xrpl diff --git a/src/test/shamap/SHAMapSync_test.cpp b/src/test/shamap/SHAMapSync_test.cpp index a1db1875d3..6374e49e71 100644 --- a/src/test/shamap/SHAMapSync_test.cpp +++ b/src/test/shamap/SHAMapSync_test.cpp @@ -1,30 +1,14 @@ #include #include -#include -#include -#include -#include #include -#include +#include #include -#include #include #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::tests { +namespace xrpl { +namespace tests { class SHAMapSync_test : public beast::unit_test::suite { @@ -174,4 +158,5 @@ public: BEAST_DEFINE_TESTSUITE(SHAMapSync, shamap, xrpl); -} // namespace xrpl::tests +} // namespace tests +} // namespace xrpl diff --git a/src/test/shamap/SHAMap_test.cpp b/src/test/shamap/SHAMap_test.cpp index 8bbc4ae084..1c6d62be97 100644 --- a/src/test/shamap/SHAMap_test.cpp +++ b/src/test/shamap/SHAMap_test.cpp @@ -3,27 +3,12 @@ #include #include -#include -#include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::tests { +namespace xrpl { +namespace tests { #ifndef __INTELLISENSE__ static_assert(std::is_nothrow_destructible{}, ""); @@ -424,4 +409,5 @@ class SHAMapPathProof_test : public beast::unit_test::suite BEAST_DEFINE_TESTSUITE(SHAMap, shamap, xrpl); BEAST_DEFINE_TESTSUITE(SHAMapPathProof, shamap, xrpl); -} // namespace xrpl::tests +} // namespace tests +} // namespace xrpl diff --git a/src/test/shamap/common.h b/src/test/shamap/common.h index cd942076b8..8284051d44 100644 --- a/src/test/shamap/common.h +++ b/src/test/shamap/common.h @@ -5,7 +5,8 @@ #include #include -namespace xrpl::tests { +namespace xrpl { +namespace tests { class TestNodeFamily : public Family { @@ -102,4 +103,5 @@ public: } }; -} // namespace xrpl::tests +} // namespace tests +} // namespace xrpl diff --git a/src/test/unit_test/FileDirGuard.h b/src/test/unit_test/FileDirGuard.h index 9d4b94d8c5..b551b9389d 100644 --- a/src/test/unit_test/FileDirGuard.h +++ b/src/test/unit_test/FileDirGuard.h @@ -8,7 +8,8 @@ #include -namespace xrpl::detail { +namespace xrpl { +namespace detail { /** Create a directory and remove it when it's done @@ -29,14 +30,10 @@ protected: rmDir(path const& toRm) { if (is_directory(toRm) && is_empty(toRm)) - { remove(toRm); - } else - { test_.log << "Expected " << toRm.string() << " to be an empty existing directory." << std::endl; - } } public: @@ -54,9 +51,7 @@ public: rmSubDir_ = true; } else if (is_directory(subDir_)) - { rmSubDir_ = false; - } else { // Cannot run the test. Someone created a file where we want to @@ -134,10 +129,8 @@ public: else { if (created_) - { test_.log << "Expected " << file_.string() << " to be an existing file." << std::endl; - } } } catch (std::exception& e) @@ -160,4 +153,5 @@ public: } }; -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/src/test/unit_test/SuiteJournal.h b/src/test/unit_test/SuiteJournal.h index c3820b8709..93005401e6 100644 --- a/src/test/unit_test/SuiteJournal.h +++ b/src/test/unit_test/SuiteJournal.h @@ -3,7 +3,8 @@ #include #include -namespace xrpl::test { +namespace xrpl { +namespace test { // A Journal::Sink intended for use with the beast unit test framework. class SuiteJournalSink : public beast::Journal::Sink @@ -21,7 +22,7 @@ public: } // For unit testing, always generate logging text. - bool + inline bool active(beast::severities::Severity level) const override { return true; @@ -113,7 +114,7 @@ public: writeAlways(level, text); } - void + inline void writeAlways(beast::severities::Severity level, std::string const& text) override { strm_ << text << std::endl; @@ -126,4 +127,5 @@ public: } }; -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/test/unit_test/multi_runner.cpp b/src/test/unit_test/multi_runner.cpp index a09110ca43..e4fb1c4f45 100644 --- a/src/test/unit_test/multi_runner.cpp +++ b/src/test/unit_test/multi_runner.cpp @@ -1,29 +1,13 @@ #include #include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include #include #include -#include -#include #include -#include -#include -#include -#include #include namespace xrpl { @@ -64,7 +48,6 @@ results::add(suite_results const& r) auto const elapsed = clock_type::now() - r.start; if (elapsed >= std::chrono::seconds{1}) { - // NOLINTNEXTLINE(modernize-use-ranges) auto const iter = std::lower_bound( top.begin(), top.end(), @@ -105,9 +88,13 @@ results::merge(results const& r) // combine the two top collections boost::container::static_vector top_result; top_result.resize(top.size() + r.top.size()); - std::ranges::merge(top, r.top, top_result.begin(), [](run_time const& t1, run_time const& t2) { - return t1.second > t2.second; - }); + std::merge( + top.begin(), + top.end(), + r.top.begin(), + r.top.end(), + top_result.begin(), + [](run_time const& t1, run_time const& t2) { return t1.second > t2.second; }); if (top_result.size() > max_top) top_result.resize(max_top); diff --git a/src/test/unit_test/multi_runner.h b/src/test/unit_test/multi_runner.h index 86d4699017..2eda4e66a0 100644 --- a/src/test/unit_test/multi_runner.h +++ b/src/test/unit_test/multi_runner.h @@ -252,7 +252,7 @@ public: operator=(multi_runner_child const&) = delete; multi_runner_child(std::size_t num_jobs, bool quiet, bool print_log); - ~multi_runner_child() override; + ~multi_runner_child(); std::size_t tests() const; @@ -268,25 +268,25 @@ public: run_multi(Pred pred); private: - void + virtual void on_suite_begin(beast::unit_test::suite_info const& info) override; - void + virtual void on_suite_end() override; - void + virtual void on_case_begin(std::string const& name) override; - void + virtual void on_case_end() override; - void + virtual void on_pass() override; - void + virtual void on_fail(std::string const& reason) override; - void + virtual void on_log(std::string const& s) override; }; diff --git a/src/test/unit_test/utils.h b/src/test/unit_test/utils.h index d386818e10..1f6ee58436 100644 --- a/src/test/unit_test/utils.h +++ b/src/test/unit_test/utils.h @@ -2,7 +2,8 @@ #include -namespace xrpl::test { +namespace xrpl { +namespace test { /// Compare two SecretKey objects for equality. /// SecretKey::operator== is deleted, so a named function is used @@ -14,4 +15,5 @@ equal(SecretKey const& lhs, SecretKey const& rhs) std::memcmp(lhs.data(), rhs.data(), SecretKey::size_) == 0; } -} // namespace xrpl::test +} // namespace test +} // namespace xrpl diff --git a/src/tests/libxrpl/CMakeLists.txt b/src/tests/libxrpl/CMakeLists.txt index 0b666441d1..a82ed1472f 100644 --- a/src/tests/libxrpl/CMakeLists.txt +++ b/src/tests/libxrpl/CMakeLists.txt @@ -32,9 +32,20 @@ xrpl_add_test(json) target_link_libraries(xrpl.test.json PRIVATE xrpl.imports.test) add_dependencies(xrpl.tests xrpl.test.json) -xrpl_add_test(protocol_autogen) +# protocol_autogen tests use explicit source list (not GLOB) because sources are generated +# Mark generated sources so CMake knows they'll be created at build time +set_source_files_properties( + ${PROTOCOL_AUTOGEN_TEST_SOURCES} + PROPERTIES GENERATED TRUE +) +add_executable(xrpl.test.protocol_autogen ${PROTOCOL_AUTOGEN_TEST_SOURCES}) target_link_libraries(xrpl.test.protocol_autogen PRIVATE xrpl.imports.test) add_dependencies(xrpl.tests xrpl.test.protocol_autogen) +add_test(NAME xrpl.test.protocol_autogen COMMAND xrpl.test.protocol_autogen) +# Ensure code generation runs before compiling tests +if(TARGET protocol_autogen_generate) + add_dependencies(xrpl.test.protocol_autogen protocol_autogen_generate) +endif() # Network unit tests are currently not supported on Windows if(NOT WIN32) diff --git a/src/tests/libxrpl/basics/MallocTrim.cpp b/src/tests/libxrpl/basics/MallocTrim.cpp index 7c72cd6781..93ed48b885 100644 --- a/src/tests/libxrpl/basics/MallocTrim.cpp +++ b/src/tests/libxrpl/basics/MallocTrim.cpp @@ -1,13 +1,9 @@ #include -#include - #include #include -#include - using namespace xrpl; // cSpell:ignore statm diff --git a/src/tests/libxrpl/basics/Mutex.cpp b/src/tests/libxrpl/basics/Mutex.cpp index e91781c463..9f58799fe7 100644 --- a/src/tests/libxrpl/basics/Mutex.cpp +++ b/src/tests/libxrpl/basics/Mutex.cpp @@ -6,8 +6,6 @@ #include #include #include -#include -#include #include using namespace xrpl; diff --git a/src/tests/libxrpl/basics/RangeSet.cpp b/src/tests/libxrpl/basics/RangeSet.cpp index 1d5d2391f8..41a33133f2 100644 --- a/src/tests/libxrpl/basics/RangeSet.cpp +++ b/src/tests/libxrpl/basics/RangeSet.cpp @@ -1,8 +1,5 @@ #include -#include -#include - #include #include diff --git a/src/tests/libxrpl/basics/Slice.cpp b/src/tests/libxrpl/basics/Slice.cpp index b7ef9f6a33..72f2d081c7 100644 --- a/src/tests/libxrpl/basics/Slice.cpp +++ b/src/tests/libxrpl/basics/Slice.cpp @@ -3,7 +3,6 @@ #include #include -#include #include using namespace xrpl; diff --git a/src/tests/libxrpl/basics/contract.cpp b/src/tests/libxrpl/basics/contract.cpp index 721aa19fd3..d9b729e85d 100644 --- a/src/tests/libxrpl/basics/contract.cpp +++ b/src/tests/libxrpl/basics/contract.cpp @@ -3,6 +3,7 @@ #include #include +#include using namespace xrpl; diff --git a/src/tests/libxrpl/basics/scope.cpp b/src/tests/libxrpl/basics/scope.cpp index a13bab30df..067698bce4 100644 --- a/src/tests/libxrpl/basics/scope.cpp +++ b/src/tests/libxrpl/basics/scope.cpp @@ -2,8 +2,6 @@ #include -#include - using namespace xrpl; TEST(scope, scope_exit) diff --git a/src/tests/libxrpl/basics/tagged_integer.cpp b/src/tests/libxrpl/basics/tagged_integer.cpp index 53e0ddc1d9..85a246428b 100644 --- a/src/tests/libxrpl/basics/tagged_integer.cpp +++ b/src/tests/libxrpl/basics/tagged_integer.cpp @@ -2,7 +2,6 @@ #include -#include #include using namespace xrpl; @@ -22,85 +21,85 @@ using TagUInt3 = tagged_integer; // Check construction of tagged_integers static_assert( - std::is_constructible_v, + std::is_constructible::value, "TagUInt1 should be constructible using a std::uint32_t"); static_assert( - !std::is_constructible_v, + !std::is_constructible::value, "TagUInt1 should not be constructible using a std::uint64_t"); static_assert( - std::is_constructible_v, + std::is_constructible::value, "TagUInt3 should be constructible using a std::uint32_t"); static_assert( - std::is_constructible_v, + std::is_constructible::value, "TagUInt3 should be constructible using a std::uint64_t"); // Check assignment of tagged_integers static_assert( - !std::is_assignable_v, + !std::is_assignable::value, "TagUInt1 should not be assignable with a std::uint32_t"); static_assert( - !std::is_assignable_v, + !std::is_assignable::value, "TagUInt1 should not be assignable with a std::uint64_t"); static_assert( - !std::is_assignable_v, + !std::is_assignable::value, "TagUInt3 should not be assignable with a std::uint32_t"); static_assert( - !std::is_assignable_v, + !std::is_assignable::value, "TagUInt3 should not be assignable with a std::uint64_t"); static_assert( - std::is_assignable_v, + std::is_assignable::value, "TagUInt1 should be assignable with a TagUInt1"); static_assert( - !std::is_assignable_v, + !std::is_assignable::value, "TagUInt1 should not be assignable with a TagUInt2"); static_assert( - std::is_assignable_v, + std::is_assignable::value, "TagUInt3 should be assignable with a TagUInt1"); static_assert( - !std::is_assignable_v, + !std::is_assignable::value, "TagUInt1 should not be assignable with a TagUInt3"); static_assert( - !std::is_assignable_v, + !std::is_assignable::value, "TagUInt3 should not be assignable with a TagUInt1"); // Check convertibility of tagged_integers static_assert( - !std::is_convertible_v, + !std::is_convertible::value, "std::uint32_t should not be convertible to a TagUInt1"); static_assert( - !std::is_convertible_v, + !std::is_convertible::value, "std::uint32_t should not be convertible to a TagUInt3"); static_assert( - !std::is_convertible_v, + !std::is_convertible::value, "std::uint64_t should not be convertible to a TagUInt3"); static_assert( - !std::is_convertible_v, + !std::is_convertible::value, "std::uint64_t should not be convertible to a TagUInt2"); static_assert( - !std::is_convertible_v, + !std::is_convertible::value, "TagUInt1 should not be convertible to TagUInt2"); static_assert( - !std::is_convertible_v, + !std::is_convertible::value, "TagUInt1 should not be convertible to TagUInt3"); static_assert( - !std::is_convertible_v, + !std::is_convertible::value, "TagUInt2 should not be convertible to a TagUInt3"); using TagInt = tagged_integer; diff --git a/src/tests/libxrpl/crypto/csprng.cpp b/src/tests/libxrpl/crypto/csprng.cpp index 4a383cae62..41dcfd57a9 100644 --- a/src/tests/libxrpl/crypto/csprng.cpp +++ b/src/tests/libxrpl/crypto/csprng.cpp @@ -2,8 +2,6 @@ #include -#include - using namespace xrpl; TEST(csprng, get_values) diff --git a/src/tests/libxrpl/helpers/TestSink.cpp b/src/tests/libxrpl/helpers/TestSink.cpp index 3b138edfd8..17cc110429 100644 --- a/src/tests/libxrpl/helpers/TestSink.cpp +++ b/src/tests/libxrpl/helpers/TestSink.cpp @@ -1,11 +1,8 @@ -#include - -#include - #include +#include + #include // for getenv -#include #if BOOST_OS_WINDOWS #include // for _isatty, _fileno diff --git a/src/tests/libxrpl/json/Output.cpp b/src/tests/libxrpl/json/Output.cpp index bc26c068ca..96d7369d51 100644 --- a/src/tests/libxrpl/json/Output.cpp +++ b/src/tests/libxrpl/json/Output.cpp @@ -1,5 +1,4 @@ #include - #include #include diff --git a/src/tests/libxrpl/json/Value.cpp b/src/tests/libxrpl/json/Value.cpp index a53d81b5e1..194c677024 100644 --- a/src/tests/libxrpl/json/Value.cpp +++ b/src/tests/libxrpl/json/Value.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -8,15 +7,10 @@ #include #include -#include -#include -#include -#include -#include +#include #include #include #include -#include namespace xrpl { @@ -1105,7 +1099,7 @@ TEST(json_value, access_members) EXPECT_FALSE(val.isValidIndex(0)); EXPECT_FALSE(val.isMember("key")); - val = std::numbers::pi; + val = 3.14159; EXPECT_EQ(val.type(), Json::realValue); EXPECT_EQ(val.size(), 0); EXPECT_FALSE(val.isValidIndex(0)); diff --git a/src/tests/libxrpl/json/Writer.cpp b/src/tests/libxrpl/json/Writer.cpp index a21f27199f..7016b4322d 100644 --- a/src/tests/libxrpl/json/Writer.cpp +++ b/src/tests/libxrpl/json/Writer.cpp @@ -1,8 +1,6 @@ #include -#include -#include - +#include #include #include diff --git a/src/tests/libxrpl/net/HTTPClient.cpp b/src/tests/libxrpl/net/HTTPClient.cpp index d3dfd32361..de567a93ab 100644 --- a/src/tests/libxrpl/net/HTTPClient.cpp +++ b/src/tests/libxrpl/net/HTTPClient.cpp @@ -1,29 +1,24 @@ +#include #include -#include -#include -#include - -#include -#include // IWYU pragma: keep +#include +#include #include -#include #include -#include #include -#include // IWYU pragma: keep -#include // IWYU pragma: keep -#include // IWYU pragma: keep +#include +#include +#include +#include #include #include -#include -#include +#include #include -#include -#include -#include +#include +#include +#include using namespace xrpl; diff --git a/src/xrpld/app/consensus/RCLConsensus.cpp b/src/xrpld/app/consensus/RCLConsensus.cpp index 6d99c2ee15..b7b0919aad 100644 --- a/src/xrpld/app/consensus/RCLConsensus.cpp +++ b/src/xrpld/app/consensus/RCLConsensus.cpp @@ -1,88 +1,34 @@ #include - -#include -#include -#include -#include #include #include -#include #include #include #include #include #include -#include #include #include #include #include -#include -#include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include #include -#include -#include -#include -#include #include -#include #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include #include #include -#include -#include -#include - -#include - -#include #include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/consensus/RCLCxPeerPos.cpp b/src/xrpld/app/consensus/RCLCxPeerPos.cpp index 7cc2ab8b90..8f99dceea8 100644 --- a/src/xrpld/app/consensus/RCLCxPeerPos.cpp +++ b/src/xrpld/app/consensus/RCLCxPeerPos.cpp @@ -1,16 +1,7 @@ #include -#include -#include -#include -#include -#include -#include #include #include -#include - -#include namespace xrpl { diff --git a/src/xrpld/app/consensus/RCLCxPeerPos.h b/src/xrpld/app/consensus/RCLCxPeerPos.h index f5d3f0e8f0..e334320826 100644 --- a/src/xrpld/app/consensus/RCLCxPeerPos.h +++ b/src/xrpld/app/consensus/RCLCxPeerPos.h @@ -95,7 +95,7 @@ private: { using beast::hash_append; hash_append(h, HashPrefix::proposal); - hash_append(h, proposal().proposeSeq()); + hash_append(h, std::uint32_t(proposal().proposeSeq())); hash_append(h, proposal().closeTime()); hash_append(h, proposal().prevLedger()); hash_append(h, proposal().position()); diff --git a/src/xrpld/app/consensus/RCLValidations.cpp b/src/xrpld/app/consensus/RCLValidations.cpp index b969774954..7bc16f194e 100644 --- a/src/xrpld/app/consensus/RCLValidations.cpp +++ b/src/xrpld/app/consensus/RCLValidations.cpp @@ -1,28 +1,16 @@ #include - #include #include #include #include #include -#include #include -#include #include -#include -#include #include #include -#include -#include -#include -#include -#include -#include #include -#include namespace xrpl { diff --git a/src/xrpld/app/ledger/AcceptedLedger.cpp b/src/xrpld/app/ledger/AcceptedLedger.cpp index f866a5f3bc..1da70702bf 100644 --- a/src/xrpld/app/ledger/AcceptedLedger.cpp +++ b/src/xrpld/app/ledger/AcceptedLedger.cpp @@ -1,10 +1,6 @@ #include -#include -#include - #include -#include namespace xrpl { @@ -23,7 +19,7 @@ AcceptedLedger::AcceptedLedger(std::shared_ptr const& ledger) : transactions_.reserve(256); insertAll(ledger->txs); - std::ranges::sort(transactions_, [](auto const& a, auto const& b) { + std::sort(transactions_.begin(), transactions_.end(), [](auto const& a, auto const& b) { return a->getTxnSeq() < b->getTxnSeq(); }); } diff --git a/src/xrpld/app/ledger/AccountStateSF.cpp b/src/xrpld/app/ledger/AccountStateSF.cpp index d5fa5d83ff..79c1f0eaf6 100644 --- a/src/xrpld/app/ledger/AccountStateSF.cpp +++ b/src/xrpld/app/ledger/AccountStateSF.cpp @@ -1,14 +1,5 @@ #include -#include -#include -#include -#include - -#include -#include -#include - namespace xrpl { void diff --git a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp index d42ff0a9e0..5fd614a1d9 100644 --- a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp +++ b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp @@ -1,25 +1,12 @@ #include - #include #include -#include -#include -#include -#include -#include #include +#include #include -#include -#include // IWYU pragma: keep +#include #include -#include - -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/ledger/InboundLedger.h b/src/xrpld/app/ledger/InboundLedger.h index 4176aa0b09..b17b59b27f 100644 --- a/src/xrpld/app/ledger/InboundLedger.h +++ b/src/xrpld/app/ledger/InboundLedger.h @@ -36,7 +36,7 @@ public: clock_type&, std::unique_ptr peerSet); - ~InboundLedger() override; + ~InboundLedger(); // Called when another attempt is made to fetch this same ledger void diff --git a/src/xrpld/app/ledger/LedgerCleaner.h b/src/xrpld/app/ledger/LedgerCleaner.h index a5ad4f981b..aa8d042c24 100644 --- a/src/xrpld/app/ledger/LedgerCleaner.h +++ b/src/xrpld/app/ledger/LedgerCleaner.h @@ -17,7 +17,7 @@ protected: } public: - ~LedgerCleaner() override = default; + virtual ~LedgerCleaner() = default; virtual void start() = 0; diff --git a/src/xrpld/app/ledger/LedgerHistory.cpp b/src/xrpld/app/ledger/LedgerHistory.cpp index 8fd2e075c6..969511db4c 100644 --- a/src/xrpld/app/ledger/LedgerHistory.cpp +++ b/src/xrpld/app/ledger/LedgerHistory.cpp @@ -1,33 +1,11 @@ #include - #include #include #include -#include -#include -#include #include #include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -305,8 +283,9 @@ leaves(SHAMap const& sm) std::vector v; for (auto const& item : sm) v.push_back(&item); - std::ranges::sort( - v, [](SHAMapItem const* lhs, SHAMapItem const* rhs) { return lhs->key() < rhs->key(); }); + std::sort(v.begin(), v.end(), [](SHAMapItem const* lhs, SHAMapItem const* rhs) { + return lhs->key() < rhs->key(); + }); return v; } diff --git a/src/xrpld/app/ledger/LedgerMaster.h b/src/xrpld/app/ledger/LedgerMaster.h index 1bd4530d6d..e598787047 100644 --- a/src/xrpld/app/ledger/LedgerMaster.h +++ b/src/xrpld/app/ledger/LedgerMaster.h @@ -38,7 +38,7 @@ public: beast::insight::Collector::ptr const& collector, beast::Journal journal); - ~LedgerMaster() override = default; + virtual ~LedgerMaster() = default; LedgerIndex getCurrentLedgerIndex(); @@ -363,7 +363,7 @@ private: LedgerIndex const max_ledger_difference_{1000000}; // Time that the previous upgrade warning was issued. - TimeKeeper::time_point upgradeWarningPrevTime_; + TimeKeeper::time_point upgradeWarningPrevTime_{}; private: struct Stats diff --git a/src/xrpld/app/ledger/LedgerReplayTask.h b/src/xrpld/app/ledger/LedgerReplayTask.h index 65c43edb2d..030121b240 100644 --- a/src/xrpld/app/ledger/LedgerReplayTask.h +++ b/src/xrpld/app/ledger/LedgerReplayTask.h @@ -31,8 +31,8 @@ public: // to be updated std::uint32_t finishSeq_ = 0; - std::vector skipList_; // including the finishHash - uint256 startHash_; + std::vector skipList_ = {}; // including the finishHash + uint256 startHash_ = {}; std::uint32_t startSeq_ = 0; bool full_ = false; @@ -80,7 +80,7 @@ public: std::shared_ptr& skipListAcquirer, TaskParameter const& parameter); - ~LedgerReplayTask() override; + ~LedgerReplayTask(); /** Start the task */ void @@ -146,7 +146,7 @@ private: TaskParameter parameter_; uint32_t maxTimeouts_; std::shared_ptr skipListAcquirer_; - std::shared_ptr parent_; + std::shared_ptr parent_ = {}; uint32_t deltaToBuild_ = 0; // should not build until have parent std::vector> deltas_; diff --git a/src/xrpld/app/ledger/LedgerToJson.h b/src/xrpld/app/ledger/LedgerToJson.h index 53985f343b..3686311656 100644 --- a/src/xrpld/app/ledger/LedgerToJson.h +++ b/src/xrpld/app/ledger/LedgerToJson.h @@ -19,7 +19,7 @@ struct LedgerFill std::vector q = {}) : ledger(l), options(o), txQueue(std::move(q)), context(ctx) { - if (context != nullptr) + if (context) closeTime = context->ledgerMaster.getCloseTimeBySeq(ledger.seq()); } diff --git a/src/xrpld/app/ledger/OrderBookDBImpl.cpp b/src/xrpld/app/ledger/OrderBookDBImpl.cpp index 1c64c5e6fa..1a764d952f 100644 --- a/src/xrpld/app/ledger/OrderBookDBImpl.cpp +++ b/src/xrpld/app/ledger/OrderBookDBImpl.cpp @@ -1,34 +1,10 @@ +#include #include -#include - -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/ledger/TransactionStateSF.cpp b/src/xrpld/app/ledger/TransactionStateSF.cpp index e2ec3ca7b6..11d3c83058 100644 --- a/src/xrpld/app/ledger/TransactionStateSF.cpp +++ b/src/xrpld/app/ledger/TransactionStateSF.cpp @@ -1,15 +1,5 @@ #include -#include -#include -#include -#include -#include - -#include -#include -#include - namespace xrpl { void diff --git a/src/xrpld/app/ledger/detail/BuildLedger.cpp b/src/xrpld/app/ledger/detail/BuildLedger.cpp index 8f5184336a..3b48ab13c5 100644 --- a/src/xrpld/app/ledger/detail/BuildLedger.cpp +++ b/src/xrpld/app/ledger/detail/BuildLedger.cpp @@ -1,27 +1,13 @@ #include - #include #include #include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include - namespace xrpl { /* Generic buildLedgerImpl that dispatches to ApplyTxs invocable with signature diff --git a/src/xrpld/app/ledger/detail/InboundLedger.cpp b/src/xrpld/app/ledger/detail/InboundLedger.cpp index a65fae2ff3..2402b5b561 100644 --- a/src/xrpld/app/ledger/detail/InboundLedger.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedger.cpp @@ -1,53 +1,21 @@ -#include - #include +#include #include #include #include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include -#include #include #include #include -#include #include -#include - #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -96,7 +64,7 @@ InboundLedger::InboundLedger( app, hash, ledgerAcquireTimeout, - {.jobType = jtLEDGER_DATA, .jobName = "InboundLedger", .jobLimit = 5}, + {jtLEDGER_DATA, "InboundLedger", 5}, app.getJournal("InboundLedger")) , m_clock(clock) , mSeq(seq) @@ -554,7 +522,7 @@ InboundLedger::trigger(std::shared_ptr const& peer, TriggerReason reason) auto packet = std::make_shared(tmBH, protocol::mtGET_OBJECTS); auto const& peerIds = mPeerSet->getPeerIds(); - std::ranges::for_each(peerIds, [this, &packet](auto id) { + std::for_each(peerIds.begin(), peerIds.end(), [this, &packet](auto id) { if (auto p = app_.getOverlay().findPeerByShortID(id)) { mByHash = false; @@ -756,13 +724,14 @@ InboundLedger::filterNodes( { // Sort nodes so that the ones we haven't recently // requested come before the ones we have. - auto dup = std::ranges::stable_partition( - nodes, [this](auto const& item) { return mRecentNodes.count(item.second) == 0; }); + auto dup = std::stable_partition(nodes.begin(), nodes.end(), [this](auto const& item) { + return mRecentNodes.count(item.second) == 0; + }); // If everything is a duplicate we don't want to send // any query at all except on a timeout where we need // to query everyone: - if (dup.begin() == nodes.begin()) + if (dup == nodes.begin()) { JLOG(journal_.trace()) << "filterNodes: all duplicates"; @@ -776,7 +745,7 @@ InboundLedger::filterNodes( { JLOG(journal_.trace()) << "filterNodes: pruning duplicates"; - nodes.erase(dup.begin(), dup.end()); + nodes.erase(dup, nodes.end()); } std::size_t const limit = (reason == TriggerReason::reply) ? reqNodesReply : reqNodes; @@ -988,7 +957,7 @@ InboundLedger::getNeededHashes() if (!mHaveHeader) { - ret.emplace_back(protocol::TMGetObjectByHash::otLEDGER, hash_); + ret.push_back(std::make_pair(protocol::TMGetObjectByHash::otLEDGER, hash_)); return ret; } @@ -997,7 +966,7 @@ InboundLedger::getNeededHashes() AccountStateSF filter(mLedger->stateMap().family().db(), app_.getLedgerMaster()); for (auto const& h : neededStateHashes(4, &filter)) { - ret.emplace_back(protocol::TMGetObjectByHash::otSTATE_NODE, h); + ret.push_back(std::make_pair(protocol::TMGetObjectByHash::otSTATE_NODE, h)); } } @@ -1006,7 +975,7 @@ InboundLedger::getNeededHashes() TransactionStateSF filter(mLedger->txMap().family().db(), app_.getLedgerMaster()); for (auto const& h : neededTxHashes(4, &filter)) { - ret.emplace_back(protocol::TMGetObjectByHash::otTRANSACTION_NODE, h); + ret.push_back(std::make_pair(protocol::TMGetObjectByHash::otTRANSACTION_NODE, h)); } } diff --git a/src/xrpld/app/ledger/detail/InboundLedgers.cpp b/src/xrpld/app/ledger/detail/InboundLedgers.cpp index 2207308737..f147a35ca4 100644 --- a/src/xrpld/app/ledger/detail/InboundLedgers.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedgers.cpp @@ -1,43 +1,18 @@ #include - -#include #include #include -#include -#include #include -#include -#include -#include -#include #include #include -#include -#include -#include -#include #include #include -#include -#include -#include #include #include -#include -#include - -#include -#include -#include #include -#include #include #include -#include -#include -#include #include namespace xrpl { @@ -311,7 +286,7 @@ public: for (auto const& it : mLedgers) { XRPL_ASSERT(it.second, "xrpl::InboundLedgersImp::getInfo : non-null ledger"); - acqs.emplace_back(it); + acqs.push_back(it); } for (auto const& it : mRecentFailures) { diff --git a/src/xrpld/app/ledger/detail/InboundTransactions.cpp b/src/xrpld/app/ledger/detail/InboundTransactions.cpp index 56c9c633f4..cc3585a3fb 100644 --- a/src/xrpld/app/ledger/detail/InboundTransactions.cpp +++ b/src/xrpld/app/ledger/detail/InboundTransactions.cpp @@ -1,29 +1,16 @@ +#include #include - #include #include -#include -#include -#include -#include -#include +#include #include #include #include -#include -#include -#include - -#include #include -#include -#include #include #include -#include -#include namespace xrpl { @@ -163,7 +150,7 @@ public: return; } - data.emplace_back(*id, makeSlice(node.nodedata())); + data.emplace_back(std::make_pair(*id, makeSlice(node.nodedata()))); } if (!ta->takeNodes(data, peer).isUseful()) diff --git a/src/xrpld/app/ledger/detail/LedgerCleaner.cpp b/src/xrpld/app/ledger/detail/LedgerCleaner.cpp index 850b60f4ed..a0d168f299 100644 --- a/src/xrpld/app/ledger/detail/LedgerCleaner.cpp +++ b/src/xrpld/app/ledger/detail/LedgerCleaner.cpp @@ -1,34 +1,12 @@ -#include - -#include #include +#include #include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include - -#include -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp index 0ff9a0ed98..f829e58830 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.cpp @@ -1,34 +1,12 @@ -#include - #include #include #include #include -#include +#include #include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -42,9 +20,7 @@ LedgerDeltaAcquire::LedgerDeltaAcquire( app, ledgerHash, LedgerReplayParameters::SUB_TASK_TIMEOUT, - {.jobType = jtREPLAY_TASK, - .jobName = "LedReplDelta", - .jobLimit = LedgerReplayParameters::MAX_QUEUED_TASKS}, + {jtREPLAY_TASK, "LedReplDelta", LedgerReplayParameters::MAX_QUEUED_TASKS}, app.getJournal("LedgerReplayDelta")) , inboundLedgers_(inboundLedgers) , ledgerSeq_(ledgerSeq) diff --git a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h index 6839c44386..9ac58c2e7c 100644 --- a/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h +++ b/src/xrpld/app/ledger/detail/LedgerDeltaAcquire.h @@ -125,8 +125,8 @@ private: InboundLedgers& inboundLedgers_; std::uint32_t const ledgerSeq_; std::unique_ptr peerSet_; - std::shared_ptr replayTemp_; - std::shared_ptr fullLedger_; + std::shared_ptr replayTemp_ = {}; + std::shared_ptr fullLedger_ = {}; std::map> orderedTxns_; std::vector dataReadyCallbacks_; std::set reasons_; diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index 880e8e9e38..b9305b743f 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -1,9 +1,6 @@ -#include - #include -#include +#include #include -#include #include #include #include @@ -11,71 +8,33 @@ #include #include #include -#include #include #include #include #include -#include #include -#include -#include -#include #include -#include -#include #include #include #include -#include -#include -#include #include -#include -#include #include #include #include #include -#include -#include #include #include -#include -#include -#include -#include -#include #include #include #include #include #include -#include -#include -#include - -#include - -#include #include -#include #include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include namespace xrpl { @@ -272,7 +231,7 @@ LedgerMaster::setValidLedger(std::shared_ptr const& l) if (!times.empty() && times.size() >= app_.getValidators().quorum()) { // Calculate the sample median - std::ranges::sort(times); + std::sort(times.begin(), times.end()); auto const t0 = times[(times.size() - 1) / 2]; auto const t1 = times[times.size() / 2]; signTime = t0 + (t1 - t0) / 2; @@ -983,12 +942,12 @@ LedgerMaster::checkAccept(std::shared_ptr const& ledger) { auto fees2 = app_.getValidations().fees(ledger->header().parentHash, base); fees.reserve(fees.size() + fees2.size()); - std::ranges::copy(fees2, std::back_inserter(fees)); + std::copy(fees2.begin(), fees2.end(), std::back_inserter(fees)); } std::uint32_t fee = 0; if (!fees.empty()) { - std::ranges::sort(fees); + std::sort(fees.begin(), fees.end()); if (auto stream = m_journal.debug()) { std::stringstream s; diff --git a/src/xrpld/app/ledger/detail/LedgerPersistence.cpp b/src/xrpld/app/ledger/detail/LedgerPersistence.cpp index 0edf425f13..91de010f1d 100644 --- a/src/xrpld/app/ledger/detail/LedgerPersistence.cpp +++ b/src/xrpld/app/ledger/detail/LedgerPersistence.cpp @@ -1,22 +1,14 @@ #include -#include -#include #include #include -#include #include #include +#include #include -#include +#include #include -#include -#include -#include -#include -#include - namespace xrpl { static bool diff --git a/src/xrpld/app/ledger/detail/LedgerReplay.cpp b/src/xrpld/app/ledger/detail/LedgerReplay.cpp index 925ede6d27..a02267e4a1 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplay.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplay.cpp @@ -1,12 +1,6 @@ #include #include -#include - -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp index 9facb24c9d..93d7ac0d2f 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayMsgHandler.cpp @@ -1,35 +1,12 @@ -#include - #include #include +#include #include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include #include -#include -#include -#include namespace xrpl { LedgerReplayMsgHandler::LedgerReplayMsgHandler(Application& app, LedgerReplayer& replayer) diff --git a/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp b/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp index 1afe94bbc8..f393c7fca8 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayTask.cpp @@ -1,23 +1,8 @@ -#include - -#include #include +#include #include #include #include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include namespace xrpl { @@ -67,7 +52,7 @@ LedgerReplayTask::TaskParameter::canMergeInto(TaskParameter const& existingTask) if (existingTask.full_) { auto const& exList = existingTask.skipList_; - if (auto i = std::ranges::find(exList, finishHash_); i != exList.end()) + if (auto i = std::find(exList.begin(), exList.end(), finishHash_); i != exList.end()) { return existingTask.totalLedgers_ >= totalLedgers_ + (exList.end() - i) - 1; } @@ -87,9 +72,7 @@ LedgerReplayTask::LedgerReplayTask( app, parameter.finishHash_, LedgerReplayParameters::TASK_TIMEOUT, - {.jobType = jtREPLAY_TASK, - .jobName = "LedReplTask", - .jobLimit = LedgerReplayParameters::MAX_QUEUED_TASKS}, + {jtREPLAY_TASK, "LedReplTask", LedgerReplayParameters::MAX_QUEUED_TASKS}, app.getJournal("LedgerReplayTask")) , inboundLedgers_(inboundLedgers) , replayer_(replayer) diff --git a/src/xrpld/app/ledger/detail/LedgerReplayer.cpp b/src/xrpld/app/ledger/detail/LedgerReplayer.cpp index 7779132b39..ae3552f258 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayer.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayer.cpp @@ -1,28 +1,6 @@ #include - -#include -#include #include #include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -119,7 +97,8 @@ LedgerReplayer::createDeltas(std::shared_ptr task) JLOG(j_.trace()) << "Creating " << parameter.totalLedgers_ - 1 << " deltas"; if (parameter.totalLedgers_ > 1) { - auto skipListItem = std::ranges::find(parameter.skipList_, parameter.startHash_); + auto skipListItem = + std::find(parameter.skipList_.begin(), parameter.skipList_.end(), parameter.startHash_); auto const wasLast = skipListItem == parameter.skipList_.end(); if (not wasLast) ++skipListItem; @@ -218,9 +197,9 @@ LedgerReplayer::sweep() << skipLists_.size() << " skipLists, and " << deltas_.size() << " deltas."; tasks_.erase( - std::ranges::remove_if( - tasks_, - + std::remove_if( + tasks_.begin(), + tasks_.end(), [this](auto const& t) -> bool { if (t->finished()) { @@ -228,8 +207,7 @@ LedgerReplayer::sweep() return true; } return false; - }) - .begin(), + }), tasks_.end()); auto removeCannotLocked = [](auto& subTasks) { @@ -261,7 +239,7 @@ LedgerReplayer::stop() JLOG(j_.info()) << "Stopping..."; { std::lock_guard const lock(mtx_); - std::ranges::for_each(tasks_, [](auto& i) { i->cancel(); }); + std::for_each(tasks_.begin(), tasks_.end(), [](auto& i) { i->cancel(); }); tasks_.clear(); auto lockAndCancel = [](auto& i) { if (auto sptr = i.second.lock(); sptr) @@ -269,9 +247,9 @@ LedgerReplayer::stop() sptr->cancel(); } }; - std::ranges::for_each(skipLists_, lockAndCancel); + std::for_each(skipLists_.begin(), skipLists_.end(), lockAndCancel); skipLists_.clear(); - std::ranges::for_each(deltas_, lockAndCancel); + std::for_each(deltas_.begin(), deltas_.end(), lockAndCancel); deltas_.clear(); } diff --git a/src/xrpld/app/ledger/detail/LedgerToJson.cpp b/src/xrpld/app/ledger/detail/LedgerToJson.cpp index 8ba45fb515..a48756f9b6 100644 --- a/src/xrpld/app/ledger/detail/LedgerToJson.cpp +++ b/src/xrpld/app/ledger/detail/LedgerToJson.cpp @@ -1,35 +1,15 @@ -#include - #include +#include #include #include #include #include #include -#include #include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include - -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/ledger/detail/LocalTxs.cpp b/src/xrpld/app/ledger/detail/LocalTxs.cpp index 5326568e35..38969a092c 100644 --- a/src/xrpld/app/ledger/detail/LocalTxs.cpp +++ b/src/xrpld/app/ledger/detail/LocalTxs.cpp @@ -1,19 +1,7 @@ #include -#include -#include -#include -#include +#include #include -#include -#include -#include - -#include -#include -#include -#include -#include /* This code prevents scenarios like the following: diff --git a/src/xrpld/app/ledger/detail/OpenLedger.cpp b/src/xrpld/app/ledger/detail/OpenLedger.cpp index 5db4e23e1e..dfce2278a5 100644 --- a/src/xrpld/app/ledger/detail/OpenLedger.cpp +++ b/src/xrpld/app/ledger/detail/OpenLedger.cpp @@ -1,39 +1,17 @@ #include - #include #include #include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include #include #include -#include - -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { OpenLedger::OpenLedger( diff --git a/src/xrpld/app/ledger/detail/SkipListAcquire.cpp b/src/xrpld/app/ledger/detail/SkipListAcquire.cpp index c77c0f1b03..20d63bcb64 100644 --- a/src/xrpld/app/ledger/detail/SkipListAcquire.cpp +++ b/src/xrpld/app/ledger/detail/SkipListAcquire.cpp @@ -1,30 +1,9 @@ -#include - #include #include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include - namespace xrpl { SkipListAcquire::SkipListAcquire( @@ -36,9 +15,7 @@ SkipListAcquire::SkipListAcquire( app, ledgerHash, LedgerReplayParameters::SUB_TASK_TIMEOUT, - {.jobType = jtREPLAY_TASK, - .jobName = "SkipListAcq", - .jobLimit = LedgerReplayParameters::MAX_QUEUED_TASKS}, + {jtREPLAY_TASK, "SkipListAcq", LedgerReplayParameters::MAX_QUEUED_TASKS}, app.getJournal("LedgerReplaySkipList")) , inboundLedgers_(inboundLedgers) , peerSet_(std::move(peerSet)) diff --git a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp index 9cf58bee47..216771e60d 100644 --- a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp +++ b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp @@ -1,19 +1,7 @@ #include -#include - -#include -#include -#include -#include #include -#include -#include - -#include -#include - namespace xrpl { using namespace std::chrono_literals; diff --git a/src/xrpld/app/ledger/detail/TransactionAcquire.cpp b/src/xrpld/app/ledger/detail/TransactionAcquire.cpp index b38c413344..d2561718a3 100644 --- a/src/xrpld/app/ledger/detail/TransactionAcquire.cpp +++ b/src/xrpld/app/ledger/detail/TransactionAcquire.cpp @@ -1,28 +1,13 @@ -#include - #include +#include #include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include - -#include #include -#include -#include #include -#include -#include namespace xrpl { @@ -44,11 +29,11 @@ TransactionAcquire::TransactionAcquire( app, hash, TX_ACQUIRE_TIMEOUT, - {.jobType = jtTXN_DATA, .jobName = "TxAcq", .jobLimit = {}}, + {jtTXN_DATA, "TxAcq", {}}, app.getJournal("TransactionAcquire")) , mPeerSet(std::move(peerSet)) { - mMap = std::make_shared(SHAMapType::TRANSACTION, hash, app.getNodeFamily()); + mMap = std::make_shared(SHAMapType::TRANSACTION, hash, app_.getNodeFamily()); mMap->setUnbacked(); } diff --git a/src/xrpld/app/ledger/detail/TransactionAcquire.h b/src/xrpld/app/ledger/detail/TransactionAcquire.h index d0887f8418..f29a01fca4 100644 --- a/src/xrpld/app/ledger/detail/TransactionAcquire.h +++ b/src/xrpld/app/ledger/detail/TransactionAcquire.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include @@ -17,7 +16,7 @@ public: using pointer = std::shared_ptr; TransactionAcquire(Application& app, uint256 const& hash, std::unique_ptr peerSet); - ~TransactionAcquire() override = default; + ~TransactionAcquire() = default; SHAMapAddNode takeNodes( diff --git a/src/xrpld/app/ledger/detail/TransactionMaster.cpp b/src/xrpld/app/ledger/detail/TransactionMaster.cpp index 798c29dc05..4be3c95993 100644 --- a/src/xrpld/app/ledger/detail/TransactionMaster.cpp +++ b/src/xrpld/app/ledger/detail/TransactionMaster.cpp @@ -1,29 +1,10 @@ #include - #include #include -#include -#include // IWYU pragma: keep -#include +#include #include -#include -#include #include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index c83b45f247..129bab8e20 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -1,20 +1,16 @@ -#include - #include -#include #include #include #include #include #include -#include #include #include #include #include #include +#include #include -#include #include #include #include @@ -26,109 +22,53 @@ #include #include #include -#include #include #include #include #include #include -#include -#include -#include -#include #include -#include #include -#include #include -#include #include #include -#include -#include -#include -#include #include #include #include -#include -#include -#include -#include -#include #include -#include -#include #include #include -#include #include -#include #include -#include #include -#include -#include #include -#include #include -#include -#include #include #include #include #include #include -#include -#include #include -#include -#include #include -#include #include -#include #include -#include -#include -#include -#include -#include #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include +#include #include -#include -#include #include -#include -#include +#include #include -#include #include -#include -#include -#include #include -#include +#include #include -#include -#include -#include #include -#include namespace xrpl { @@ -153,7 +93,7 @@ private: beast::Journal journal, std::chrono::milliseconds interval, boost::asio::io_context& ios) - : m_event(std::move(ev)), m_journal(journal), m_probe(interval, ios) + : m_event(ev), m_journal(journal), m_probe(interval, ios) { } @@ -389,9 +329,7 @@ public: , nodeFamily_(*this, *m_collectorManager) - , m_orderBookDB(make_OrderBookDB( - *this, - {.pathSearchMax = config_->PATH_SEARCH_MAX, .standalone = config_->standalone()})) + , m_orderBookDB(make_OrderBookDB(*this, {config_->PATH_SEARCH_MAX, config_->standalone()})) , m_pathRequestManager( std::make_unique( @@ -610,7 +548,7 @@ public: return *m_networkOPs; } - ServerHandler& + virtual ServerHandler& getServerHandler() override { XRPL_ASSERT( @@ -1134,7 +1072,7 @@ public: return maxDisallowedLedger_; } - std::optional const& + virtual std::optional const& getTrapTxID() const override { return trapTxID_; @@ -1492,16 +1430,16 @@ ApplicationImp::setup(boost::program_options::variables_map const& cmdline) Resource::Charge loadType = Resource::feeReferenceRPC; Resource::Consumer c; RPC::JsonContext context{ - {.j = getJournal("RPCHandler"), - .app = *this, - .loadType = loadType, - .netOps = getOPs(), - .ledgerMaster = getLedgerMaster(), - .consumer = c, - .role = Role::ADMIN, - .coro = {}, - .infoSub = {}, - .apiVersion = RPC::apiMaximumSupportedVersion}, + {getJournal("RPCHandler"), + *this, + loadType, + getOPs(), + getLedgerMaster(), + c, + Role::ADMIN, + {}, + {}, + RPC::apiMaximumSupportedVersion}, jvCommand}; Json::Value jvResult; diff --git a/src/xrpld/app/main/Application.h b/src/xrpld/app/main/Application.h index d0437be9a6..45bd94adce 100644 --- a/src/xrpld/app/main/Application.h +++ b/src/xrpld/app/main/Application.h @@ -16,6 +16,15 @@ namespace xrpl { +namespace unl { +class Manager; +} // namespace unl +namespace Resource { +class Manager; +} // namespace Resource +namespace NodeStore { +class Database; +} // namespace NodeStore namespace perf { class PerfLog; } // namespace perf diff --git a/src/xrpld/app/main/BasicApp.cpp b/src/xrpld/app/main/BasicApp.cpp index 9de7dc53d3..2c5a2b0364 100644 --- a/src/xrpld/app/main/BasicApp.cpp +++ b/src/xrpld/app/main/BasicApp.cpp @@ -4,9 +4,6 @@ #include -#include -#include - BasicApp::BasicApp(std::size_t numberOfThreads) { work_.emplace(boost::asio::make_work_guard(io_context_)); diff --git a/src/xrpld/app/main/CollectorManager.cpp b/src/xrpld/app/main/CollectorManager.cpp index a722e1447d..353a49de91 100644 --- a/src/xrpld/app/main/CollectorManager.cpp +++ b/src/xrpld/app/main/CollectorManager.cpp @@ -1,16 +1,6 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include - #include -#include namespace xrpl { @@ -41,7 +31,7 @@ public: m_groups = beast::insight::make_Groups(m_collector); } - ~CollectorManagerImp() override = default; + ~CollectorManagerImp() = default; beast::insight::Collector::ptr const& collector() override diff --git a/src/xrpld/app/main/GRPCServer.cpp b/src/xrpld/app/main/GRPCServer.cpp index 3c64606516..c8017d9ac0 100644 --- a/src/xrpld/app/main/GRPCServer.cpp +++ b/src/xrpld/app/main/GRPCServer.cpp @@ -1,55 +1,9 @@ #include - -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -389,48 +343,6 @@ GRPCServerImpl::GRPCServerImpl(Application& app) Throw("Error parsing secure_gateway section"); } } - - // Read TLS certificate configuration (optional) - sslCertPath_ = section.get("ssl_cert"); - sslKeyPath_ = section.get("ssl_key"); - sslCertChainPath_ = section.get("ssl_cert_chain"); - sslClientCAPath_ = section.get("ssl_client_ca"); - - // If cert or key is specified, both must be specified - if (sslCertPath_.has_value() || sslKeyPath_.has_value()) - { - if (!sslCertPath_.has_value() || !sslKeyPath_.has_value()) - { - JLOG(journal_.error()) - << "Both ssl_cert and ssl_key must be specified for gRPC TLS"; - Throw("Incomplete TLS configuration for gRPC"); - } - JLOG(journal_.info()) << "gRPC TLS enabled with certificate: " << *sslCertPath_; - } - - // Validate TLS configuration consistency: ssl_cert_chain only makes sense when TLS is - // enabled - if (sslCertChainPath_.has_value() && - (!sslCertPath_.has_value() || !sslKeyPath_.has_value())) - { - JLOG(journal_.error()) - << "ssl_cert_chain specified for gRPC without both ssl_cert and ssl_key; " - << "this is an invalid TLS configuration"; - Throw( - "Invalid gRPC TLS configuration: ssl_cert_chain requires both ssl_cert and " - "ssl_key"); - } - - // Validate TLS configuration consistency: ssl_client_ca only makes sense when TLS is - // enabled - if (sslClientCAPath_.has_value() && (!sslCertPath_.has_value() || !sslKeyPath_.has_value())) - { - JLOG(journal_.error()) - << "ssl_client_ca specified for gRPC without both ssl_cert and ssl_key; " - << "this is an invalid TLS configuration"; - Throw( - "Invalid gRPC TLS configuration: ssl_client_ca requires both ssl_cert and ssl_key"); - } } } @@ -465,8 +377,10 @@ GRPCServerImpl::handleRpcs() std::vector> requests = setupListeners(); auto erase = [&requests](Processor* ptr) { - auto it = std::ranges::find_if( - requests, [ptr](std::shared_ptr& sPtr) { return sPtr.get() == ptr; }); + auto it = + std::find_if(requests.begin(), requests.end(), [ptr](std::shared_ptr& sPtr) { + return sPtr.get() == ptr; + }); BOOST_ASSERT(it != requests.end()); it->swap(requests.back()); requests.pop_back(); @@ -600,104 +514,6 @@ GRPCServerImpl::setupListeners() return requests; } -std::shared_ptr -GRPCServerImpl::createServerCredentials() -{ - if (not sslCertPath_.has_value() or not sslKeyPath_.has_value()) - { - JLOG(journal_.info()) << "Configuring gRPC server without TLS"; - return grpc::InsecureServerCredentials(); - } - - JLOG(journal_.info()) << "Configuring gRPC server with TLS"; - - try - { - boost::system::error_code ec; - grpc::SslServerCredentialsOptions sslOpts; - grpc::SslServerCredentialsOptions::PemKeyCertPair keyCertPair; - - std::string const certContents = getFileContents(ec, *sslCertPath_); - if (ec) - { - JLOG(journal_.error()) << "Failed to read gRPC SSL certificate file: " << *sslCertPath_ - << " - " << ec.message(); // LCOV_EXCL_LINE - return nullptr; - } - - std::string const keyContents = getFileContents(ec, *sslKeyPath_); - if (ec) - { - JLOG(journal_.error()) << "Failed to read gRPC SSL key file: " << *sslKeyPath_ << " - " - << ec.message(); // LCOV_EXCL_LINE - return nullptr; - } - - keyCertPair.private_key = keyContents; - - // Read intermediate CA certificates for server certificate chain (optional) - std::string certChainContents; - if (sslCertChainPath_.has_value()) - { - certChainContents = getFileContents(ec, *sslCertChainPath_); - if (ec) - { - JLOG(journal_.error()) - << "Failed to read gRPC SSL cert chain file: " << *sslCertChainPath_ << " - " - << ec.message(); // LCOV_EXCL_LINE - return nullptr; - } - } - - // Read CA certificate for client verification (mTLS, optional) - if (sslClientCAPath_.has_value()) - { - auto const clientCAContents = getFileContents(ec, *sslClientCAPath_); - if (ec) - { - JLOG(journal_.error()) - << "Failed to read gRPC SSL client CA file: " << *sslClientCAPath_ << " - " - << ec.message(); // LCOV_EXCL_LINE - return nullptr; - } - - if (clientCAContents.empty()) - { - JLOG(journal_.error()) - << "Empty/truncated gRPC SSL client CA file: " << *sslClientCAPath_ - << " - failed to configure mutual TLS"; // LCOV_EXCL_LINE - return nullptr; - } - - sslOpts.pem_root_certs = clientCAContents; - sslOpts.client_certificate_request = - GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY; - JLOG(journal_.info()) << "gRPC mutual TLS enabled - client certificates will be " - "required and verified"; - } - - // Combine server cert with intermediate CA certs for complete chain - keyCertPair.cert_chain = certContents; - if (!certChainContents.empty()) - { - keyCertPair.cert_chain += '\n' + certChainContents; - JLOG(journal_.info()) << "gRPC server certificate chain configured with " - "intermediate CA certificates"; // LCOV_EXCL_LINE - } - - sslOpts.pem_key_cert_pairs.push_back(keyCertPair); - - JLOG(journal_.info()) << "gRPC TLS credentials configured successfully"; // LCOV_EXCL_LINE - return grpc::SslServerCredentials(sslOpts); - } - catch (std::exception const& e) - { - JLOG(journal_.error()) << "Exception while configuring gRPC TLS: " - << e.what(); // LCOV_EXCL_LINE - return nullptr; - } -} - bool GRPCServerImpl::start() { @@ -705,63 +521,24 @@ GRPCServerImpl::start() if (serverAddress_.empty()) return false; - // Determine TLS mode for logging - bool const tlsEnabled = sslCertPath_.has_value() && sslKeyPath_.has_value(); - bool const mtlsEnabled = tlsEnabled && sslClientCAPath_.has_value(); - - std::string tlsMode = "without TLS"; - if (mtlsEnabled) - { - tlsMode = "with mutual TLS (mTLS)"; - } - else if (tlsEnabled) - { - tlsMode = "with TLS"; - } - - JLOG(journal_.info()) << "Starting gRPC server at " << serverAddress_ << " " - << tlsMode; // LCOV_EXCL_LINE + JLOG(journal_.info()) << "Starting gRPC server at " << serverAddress_; grpc::ServerBuilder builder; + + // Listen on the given address without any authentication mechanism. + // Actually binded port will be returned into "port" variable. int port = 0; - - // Create credentials (TLS or insecure) based on configuration - auto credentials = createServerCredentials(); - if (!credentials) - { - JLOG(journal_.error()) << "Failed to create gRPC server credentials for " << serverAddress_ - << " (TLS mode: " << tlsMode - << ") - server will not start"; // LCOV_EXCL_LINE - return false; - } - - // Add listening port with appropriate credentials - builder.AddListeningPort(serverAddress_, credentials, &port); - + builder.AddListeningPort(serverAddress_, grpc::InsecureServerCredentials(), &port); // Register "service_" as the instance through which we'll communicate with // clients. In this case it corresponds to an *asynchronous* service. builder.RegisterService(&service_); - // Get hold of the completion queue used for the asynchronous communication // with the gRPC runtime. cq_ = builder.AddCompletionQueue(); - // Finally assemble the server. server_ = builder.BuildAndStart(); serverPort_ = static_cast(port); - if (serverPort_ != 0u) - { - JLOG(journal_.info()) << "gRPC server started successfully on port " << serverPort_; - } - else - { - JLOG(journal_.error()) - << "Failed to start gRPC server at " << serverAddress_ << " (TLS mode: " << tlsMode - << "); Possible causes: address already in use, invalid address format, or permission " - "denied"; // LCOV_EXCL_LINE - } - return static_cast(serverPort_); } diff --git a/src/xrpld/app/main/GRPCServer.h b/src/xrpld/app/main/GRPCServer.h index 215c1e037d..7fa9364174 100644 --- a/src/xrpld/app/main/GRPCServer.h +++ b/src/xrpld/app/main/GRPCServer.h @@ -66,13 +66,6 @@ private: std::vector secureGatewayIPs_; - // TLS certificate paths - std::optional sslCertPath_; - std::optional sslKeyPath_; - std::optional sslCertChainPath_; // Intermediate CA certs for server cert chain - std::optional - sslClientCAPath_; // CA cert for client certificate verification (mTLS) - beast::Journal journal_; // typedef for function to bind a listener @@ -131,10 +124,6 @@ public: getEndpoint() const; private: - // Create server credentials (TLS or insecure) based on configuration - std::shared_ptr - createServerCredentials(); - // Class encompassing the state and logic needed to serve a request. template class CallData : public Processor, @@ -186,7 +175,7 @@ private: std::vector const& secureGatewayIPs_; public: - ~CallData() override = default; + virtual ~CallData() = default; // Take in the "service" instance (in this case representing an // asynchronous server) and the completion queue "cq" used for @@ -207,10 +196,10 @@ private: CallData& operator=(CallData const&) = delete; - void + virtual void process() override; - bool + virtual bool isFinished() override; std::shared_ptr diff --git a/src/xrpld/app/main/LoadManager.cpp b/src/xrpld/app/main/LoadManager.cpp index 84c57ad360..47948a4031 100644 --- a/src/xrpld/app/main/LoadManager.cpp +++ b/src/xrpld/app/main/LoadManager.cpp @@ -1,18 +1,11 @@ +#include #include -#include - -#include -#include #include -#include -#include -#include // IWYU pragma: keep +#include #include #include -#include -#include #include #include #include diff --git a/src/xrpld/app/main/LoadManager.h b/src/xrpld/app/main/LoadManager.h index 3ae1f45e3b..c36afb1804 100644 --- a/src/xrpld/app/main/LoadManager.h +++ b/src/xrpld/app/main/LoadManager.h @@ -3,7 +3,6 @@ #include #include -#include #include #include #include diff --git a/src/xrpld/app/main/Main.cpp b/src/xrpld/app/main/Main.cpp index 076faff845..ebd5920492 100644 --- a/src/xrpld/app/main/Main.cpp +++ b/src/xrpld/app/main/Main.cpp @@ -5,48 +5,28 @@ #include #include -#include -#include #include -#include -#include -#include -#include #include #include -#include #include -#include -#include -#include +#include #include -#include // IWYU pragma: keep +#include #include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef ENABLE_TESTS #include #include #endif // ENABLE_TESTS +#include +#include #include #include +#include #include #include @@ -69,7 +49,7 @@ #endif #ifdef ENABLE_VOIDSTAR -#include +#include "antithesis_instrumentation.h" #endif namespace po = boost::program_options; @@ -208,7 +188,7 @@ public: std::vector v; boost::split(v, patterns, boost::algorithm::is_any_of(",")); selectors_.reserve(v.size()); - std::ranges::for_each(v, [this](std::string s) { + std::for_each(v.begin(), v.end(), [this](std::string s) { boost::trim(s); if (selectors_.empty() || !s.empty()) selectors_.emplace_back(beast::unit_test::selector::automatch, s); diff --git a/src/xrpld/app/main/NodeIdentity.cpp b/src/xrpld/app/main/NodeIdentity.cpp index f52e7e372e..bc2c943b10 100644 --- a/src/xrpld/app/main/NodeIdentity.cpp +++ b/src/xrpld/app/main/NodeIdentity.cpp @@ -1,22 +1,10 @@ -#include - #include +#include #include #include -#include -#include -#include -#include #include -#include - -#include -#include -#include -#include - namespace xrpl { std::pair diff --git a/src/xrpld/app/main/NodeStoreScheduler.cpp b/src/xrpld/app/main/NodeStoreScheduler.cpp index 2aebe40252..1ca8e80523 100644 --- a/src/xrpld/app/main/NodeStoreScheduler.cpp +++ b/src/xrpld/app/main/NodeStoreScheduler.cpp @@ -1,10 +1,5 @@ #include -#include -#include -#include -#include - namespace xrpl { NodeStoreScheduler::NodeStoreScheduler(JobQueue& jobQueue) : jobQueue_(jobQueue) diff --git a/src/xrpld/app/misc/DeliverMax.h b/src/xrpld/app/misc/DeliverMax.h index 8610a6a529..7fec517d28 100644 --- a/src/xrpld/app/misc/DeliverMax.h +++ b/src/xrpld/app/misc/DeliverMax.h @@ -6,7 +6,9 @@ namespace Json { class Value; } // namespace Json -namespace xrpl::RPC { +namespace xrpl { + +namespace RPC { /** Copy `Amount` field to `DeliverMax` field in transaction output JSON. @@ -22,4 +24,5 @@ insertDeliverMax(Json::Value& tx_json, TxType txnType, unsigned int apiVersion); /** @} */ -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/app/misc/FeeVoteImpl.cpp b/src/xrpld/app/misc/FeeVoteImpl.cpp index 53e56286b8..414d8d7421 100644 --- a/src/xrpld/app/misc/FeeVoteImpl.cpp +++ b/src/xrpld/app/misc/FeeVoteImpl.cpp @@ -1,31 +1,10 @@ #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { diff --git a/src/xrpld/app/misc/NegativeUNLVote.cpp b/src/xrpld/app/misc/NegativeUNLVote.cpp index 8db726ff48..212cfaa2e9 100644 --- a/src/xrpld/app/misc/NegativeUNLVote.cpp +++ b/src/xrpld/app/misc/NegativeUNLVote.cpp @@ -1,31 +1,8 @@ +#include #include -#include - -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include - -#include -#include -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index cedc888825..e39230efdb 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -1,10 +1,7 @@ -#include - #include #include #include #include -#include #include #include #include @@ -14,19 +11,17 @@ #include #include #include -#include #include #include #include #include +#include #include #include +#include #include -#include -#include #include #include -#include #include #include #include @@ -35,122 +30,47 @@ #include #include -#include -#include -#include #include -#include -#include -#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include #include #include -#include #include #include #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include -#include #include #include #include -#include -#include -#include #include -#include #include -#include -#include -#include -#include #include #include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include #include -#include #include -#include #include -#include -#include #include -#include -#include #include #include -#include -#include -#include - -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include #include #include #include #include -#include #include -#include -#include +#include #include -#include -#include namespace xrpl { @@ -171,7 +91,7 @@ class NetworkOPsImp final : public NetworkOPs TER result; TransactionStatus(std::shared_ptr t, bool a, bool l, FailHard f) - : transaction(std::move(t)), admin(a), local(l), failType(f) + : transaction(t), admin(a), local(l), failType(f) { XRPL_ASSERT( local || failType == FailHard::no, @@ -258,11 +178,7 @@ class NetworkOPsImp final : public NetworkOPs getCounterData() const { std::lock_guard const lock(mutex_); - return { - .counters = counters_, - .mode = mode_, - .start = start_, - .initialSyncUs = initialSyncUs_}; + return {counters_, mode_, start_, initialSyncUs_}; } }; @@ -1338,7 +1254,7 @@ NetworkOPsImp::doTransactionAsync( if (transaction->getApplying()) return; - mTransactions.emplace_back(transaction, bUnlimited, false, failType); + mTransactions.push_back(TransactionStatus(transaction, bUnlimited, false, failType)); transaction->setApplying(); if (mDispatchState == DispatchState::none) @@ -1360,7 +1276,7 @@ NetworkOPsImp::doTransactionSync( if (!transaction->getApplying()) { - mTransactions.emplace_back(transaction, bUnlimited, true, failType); + mTransactions.push_back(TransactionStatus(transaction, bUnlimited, true, failType)); transaction->setApplying(); } @@ -1457,8 +1373,9 @@ NetworkOPsImp::processTransactionSet(CanonicalTXSet const& set) doTransactionSyncBatch(lock, [&](std::unique_lock const&) { XRPL_ASSERT(lock.owns_lock(), "xrpl::NetworkOPsImp::processTransactionSet has lock"); - return std::ranges::any_of( - mTransactions, [](auto const& t) { return t.transaction->getApplying(); }); + return std::any_of(mTransactions.begin(), mTransactions.end(), [](auto const& t) { + return t.transaction->getApplying(); + }); }); } @@ -2943,7 +2860,7 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) // This array must be sorted in increasing order. static constexpr std::array protocols{ "http", "https", "peer", "ws", "ws2", "wss", "wss2"}; - static_assert(std::ranges::is_sorted(protocols)); + static_assert(std::is_sorted(std::begin(protocols), std::end(protocols))); { Json::Value ports{Json::arrayValue}; for (auto const& port : registry_.get().getServerHandler().setup().ports) @@ -2954,7 +2871,6 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) port.admin_user.empty() && port.admin_password.empty())) continue; std::vector proto; - // NOLINTNEXTLINE(modernize-use-ranges) std::set_intersection( std::begin(port.protocol), std::end(port.protocol), @@ -3433,7 +3349,7 @@ NetworkOPsImp::pubAccountTransaction( if (auto isSptr = info.sinkWptr_.lock(); isSptr) { accountHistoryNotify.emplace_back( - SubAccountHistoryInfo{.sink_ = isSptr, .index_ = info.index_}); + SubAccountHistoryInfo{isSptr, info.index_}); ++it; } else @@ -3762,11 +3678,7 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo) case Sqlite: { auto& db = registry_.get().getRelationalDatabase(); RelationalDatabase::AccountTxPageOptions const options{ - .account = accountId, - .ledgerRange = {.min = minLedger, .max = maxLedger}, - .marker = marker, - .limit = 0, - .bAdmin = true}; + accountId, {minLedger, maxLedger}, marker, 0, true}; return db.newestAccountTxPage(options); } // LCOV_EXCL_START @@ -3990,8 +3902,7 @@ NetworkOPsImp::subAccountHistory(InfoSub::ref isrListener, AccountID const& acco } std::lock_guard const sl(mSubLock); - SubAccountHistoryInfoWeak ahi{ - .sinkWptr_ = isrListener, .index_ = std::make_shared(accountId)}; + SubAccountHistoryInfoWeak ahi{isrListener, std::make_shared(accountId)}; auto simIterator = mSubAccountHistory.find(accountId); if (simIterator == mSubAccountHistory.end()) { diff --git a/src/xrpld/app/misc/SHAMapStore.h b/src/xrpld/app/misc/SHAMapStore.h index 6788d15392..b377538f62 100644 --- a/src/xrpld/app/misc/SHAMapStore.h +++ b/src/xrpld/app/misc/SHAMapStore.h @@ -1,7 +1,5 @@ #pragma once -#include - #include #include diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index 518d9f6b14..140f260d56 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -1,45 +1,16 @@ -#include - #include -#include +#include #include -#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include #include -#include #include #include #include -#include #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { void diff --git a/src/xrpld/app/misc/SHAMapStoreImp.h b/src/xrpld/app/misc/SHAMapStoreImp.h index 08e3dd70eb..c361fa426c 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.h +++ b/src/xrpld/app/misc/SHAMapStoreImp.h @@ -61,7 +61,7 @@ private: // minimum # of ledgers required for standalone mode. static std::uint32_t const minimumDeletionIntervalSA_ = 8; // minimum ledger to maintain online. - std::atomic minimumOnline_; + std::atomic minimumOnline_{}; NodeStore::Scheduler& scheduler_; beast::Journal const journal_; @@ -102,7 +102,7 @@ public: std::uint32_t clampFetchDepth(std::uint32_t fetch_depth) const override { - return (deleteInterval_ != 0u) ? std::min(fetch_depth, deleteInterval_) : fetch_depth; + return deleteInterval_ ? std::min(fetch_depth, deleteInterval_) : fetch_depth; } std::unique_ptr @@ -209,7 +209,7 @@ public: void start() override { - if (deleteInterval_ != 0u) + if (deleteInterval_) thread_ = std::thread(&SHAMapStoreImp::run, this); } diff --git a/src/xrpld/app/misc/Transaction.h b/src/xrpld/app/misc/Transaction.h index 31d899d99b..fa126e6bb5 100644 --- a/src/xrpld/app/misc/Transaction.h +++ b/src/xrpld/app/misc/Transaction.h @@ -21,6 +21,7 @@ namespace xrpl { // class Application; +class Database; class Rules; enum TransStatus { @@ -138,7 +139,7 @@ public: * @return Whether transaction is being applied within a batch. */ bool - getApplying() const + getApplying() { // Note that all access to mApplying are made by NetworkOPsImp, and must // be done under that class's lock. @@ -307,7 +308,7 @@ public: // Calling the wrong getter function will throw an exception. // See documentation for the getter functions for more details bool - isFound() const + isFound() { return std::holds_alternative>(locator); } diff --git a/src/xrpld/app/misc/TxQ.h b/src/xrpld/app/misc/TxQ.h index fa7e573071..b9ea7cc8f6 100644 --- a/src/xrpld/app/misc/TxQ.h +++ b/src/xrpld/app/misc/TxQ.h @@ -382,12 +382,11 @@ private: , targetTxnCount_( setup.targetTxnInLedger < minimumTxnCount_ ? minimumTxnCount_ : setup.targetTxnInLedger) - , maximumTxnCount_([&]() -> std::optional { - if (!setup.maximumTxnInLedger) - return std::nullopt; - return *setup.maximumTxnInLedger < targetTxnCount_ ? targetTxnCount_ - : *setup.maximumTxnInLedger; - }()) + , maximumTxnCount_( + setup.maximumTxnInLedger ? *setup.maximumTxnInLedger < targetTxnCount_ + ? targetTxnCount_ + : *setup.maximumTxnInLedger + : std::optional(std::nullopt)) , txnsExpected_(minimumTxnCount_) , recentTxnCounts_(setup.ledgersInQueue) , escalationMultiplier_(setup.minimumEscalationMultiplier) @@ -425,7 +424,7 @@ private: Snapshot getSnapshot() const { - return {.txnsExpected = txnsExpected_, .escalationMultiplier = escalationMultiplier_}; + return {txnsExpected_, escalationMultiplier_}; } /** Use the number of transactions in the current open ledger @@ -673,7 +672,7 @@ private: bool empty() const { - return getTxnCount() == 0u; + return !getTxnCount(); } /// Find the entry in transactions that precedes seqProx, if one does. diff --git a/src/xrpld/app/misc/detail/AccountTxPaging.cpp b/src/xrpld/app/misc/detail/AccountTxPaging.cpp index d29bedc19d..bb0a09426a 100644 --- a/src/xrpld/app/misc/detail/AccountTxPaging.cpp +++ b/src/xrpld/app/misc/detail/AccountTxPaging.cpp @@ -1,22 +1,11 @@ -#include - #include #include #include #include +#include -#include -#include #include -#include -#include #include -#include - -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/misc/detail/AmendmentTable.cpp b/src/xrpld/app/misc/detail/AmendmentTable.cpp index 0698230eb2..afecb08b24 100644 --- a/src/xrpld/app/misc/detail/AmendmentTable.cpp +++ b/src/xrpld/app/misc/detail/AmendmentTable.cpp @@ -1,48 +1,18 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include -#include -#include -#include -#include #include -#include #include #include -#include #include -#include -#include +#include +#include #include -#include -#include -#include +#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -75,7 +45,7 @@ parseSection(Section const& section) "Invalid amendment ID '" + match[1] + "' in [" + section.name() + "]"); } - names.emplace_back(id, match[2]); + names.push_back(std::make_pair(id, match[2])); } return names; @@ -221,8 +191,9 @@ public: } // Now remove any expired records from recordedVotes_. - std::ranges::for_each( - recordedVotes_, + std::for_each( + recordedVotes_.begin(), + recordedVotes_.end(), [&closeTime, newTimeout, &j](decltype(recordedVotes_)::value_type& votes) { auto const pkHuman = toBase58(TokenType::NodePublic, votes.first); if (!votes.second.timeout) @@ -783,7 +754,7 @@ AmendmentTableImpl::doValidation(std::set const& enabled) const } if (!amendments.empty()) - std::ranges::sort(amendments); + std::sort(amendments.begin(), amendments.end()); return amendments; } diff --git a/src/xrpld/app/misc/detail/DeliverMax.cpp b/src/xrpld/app/misc/detail/DeliverMax.cpp index 4e3d6563f9..44500eec7e 100644 --- a/src/xrpld/app/misc/detail/DeliverMax.cpp +++ b/src/xrpld/app/misc/detail/DeliverMax.cpp @@ -1,9 +1,9 @@ #include -#include #include -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { void insertDeliverMax(Json::Value& tx_json, TxType txnType, unsigned int apiVersion) @@ -19,4 +19,5 @@ insertDeliverMax(Json::Value& tx_json, TxType txnType, unsigned int apiVersion) } } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/Transaction.cpp b/src/xrpld/app/misc/detail/Transaction.cpp index 758f560835..f0cabf0fa6 100644 --- a/src/xrpld/app/misc/detail/Transaction.cpp +++ b/src/xrpld/app/misc/detail/Transaction.cpp @@ -1,34 +1,14 @@ -#include - #include #include +#include #include -#include -#include -#include #include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include #include - -#include - -#include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { diff --git a/src/xrpld/app/misc/detail/TxQ.cpp b/src/xrpld/app/misc/detail/TxQ.cpp index eb3b7a54be..3494a4b7bd 100644 --- a/src/xrpld/app/misc/detail/TxQ.cpp +++ b/src/xrpld/app/misc/detail/TxQ.cpp @@ -1,53 +1,16 @@ -#include - #include #include +#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include #include -#include - -#include #include -#include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -113,7 +76,7 @@ TxQ::FeeMetrics::update( std::for_each(txBegin, txEnd, [&](auto const& tx) { feeLevels.push_back(getFeeLevelPaid(view, *tx.first)); }); - std::ranges::sort(feeLevels); + std::sort(feeLevels.begin(), feeLevels.end()); XRPL_ASSERT(size == feeLevels.size(), "xrpl::TxQ::FeeMetrics::update : fee levels size"); JLOG((timeLeap ? j_.warn() : j_.debug())) @@ -139,7 +102,7 @@ TxQ::FeeMetrics::update( { recentTxnCounts_.push_back(mulDiv(size, 100 + setup.normalConsensusIncreasePercent, 100) .value_or(xrpl::muldiv_max)); - auto const iter = std::ranges::max_element(recentTxnCounts_); + auto const iter = std::max_element(recentTxnCounts_.begin(), recentTxnCounts_.end()); BOOST_ASSERT(iter != recentTxnCounts_.end()); auto const next = [&] { // Grow quickly: If the max_element is >= the @@ -1762,10 +1725,10 @@ TxQ::getTxRequiredFeeAndSeq(OpenView const& view, std::shared_ptr co std::uint32_t const accountSeq = sle ? (*sle)[sfSequence] : 0; std::uint32_t const availableSeq = nextQueuableSeqImpl(sle, lock).value(); return { - .fee = mulDiv(fee, baseFee, baseLevel) - .value_or(XRPAmount(std::numeric_limits::max())), - .accountSeq = accountSeq, - .availableSeq = availableSeq}; + mulDiv(fee, baseFee, baseLevel) + .value_or(XRPAmount(std::numeric_limits::max())), + accountSeq, + availableSeq}; } std::vector diff --git a/src/xrpld/app/misc/detail/ValidatorKeys.cpp b/src/xrpld/app/misc/detail/ValidatorKeys.cpp index bd9c723acb..59ddc6d702 100644 --- a/src/xrpld/app/misc/detail/ValidatorKeys.cpp +++ b/src/xrpld/app/misc/detail/ValidatorKeys.cpp @@ -1,19 +1,11 @@ #include - #include #include #include #include -#include -#include -#include -#include -#include #include -#include - namespace xrpl { ValidatorKeys::ValidatorKeys(Config const& config, beast::Journal j) { diff --git a/src/xrpld/app/misc/detail/ValidatorList.cpp b/src/xrpld/app/misc/detail/ValidatorList.cpp index c8b249cd74..1951c657b0 100644 --- a/src/xrpld/app/misc/detail/ValidatorList.cpp +++ b/src/xrpld/app/misc/detail/ValidatorList.cpp @@ -1,60 +1,24 @@ #include - -#include #include -#include -#include #include -#include #include #include #include -#include -#include -#include -#include -#include #include -#include #include -#include #include #include -#include #include #include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include +#include -#include - -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include namespace xrpl { @@ -822,14 +786,10 @@ ValidatorList::buildBlobInfos( { auto const& current = lists.current; auto const& remaining = lists.remaining; - blobInfos[current.sequence] = { - .blob = current.rawBlob, - .signature = current.rawSignature, - .manifest = current.rawManifest}; + blobInfos[current.sequence] = {current.rawBlob, current.rawSignature, current.rawManifest}; for (auto const& [sequence, vl] : remaining) { - blobInfos[sequence] = { - .blob = vl.rawBlob, .signature = vl.rawSignature, .manifest = vl.rawManifest}; + blobInfos[sequence] = {vl.rawBlob, vl.rawSignature, vl.rawManifest}; } } @@ -1239,7 +1199,7 @@ ValidatorList::applyList( } else { - publisherList.emplace_back(Slice{ret->data(), ret->size()}); + publisherList.push_back(PublicKey(Slice{ret->data(), ret->size()})); } if (val.isMember(jss::manifest) && val[jss::manifest].isString()) @@ -1248,7 +1208,7 @@ ValidatorList::applyList( } // Standardize the list order by sorting - std::sort(publisherList.begin(), publisherList.end()); // NOLINT(modernize-use-ranges) + std::sort(publisherList.begin(), publisherList.end()); } // If this publisher has ever sent a more updated version than the one // in this file, keep it. This scenario is unlikely, but legal. @@ -2098,8 +2058,9 @@ ValidatorList::negativeUNLFilter(std::vector>&& va if (!negativeUNL_.empty()) { ret.erase( - std::ranges::remove_if( - ret, + std::remove_if( + ret.begin(), + ret.end(), [&](auto const& v) -> bool { if (auto const masterKey = getTrustedKey(read_lock, v->getSignerPublic()); masterKey) @@ -2108,8 +2069,7 @@ ValidatorList::negativeUNLFilter(std::vector>&& va } return false; - }) - .begin(), + }), ret.end()); } diff --git a/src/xrpld/app/misc/detail/ValidatorSite.cpp b/src/xrpld/app/misc/detail/ValidatorSite.cpp index ca96e0fa37..a4623e7acc 100644 --- a/src/xrpld/app/misc/detail/ValidatorSite.cpp +++ b/src/xrpld/app/misc/detail/ValidatorSite.cpp @@ -1,46 +1,14 @@ -#include - -#include #include -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include - #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -222,8 +190,9 @@ ValidatorSite::setTimer( std::lock_guard const& site_lock, std::lock_guard const& state_lock) { - auto next = std::ranges::min_element( - sites_, [](Site const& a, Site const& b) { return a.nextRefresh < b.nextRefresh; }); + auto next = std::min_element(sites_.begin(), sites_.end(), [](Site const& a, Site const& b) { + return a.nextRefresh < b.nextRefresh; + }); if (next != sites_.end()) { @@ -436,10 +405,7 @@ ValidatorSite::parseJsonResponse( app_.getOPs()); sites_[siteIdx].lastRefreshStatus.emplace( - Site::Status{ - .refreshed = clock_type::now(), - .disposition = applyResult.bestDisposition(), - .message = ""}); + Site::Status{clock_type::now(), applyResult.bestDisposition(), ""}); for (auto const& [disp, count] : applyResult.dispositions) { @@ -551,10 +517,7 @@ ValidatorSite::onSiteFetch( << endpoint; auto onError = [&](std::string const& errMsg, bool retry) { sites_[siteIdx].lastRefreshStatus.emplace( - Site::Status{ - .refreshed = clock_type::now(), - .disposition = ListDisposition::invalid, - .message = errMsg}); + Site::Status{clock_type::now(), ListDisposition::invalid, errMsg}); if (retry) sites_[siteIdx].nextRefresh = clock_type::now() + error_retry_interval; @@ -647,10 +610,7 @@ ValidatorSite::onTextFetch( { JLOG(j_.error()) << "Exception in " << __func__ << ": " << ex.what(); sites_[siteIdx].lastRefreshStatus.emplace( - Site::Status{ - .refreshed = clock_type::now(), - .disposition = ListDisposition::invalid, - .message = ex.what()}); + Site::Status{clock_type::now(), ListDisposition::invalid, ex.what()}); } sites_[siteIdx].activeResource.reset(); } diff --git a/src/xrpld/app/misc/detail/Work.h b/src/xrpld/app/misc/detail/Work.h index 27f4e7f6eb..5261cf3bd7 100644 --- a/src/xrpld/app/misc/detail/Work.h +++ b/src/xrpld/app/misc/detail/Work.h @@ -3,7 +3,9 @@ #include #include -namespace xrpl::detail { +namespace xrpl { + +namespace detail { using response_type = boost::beast::http::response; @@ -19,4 +21,6 @@ public: cancel() = 0; }; -} // namespace xrpl::detail +} // namespace detail + +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/WorkBase.h b/src/xrpld/app/misc/detail/WorkBase.h index 56b227613f..35f04efe00 100644 --- a/src/xrpld/app/misc/detail/WorkBase.h +++ b/src/xrpld/app/misc/detail/WorkBase.h @@ -12,9 +12,9 @@ #include #include -#include +namespace xrpl { -namespace xrpl::detail { +namespace detail { template class WorkBase : public Work @@ -47,18 +47,16 @@ protected: endpoint_type lastEndpoint_; bool lastStatus_; -private: +public: WorkBase( - std::string host, - std::string path, - std::string port, + std::string const& host, + std::string const& path, + std::string const& port, boost::asio::io_context& ios, - endpoint_type lastEndpoint, + endpoint_type const& lastEndpoint, bool lastStatus, callback_type cb); - -public: - ~WorkBase() override; + ~WorkBase(); Impl& impl() @@ -93,30 +91,28 @@ public: private: void close(); - - friend Impl; }; //------------------------------------------------------------------------------ template WorkBase::WorkBase( - std::string host, - std::string path, - std::string port, + std::string const& host, + std::string const& path, + std::string const& port, boost::asio::io_context& ios, - endpoint_type lastEndpoint, + endpoint_type const& lastEndpoint, bool lastStatus, callback_type cb) - : host_(std::move(host)) - , path_(std::move(path)) - , port_(std::move(port)) + : host_(host) + , path_(path) + , port_(port) , cb_(std::move(cb)) , ios_(ios) , strand_(boost::asio::make_strand(ios)) , resolver_(ios) , socket_(ios) - , lastEndpoint_{std::move(lastEndpoint)} + , lastEndpoint_{lastEndpoint} , lastStatus_(lastStatus) { } @@ -134,12 +130,10 @@ void WorkBase::run() { if (!strand_.running_in_this_thread()) - { return boost::asio::post( ios_, boost::asio::bind_executor( strand_, std::bind(&WorkBase::run, impl().shared_from_this()))); - } resolver_.async_resolve( host_, @@ -274,4 +268,6 @@ WorkBase::close() } } -} // namespace xrpl::detail +} // namespace detail + +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/WorkFile.h b/src/xrpld/app/misc/detail/WorkFile.h index 067dc4c38b..5113ec5f3a 100644 --- a/src/xrpld/app/misc/detail/WorkFile.h +++ b/src/xrpld/app/misc/detail/WorkFile.h @@ -10,9 +10,9 @@ #include #include -#include +namespace xrpl { -namespace xrpl::detail { +namespace detail { // Work with files class WorkFile : public Work, public std::enable_shared_from_this @@ -26,8 +26,8 @@ public: using callback_type = std::function; public: - WorkFile(std::string path, boost::asio::io_context& ios, callback_type cb); - ~WorkFile() override; + WorkFile(std::string const& path, boost::asio::io_context& ios, callback_type cb); + ~WorkFile(); void run() override; @@ -44,8 +44,8 @@ private: //------------------------------------------------------------------------------ -inline WorkFile::WorkFile(std::string path, boost::asio::io_context& ios, callback_type cb) - : path_(std::move(path)), cb_(std::move(cb)), ios_(ios), strand_(boost::asio::make_strand(ios)) +inline WorkFile::WorkFile(std::string const& path, boost::asio::io_context& ios, callback_type cb) + : path_(path), cb_(std::move(cb)), ios_(ios), strand_(boost::asio::make_strand(ios)) { } @@ -59,12 +59,9 @@ inline void WorkFile::run() { if (!strand_.running_in_this_thread()) - { - boost::asio::post( + return boost::asio::post( ios_, boost::asio::bind_executor(strand_, std::bind(&WorkFile::run, shared_from_this()))); - return; - } error_code ec; auto const fileContents = getFileContents(ec, path_, megabytes(1)); @@ -80,4 +77,6 @@ WorkFile::cancel() // Nothing to do. Either it finished in run, or it didn't start. } -} // namespace xrpl::detail +} // namespace detail + +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/WorkPlain.h b/src/xrpld/app/misc/detail/WorkPlain.h index d3c0309e77..361a7b4513 100644 --- a/src/xrpld/app/misc/detail/WorkPlain.h +++ b/src/xrpld/app/misc/detail/WorkPlain.h @@ -2,7 +2,9 @@ #include -namespace xrpl::detail { +namespace xrpl { + +namespace detail { // Work over TCP/IP class WorkPlain : public WorkBase, public std::enable_shared_from_this @@ -18,7 +20,7 @@ public: endpoint_type const& lastEndpoint, bool lastStatus, callback_type cb); - ~WorkPlain() override = default; + ~WorkPlain() = default; private: void @@ -49,12 +51,11 @@ inline void WorkPlain::onConnect(error_code const& ec) { if (ec) - { - fail(ec); - return; - } + return fail(ec); onStart(); } -} // namespace xrpl::detail +} // namespace detail + +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/WorkSSL.cpp b/src/xrpld/app/misc/detail/WorkSSL.cpp index 0a8d53b1a2..3ae0db1a96 100644 --- a/src/xrpld/app/misc/detail/WorkSSL.cpp +++ b/src/xrpld/app/misc/detail/WorkSSL.cpp @@ -1,22 +1,7 @@ #include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace xrpl::detail { +namespace xrpl { +namespace detail { WorkSSL::WorkSSL( std::string const& host, @@ -70,4 +55,6 @@ WorkSSL::onHandshake(error_code const& ec) onStart(); } -} // namespace xrpl::detail +} // namespace detail + +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/WorkSSL.h b/src/xrpld/app/misc/detail/WorkSSL.h index 74676bb7c1..b12c774f6e 100644 --- a/src/xrpld/app/misc/detail/WorkSSL.h +++ b/src/xrpld/app/misc/detail/WorkSSL.h @@ -11,7 +11,9 @@ #include -namespace xrpl::detail { +namespace xrpl { + +namespace detail { // Work over SSL class WorkSSL : public WorkBase, public std::enable_shared_from_this @@ -35,7 +37,7 @@ public: endpoint_type const& lastEndpoint, bool lastStatus, callback_type cb); - ~WorkSSL() override = default; + ~WorkSSL() = default; private: stream_type& @@ -51,4 +53,6 @@ private: onHandshake(error_code const& ec); }; -} // namespace xrpl::detail +} // namespace detail + +} // namespace xrpl diff --git a/src/xrpld/app/misc/detail/setup_HashRouter.cpp b/src/xrpld/app/misc/detail/setup_HashRouter.cpp index 57e2b9b282..0cc61f0730 100644 --- a/src/xrpld/app/misc/detail/setup_HashRouter.cpp +++ b/src/xrpld/app/misc/detail/setup_HashRouter.cpp @@ -1,14 +1,7 @@ #include - #include #include -#include -#include - -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/app/rdb/backend/detail/Node.cpp b/src/xrpld/app/rdb/backend/detail/Node.cpp index f1b5f4edc3..bc19a25b40 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.cpp +++ b/src/xrpld/app/rdb/backend/detail/Node.cpp @@ -1,71 +1,25 @@ -#include - #include #include #include #include #include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include // IWYU pragma: keep +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include -#include -#include -#include -#include +#include -#include -#include -#include -#include -#include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::detail { +namespace xrpl { +namespace detail { /** * @brief to_string Returns the name of a table according to its TableType. @@ -137,16 +91,15 @@ makeLedgerDBs( { if (pk == 1) { - return { - .ledgerDb = std::move(lgr), .transactionDb = std::move(tx), .valid = false}; + return {std::move(lgr), std::move(tx), false}; } } } - return {.ledgerDb = std::move(lgr), .transactionDb = std::move(tx), .valid = true}; + return {std::move(lgr), std::move(tx), true}; } - return {.ledgerDb = std::move(lgr), .transactionDb = {}, .valid = true}; + return {std::move(lgr), {}, true}; } std::optional @@ -1139,8 +1092,7 @@ accountTxPage( else if (numberOfResults == 0) { newmarker = { - .ledgerSeq = rangeCheckedCast(ledgerSeq.value_or(0)), - .txnSeq = txnSeq.value_or(0)}; + rangeCheckedCast(ledgerSeq.value_or(0)), txnSeq.value_or(0)}; break; } @@ -1347,4 +1299,5 @@ dbHasSpace(soci::session& session, Config const& config, beast::Journal j) return true; } -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/src/xrpld/app/rdb/backend/detail/Node.h b/src/xrpld/app/rdb/backend/detail/Node.h index 7ea2992447..5fbabeca47 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.h +++ b/src/xrpld/app/rdb/backend/detail/Node.h @@ -5,7 +5,8 @@ #include #include -namespace xrpl::detail { +namespace xrpl { +namespace detail { /* Need to change TableTypeCount if TableType is modified. */ enum class TableType { Ledgers, Transactions, AccountTransactions }; @@ -401,4 +402,5 @@ getTransaction( bool dbHasSpace(soci::session& session, Config const& config, beast::Journal j); -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl diff --git a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp index 59f77142f8..90d3b5a8e4 100644 --- a/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp +++ b/src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp @@ -1,37 +1,13 @@ -#include - #include +#include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { bool @@ -194,7 +170,7 @@ SQLiteDatabase::getLedgerCountMinMax() return detail::getRowsMinMax(*db, detail::TableType::Ledgers); } - return {.numberOfRows = 0, .minLedgerSequence = 0, .maxLedgerSequence = 0}; + return {0, 0, 0}; } bool @@ -636,10 +612,7 @@ SQLiteDatabase::SQLiteDatabase(ServiceRegistry& registry, Config const& config, , j_(registry.getJournal("SQLiteDatabase")) { DatabaseCon::Setup const setup = setup_DatabaseCon(config, j_); - if (!makeLedgerDBs( - config, - setup, - DatabaseCon::CheckpointerSetup{.jobQueue = &jobQueue, .registry = registry_})) + if (!makeLedgerDBs(config, setup, DatabaseCon::CheckpointerSetup{&jobQueue, registry_})) { std::string_view constexpr error = "Failed to create ledger databases"; diff --git a/src/xrpld/app/rdb/detail/PeerFinder.cpp b/src/xrpld/app/rdb/detail/PeerFinder.cpp index 2f8d0355af..a568461fb7 100644 --- a/src/xrpld/app/rdb/detail/PeerFinder.cpp +++ b/src/xrpld/app/rdb/detail/PeerFinder.cpp @@ -1,27 +1,5 @@ #include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - namespace xrpl { void diff --git a/src/xrpld/app/tx/detail/Taker.h b/src/xrpld/app/tx/detail/Taker.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/xrpld/consensus/Consensus.cpp b/src/xrpld/consensus/Consensus.cpp index 309813cf7e..9ad7e677ad 100644 --- a/src/xrpld/consensus/Consensus.cpp +++ b/src/xrpld/consensus/Consensus.cpp @@ -1,16 +1,6 @@ #include -#include -#include - #include -#include - -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index 4337e8da01..142b1a01f0 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -779,13 +779,9 @@ Consensus::peerProposalInternal( } if (peerPosIt != currPeerPositions_.end()) - { peerPosIt->second = newPeerPos; - } else - { currPeerPositions_.emplace(peerID, newPeerPos); - } } if (newPeerProp.isInitial()) @@ -807,9 +803,7 @@ Consensus::peerProposalInternal( // spawn a request for it and return nullopt/nullptr. It will call // gotTxSet once it arrives if (auto set = adaptor_.acquireTxSet(newPeerProp.position())) - { gotTxSet(now_, *set); - } else JLOG(j_.debug()) << "Don't have tx set for peer"; } @@ -849,13 +843,9 @@ Consensus::timerEntry( } if (phase_ == ConsensusPhase::open) - { phaseOpen(clog); - } else if (phase_ == ConsensusPhase::establish) - { phaseEstablish(clog); - } CLOG(clog) << "timerEntry finishing in phase " << to_string(phase_) << ". "; } @@ -942,9 +932,7 @@ Consensus::getJson(bool full) const ret["close_granularity"] = static_cast(closeResolution_.count()); } else - { ret["synched"] = false; - } ret["phase"] = to_string(phase_); @@ -1149,13 +1137,9 @@ Consensus::phaseOpen(std::unique_ptr const& clog) : prevCloseTime_; // use the time we saw internally if (now_ >= lastCloseTime) - { sinceClose = duration_cast(now_ - lastCloseTime); - } else - { sinceClose = -duration_cast(lastCloseTime - now_); - } CLOG(clog) << "calculating how long since last ledger's close time " "based on mode : " << to_string(mode) << ", previous closeAgree: " << closeAgree @@ -1217,7 +1201,7 @@ Consensus::shouldPause(std::unique_ptr const& clog) << "offline: " << offline << ", " << "quorum: " << quorum << ")"; - if ((ahead == 0u) || (laggards == 0u) || (totalValidators == 0u) || !adaptor_.validator() || + if (!ahead || !laggards || !totalValidators || !adaptor_.validator() || !adaptor_.haveValidated() || result_->roundTime.read() > parms.ledgerMAX_CONSENSUS) { j_.debug() << "not pausing (early)" << vars.str(); diff --git a/src/xrpld/consensus/ConsensusParms.h b/src/xrpld/consensus/ConsensusParms.h index c8b79c4de9..97fbb2c4a0 100644 --- a/src/xrpld/consensus/ConsensusParms.h +++ b/src/xrpld/consensus/ConsensusParms.h @@ -121,14 +121,14 @@ struct ConsensusParms std::map const avalancheCutoffs{ // {state, {time, percent, nextState}}, // Initial state: 50% of nodes must vote yes - {init, {.consensusTime = 0, .consensusPct = 50, .next = mid}}, + {init, {0, 50, mid}}, // mid-consensus starts after 50% of the previous round time, and // requires 65% yes - {mid, {.consensusTime = 50, .consensusPct = 65, .next = late}}, + {mid, {50, 65, late}}, // late consensus starts after 85% time, and requires 70% yes - {late, {.consensusTime = 85, .consensusPct = 70, .next = stuck}}, + {late, {85, 70, stuck}}, // we're stuck after 2x time, requires 95% yes votes - {stuck, {.consensusTime = 200, .consensusPct = 95, .next = stuck}}, + {stuck, {200, 95, stuck}}, }; //! Percentage of nodes required to reach agreement on ledger close time diff --git a/src/xrpld/consensus/DisputedTx.h b/src/xrpld/consensus/DisputedTx.h index 2172fd5d47..e8304f4242 100644 --- a/src/xrpld/consensus/DisputedTx.h +++ b/src/xrpld/consensus/DisputedTx.h @@ -8,8 +8,6 @@ #include -#include - namespace xrpl { /** A transaction discovered to be in dispute during consensus. @@ -40,8 +38,8 @@ public: @param numPeers Anticipated number of peer votes @param j Journal for debugging */ - DisputedTx(Tx_t tx, bool ourVote, std::size_t numPeers, beast::Journal j) - : ourVote_(ourVote), tx_(std::move(tx)), j_(j) + DisputedTx(Tx_t const& tx, bool ourVote, std::size_t numPeers, beast::Journal j) + : ourVote_(ourVote), tx_(tx), j_(j) { votes_.reserve(numPeers); } @@ -100,11 +98,9 @@ public: // Compute the percentage of nodes voting 'yes' (possibly including us) int const support = (yays_ + (proposing && ourVote_ ? 1 : 0)) * 100; int const total = nays_ + yays_ + (proposing ? 1 : 0); - if (total == 0) - { + if (!total) // There are no votes, so we know nothing return false; - } int const weight = support / total; // Returns true if the tx has more than minCONSENSUS_PCT (80) percent // agreement. Either voting for _or_ voting against the tx. @@ -214,7 +210,7 @@ DisputedTx::setVote(NodeID_t const& peer, bool votesYes) return true; } // changes vote to yes - if (votesYes && !it->second) + else if (votesYes && !it->second) { JLOG(j_.debug()) << "Peer " << peer << " now votes YES on " << tx_.id(); --nays_; @@ -223,7 +219,7 @@ DisputedTx::setVote(NodeID_t const& peer, bool votesYes) return true; } // changes vote to no - if (!votesYes && it->second) + else if (!votesYes && it->second) { JLOG(j_.debug()) << "Peer " << peer << " now votes NO on " << tx_.id(); ++nays_; @@ -244,13 +240,9 @@ DisputedTx::unVote(NodeID_t const& peer) if (it != votes_.end()) { if (it->second) - { --yays_; - } else - { --nays_; - } votes_.erase(it); } diff --git a/src/xrpld/consensus/LedgerTrie.h b/src/xrpld/consensus/LedgerTrie.h index 38ad0afbf9..aecd105c07 100644 --- a/src/xrpld/consensus/LedgerTrie.h +++ b/src/xrpld/consensus/LedgerTrie.h @@ -10,7 +10,6 @@ #include #include #include -#include #include namespace xrpl { @@ -134,7 +133,7 @@ public: } private: - Span(Seq start, Seq end, Ledger l) : start_{start}, end_{end}, ledger_{std::move(l)} + Span(Seq start, Seq end, Ledger const& l) : start_{start}, end_{end}, ledger_{l} { // Spans cannot be empty XRPL_ASSERT(start < end, "xrpl::Span::Span : non-empty span input"); @@ -384,7 +383,7 @@ class LedgerTrie Node* findByLedgerID(Ledger const& ledger, Node* parent = nullptr) const { - if (parent == nullptr) + if (!parent) parent = root.get(); if (ledger.id() == parent->span.tip().id) return parent; @@ -514,7 +513,7 @@ public: { Node* loc = findByLedgerID(ledger); // Must be exact match with tip support - if ((loc == nullptr) || loc->tipSupport == 0) + if (!loc || loc->tipSupport == 0) return false; // found our node, remove it @@ -554,9 +553,7 @@ public: parent->erase(loc); } else - { break; - } loc = parent; } return true; @@ -585,7 +582,7 @@ public: branchSupport(Ledger const& ledger) const { Node const* loc = findByLedgerID(ledger); - if (loc == nullptr) + if (!loc) { Seq diffSeq; std::tie(loc, diffSeq) = find(ledger); @@ -695,10 +692,8 @@ public: uncommitted += uncommittedIt->second; uncommittedIt++; } - else - { // otherwise we jump to the end of the span + else // otherwise we jump to the end of the span nextSeq = curr->span.end(); - } } // We did not consume the entire span, so we have found the // preferred ledger @@ -741,13 +736,9 @@ public: // If the best child has margin exceeding the uncommitted support, // continue from that child, otherwise we are done if (best && ((margin > uncommitted) || (uncommitted == 0))) - { curr = best; - } - else - { // current is the best + else // current is the best done = true; - } } return curr->span.tip(); } @@ -794,7 +785,7 @@ public: { Node const* curr = nodes.top(); nodes.pop(); - if (curr == nullptr) + if (!curr) continue; // Node with 0 tip support must have multiple children diff --git a/src/xrpld/consensus/Validations.h b/src/xrpld/consensus/Validations.h index 00f10f89cf..4d0b64a350 100644 --- a/src/xrpld/consensus/Validations.h +++ b/src/xrpld/consensus/Validations.h @@ -369,9 +369,7 @@ private: it = acquiring_.erase(it); } else - { ++it; - } } } @@ -433,13 +431,9 @@ private: else { if (std::optional ledger = adaptor_.acquire(val.ledgerID())) - { updateTrie(lock, nodeID, *ledger); - } else - { acquiring_[valPair].insert(nodeID); - } } } @@ -660,9 +654,7 @@ public: updateTrie(lock, nodeID, val, old); } else - { return ValStatus::stale; - } } else if (val.trusted()) { @@ -925,11 +917,9 @@ public: // Use trie if ledger is the right one if (ledger.id() == ledgerID) - { return withTrie(lock, [&ledger](LedgerTrie& trie) { return trie.branchSupport(ledger) - trie.tipSupport(ledger); }); - } // Count parent ledgers as fallback return std::count_if(lastLedger_.begin(), lastLedger_.end(), [&ledgerID](auto const& it) { @@ -1038,13 +1028,9 @@ public: { std::optional loadFee = v.loadFee(); if (loadFee) - { res.push_back(*loadFee); - } else - { res.push_back(baseFee); - } } }); return res; diff --git a/src/xrpld/core/TimeKeeper.h b/src/xrpld/core/TimeKeeper.h index 8f2bbbcd53..0d809d076d 100644 --- a/src/xrpld/core/TimeKeeper.h +++ b/src/xrpld/core/TimeKeeper.h @@ -11,7 +11,7 @@ namespace xrpl { class TimeKeeper : public beast::abstract_clock { private: - std::atomic closeOffset_; + std::atomic closeOffset_{}; // Adjust system_clock::time_point for NetClock epoch static constexpr time_point @@ -22,7 +22,7 @@ private: } public: - ~TimeKeeper() override = default; + virtual ~TimeKeeper() = default; /** Returns the current time, using the server's clock. diff --git a/src/xrpld/core/detail/Config.cpp b/src/xrpld/core/detail/Config.cpp index b7063287bb..204b29ad30 100644 --- a/src/xrpld/core/detail/Config.cpp +++ b/src/xrpld/core/detail/Config.cpp @@ -1,60 +1,33 @@ #include - #include -#include #include #include #include -#include #include #include -#include -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include -#include // IWYU pragma: keep -#include -#include -#include +#include #include -#include -#include -#include #include #include #include -#include -#include -#include #include -#include -#include -#include #include -#include -#include -#include #if BOOST_OS_WINDOWS #include -namespace xrpl::detail { +namespace xrpl { +namespace detail { [[nodiscard]] std::uint64_t getMemorySize() @@ -65,14 +38,15 @@ getMemorySize() return 0; } -} // namespace xrpl::detail - +} // namespace detail +} // namespace xrpl #endif #if BOOST_OS_LINUX -#include // IWYU pragma: keep +#include -namespace xrpl::detail { +namespace xrpl { +namespace detail { [[nodiscard]] std::uint64_t getMemorySize() @@ -83,14 +57,17 @@ getMemorySize() return 0; } -} // namespace xrpl::detail +} // namespace detail +} // namespace xrpl #endif #if BOOST_OS_MACOS #include +#include -namespace xrpl::detail { +namespace xrpl { +namespace detail { [[nodiscard]] std::uint64_t getMemorySize() @@ -105,8 +82,8 @@ getMemorySize() return 0; } -} // namespace xrpl::detail - +} // namespace detail +} // namespace xrpl #endif namespace xrpl { @@ -285,9 +262,10 @@ Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone) // First, check against 'minimum' RAM requirements per node size: auto const& threshold = sizedItems[std::underlying_type_t(SizedItem::ramSizeGB)]; - auto ns = std::ranges::find_if(threshold.second, [this](std::size_t limit) { - return (limit == 0) || (ramSize_ < limit); - }); + auto ns = std::find_if( + threshold.second.begin(), threshold.second.end(), [this](std::size_t limit) { + return (limit == 0) || (ramSize_ < limit); + }); XRPL_ASSERT(ns != threshold.second.end(), "xrpl::Config::setupControl : valid node size"); diff --git a/src/xrpld/core/detail/NetworkIDServiceImpl.cpp b/src/xrpld/core/detail/NetworkIDServiceImpl.cpp index 38e72a4db6..839eb0c464 100644 --- a/src/xrpld/core/detail/NetworkIDServiceImpl.cpp +++ b/src/xrpld/core/detail/NetworkIDServiceImpl.cpp @@ -1,7 +1,6 @@ +#include #include -#include - namespace xrpl { NetworkIDServiceImpl::NetworkIDServiceImpl(std::uint32_t networkID) : networkID_(networkID) diff --git a/src/xrpld/overlay/ClusterNode.h b/src/xrpld/overlay/ClusterNode.h index 3e319ef8be..c6ab208383 100644 --- a/src/xrpld/overlay/ClusterNode.h +++ b/src/xrpld/overlay/ClusterNode.h @@ -5,7 +5,6 @@ #include #include -#include namespace xrpl { @@ -16,10 +15,10 @@ public: ClusterNode( PublicKey const& identity, - std::string name, + std::string const& name, std::uint32_t fee = 0, NetClock::time_point rtime = NetClock::time_point{}) - : identity_(identity), name_(std::move(name)), mLoadFee(fee), mReportTime(rtime) + : identity_(identity), name_(name), mLoadFee(fee), mReportTime(rtime) { } @@ -51,7 +50,7 @@ private: PublicKey const identity_; std::string name_; std::uint32_t mLoadFee = 0; - NetClock::time_point mReportTime; + NetClock::time_point mReportTime = {}; }; } // namespace xrpl diff --git a/src/xrpld/overlay/Compression.h b/src/xrpld/overlay/Compression.h index cb60b4bb48..e9f530035a 100644 --- a/src/xrpld/overlay/Compression.h +++ b/src/xrpld/overlay/Compression.h @@ -3,7 +3,9 @@ #include #include -namespace xrpl::compression { +namespace xrpl { + +namespace compression { std::size_t constexpr headerBytes = 6; std::size_t constexpr headerBytesCompressed = 10; @@ -34,20 +36,20 @@ decompress( try { if (algorithm == Algorithm::LZ4) - { return xrpl::compression_algorithms::lz4Decompress( in, inSize, decompressed, decompressedSize); + else + { + // LCOV_EXCL_START + JLOG(debugLog().warn()) + << "decompress: invalid compression algorithm " << static_cast(algorithm); + UNREACHABLE( + "xrpl::compression::decompress : invalid compression " + "algorithm"); + // LCOV_EXCL_STOP } - - // LCOV_EXCL_START - JLOG(debugLog().warn()) << "decompress: invalid compression algorithm " - << static_cast(algorithm); - UNREACHABLE( - "xrpl::compression::decompress : invalid compression " - "algorithm"); - // LCOV_EXCL_STOP } - catch (...) // NOLINT(bugprone-empty-catch) + catch (...) { } return 0; @@ -73,22 +75,24 @@ compress( try { if (algorithm == Algorithm::LZ4) - { return xrpl::compression_algorithms::lz4Compress( in, inSize, std::forward(bf)); + else + { + // LCOV_EXCL_START + JLOG(debugLog().warn()) + << "compress: invalid compression algorithm" << static_cast(algorithm); + UNREACHABLE( + "xrpl::compression::compress : invalid compression " + "algorithm"); + // LCOV_EXCL_STOP } - - // LCOV_EXCL_START - JLOG(debugLog().warn()) << "compress: invalid compression algorithm" - << static_cast(algorithm); - UNREACHABLE( - "xrpl::compression::compress : invalid compression " - "algorithm"); - // LCOV_EXCL_STOP } - catch (...) // NOLINT(bugprone-empty-catch) + catch (...) { } return 0; } -} // namespace xrpl::compression +} // namespace compression + +} // namespace xrpl diff --git a/src/xrpld/overlay/Overlay.h b/src/xrpld/overlay/Overlay.h index 2c2371a1d1..7d2508a584 100644 --- a/src/xrpld/overlay/Overlay.h +++ b/src/xrpld/overlay/Overlay.h @@ -14,9 +14,13 @@ #include #include -namespace boost::asio::ssl { +namespace boost { +namespace asio { +namespace ssl { class context; -} // namespace boost::asio::ssl +} // namespace ssl +} // namespace asio +} // namespace boost namespace xrpl { @@ -51,7 +55,7 @@ public: using PeerSequence = std::vector>; - ~Overlay() override = default; + virtual ~Overlay() = default; virtual void start() diff --git a/src/xrpld/overlay/ReduceRelayCommon.h b/src/xrpld/overlay/ReduceRelayCommon.h index 84e9cf9994..9ddde335e6 100644 --- a/src/xrpld/overlay/ReduceRelayCommon.h +++ b/src/xrpld/overlay/ReduceRelayCommon.h @@ -2,11 +2,13 @@ #include +namespace xrpl { + // Blog post explaining the rationale behind reduction of flooding gossip // protocol: // https://xrpl.org/blog/2021/message-routing-optimizations-pt-1-proposal-validation-relaying.html -namespace xrpl::reduce_relay { +namespace reduce_relay { // Peer's squelch is limited in time to // rand{MIN_UNSQUELCH_EXPIRE, max_squelch}, @@ -36,4 +38,6 @@ static constexpr auto WAIT_ON_BOOTUP = std::chrono::minutes{10}; // size limit of 64MB. static constexpr std::size_t MAX_TX_QUEUE_SIZE = 10000; -} // namespace xrpl::reduce_relay +} // namespace reduce_relay + +} // namespace xrpl diff --git a/src/xrpld/overlay/Slot.h b/src/xrpld/overlay/Slot.h index d7f3e9b4d3..22e908ee99 100644 --- a/src/xrpld/overlay/Slot.h +++ b/src/xrpld/overlay/Slot.h @@ -19,7 +19,9 @@ #include #include -namespace xrpl::reduce_relay { +namespace xrpl { + +namespace reduce_relay { template class Slots; @@ -50,7 +52,9 @@ epoch(TP const& t) class SquelchHandler { public: - virtual ~SquelchHandler() = default; + virtual ~SquelchHandler() + { + } /** Squelch handler * @param validator Public key of the source validator * @param id Peer's id to squelch @@ -320,7 +324,7 @@ Slot::update( // idled peers. std::unordered_set selected; auto const consideredPoolSize = considered_.size(); - while (selected.size() != maxSelectedPeers_ && !considered_.empty()) + while (selected.size() != maxSelectedPeers_ && considered_.size() != 0) { auto i = considered_.size() == 1 ? 0 : rand_int(considered_.size() - 1); auto it = std::next(considered_.begin(), i); @@ -362,9 +366,7 @@ Slot::update( v.count = 0; if (selected.find(k) != selected.end()) - { v.state = PeerState::Selected; - } else if (v.state != PeerState::Squelched) { if (journal_.trace()) @@ -409,7 +411,7 @@ Slot::deletePeer(PublicKey const& validator, id_t id, bool erase) JLOG(journal_.trace()) << "deletePeer: " << Slice(validator) << " " << id << " selected " << (it->second.state == PeerState::Selected) << " considered " - << (considered_.contains(id)) << " erase " << erase; + << (considered_.find(id) != considered_.end()) << " erase " << erase; auto now = clock_type::now(); if (it->second.state == PeerState::Selected) { @@ -426,7 +428,7 @@ Slot::deletePeer(PublicKey const& validator, id_t id, bool erase) reachedThreshold_ = 0; state_ = SlotState::Counting; } - else if (considered_.contains(id)) + else if (considered_.find(id) != considered_.end()) { if (it->second.count > MAX_MESSAGE_THRESHOLD) --reachedThreshold_; @@ -488,10 +490,8 @@ Slot::getSelected() const { std::set r; for (auto const& [id, info] : peers_) - { if (info.state == PeerState::Selected) r.insert(id); - } return r; } @@ -504,7 +504,6 @@ Slot::getPeers() const unordered_map>(); for (auto const& [id, info] : peers_) - { r.emplace( std::make_pair( id, @@ -514,7 +513,6 @@ Slot::getPeers() const info.count, epoch(info.expire).count(), epoch(info.lastMessage).count())))); - } return r; } @@ -562,10 +560,8 @@ public: reduceRelayReady() { if (!reduceRelayReady_) - { reduceRelayReady_ = reduce_relay::epoch(clock_type::now()) > reduce_relay::WAIT_ON_BOOTUP; - } return reduceRelayReady_; } @@ -760,9 +756,7 @@ Slots::updateSlotAndSquelch( it->second.update(validator, id, type, callback); } else - { it->second.update(validator, id, type, callback); - } } template @@ -788,10 +782,10 @@ Slots::deleteIdlePeers() it = slots_.erase(it); } else - { ++it; - } } } -} // namespace xrpl::reduce_relay +} // namespace reduce_relay + +} // namespace xrpl diff --git a/src/xrpld/overlay/Squelch.h b/src/xrpld/overlay/Squelch.h index 3f1d1b3192..1d92cfed3a 100644 --- a/src/xrpld/overlay/Squelch.h +++ b/src/xrpld/overlay/Squelch.h @@ -2,13 +2,16 @@ #include -#include #include #include +#include #include +#include -namespace xrpl::reduce_relay { +namespace xrpl { + +namespace reduce_relay { /** Maintains squelching of relaying messages from validators */ template @@ -86,7 +89,7 @@ Squelch::expireSquelch(PublicKey const& validator) auto const& it = squelched_.find(validator); if (it == squelched_.end()) return true; - if (it->second > now) + else if (it->second > now) return false; // squelch expired @@ -95,4 +98,6 @@ Squelch::expireSquelch(PublicKey const& validator) return true; } -} // namespace xrpl::reduce_relay +} // namespace reduce_relay + +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/Cluster.cpp b/src/xrpld/overlay/detail/Cluster.cpp index c74a9aa5bd..72b7ef5147 100644 --- a/src/xrpld/overlay/detail/Cluster.cpp +++ b/src/xrpld/overlay/detail/Cluster.cpp @@ -1,24 +1,13 @@ +#include +#include #include - #include -#include #include #include -#include -#include -#include #include -#include -#include - -#include -#include -#include -#include -#include -#include +#include namespace xrpl { diff --git a/src/xrpld/overlay/detail/ConnectAttempt.cpp b/src/xrpld/overlay/detail/ConnectAttempt.cpp index a90400dd2d..40466f19b9 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.cpp +++ b/src/xrpld/overlay/detail/ConnectAttempt.cpp @@ -1,55 +1,18 @@ -#include - -#include #include -#include -#include +#include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include #include -#include -#include namespace xrpl { ConnectAttempt::ConnectAttempt( Application& app, boost::asio::io_context& io_context, - endpoint_type remote_endpoint, + endpoint_type const& remote_endpoint, Resource::Consumer usage, shared_context const& context, std::uint32_t id, @@ -61,7 +24,7 @@ ConnectAttempt::ConnectAttempt( , id_(id) , sink_(journal, OverlayImpl::makePrefix(id)) , journal_(sink_) - , remote_endpoint_(std::move(remote_endpoint)) + , remote_endpoint_(remote_endpoint) , usage_(usage) , strand_(boost::asio::make_strand(io_context)) , timer_(io_context) diff --git a/src/xrpld/overlay/detail/ConnectAttempt.h b/src/xrpld/overlay/detail/ConnectAttempt.h index 0626efd9c7..520ebe277e 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.h +++ b/src/xrpld/overlay/detail/ConnectAttempt.h @@ -137,7 +137,7 @@ public: ConnectAttempt( Application& app, boost::asio::io_context& io_context, - endpoint_type remote_endpoint, + endpoint_type const& remote_endpoint, Resource::Consumer usage, shared_context const& context, Peer::id_t id, @@ -145,7 +145,7 @@ public: beast::Journal journal, OverlayImpl& overlay); - ~ConnectAttempt() override; + virtual ~ConnectAttempt(); /** * @brief Stop the connection attempt diff --git a/src/xrpld/overlay/detail/Handshake.cpp b/src/xrpld/overlay/detail/Handshake.cpp index 22e971dd6e..9d86724b82 100644 --- a/src/xrpld/overlay/detail/Handshake.cpp +++ b/src/xrpld/overlay/detail/Handshake.cpp @@ -1,46 +1,15 @@ -#include - #include #include -#include +#include -#include -#include -#include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include +#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include +#include // VFALCO Shouldn't we have to include the OpenSSL // headers or something for SSL_get_finished? diff --git a/src/xrpld/overlay/detail/Message.cpp b/src/xrpld/overlay/detail/Message.cpp index f8d3fbc8ff..1f0c6f608d 100644 --- a/src/xrpld/overlay/detail/Message.cpp +++ b/src/xrpld/overlay/detail/Message.cpp @@ -1,20 +1,7 @@ #include - -#include #include -#include -#include - -#include - -#include - -#include #include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index 30fa2587e7..10ebae6b0f 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -1,93 +1,30 @@ -#include - #include #include #include #include -#include #include -#include #include #include -#include -#include +#include #include -#include #include #include -#include -#include -#include -#include #include -#include -#include -#include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include #include #include #include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -165,7 +102,7 @@ OverlayImpl::Timer::on_timer(error_code ec) OverlayImpl::OverlayImpl( Application& app, - Setup setup, + Setup const& setup, ServerHandler& serverHandler, Resource::Manager& resourceManager, Resolver& resolver, @@ -176,7 +113,7 @@ OverlayImpl::OverlayImpl( , io_context_(io_context) , work_(std::in_place, boost::asio::make_work_guard(io_context_)) , strand_(boost::asio::make_strand(io_context_)) - , setup_(std::move(setup)) + , setup_(setup) , journal_(app_.getJournal("Overlay")) , serverHandler_(serverHandler) , m_resourceManager(resourceManager) @@ -255,7 +192,7 @@ OverlayImpl::onHandoff( { auto const types = beast::rfc2616::split_commas(request["Connect-As"]); - if (std::ranges::find_if(types, [](std::string const& s) { + if (std::find_if(types.begin(), types.end(), [](std::string const& s) { return boost::iequals(s, "peer"); }) == types.end()) { @@ -524,16 +461,16 @@ OverlayImpl::start() if (bootstrapIps.empty()) { // Pool of servers operated by Ripple Labs Inc. - https://ripple.com - bootstrapIps.emplace_back("r.ripple.com 51235"); + bootstrapIps.push_back("r.ripple.com 51235"); // Pool of servers operated by ISRDC - https://isrdc.in - bootstrapIps.emplace_back("sahyadri.isrdc.in 51235"); + bootstrapIps.push_back("sahyadri.isrdc.in 51235"); // Pool of servers operated by @Xrpkuwait - https://xrpkuwait.com - bootstrapIps.emplace_back("hubs.xrpkuwait.com 51235"); + bootstrapIps.push_back("hubs.xrpkuwait.com 51235"); // Pool of servers operated by XRPL Commons - https://xrpl-commons.org - bootstrapIps.emplace_back("hub.xrpl-commons.org 51235"); + bootstrapIps.push_back("hub.xrpl-commons.org 51235"); } m_resolver.resolve( diff --git a/src/xrpld/overlay/detail/OverlayImpl.h b/src/xrpld/overlay/detail/OverlayImpl.h index 0c4990a6f4..167d574188 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.h +++ b/src/xrpld/overlay/detail/OverlayImpl.h @@ -119,7 +119,7 @@ private: public: OverlayImpl( Application& app, - Setup setup, + Setup const& setup, ServerHandler& serverHandler, Resource::Manager& resourceManager, Resolver& resolver, diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index c0f21e3a5d..13fe0c571c 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -1,6 +1,3 @@ -#include - -#include #include #include #include @@ -8,96 +5,31 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include #include -#include -#include #include #include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include - -#include - -#include #include #include -#include -#include -#include -#include -#include #include #include #include -#include -#include #include -#include -#include -#include -#include -#include using namespace std::chrono_literals; @@ -145,7 +77,7 @@ PeerImp::PeerImp( , remote_address_(slot->remote_endpoint()) , overlay_(overlay) , inbound_(true) - , protocol_(std::move(protocol)) + , protocol_(protocol) , tracking_(Tracking::unknown) , trackingTime_(clock_type::now()) , publicKey_(publicKey) @@ -153,7 +85,7 @@ PeerImp::PeerImp( , creationTime_(clock_type::now()) , squelch_(app_.getJournal("Squelch")) , usage_(consumer) - , fee_{.fee = Resource::feeTrivialPeer, .context = ""} + , fee_{Resource::feeTrivialPeer, ""} , slot_(slot) , request_(std::move(request)) , headers_(request_) @@ -365,8 +297,9 @@ PeerImp::sendTxQueue() if (!txQueue_.empty()) { protocol::TMHaveTransactions ht; - std::ranges::for_each( - txQueue_, [&](auto const& hash) { ht.add_hashes(hash.data(), hash.size()); }); + std::for_each(txQueue_.begin(), txQueue_.end(), [&](auto const& hash) { + ht.add_hashes(hash.data(), hash.size()); + }); JLOG(p_journal_.trace()) << "sendTxQueue " << txQueue_.size(); txQueue_.clear(); send(std::make_shared(ht, protocol::mtHAVE_TRANSACTIONS)); @@ -581,7 +514,7 @@ PeerImp::hasLedger(uint256 const& hash, std::uint32_t seq) const if ((seq != 0) && (seq >= minLedger_) && (seq <= maxLedger_) && (tracking_.load() == Tracking::converged)) return true; - if (std::ranges::find(recentLedgers_, hash) != recentLedgers_.end()) + if (std::find(recentLedgers_.begin(), recentLedgers_.end(), hash) != recentLedgers_.end()) return true; } return false; @@ -600,7 +533,7 @@ bool PeerImp::hasTxSet(uint256 const& hash) const { std::lock_guard const sl(recentLock_); - return std::ranges::find(recentTxSets_, hash) != recentTxSets_.end(); + return std::find(recentTxSets_.begin(), recentTxSets_.end(), hash) != recentTxSets_.end(); } void @@ -1186,7 +1119,7 @@ PeerImp::onMessageBegin( { auto const name = protocolMessageName(type); load_event_ = app_.getJobQueue().makeLoadEvent(jtPEER, name); - fee_ = {.fee = Resource::feeTrivialPeer, .context = name}; + fee_ = {Resource::feeTrivialPeer, name}; auto const category = TrafficCount::categorize(*m, static_cast(type), true); @@ -2183,7 +2116,7 @@ PeerImp::onMessage(std::shared_ptr const& m) { std::lock_guard const sl(recentLock_); - if (std::ranges::find(recentTxSets_, hash) != recentTxSets_.end()) + if (std::find(recentTxSets_.begin(), recentTxSets_.end(), hash) != recentTxSets_.end()) { fee_.update(Resource::feeUselessData, "duplicate (tsHAVE)"); return; @@ -2848,7 +2781,7 @@ PeerImp::addLedger(uint256 const& hash, std::lock_guard const& locke // locked by the caller. (void)lockedRecentLock; - if (std::ranges::find(recentLedgers_, hash) != recentLedgers_.end()) + if (std::find(recentLedgers_.begin(), recentLedgers_.end(), hash) != recentLedgers_.end()) return; recentLedgers_.push_back(hash); diff --git a/src/xrpld/overlay/detail/PeerImp.h b/src/xrpld/overlay/detail/PeerImp.h index f2cca1407a..7f7d8c9324 100644 --- a/src/xrpld/overlay/detail/PeerImp.h +++ b/src/xrpld/overlay/detail/PeerImp.h @@ -23,7 +23,6 @@ #include #include #include -#include namespace xrpl { @@ -191,7 +190,7 @@ private: struct ChargeWithContext { Resource::Charge fee = Resource::feeTrivialPeer; - std::string context{}; // NOLINT(readability-redundant-member-init) + std::string context = {}; void update(Resource::Charge f, std::string const& add) @@ -314,7 +313,7 @@ public: id_t id, OverlayImpl& overlay); - ~PeerImp() override; + virtual ~PeerImp(); beast::Journal const& pJournal() const @@ -362,8 +361,9 @@ public: /** Send a set of PeerFinder endpoints as a protocol message. */ template < class FwdIt, - class = typename std::enable_if_t< - std::is_same_v::value_type, PeerFinder::Endpoint>>> + class = typename std::enable_if_t::value_type, + PeerFinder::Endpoint>::value>> void sendEndpoints(FwdIt first, FwdIt last); @@ -826,7 +826,7 @@ PeerImp::PeerImp( , remote_address_(slot->remote_endpoint()) , overlay_(overlay) , inbound_(false) - , protocol_(std::move(protocol)) + , protocol_(protocol) , tracking_(Tracking::unknown) , trackingTime_(clock_type::now()) , publicKey_(publicKey) @@ -834,7 +834,7 @@ PeerImp::PeerImp( , creationTime_(clock_type::now()) , squelch_(app_.getJournal("Squelch")) , usage_(usage) - , fee_{.fee = Resource::feeTrivialPeer} + , fee_{Resource::feeTrivialPeer} , slot_(std::move(slot)) , response_(std::move(response)) , headers_(response_) diff --git a/src/xrpld/overlay/detail/PeerReservationTable.cpp b/src/xrpld/overlay/detail/PeerReservationTable.cpp index f0e5f55a00..6ea2253df9 100644 --- a/src/xrpld/overlay/detail/PeerReservationTable.cpp +++ b/src/xrpld/overlay/detail/PeerReservationTable.cpp @@ -1,15 +1,13 @@ #include - #include #include #include -#include +#include #include #include #include #include -#include #include #include @@ -34,9 +32,9 @@ PeerReservationTable::list() const -> std::vector { std::lock_guard const lock(mutex_); list.reserve(table_.size()); - std::ranges::copy(table_, std::back_inserter(list)); + std::copy(table_.begin(), table_.end(), std::back_inserter(list)); } - std::sort(list.begin(), list.end()); // NOLINT(modernize-use-ranges) + std::sort(list.begin(), list.end()); return list; } @@ -100,7 +98,7 @@ PeerReservationTable::erase(PublicKey const& nodeId) std::lock_guard const lock(mutex_); - auto const it = table_.find({.nodeId = nodeId}); + auto const it = table_.find({nodeId}); if (it != table_.end()) { previous = *it; diff --git a/src/xrpld/overlay/detail/PeerSet.cpp b/src/xrpld/overlay/detail/PeerSet.cpp index 8d3d79d358..391fb6d3ca 100644 --- a/src/xrpld/overlay/detail/PeerSet.cpp +++ b/src/xrpld/overlay/detail/PeerSet.cpp @@ -1,24 +1,8 @@ +#include +#include #include -#include -#include -#include -#include - -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -75,8 +59,9 @@ PeerSetImpl::addPeers( pairs.emplace_back(score, std::move(peer)); }); - std::ranges::sort( - pairs, [](ScoredPeer const& lhs, ScoredPeer const& rhs) { return lhs.first > rhs.first; }); + std::sort(pairs.begin(), pairs.end(), [](ScoredPeer const& lhs, ScoredPeer const& rhs) { + return lhs.first > rhs.first; + }); std::size_t accepted = 0; for (auto const& pair : pairs) @@ -123,7 +108,7 @@ public: { } - std::unique_ptr + virtual std::unique_ptr build() override { return std::make_unique(app_); diff --git a/src/xrpld/overlay/detail/ProtocolMessage.h b/src/xrpld/overlay/detail/ProtocolMessage.h index 6b5b746ffd..41d42674ba 100644 --- a/src/xrpld/overlay/detail/ProtocolMessage.h +++ b/src/xrpld/overlay/detail/ProtocolMessage.h @@ -233,7 +233,7 @@ parseMessageHeader(boost::system::error_code& ec, BufferSequence const& bufs, st template < class T, class Buffers, - class = std::enable_if_t>> + class = std::enable_if_t::value>> std::shared_ptr parseMessageContent(MessageHeader const& header, Buffers const& buffers) { @@ -258,9 +258,7 @@ parseMessageContent(MessageHeader const& header, Buffers const& buffers) return {}; } else if (!m->ParseFromZeroCopyStream(&stream)) - { return {}; - } return m; } @@ -269,7 +267,7 @@ template < class T, class Buffers, class Handler, - class = std::enable_if_t>> + class = std::enable_if_t::value>> bool invoke(MessageHeader const& header, Buffers const& buffers, Handler& handler) { diff --git a/src/xrpld/overlay/detail/ProtocolVersion.cpp b/src/xrpld/overlay/detail/ProtocolVersion.cpp index c7416973ba..1a55030cd4 100644 --- a/src/xrpld/overlay/detail/ProtocolVersion.cpp +++ b/src/xrpld/overlay/detail/ProtocolVersion.cpp @@ -3,19 +3,11 @@ #include #include -#include #include -#include -#include -#include +#include #include -#include #include -#include -#include -#include -#include namespace xrpl { @@ -104,9 +96,8 @@ parseProtocolVersions(boost::beast::string_view const& value) } // We guarantee that the returned list is sorted and contains no duplicates: - std::ranges::sort(result); - auto const uniq = std::ranges::unique(result); - result.erase(uniq.begin(), uniq.end()); + std::sort(result.begin(), result.end()); + result.erase(std::unique(result.begin(), result.end()), result.end()); return result; } @@ -124,8 +115,12 @@ negotiateProtocolVersion(std::vector const& versions) std::function const pickVersion = [&result](ProtocolVersion const& v) { result = v; }; - std::ranges::set_intersection( - versions, supportedProtocolList, boost::make_function_output_iterator(pickVersion)); + std::set_intersection( + std::begin(versions), + std::end(versions), + std::begin(supportedProtocolList), + std::end(supportedProtocolList), + boost::make_function_output_iterator(pickVersion)); return result; } @@ -159,7 +154,8 @@ supportedProtocolVersions() bool isProtocolSupported(ProtocolVersion const& v) { - return std::end(supportedProtocolList) != std::ranges::find(supportedProtocolList, v); + return std::end(supportedProtocolList) != + std::find(std::begin(supportedProtocolList), std::end(supportedProtocolList), v); } } // namespace xrpl diff --git a/src/xrpld/overlay/detail/ProtocolVersion.h b/src/xrpld/overlay/detail/ProtocolVersion.h index c4fa7ced0b..5b3a1b3302 100644 --- a/src/xrpld/overlay/detail/ProtocolVersion.h +++ b/src/xrpld/overlay/detail/ProtocolVersion.h @@ -17,7 +17,7 @@ namespace xrpl { * */ using ProtocolVersion = std::pair; -constexpr ProtocolVersion +inline constexpr ProtocolVersion make_protocol(std::uint16_t major, std::uint16_t minor) { return {major, minor}; diff --git a/src/xrpld/overlay/detail/TrafficCount.cpp b/src/xrpld/overlay/detail/TrafficCount.cpp index 3841be28b0..2ce32b4468 100644 --- a/src/xrpld/overlay/detail/TrafficCount.cpp +++ b/src/xrpld/overlay/detail/TrafficCount.cpp @@ -1,11 +1,5 @@ #include -#include - -#include - -#include - namespace xrpl { std::unordered_map const type_lookup = { diff --git a/src/xrpld/overlay/detail/TrafficCount.h b/src/xrpld/overlay/detail/TrafficCount.h index bdc0729a51..930e92129d 100644 --- a/src/xrpld/overlay/detail/TrafficCount.h +++ b/src/xrpld/overlay/detail/TrafficCount.h @@ -56,7 +56,7 @@ public: operator bool() const { - return (messagesIn != 0u) || (messagesOut != 0u); + return messagesIn || messagesOut; } }; diff --git a/src/xrpld/overlay/detail/Tuning.h b/src/xrpld/overlay/detail/Tuning.h index 0471587fec..bd62cd2a03 100644 --- a/src/xrpld/overlay/detail/Tuning.h +++ b/src/xrpld/overlay/detail/Tuning.h @@ -2,7 +2,9 @@ #include -namespace xrpl::Tuning { +namespace xrpl { + +namespace Tuning { enum { /** How many ledgers off a server can be and we will @@ -42,4 +44,6 @@ enum { /** Size of buffer used to read from the socket. */ std::size_t constexpr readBufferBytes = 16384; -} // namespace xrpl::Tuning +} // namespace Tuning + +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/TxMetrics.cpp b/src/xrpld/overlay/detail/TxMetrics.cpp index 0a44c719f4..ee0e42e5d6 100644 --- a/src/xrpld/overlay/detail/TxMetrics.cpp +++ b/src/xrpld/overlay/detail/TxMetrics.cpp @@ -1,17 +1,12 @@ #include -#include #include -#include - -#include -#include -#include #include -#include -namespace xrpl::metrics { +namespace xrpl { + +namespace metrics { void TxMetrics::addMetrics(protocol::MessageType type, std::uint32_t val) @@ -129,4 +124,6 @@ TxMetrics::json() const return ret; } -} // namespace xrpl::metrics +} // namespace metrics + +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/TxMetrics.h b/src/xrpld/overlay/detail/TxMetrics.h index a5aea854cc..37194c34e3 100644 --- a/src/xrpld/overlay/detail/TxMetrics.h +++ b/src/xrpld/overlay/detail/TxMetrics.h @@ -8,7 +8,9 @@ #include #include -namespace xrpl::metrics { +namespace xrpl { + +namespace metrics { /** Run single metrics rolling average. Can be either average of a value per second or average of a value's sample per second. For instance, @@ -109,4 +111,6 @@ struct TxMetrics json() const; }; -} // namespace xrpl::metrics +} // namespace metrics + +} // namespace xrpl diff --git a/src/xrpld/overlay/detail/ZeroCopyStream.h b/src/xrpld/overlay/detail/ZeroCopyStream.h index 034f69a8da..6ce81edc54 100644 --- a/src/xrpld/overlay/detail/ZeroCopyStream.h +++ b/src/xrpld/overlay/detail/ZeroCopyStream.h @@ -124,7 +124,7 @@ private: public: explicit ZeroCopyOutputStream(Streambuf& streambuf, std::size_t blockSize); - ~ZeroCopyOutputStream() override; + ~ZeroCopyOutputStream(); bool Next(void** data, int* size) override; diff --git a/src/xrpld/overlay/predicates.h b/src/xrpld/overlay/predicates.h index e0b4a626ec..3adecf7c6a 100644 --- a/src/xrpld/overlay/predicates.h +++ b/src/xrpld/overlay/predicates.h @@ -101,7 +101,10 @@ struct match_peer bool operator()(std::shared_ptr const& peer) const { - return (matchPeer != nullptr) && (peer.get() == matchPeer); + if (matchPeer && (peer.get() == matchPeer)) + return true; + + return false; } }; @@ -143,7 +146,10 @@ struct peer_in_set bool operator()(std::shared_ptr const& peer) const { - return peerSet.contains(peer->id()); + if (peerSet.count(peer->id()) == 0) + return false; + + return true; } }; diff --git a/src/xrpld/peerfinder/PeerfinderManager.h b/src/xrpld/peerfinder/PeerfinderManager.h index 1ceaebe04d..57fde8a569 100644 --- a/src/xrpld/peerfinder/PeerfinderManager.h +++ b/src/xrpld/peerfinder/PeerfinderManager.h @@ -2,16 +2,18 @@ #include #include -#include #include #include #include +#include "xrpld/peerfinder/detail/Tuning.h" + #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { using clock_type = beast::abstract_clock; @@ -101,7 +103,7 @@ struct Endpoint { Endpoint() = default; - Endpoint(beast::IP::Endpoint ep, std::uint32_t hops_); + Endpoint(beast::IP::Endpoint const& ep, std::uint32_t hops_); std::uint32_t hops = 0; beast::IP::Endpoint address; @@ -167,7 +169,7 @@ public: There may be some listener calls made before the destructor returns. */ - ~Manager() override = default; + virtual ~Manager() = default; /** Set the configuration for the manager. The new settings will be applied asynchronously. @@ -284,4 +286,5 @@ public: once_per_second() = 0; }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/Slot.h b/src/xrpld/peerfinder/Slot.h index 81249f54df..d0fce0626d 100644 --- a/src/xrpld/peerfinder/Slot.h +++ b/src/xrpld/peerfinder/Slot.h @@ -5,7 +5,8 @@ #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** Properties and state associated with a peer to peer overlay connection. */ class Slot @@ -57,4 +58,5 @@ public: public_key() const = 0; }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Bootcache.cpp b/src/xrpld/peerfinder/detail/Bootcache.cpp index 7b26bc8d9a..dac55d50d6 100644 --- a/src/xrpld/peerfinder/detail/Bootcache.cpp +++ b/src/xrpld/peerfinder/detail/Bootcache.cpp @@ -1,22 +1,13 @@ #include - -#include -#include #include #include #include -#include -#include -#include -#include #include -#include -#include -#include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { Bootcache::Bootcache(Store& store, clock_type& clock, beast::Journal journal) : m_store(store), m_clock(clock), m_journal(journal), m_whenUpdate(m_clock.now()) @@ -261,4 +252,5 @@ Bootcache::flagForUpdate() checkUpdate(); } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Bootcache.h b/src/xrpld/peerfinder/detail/Bootcache.h index 5405dd3432..9ab0a878e8 100644 --- a/src/xrpld/peerfinder/detail/Bootcache.h +++ b/src/xrpld/peerfinder/detail/Bootcache.h @@ -12,7 +12,8 @@ #include #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** Stores IP addresses useful for gaining initial connections. @@ -54,7 +55,9 @@ private: friend bool operator<(Entry const& lhs, Entry const& rhs) { - return lhs.valence() > rhs.valence(); + if (lhs.valence() > rhs.valence()) + return true; + return false; } private: @@ -168,4 +171,5 @@ private: flagForUpdate(); }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Checker.h b/src/xrpld/peerfinder/detail/Checker.h index 3bd23f85db..21cc0f160e 100644 --- a/src/xrpld/peerfinder/detail/Checker.h +++ b/src/xrpld/peerfinder/detail/Checker.h @@ -10,7 +10,8 @@ #include #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** Tests remote listening sockets to make sure they are connectable. */ template @@ -43,10 +44,7 @@ private: async_op(Checker& owner, boost::asio::io_context& io_context, Handler&& handler); - ~async_op() override - { - checker_.remove(*this); - } + virtual ~async_op(); void stop() override; @@ -115,6 +113,13 @@ Checker::async_op::async_op( { } +template +template +Checker::async_op::~async_op() +{ + checker_.remove(*this); +} + template template void @@ -193,4 +198,5 @@ Checker::remove(basic_async_op& op) cond_.notify_all(); } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Counts.h b/src/xrpld/peerfinder/detail/Counts.h index e3d120b414..8d40b44300 100644 --- a/src/xrpld/peerfinder/detail/Counts.h +++ b/src/xrpld/peerfinder/detail/Counts.h @@ -6,7 +6,8 @@ #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** Manages the count of available connections for the various slots. */ class Counts @@ -178,12 +179,15 @@ public: // // Fixed peers do not count towards the active outgoing total. - return m_out_max <= 0; + if (m_out_max > 0) + return false; + + return true; } /** Output statistics. */ void - onWrite(beast::PropertyStream::Map& map) const + onWrite(beast::PropertyStream::Map& map) { map["accept"] = acceptCount(); map["connect"] = connectCount(); @@ -239,13 +243,9 @@ private: if (!s.fixed() && !s.reserved()) { if (s.inbound()) - { m_in_active += n; - } else - { m_out_active += n; - } } m_active += n; break; @@ -298,4 +298,5 @@ private: int m_closingCount{0}; }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Endpoint.cpp b/src/xrpld/peerfinder/detail/Endpoint.cpp index 5d58e6c9bb..46f4f28b88 100644 --- a/src/xrpld/peerfinder/detail/Endpoint.cpp +++ b/src/xrpld/peerfinder/detail/Endpoint.cpp @@ -1,17 +1,13 @@ #include #include -#include +namespace xrpl { +namespace PeerFinder { -#include -#include -#include - -namespace xrpl::PeerFinder { - -Endpoint::Endpoint(beast::IP::Endpoint ep, std::uint32_t hops_) - : hops(std::min(hops_, Tuning::maxHops + 1)), address(std::move(ep)) +Endpoint::Endpoint(beast::IP::Endpoint const& ep, std::uint32_t hops_) + : hops(std::min(hops_, Tuning::maxHops + 1)), address(ep) { } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Fixed.h b/src/xrpld/peerfinder/detail/Fixed.h index b898c6ce3f..8b67347e6a 100644 --- a/src/xrpld/peerfinder/detail/Fixed.h +++ b/src/xrpld/peerfinder/detail/Fixed.h @@ -2,7 +2,8 @@ #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** Metadata for a Fixed slot. */ class Fixed @@ -42,4 +43,5 @@ private: std::size_t m_failures{0}; }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Handouts.h b/src/xrpld/peerfinder/detail/Handouts.h index 0d5eae7ef7..77e2e31ed9 100644 --- a/src/xrpld/peerfinder/detail/Handouts.h +++ b/src/xrpld/peerfinder/detail/Handouts.h @@ -6,9 +6,8 @@ #include #include -#include - -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { namespace detail { @@ -79,7 +78,7 @@ class RedirectHandouts { public: template - explicit RedirectHandouts(SlotImp::ptr slot); + explicit RedirectHandouts(SlotImp::ptr const& slot); template bool @@ -115,7 +114,7 @@ private: }; template -RedirectHandouts::RedirectHandouts(SlotImp::ptr slot) : slot_(std::move(slot)) +RedirectHandouts::RedirectHandouts(SlotImp::ptr const& slot) : slot_(slot) { list_.reserve(Tuning::redirectEndpointCount); } @@ -163,7 +162,7 @@ class SlotHandouts { public: template - explicit SlotHandouts(SlotImp::ptr slot); + explicit SlotHandouts(SlotImp::ptr const& slot); template bool @@ -199,7 +198,7 @@ private: }; template -SlotHandouts::SlotHandouts(SlotImp::ptr slot) : slot_(std::move(slot)) +SlotHandouts::SlotHandouts(SlotImp::ptr const& slot) : slot_(slot) { list_.reserve(Tuning::numberOfEndpoints); } @@ -330,4 +329,5 @@ ConnectHandouts::try_insert(beast::IP::Endpoint const& endpoint) return true; } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Livecache.h b/src/xrpld/peerfinder/detail/Livecache.h index 5c5ed577af..ac435e1e24 100644 --- a/src/xrpld/peerfinder/detail/Livecache.h +++ b/src/xrpld/peerfinder/detail/Livecache.h @@ -13,9 +13,9 @@ #include #include -#include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { template class Livecache; @@ -30,7 +30,7 @@ public: protected: struct Element : boost::intrusive::list_base_hook<> { - Element(Endpoint endpoint_) : endpoint(std::move(endpoint_)) + Element(Endpoint const& endpoint_) : endpoint(endpoint_) { } @@ -409,7 +409,7 @@ Livecache::insert(Endpoint const& ep) << " at hops " << ep.hops; return; } - if (!result.second && (ep.hops > e.endpoint.hops)) + else if (!result.second && (ep.hops > e.endpoint.hops)) { // Drop duplicates at higher hops std::size_t const excess(ep.hops - e.endpoint.hops); @@ -465,7 +465,7 @@ Livecache::hops_t::shuffle() { std::vector> v; v.reserve(list.size()); - std::ranges::copy(list, std::back_inserter(v)); + std::copy(list.begin(), list.end(), std::back_inserter(v)); std::shuffle(v.begin(), v.end(), default_prng()); list.clear(); for (auto& e : v) @@ -490,7 +490,7 @@ Livecache::hops_t::histogram() const template Livecache::hops_t::hops_t(Allocator const& alloc) { - std::ranges::fill(m_hist, 0); + std::fill(m_hist.begin(), m_hist.end(), 0); } template @@ -532,4 +532,5 @@ Livecache::hops_t::remove(Element& e) list.erase(list.iterator_to(e)); } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Logic.h b/src/xrpld/peerfinder/detail/Logic.h index 9e2cbedc64..ad0a2f8b96 100644 --- a/src/xrpld/peerfinder/detail/Logic.h +++ b/src/xrpld/peerfinder/detail/Logic.h @@ -23,7 +23,8 @@ #include #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** The Logic for maintaining the list of Slot addresses. We keep this in a separate class so it can be instantiated @@ -253,7 +254,7 @@ public: } // Check for duplicate connection - if (slots_.contains(remote_endpoint)) + if (slots_.find(remote_endpoint) != slots_.end()) { JLOG(m_journal.debug()) << beast::leftw(18) << "Logic dropping " << remote_endpoint << " as duplicate incoming"; @@ -289,7 +290,7 @@ public: std::lock_guard const _(lock_); // Check for duplicate connection - if (slots_.contains(remote_endpoint)) + if (slots_.find(remote_endpoint) != slots_.end()) { JLOG(m_journal.debug()) << beast::leftw(18) << "Logic dropping " << remote_endpoint << " as duplicate connect"; @@ -376,7 +377,7 @@ public: "xrpl::PeerFinder::Logic::activate : valid slot state"); // Check for duplicate connection by key - if (keys_.contains(key)) + if (keys_.find(key) != keys_.end()) return Result::duplicatePeer; // If the peer belongs to a cluster or is reserved, @@ -417,11 +418,9 @@ public: { auto iter(fixed_.find(slot->remote_endpoint())); if (iter == fixed_.end()) - { LogicError( "PeerFinder::Logic::activate(): remote_endpoint " "missing from fixed_"); - } iter->second.success(m_clock.now()); JLOG(journal.trace()) << "Logic fixed success"; @@ -517,7 +516,7 @@ public: << ((h.list().size() > 1) ? "endpoints" : "endpoint"); return h.list(); } - if (counts_.attempts() > 0) + else if (counts_.attempts() > 0) { JLOG(m_journal.debug()) << beast::leftw(18) << "Logic waiting on " << counts_.attempts() << " attempts"; @@ -628,7 +627,7 @@ public: beast::Journal const journal{sink}; JLOG(journal.trace()) << "Logic sending " << list.size() << ((list.size() == 1) ? " endpoint" : " endpoints"); - result.emplace_back(slot, list); + result.push_back(std::make_pair(slot, list)); } m_whenBroadcast = now + Tuning::secondsPerMessage; @@ -826,11 +825,9 @@ public: auto const iter = slots_.find(slot->remote_endpoint()); // The slot must exist in the table if (iter == slots_.end()) - { LogicError( "PeerFinder::Logic::remove(): remote_endpoint " "missing from slots_"); - } // Remove from slot by IP table slots_.erase(iter); @@ -841,11 +838,9 @@ public: auto const iter = keys_.find(*slot->public_key()); // Key must exist if (iter == keys_.end()) - { LogicError( "PeerFinder::Logic::remove(): public_key missing " "from keys_"); - } keys_.erase(iter); } @@ -854,11 +849,9 @@ public: auto const iter(connectedAddresses_.find(slot->remote_endpoint().address())); // Address must exist if (iter == connectedAddresses_.end()) - { LogicError( "PeerFinder::Logic::remove(): remote_endpoint " "address missing from connectedAddresses_"); - } connectedAddresses_.erase(iter); } @@ -882,11 +875,9 @@ public: { auto iter(fixed_.find(slot->remote_endpoint())); if (iter == fixed_.end()) - { LogicError( "PeerFinder::Logic::on_closed(): remote_endpoint " "missing from fixed_"); - } iter->second.failure(m_clock.now()); JLOG(journal.debug()) << "Logic fixed failed"; @@ -948,10 +939,8 @@ public: fixed(beast::IP::Endpoint const& endpoint) const { for (auto const& entry : fixed_) - { if (entry.first == endpoint) return true; - } return false; } @@ -962,10 +951,8 @@ public: fixed(beast::IP::Address const& address) const { for (auto const& entry : fixed_) - { if (entry.first.address() == address) return true; - } return false; } @@ -1212,4 +1199,5 @@ Logic::onRedirects( } } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/PeerfinderConfig.cpp b/src/xrpld/peerfinder/detail/PeerfinderConfig.cpp index 1c57f5187e..6a158fbbab 100644 --- a/src/xrpld/peerfinder/detail/PeerfinderConfig.cpp +++ b/src/xrpld/peerfinder/detail/PeerfinderConfig.cpp @@ -1,14 +1,10 @@ -#include #include #include -#include - #include -#include -#include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { Config::Config() : outPeers(calcOutPeers()) @@ -127,4 +123,5 @@ Config::makeConfig( return config; } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/PeerfinderManager.cpp b/src/xrpld/peerfinder/detail/PeerfinderManager.cpp index 2858586120..e9c42b7eb5 100644 --- a/src/xrpld/peerfinder/detail/PeerfinderManager.cpp +++ b/src/xrpld/peerfinder/detail/PeerfinderManager.cpp @@ -1,34 +1,17 @@ #include - -#include #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include - #include #include -#include -#include #include -#include #include -#include -#include -#include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { class ManagerImp : public Manager { @@ -266,4 +249,5 @@ make_Manager( return std::make_unique(io_context, clock, journal, config, collector); } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/SlotImp.cpp b/src/xrpld/peerfinder/detail/SlotImp.cpp index f763a154aa..07156c6a87 100644 --- a/src/xrpld/peerfinder/detail/SlotImp.cpp +++ b/src/xrpld/peerfinder/detail/SlotImp.cpp @@ -1,21 +1,13 @@ -#include - #include -#include +#include #include -#include -#include -#include - -#include -#include - -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { SlotImp::SlotImp( beast::IP::Endpoint const& local_endpoint, - beast::IP::Endpoint remote_endpoint, + beast::IP::Endpoint const& remote_endpoint, bool fixed, clock_type& clock) : recent(clock) @@ -23,7 +15,7 @@ SlotImp::SlotImp( , m_fixed(fixed) , m_reserved(false) , m_state(accept) - , m_remote_endpoint(std::move(remote_endpoint)) + , m_remote_endpoint(remote_endpoint) , m_local_endpoint(local_endpoint) , m_listening_port(unknownPort) , checked(false) @@ -32,13 +24,13 @@ SlotImp::SlotImp( { } -SlotImp::SlotImp(beast::IP::Endpoint remote_endpoint, bool fixed, clock_type& clock) +SlotImp::SlotImp(beast::IP::Endpoint const& remote_endpoint, bool fixed, clock_type& clock) : recent(clock) , m_inbound(false) , m_fixed(fixed) , m_reserved(false) , m_state(connect) - , m_remote_endpoint(std::move(remote_endpoint)) + , m_remote_endpoint(remote_endpoint) , m_listening_port(unknownPort) , checked(true) , canAccept(true) @@ -133,4 +125,5 @@ SlotImp::recent_t::expire() beast::expire(cache, Tuning::liveCacheSecondsToLive); } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/SlotImp.h b/src/xrpld/peerfinder/detail/SlotImp.h index a94473be87..f18410d214 100644 --- a/src/xrpld/peerfinder/detail/SlotImp.h +++ b/src/xrpld/peerfinder/detail/SlotImp.h @@ -8,7 +8,8 @@ #include #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { class SlotImp : public Slot { @@ -18,12 +19,12 @@ public: // inbound SlotImp( beast::IP::Endpoint const& local_endpoint, - beast::IP::Endpoint remote_endpoint, + beast::IP::Endpoint const& remote_endpoint, bool fixed, clock_type& clock); // outbound - SlotImp(beast::IP::Endpoint remote_endpoint, bool fixed, clock_type& clock); + SlotImp(beast::IP::Endpoint const& remote_endpoint, bool fixed, clock_type& clock); bool inbound() const override @@ -189,4 +190,5 @@ public: clock_type::time_point whenAcceptEndpoints; }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Source.h b/src/xrpld/peerfinder/detail/Source.h index c86176911e..8fc97b639f 100644 --- a/src/xrpld/peerfinder/detail/Source.h +++ b/src/xrpld/peerfinder/detail/Source.h @@ -4,7 +4,8 @@ #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** A static or dynamic source of peer addresses. These are used as fallbacks when we are bootstrapping and don't have @@ -29,7 +30,9 @@ public: IPAddresses addresses; }; - virtual ~Source() = default; + virtual ~Source() + { + } virtual std::string const& name() = 0; virtual void @@ -40,4 +43,5 @@ public: fetch(Results& results, beast::Journal journal) = 0; }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/SourceStrings.cpp b/src/xrpld/peerfinder/detail/SourceStrings.cpp index 4f6d58450c..eb2e62fc09 100644 --- a/src/xrpld/peerfinder/detail/SourceStrings.cpp +++ b/src/xrpld/peerfinder/detail/SourceStrings.cpp @@ -1,25 +1,17 @@ #include -#include - -#include -#include - -#include -#include -#include - -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { class SourceStringsImp : public SourceStrings { public: - SourceStringsImp(std::string name, Strings strings) - : m_name(std::move(name)), m_strings(std::move(strings)) + SourceStringsImp(std::string const& name, Strings const& strings) + : m_name(name), m_strings(strings) { } - ~SourceStringsImp() override = default; + ~SourceStringsImp() = default; std::string const& name() override @@ -55,4 +47,5 @@ SourceStrings::New(std::string const& name, Strings const& strings) return std::make_shared(name, strings); } -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/SourceStrings.h b/src/xrpld/peerfinder/detail/SourceStrings.h index 11b2b927ee..1cf6d81040 100644 --- a/src/xrpld/peerfinder/detail/SourceStrings.h +++ b/src/xrpld/peerfinder/detail/SourceStrings.h @@ -4,7 +4,8 @@ #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** Provides addresses from a static set of strings. */ class SourceStrings : public Source @@ -18,4 +19,5 @@ public: New(std::string const& name, Strings const& strings); }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Store.h b/src/xrpld/peerfinder/detail/Store.h index 347fc09b15..390f80800a 100644 --- a/src/xrpld/peerfinder/detail/Store.h +++ b/src/xrpld/peerfinder/detail/Store.h @@ -1,12 +1,15 @@ #pragma once -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** Abstract persistence for PeerFinder data. */ class Store { public: - virtual ~Store() = default; + virtual ~Store() + { + } // load the bootstrap cache using load_callback = std::function; @@ -25,4 +28,5 @@ public: save(std::vector const& v) = 0; }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/StoreSqdb.h b/src/xrpld/peerfinder/detail/StoreSqdb.h index 626a82c932..47b8a6825c 100644 --- a/src/xrpld/peerfinder/detail/StoreSqdb.h +++ b/src/xrpld/peerfinder/detail/StoreSqdb.h @@ -5,7 +5,8 @@ #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** Database persistence for PeerFinder using SQLite */ class StoreSqdb : public Store @@ -25,7 +26,9 @@ public: { } - ~StoreSqdb() override = default; + ~StoreSqdb() + { + } void open(BasicConfig const& config) @@ -82,4 +85,5 @@ private: } }; -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/detail/Tuning.h b/src/xrpld/peerfinder/detail/Tuning.h index 23a96a7374..d572c7b5e3 100644 --- a/src/xrpld/peerfinder/detail/Tuning.h +++ b/src/xrpld/peerfinder/detail/Tuning.h @@ -2,9 +2,12 @@ #include +namespace xrpl { +namespace PeerFinder { + /** Heuristically tuned constants. */ /** @{ */ -namespace xrpl::PeerFinder::Tuning { +namespace Tuning { enum { //--------------------------------------------------------- @@ -107,5 +110,8 @@ std::chrono::seconds constexpr liveCacheSecondsToLive(30); // Note that we ignore the port for purposes of comparison. std::chrono::seconds constexpr recentAttemptDuration(60); -} // namespace xrpl::PeerFinder::Tuning +} // namespace Tuning /** @} */ + +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/peerfinder/make_Manager.h b/src/xrpld/peerfinder/make_Manager.h index 8350255ae2..846907e08c 100644 --- a/src/xrpld/peerfinder/make_Manager.h +++ b/src/xrpld/peerfinder/make_Manager.h @@ -6,7 +6,8 @@ #include -namespace xrpl::PeerFinder { +namespace xrpl { +namespace PeerFinder { /** Create a new Manager. */ std::unique_ptr @@ -17,4 +18,5 @@ make_Manager( BasicConfig const& config, beast::insight::Collector::ptr const& collector); -} // namespace xrpl::PeerFinder +} // namespace PeerFinder +} // namespace xrpl diff --git a/src/xrpld/perflog/detail/PerfLogImp.cpp b/src/xrpld/perflog/detail/PerfLogImp.cpp index 57e7be5156..266c99a147 100644 --- a/src/xrpld/perflog/detail/PerfLogImp.cpp +++ b/src/xrpld/perflog/detail/PerfLogImp.cpp @@ -1,36 +1,25 @@ #include #include -#include -#include #include #include -#include -#include #include -#include -#include #include -#include -#include -#include - -#include +#include #include #include -#include -#include -#include +#include #include -#include -#include +#include +#include +#include #include #include #include -#include -namespace xrpl::perf { +namespace xrpl { +namespace perf { PerfLogImp::Counters::Counters(std::set const& labels, JobTypes const& jobTypes) { @@ -295,11 +284,11 @@ PerfLogImp::report() } PerfLogImp::PerfLogImp( - Setup setup, + Setup const& setup, Application& app, beast::Journal journal, std::function&& signalStop) - : setup_(std::move(setup)), app_(app), j_(journal), signalStop_(std::move(signalStop)) + : setup_(setup), app_(app), j_(journal), signalStop_(std::move(signalStop)) { openLog(); } @@ -505,4 +494,5 @@ make_PerfLog( return std::make_unique(setup, app, journal, std::move(signalStop)); } -} // namespace xrpl::perf +} // namespace perf +} // namespace xrpl diff --git a/src/xrpld/perflog/detail/PerfLogImp.h b/src/xrpld/perflog/detail/PerfLogImp.h index 2898158ea5..61329fb198 100644 --- a/src/xrpld/perflog/detail/PerfLogImp.h +++ b/src/xrpld/perflog/detail/PerfLogImp.h @@ -16,7 +16,8 @@ #include #include -namespace xrpl::perf { +namespace xrpl { +namespace perf { /** A box coupling data with a mutex for locking access to it. */ template @@ -122,7 +123,7 @@ class PerfLogImp : public PerfLog public: PerfLogImp( - Setup setup, + Setup const& setup, Application& app, beast::Journal journal, std::function&& signalStop); @@ -176,4 +177,5 @@ public: stop() override; }; -} // namespace xrpl::perf +} // namespace perf +} // namespace xrpl diff --git a/src/xrpld/rpc/BookChanges.h b/src/xrpld/rpc/BookChanges.h index 89b99cabe3..41853ee890 100644 --- a/src/xrpld/rpc/BookChanges.h +++ b/src/xrpld/rpc/BookChanges.h @@ -102,7 +102,7 @@ computeBookChanges(std::shared_ptr const& lpAccepted) std::string const g{to_string(deltaGets.asset())}; std::string const p{to_string(deltaPays.asset())}; - bool const noswap = isXRP(deltaGets) || (!isXRP(deltaPays) && (g < p)); + bool const noswap = isXRP(deltaGets) ? true : (isXRP(deltaPays) ? false : (g < p)); STAmount first = noswap ? deltaGets : deltaPays; STAmount second = noswap ? deltaPays : deltaGets; @@ -121,20 +121,15 @@ computeBookChanges(std::shared_ptr const& lpAccepted) std::stringstream ss; if (noswap) - { ss << g << "|" << p; - } else - { ss << p << "|" << g; - } std::optional const domain = finalFields[~sfDomainID]; std::string const key{ss.str()}; - if (!tally.contains(key)) - { + if (tally.find(key) == tally.end()) tally[key] = { first, // side A vol second, // side B vol @@ -143,7 +138,6 @@ computeBookChanges(std::shared_ptr const& lpAccepted) rate, // open rate, // close domain}; - } else { // increment volume diff --git a/src/xrpld/rpc/CTID.h b/src/xrpld/rpc/CTID.h index 9b36cf167d..42efb4c157 100644 --- a/src/xrpld/rpc/CTID.h +++ b/src/xrpld/rpc/CTID.h @@ -6,7 +6,9 @@ #include #include -namespace xrpl::RPC { +namespace xrpl { + +namespace RPC { // CTID stands for Concise Transaction ID. // @@ -106,4 +108,5 @@ decodeCTID(T const ctid) noexcept return std::make_tuple(ledgerSeq, txnIndex, networkID); } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/Context.h b/src/xrpld/rpc/Context.h index 58768d028a..e77d9adeb3 100644 --- a/src/xrpld/rpc/Context.h +++ b/src/xrpld/rpc/Context.h @@ -24,8 +24,8 @@ struct Context LedgerMaster& ledgerMaster; Resource::Consumer& consumer; Role role; - std::shared_ptr coro; - InfoSub::pointer infoSub; + std::shared_ptr coro{}; + InfoSub::pointer infoSub{}; unsigned int apiVersion; }; diff --git a/src/xrpld/rpc/MPTokenIssuanceID.h b/src/xrpld/rpc/MPTokenIssuanceID.h index b48f785f87..9e60c44ee0 100644 --- a/src/xrpld/rpc/MPTokenIssuanceID.h +++ b/src/xrpld/rpc/MPTokenIssuanceID.h @@ -8,7 +8,9 @@ #include #include -namespace xrpl::RPC { +namespace xrpl { + +namespace RPC { /** Add a `mpt_issuance_id` field to the `meta` input/output parameter. @@ -33,4 +35,5 @@ insertMPTokenIssuanceID( TxMeta const& transactionMeta); /** @} */ -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/RPCHandler.h b/src/xrpld/rpc/RPCHandler.h index c8133f3fe6..519740b75d 100644 --- a/src/xrpld/rpc/RPCHandler.h +++ b/src/xrpld/rpc/RPCHandler.h @@ -3,7 +3,8 @@ #include #include -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { struct JsonContext; @@ -14,4 +15,5 @@ doCommand(RPC::JsonContext&, Json::Value&); Role roleRequired(unsigned int version, bool betaEnabled, std::string const& method); -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/Status.h b/src/xrpld/rpc/Status.h index f0c6d932e7..418ad9ccae 100644 --- a/src/xrpld/rpc/Status.h +++ b/src/xrpld/rpc/Status.h @@ -4,7 +4,8 @@ #include #include -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { /** Status represents the results of an operation that might fail. @@ -27,7 +28,7 @@ public: Status() = default; // The enable_if allows only integers (not enums). Prevents enum narrowing. - template >> + template ::value>> Status(T code, Strings d = {}) : code_(code), messages_(std::move(d)) { } @@ -92,13 +93,9 @@ public: if (auto ec = toErrorCode()) { if (messages_.empty()) - { inject_error(ec, object); - } else - { inject_error(ec, message(), object); - } } } @@ -133,4 +130,5 @@ private: Strings messages_; }; -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/AccountAssets.cpp b/src/xrpld/rpc/detail/AccountAssets.cpp index b990939bd6..fbe3169bf7 100644 --- a/src/xrpld/rpc/detail/AccountAssets.cpp +++ b/src/xrpld/rpc/detail/AccountAssets.cpp @@ -1,16 +1,5 @@ #include -#include -#include - -#include -#include -#include -#include -#include - -#include - namespace xrpl { hash_set diff --git a/src/xrpld/rpc/detail/AssetCache.cpp b/src/xrpld/rpc/detail/AssetCache.cpp index bbe8fefc98..0eb9434e91 100644 --- a/src/xrpld/rpc/detail/AssetCache.cpp +++ b/src/xrpld/rpc/detail/AssetCache.cpp @@ -1,24 +1,8 @@ #include - -#include #include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include - -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/DeliveredAmount.cpp b/src/xrpld/rpc/detail/DeliveredAmount.cpp index 6b9ef15db5..e2f5bd8cd9 100644 --- a/src/xrpld/rpc/detail/DeliveredAmount.cpp +++ b/src/xrpld/rpc/detail/DeliveredAmount.cpp @@ -1,22 +1,14 @@ -#include - #include +#include #include #include +#include -#include -#include -#include -#include -#include -#include -#include +#include +#include -#include -#include -#include - -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { /* GetLedgerIndex and GetCloseTime are lambdas that allow the close time and @@ -178,4 +170,5 @@ insertDeliveredAmount( } } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/Handler.cpp b/src/xrpld/rpc/detail/Handler.cpp index b8489e0b34..05fc1cb0b4 100644 --- a/src/xrpld/rpc/detail/Handler.cpp +++ b/src/xrpld/rpc/detail/Handler.cpp @@ -1,24 +1,14 @@ #include - -#include -#include #include -#include #include #include -#include -#include #include -#include -#include #include -#include -#include -#include -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { namespace { /** Adjust an old-style handler to be call-by-reference. */ @@ -78,293 +68,79 @@ handlerFrom() Handler const handlerArray[]{ // Some handlers not specified here are added to the table via addHandler() // Request-response methods - {.name_ = "account_info", - .valueMethod_ = byRef(&doAccountInfo), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "account_currencies", - .valueMethod_ = byRef(&doAccountCurrencies), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "account_lines", - .valueMethod_ = byRef(&doAccountLines), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "account_channels", - .valueMethod_ = byRef(&doAccountChannels), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "account_nfts", - .valueMethod_ = byRef(&doAccountNFTs), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "account_objects", - .valueMethod_ = byRef(&doAccountObjects), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "account_offers", - .valueMethod_ = byRef(&doAccountOffers), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "account_tx", - .valueMethod_ = byRef(&doAccountTx), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "amm_info", - .valueMethod_ = byRef(&doAMMInfo), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "blacklist", - .valueMethod_ = byRef(&doBlackList), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "book_changes", - .valueMethod_ = byRef(&doBookChanges), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "book_offers", - .valueMethod_ = byRef(&doBookOffers), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "can_delete", - .valueMethod_ = byRef(&doCanDelete), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "channel_authorize", - .valueMethod_ = byRef(&doChannelAuthorize), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "channel_verify", - .valueMethod_ = byRef(&doChannelVerify), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "connect", - .valueMethod_ = byRef(&doConnect), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "consensus_info", - .valueMethod_ = byRef(&doConsensusInfo), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "deposit_authorized", - .valueMethod_ = byRef(&doDepositAuthorized), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "feature", - .valueMethod_ = byRef(&doFeature), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "fee", - .valueMethod_ = byRef(&doFee), - .role_ = Role::USER, - .condition_ = NEEDS_CURRENT_LEDGER}, - {.name_ = "fetch_info", - .valueMethod_ = byRef(&doFetchInfo), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "gateway_balances", - .valueMethod_ = byRef(&doGatewayBalances), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "get_counts", - .valueMethod_ = byRef(&doGetCounts), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "get_aggregate_price", - .valueMethod_ = byRef(&doGetAggregatePrice), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "ledger_accept", - .valueMethod_ = byRef(&doLedgerAccept), - .role_ = Role::ADMIN, - .condition_ = NEEDS_CURRENT_LEDGER}, - {.name_ = "ledger_cleaner", - .valueMethod_ = byRef(&doLedgerCleaner), - .role_ = Role::ADMIN, - .condition_ = NEEDS_NETWORK_CONNECTION}, - {.name_ = "ledger_closed", - .valueMethod_ = byRef(&doLedgerClosed), - .role_ = Role::USER, - .condition_ = NEEDS_CLOSED_LEDGER}, - {.name_ = "ledger_current", - .valueMethod_ = byRef(&doLedgerCurrent), - .role_ = Role::USER, - .condition_ = NEEDS_CURRENT_LEDGER}, - {.name_ = "ledger_data", - .valueMethod_ = byRef(&doLedgerData), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "ledger_entry", - .valueMethod_ = byRef(&doLedgerEntry), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "ledger_header", - .valueMethod_ = byRef(&doLedgerHeader), - .role_ = Role::USER, - .condition_ = NO_CONDITION, - .minApiVer_ = 1, - .maxApiVer_ = 1}, - {.name_ = "ledger_request", - .valueMethod_ = byRef(&doLedgerRequest), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "log_level", - .valueMethod_ = byRef(&doLogLevel), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "logrotate", - .valueMethod_ = byRef(&doLogRotate), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "manifest", - .valueMethod_ = byRef(&doManifest), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "nft_buy_offers", - .valueMethod_ = byRef(&doNFTBuyOffers), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "nft_sell_offers", - .valueMethod_ = byRef(&doNFTSellOffers), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "noripple_check", - .valueMethod_ = byRef(&doNoRippleCheck), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "owner_info", - .valueMethod_ = byRef(&doOwnerInfo), - .role_ = Role::USER, - .condition_ = NEEDS_CURRENT_LEDGER}, - {.name_ = "peers", - .valueMethod_ = byRef(&doPeers), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "path_find", - .valueMethod_ = byRef(&doPathFind), - .role_ = Role::USER, - .condition_ = NEEDS_CURRENT_LEDGER}, - {.name_ = "ping", - .valueMethod_ = byRef(&doPing), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "print", - .valueMethod_ = byRef(&doPrint), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, + {"account_info", byRef(&doAccountInfo), Role::USER, NO_CONDITION}, + {"account_currencies", byRef(&doAccountCurrencies), Role::USER, NO_CONDITION}, + {"account_lines", byRef(&doAccountLines), Role::USER, NO_CONDITION}, + {"account_channels", byRef(&doAccountChannels), Role::USER, NO_CONDITION}, + {"account_nfts", byRef(&doAccountNFTs), Role::USER, NO_CONDITION}, + {"account_objects", byRef(&doAccountObjects), Role::USER, NO_CONDITION}, + {"account_offers", byRef(&doAccountOffers), Role::USER, NO_CONDITION}, + {"account_tx", byRef(&doAccountTx), Role::USER, NO_CONDITION}, + {"amm_info", byRef(&doAMMInfo), Role::USER, NO_CONDITION}, + {"blacklist", byRef(&doBlackList), Role::ADMIN, NO_CONDITION}, + {"book_changes", byRef(&doBookChanges), Role::USER, NO_CONDITION}, + {"book_offers", byRef(&doBookOffers), Role::USER, NO_CONDITION}, + {"can_delete", byRef(&doCanDelete), Role::ADMIN, NO_CONDITION}, + {"channel_authorize", byRef(&doChannelAuthorize), Role::USER, NO_CONDITION}, + {"channel_verify", byRef(&doChannelVerify), Role::USER, NO_CONDITION}, + {"connect", byRef(&doConnect), Role::ADMIN, NO_CONDITION}, + {"consensus_info", byRef(&doConsensusInfo), Role::ADMIN, NO_CONDITION}, + {"deposit_authorized", byRef(&doDepositAuthorized), Role::USER, NO_CONDITION}, + {"feature", byRef(&doFeature), Role::USER, NO_CONDITION}, + {"fee", byRef(&doFee), Role::USER, NEEDS_CURRENT_LEDGER}, + {"fetch_info", byRef(&doFetchInfo), Role::ADMIN, NO_CONDITION}, + {"gateway_balances", byRef(&doGatewayBalances), Role::USER, NO_CONDITION}, + {"get_counts", byRef(&doGetCounts), Role::ADMIN, NO_CONDITION}, + {"get_aggregate_price", byRef(&doGetAggregatePrice), Role::USER, NO_CONDITION}, + {"ledger_accept", byRef(&doLedgerAccept), Role::ADMIN, NEEDS_CURRENT_LEDGER}, + {"ledger_cleaner", byRef(&doLedgerCleaner), Role::ADMIN, NEEDS_NETWORK_CONNECTION}, + {"ledger_closed", byRef(&doLedgerClosed), Role::USER, NEEDS_CLOSED_LEDGER}, + {"ledger_current", byRef(&doLedgerCurrent), Role::USER, NEEDS_CURRENT_LEDGER}, + {"ledger_data", byRef(&doLedgerData), Role::USER, NO_CONDITION}, + {"ledger_entry", byRef(&doLedgerEntry), Role::USER, NO_CONDITION}, + {"ledger_header", byRef(&doLedgerHeader), Role::USER, NO_CONDITION, 1, 1}, + {"ledger_request", byRef(&doLedgerRequest), Role::ADMIN, NO_CONDITION}, + {"log_level", byRef(&doLogLevel), Role::ADMIN, NO_CONDITION}, + {"logrotate", byRef(&doLogRotate), Role::ADMIN, NO_CONDITION}, + {"manifest", byRef(&doManifest), Role::USER, NO_CONDITION}, + {"nft_buy_offers", byRef(&doNFTBuyOffers), Role::USER, NO_CONDITION}, + {"nft_sell_offers", byRef(&doNFTSellOffers), Role::USER, NO_CONDITION}, + {"noripple_check", byRef(&doNoRippleCheck), Role::USER, NO_CONDITION}, + {"owner_info", byRef(&doOwnerInfo), Role::USER, NEEDS_CURRENT_LEDGER}, + {"peers", byRef(&doPeers), Role::ADMIN, NO_CONDITION}, + {"path_find", byRef(&doPathFind), Role::USER, NEEDS_CURRENT_LEDGER}, + {"ping", byRef(&doPing), Role::USER, NO_CONDITION}, + {"print", byRef(&doPrint), Role::ADMIN, NO_CONDITION}, // { "profile", byRef (&doProfile), Role::USER, // NEEDS_CURRENT_LEDGER }, - {.name_ = "random", - .valueMethod_ = byRef(&doRandom), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "peer_reservations_add", - .valueMethod_ = byRef(&doPeerReservationsAdd), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "peer_reservations_del", - .valueMethod_ = byRef(&doPeerReservationsDel), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "peer_reservations_list", - .valueMethod_ = byRef(&doPeerReservationsList), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "ripple_path_find", - .valueMethod_ = byRef(&doRipplePathFind), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "server_definitions", - .valueMethod_ = byRef(&doServerDefinitions), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "server_info", - .valueMethod_ = byRef(&doServerInfo), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "server_state", - .valueMethod_ = byRef(&doServerState), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "sign", - .valueMethod_ = byRef(&doSign), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "sign_for", - .valueMethod_ = byRef(&doSignFor), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "simulate", - .valueMethod_ = byRef(&doSimulate), - .role_ = Role::USER, - .condition_ = NEEDS_CURRENT_LEDGER}, - {.name_ = "stop", - .valueMethod_ = byRef(&doStop), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "submit", - .valueMethod_ = byRef(&doSubmit), - .role_ = Role::USER, - .condition_ = NEEDS_CURRENT_LEDGER}, - {.name_ = "submit_multisigned", - .valueMethod_ = byRef(&doSubmitMultiSigned), - .role_ = Role::USER, - .condition_ = NEEDS_CURRENT_LEDGER}, - {.name_ = "transaction_entry", - .valueMethod_ = byRef(&doTransactionEntry), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "tx", - .valueMethod_ = byRef(&doTxJson), - .role_ = Role::USER, - .condition_ = NEEDS_NETWORK_CONNECTION}, - {.name_ = "tx_history", - .valueMethod_ = byRef(&doTxHistory), - .role_ = Role::USER, - .condition_ = NO_CONDITION, - .minApiVer_ = 1, - .maxApiVer_ = 1}, - {.name_ = "tx_reduce_relay", - .valueMethod_ = byRef(&doTxReduceRelay), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "unl_list", - .valueMethod_ = byRef(&doUnlList), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "validation_create", - .valueMethod_ = byRef(&doValidationCreate), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "validators", - .valueMethod_ = byRef(&doValidators), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "validator_list_sites", - .valueMethod_ = byRef(&doValidatorListSites), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "validator_info", - .valueMethod_ = byRef(&doValidatorInfo), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, - {.name_ = "vault_info", - .valueMethod_ = byRef(&doVaultInfo), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "wallet_propose", - .valueMethod_ = byRef(&doWalletPropose), - .role_ = Role::ADMIN, - .condition_ = NO_CONDITION}, + {"random", byRef(&doRandom), Role::USER, NO_CONDITION}, + {"peer_reservations_add", byRef(&doPeerReservationsAdd), Role::ADMIN, NO_CONDITION}, + {"peer_reservations_del", byRef(&doPeerReservationsDel), Role::ADMIN, NO_CONDITION}, + {"peer_reservations_list", byRef(&doPeerReservationsList), Role::ADMIN, NO_CONDITION}, + {"ripple_path_find", byRef(&doRipplePathFind), Role::USER, NO_CONDITION}, + {"server_definitions", byRef(&doServerDefinitions), Role::USER, NO_CONDITION}, + {"server_info", byRef(&doServerInfo), Role::USER, NO_CONDITION}, + {"server_state", byRef(&doServerState), Role::USER, NO_CONDITION}, + {"sign", byRef(&doSign), Role::USER, NO_CONDITION}, + {"sign_for", byRef(&doSignFor), Role::USER, NO_CONDITION}, + {"simulate", byRef(&doSimulate), Role::USER, NEEDS_CURRENT_LEDGER}, + {"stop", byRef(&doStop), Role::ADMIN, NO_CONDITION}, + {"submit", byRef(&doSubmit), Role::USER, NEEDS_CURRENT_LEDGER}, + {"submit_multisigned", byRef(&doSubmitMultiSigned), Role::USER, NEEDS_CURRENT_LEDGER}, + {"transaction_entry", byRef(&doTransactionEntry), Role::USER, NO_CONDITION}, + {"tx", byRef(&doTxJson), Role::USER, NEEDS_NETWORK_CONNECTION}, + {"tx_history", byRef(&doTxHistory), Role::USER, NO_CONDITION, 1, 1}, + {"tx_reduce_relay", byRef(&doTxReduceRelay), Role::USER, NO_CONDITION}, + {"unl_list", byRef(&doUnlList), Role::ADMIN, NO_CONDITION}, + {"validation_create", byRef(&doValidationCreate), Role::ADMIN, NO_CONDITION}, + {"validators", byRef(&doValidators), Role::ADMIN, NO_CONDITION}, + {"validator_list_sites", byRef(&doValidatorListSites), Role::ADMIN, NO_CONDITION}, + {"validator_info", byRef(&doValidatorInfo), Role::ADMIN, NO_CONDITION}, + {"vault_info", byRef(&doVaultInfo), Role::USER, NO_CONDITION}, + {"wallet_propose", byRef(&doWalletPropose), Role::ADMIN, NO_CONDITION}, // Event methods - {.name_ = "subscribe", - .valueMethod_ = byRef(&doSubscribe), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, - {.name_ = "unsubscribe", - .valueMethod_ = byRef(&doUnsubscribe), - .role_ = Role::USER, - .condition_ = NO_CONDITION}, + {"subscribe", byRef(&doSubscribe), Role::USER, NO_CONDITION}, + {"unsubscribe", byRef(&doUnsubscribe), Role::USER, NO_CONDITION}, }; class HandlerTable @@ -486,4 +262,5 @@ getHandlerNames() return HandlerTable::instance().getHandlerNames(); } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/Handler.h b/src/xrpld/rpc/detail/Handler.h index d249409ffe..3628962a69 100644 --- a/src/xrpld/rpc/detail/Handler.h +++ b/src/xrpld/rpc/detail/Handler.h @@ -12,7 +12,8 @@ namespace Json { class Object; } // namespace Json -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { // Under what condition can we call this RPC? enum Condition { @@ -110,4 +111,5 @@ conditionMet(Condition condition_required, T& context) return rpcSUCCESS; } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/LegacyPathFind.cpp b/src/xrpld/rpc/detail/LegacyPathFind.cpp index 11debe00c1..5b5bcc540b 100644 --- a/src/xrpld/rpc/detail/LegacyPathFind.cpp +++ b/src/xrpld/rpc/detail/LegacyPathFind.cpp @@ -1,15 +1,13 @@ -#include - #include +#include #include #include #include #include -#include - -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { LegacyPathFind::LegacyPathFind(bool isAdmin, Application& app) { @@ -47,4 +45,5 @@ LegacyPathFind::~LegacyPathFind() std::atomic LegacyPathFind::inProgress(0); -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/MPTokenIssuanceID.cpp b/src/xrpld/rpc/detail/MPTokenIssuanceID.cpp index 8af745122a..48e5579581 100644 --- a/src/xrpld/rpc/detail/MPTokenIssuanceID.cpp +++ b/src/xrpld/rpc/detail/MPTokenIssuanceID.cpp @@ -1,22 +1,8 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +namespace xrpl { -#include -#include - -namespace xrpl::RPC { +namespace RPC { bool canHaveMPTokenIssuanceID( @@ -67,4 +53,5 @@ insertMPTokenIssuanceID( response[jss::mpt_issuance_id] = to_string(result.value()); } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/PathRequest.cpp b/src/xrpld/rpc/detail/PathRequest.cpp index b4ac252f10..e732ef646f 100644 --- a/src/xrpld/rpc/detail/PathRequest.cpp +++ b/src/xrpld/rpc/detail/PathRequest.cpp @@ -1,50 +1,21 @@ -#include - #include #include #include +#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include -#include -#include -#include #include +#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/PathRequest.h b/src/xrpld/rpc/detail/PathRequest.h index 046c643a84..f699ccb6f8 100644 --- a/src/xrpld/rpc/detail/PathRequest.h +++ b/src/xrpld/rpc/detail/PathRequest.h @@ -24,7 +24,7 @@ class AssetCache; class PathRequestManager; // Return values from parseJson <0 = invalid, >0 = valid -#define PFR_PJ_INVALID (-1) +#define PFR_PJ_INVALID -1 #define PFR_PJ_NOCHANGE 0 class PathRequest final : public InfoSubRequest, @@ -57,7 +57,7 @@ public: PathRequestManager&, beast::Journal journal); - ~PathRequest() override; + ~PathRequest(); bool isNew(); diff --git a/src/xrpld/rpc/detail/PathRequestManager.cpp b/src/xrpld/rpc/detail/PathRequestManager.cpp index 7508884be1..73d57a771c 100644 --- a/src/xrpld/rpc/detail/PathRequestManager.cpp +++ b/src/xrpld/rpc/detail/PathRequestManager.cpp @@ -1,28 +1,13 @@ -#include - #include #include -#include -#include +#include -#include -#include #include -#include -#include #include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -149,16 +134,17 @@ PathRequestManager::updateAll(std::shared_ptr const& inLedger) // Remove any dangling weak pointers or weak // pointers that refer to this path request. - auto ret = std::ranges::remove_if(requests_, [&removed, &request](auto const& wl) { - auto r = wl.lock(); + auto ret = std::remove_if( + requests_.begin(), requests_.end(), [&removed, &request](auto const& wl) { + auto r = wl.lock(); - if (r && r != request) - return false; - ++removed; - return true; - }); + if (r && r != request) + return false; + ++removed; + return true; + }); - requests_.erase(ret.begin(), ret.end()); + requests_.erase(ret, requests_.end()); } mustBreak = !newRequests && app_.getLedgerMaster().isNewPathRequest(); @@ -217,7 +203,7 @@ PathRequestManager::insertPathRequest(PathRequest::pointer const& req) // Insert after any older unserviced requests but before // any serviced requests - auto ret = std::ranges::find_if(requests_, [](auto const& wl) { + auto ret = std::find_if(requests_.begin(), requests_.end(), [](auto const& wl) { auto r = wl.lock(); // We come before handled requests diff --git a/src/xrpld/rpc/detail/Pathfinder.cpp b/src/xrpld/rpc/detail/Pathfinder.cpp index a31d4522a7..6bb085042b 100644 --- a/src/xrpld/rpc/detail/Pathfinder.cpp +++ b/src/xrpld/rpc/detail/Pathfinder.cpp @@ -1,46 +1,17 @@ -#include - #include -#include +#include #include #include -#include -#include -#include #include -#include -#include -#include #include -#include // IWYU pragma: keep -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include /* @@ -564,8 +535,10 @@ Pathfinder::rankPaths( // width of path // length of path // A better PathRank is lower, best are sorted to the beginning. - std::ranges::sort( - rankedPaths, [&](Pathfinder::PathRank const& a, Pathfinder::PathRank const& b) { + std::sort( + rankedPaths.begin(), + rankedPaths.end(), + [&](Pathfinder::PathRank const& a, Pathfinder::PathRank const& b) { // 1) Higher quality (lower cost) is better if (!convert_all_ && a.quality != b.quality) return a.quality < b.quality; @@ -1158,9 +1131,9 @@ Pathfinder::addLink( if (!candidates.empty()) { - std::ranges::sort( - candidates, - + std::sort( + candidates.begin(), + candidates.end(), std::bind( compareAccountCandidate, mLedger->seq(), diff --git a/src/xrpld/rpc/detail/Pathfinder.h b/src/xrpld/rpc/detail/Pathfinder.h index 964ec8c1d1..48f02bb8f9 100644 --- a/src/xrpld/rpc/detail/Pathfinder.h +++ b/src/xrpld/rpc/detail/Pathfinder.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include diff --git a/src/xrpld/rpc/detail/RPCCall.cpp b/src/xrpld/rpc/detail/RPCCall.cpp index 749b66791e..4396037f2e 100644 --- a/src/xrpld/rpc/detail/RPCCall.cpp +++ b/src/xrpld/rpc/detail/RPCCall.cpp @@ -1,56 +1,32 @@ #include - -#include #include #include #include -#include #include #include -#include #include #include -#include -#include -#include #include #include -#include #include #include -#include #include #include -#include #include #include #include +#include #include -#include #include -#include #include -#include -#include -#include +#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include +#include #include -#include -#include namespace xrpl { @@ -1273,212 +1249,74 @@ public: // Request-response methods // - Returns an error, or the request. // - To modify the method, provide a new method in the request. - {.name = "account_currencies", - .parse = &RPCParser::parseAccountCurrencies, - .minParams = 1, - .maxParams = 3}, - {.name = "account_info", - .parse = &RPCParser::parseAccountItems, - .minParams = 1, - .maxParams = 3}, - {.name = "account_lines", - .parse = &RPCParser::parseAccountLines, - .minParams = 1, - .maxParams = 5}, - {.name = "account_channels", - .parse = &RPCParser::parseAccountChannels, - .minParams = 1, - .maxParams = 3}, - {.name = "account_nfts", - .parse = &RPCParser::parseAccountItems, - .minParams = 1, - .maxParams = 5}, - {.name = "account_objects", - .parse = &RPCParser::parseAccountItems, - .minParams = 1, - .maxParams = 5}, - {.name = "account_offers", - .parse = &RPCParser::parseAccountItems, - .minParams = 1, - .maxParams = 4}, - {.name = "account_tx", - .parse = &RPCParser::parseAccountTransactions, - .minParams = 1, - .maxParams = 8}, - {.name = "amm_info", .parse = &RPCParser::parseAsIs, .minParams = 1, .maxParams = 2}, - {.name = "vault_info", .parse = &RPCParser::parseVault, .minParams = 1, .maxParams = 2}, - {.name = "book_changes", - .parse = &RPCParser::parseLedgerId, - .minParams = 1, - .maxParams = 1}, - {.name = "book_offers", - .parse = &RPCParser::parseBookOffers, - .minParams = 2, - .maxParams = 7}, - {.name = "can_delete", - .parse = &RPCParser::parseCanDelete, - .minParams = 0, - .maxParams = 1}, - {.name = "channel_authorize", - .parse = &RPCParser::parseChannelAuthorize, - .minParams = 3, - .maxParams = 4}, - {.name = "channel_verify", - .parse = &RPCParser::parseChannelVerify, - .minParams = 4, - .maxParams = 4}, - {.name = "connect", .parse = &RPCParser::parseConnect, .minParams = 1, .maxParams = 2}, - {.name = "consensus_info", - .parse = &RPCParser::parseAsIs, - .minParams = 0, - .maxParams = 0}, - {.name = "deposit_authorized", - .parse = &RPCParser::parseDepositAuthorized, - .minParams = 2, - .maxParams = 11}, - {.name = "feature", .parse = &RPCParser::parseFeature, .minParams = 0, .maxParams = 2}, - {.name = "fetch_info", - .parse = &RPCParser::parseFetchInfo, - .minParams = 0, - .maxParams = 1}, - {.name = "gateway_balances", - .parse = &RPCParser::parseGatewayBalances, - .minParams = 1, - .maxParams = -1}, - {.name = "get_counts", - .parse = &RPCParser::parseGetCounts, - .minParams = 0, - .maxParams = 1}, - {.name = "json", .parse = &RPCParser::parseJson, .minParams = 2, .maxParams = 2}, - {.name = "json2", .parse = &RPCParser::parseJson2, .minParams = 1, .maxParams = 1}, - {.name = "ledger", .parse = &RPCParser::parseLedger, .minParams = 0, .maxParams = 2}, - {.name = "ledger_accept", - .parse = &RPCParser::parseAsIs, - .minParams = 0, - .maxParams = 0}, - {.name = "ledger_closed", - .parse = &RPCParser::parseAsIs, - .minParams = 0, - .maxParams = 0}, - {.name = "ledger_current", - .parse = &RPCParser::parseAsIs, - .minParams = 0, - .maxParams = 0}, - {.name = "ledger_entry", - .parse = &RPCParser::parseLedgerEntry, - .minParams = 1, - .maxParams = 2}, - {.name = "ledger_header", - .parse = &RPCParser::parseLedgerId, - .minParams = 1, - .maxParams = 1}, - {.name = "ledger_request", - .parse = &RPCParser::parseLedgerId, - .minParams = 1, - .maxParams = 1}, - {.name = "log_level", - .parse = &RPCParser::parseLogLevel, - .minParams = 0, - .maxParams = 2}, - {.name = "logrotate", .parse = &RPCParser::parseAsIs, .minParams = 0, .maxParams = 0}, - {.name = "manifest", - .parse = &RPCParser::parseManifest, - .minParams = 1, - .maxParams = 1}, - {.name = "owner_info", - .parse = &RPCParser::parseAccountItems, - .minParams = 1, - .maxParams = 3}, - {.name = "peers", .parse = &RPCParser::parseAsIs, .minParams = 0, .maxParams = 0}, - {.name = "ping", .parse = &RPCParser::parseAsIs, .minParams = 0, .maxParams = 0}, - {.name = "print", .parse = &RPCParser::parseAsIs, .minParams = 0, .maxParams = 1}, + {"account_currencies", &RPCParser::parseAccountCurrencies, 1, 3}, + {"account_info", &RPCParser::parseAccountItems, 1, 3}, + {"account_lines", &RPCParser::parseAccountLines, 1, 5}, + {"account_channels", &RPCParser::parseAccountChannels, 1, 3}, + {"account_nfts", &RPCParser::parseAccountItems, 1, 5}, + {"account_objects", &RPCParser::parseAccountItems, 1, 5}, + {"account_offers", &RPCParser::parseAccountItems, 1, 4}, + {"account_tx", &RPCParser::parseAccountTransactions, 1, 8}, + {"amm_info", &RPCParser::parseAsIs, 1, 2}, + {"vault_info", &RPCParser::parseVault, 1, 2}, + {"book_changes", &RPCParser::parseLedgerId, 1, 1}, + {"book_offers", &RPCParser::parseBookOffers, 2, 7}, + {"can_delete", &RPCParser::parseCanDelete, 0, 1}, + {"channel_authorize", &RPCParser::parseChannelAuthorize, 3, 4}, + {"channel_verify", &RPCParser::parseChannelVerify, 4, 4}, + {"connect", &RPCParser::parseConnect, 1, 2}, + {"consensus_info", &RPCParser::parseAsIs, 0, 0}, + {"deposit_authorized", &RPCParser::parseDepositAuthorized, 2, 11}, + {"feature", &RPCParser::parseFeature, 0, 2}, + {"fetch_info", &RPCParser::parseFetchInfo, 0, 1}, + {"gateway_balances", &RPCParser::parseGatewayBalances, 1, -1}, + {"get_counts", &RPCParser::parseGetCounts, 0, 1}, + {"json", &RPCParser::parseJson, 2, 2}, + {"json2", &RPCParser::parseJson2, 1, 1}, + {"ledger", &RPCParser::parseLedger, 0, 2}, + {"ledger_accept", &RPCParser::parseAsIs, 0, 0}, + {"ledger_closed", &RPCParser::parseAsIs, 0, 0}, + {"ledger_current", &RPCParser::parseAsIs, 0, 0}, + {"ledger_entry", &RPCParser::parseLedgerEntry, 1, 2}, + {"ledger_header", &RPCParser::parseLedgerId, 1, 1}, + {"ledger_request", &RPCParser::parseLedgerId, 1, 1}, + {"log_level", &RPCParser::parseLogLevel, 0, 2}, + {"logrotate", &RPCParser::parseAsIs, 0, 0}, + {"manifest", &RPCParser::parseManifest, 1, 1}, + {"owner_info", &RPCParser::parseAccountItems, 1, 3}, + {"peers", &RPCParser::parseAsIs, 0, 0}, + {"ping", &RPCParser::parseAsIs, 0, 0}, + {"print", &RPCParser::parseAsIs, 0, 1}, // { "profile", &RPCParser::parseProfile, 1, 9 // }, - {.name = "random", .parse = &RPCParser::parseAsIs, .minParams = 0, .maxParams = 0}, - {.name = "peer_reservations_add", - .parse = &RPCParser::parsePeerReservationsAdd, - .minParams = 1, - .maxParams = 2}, - {.name = "peer_reservations_del", - .parse = &RPCParser::parsePeerReservationsDel, - .minParams = 1, - .maxParams = 1}, - {.name = "peer_reservations_list", - .parse = &RPCParser::parseAsIs, - .minParams = 0, - .maxParams = 0}, - {.name = "ripple_path_find", - .parse = &RPCParser::parseRipplePathFind, - .minParams = 1, - .maxParams = 2}, - {.name = "server_definitions", - .parse = &RPCParser::parseServerDefinitions, - .minParams = 0, - .maxParams = 1}, - {.name = "server_info", - .parse = &RPCParser::parseServerInfo, - .minParams = 0, - .maxParams = 1}, - {.name = "server_state", - .parse = &RPCParser::parseServerInfo, - .minParams = 0, - .maxParams = 1}, - {.name = "sign", .parse = &RPCParser::parseSignSubmit, .minParams = 2, .maxParams = 4}, - {.name = "sign_for", .parse = &RPCParser::parseSignFor, .minParams = 3, .maxParams = 4}, - {.name = "stop", .parse = &RPCParser::parseAsIs, .minParams = 0, .maxParams = 0}, - {.name = "simulate", - .parse = &RPCParser::parseSimulate, - .minParams = 1, - .maxParams = 2}, - {.name = "submit", - .parse = &RPCParser::parseSignSubmit, - .minParams = 1, - .maxParams = 4}, - {.name = "submit_multisigned", - .parse = &RPCParser::parseSubmitMultiSigned, - .minParams = 1, - .maxParams = 1}, - {.name = "transaction_entry", - .parse = &RPCParser::parseTransactionEntry, - .minParams = 2, - .maxParams = 2}, - {.name = "tx", .parse = &RPCParser::parseTx, .minParams = 1, .maxParams = 4}, - {.name = "tx_history", - .parse = &RPCParser::parseTxHistory, - .minParams = 1, - .maxParams = 1}, - {.name = "unl_list", .parse = &RPCParser::parseAsIs, .minParams = 0, .maxParams = 0}, - {.name = "validation_create", - .parse = &RPCParser::parseValidationCreate, - .minParams = 0, - .maxParams = 1}, - {.name = "validator_info", - .parse = &RPCParser::parseAsIs, - .minParams = 0, - .maxParams = 0}, - {.name = "version", .parse = &RPCParser::parseAsIs, .minParams = 0, .maxParams = 0}, - {.name = "wallet_propose", - .parse = &RPCParser::parseWalletPropose, - .minParams = 0, - .maxParams = 1}, - {.name = "internal", - .parse = &RPCParser::parseInternal, - .minParams = 1, - .maxParams = -1}, + {"random", &RPCParser::parseAsIs, 0, 0}, + {"peer_reservations_add", &RPCParser::parsePeerReservationsAdd, 1, 2}, + {"peer_reservations_del", &RPCParser::parsePeerReservationsDel, 1, 1}, + {"peer_reservations_list", &RPCParser::parseAsIs, 0, 0}, + {"ripple_path_find", &RPCParser::parseRipplePathFind, 1, 2}, + {"server_definitions", &RPCParser::parseServerDefinitions, 0, 1}, + {"server_info", &RPCParser::parseServerInfo, 0, 1}, + {"server_state", &RPCParser::parseServerInfo, 0, 1}, + {"sign", &RPCParser::parseSignSubmit, 2, 4}, + {"sign_for", &RPCParser::parseSignFor, 3, 4}, + {"stop", &RPCParser::parseAsIs, 0, 0}, + {"simulate", &RPCParser::parseSimulate, 1, 2}, + {"submit", &RPCParser::parseSignSubmit, 1, 4}, + {"submit_multisigned", &RPCParser::parseSubmitMultiSigned, 1, 1}, + {"transaction_entry", &RPCParser::parseTransactionEntry, 2, 2}, + {"tx", &RPCParser::parseTx, 1, 4}, + {"tx_history", &RPCParser::parseTxHistory, 1, 1}, + {"unl_list", &RPCParser::parseAsIs, 0, 0}, + {"validation_create", &RPCParser::parseValidationCreate, 0, 1}, + {"validator_info", &RPCParser::parseAsIs, 0, 0}, + {"version", &RPCParser::parseAsIs, 0, 0}, + {"wallet_propose", &RPCParser::parseWalletPropose, 0, 1}, + {"internal", &RPCParser::parseInternal, 1, -1}, // Event methods - {.name = "path_find", - .parse = &RPCParser::parseEvented, - .minParams = -1, - .maxParams = -1}, - {.name = "subscribe", - .parse = &RPCParser::parseEvented, - .minParams = -1, - .maxParams = -1}, - {.name = "unsubscribe", - .parse = &RPCParser::parseEvented, - .minParams = -1, - .maxParams = -1}, + {"path_find", &RPCParser::parseEvented, -1, -1}, + {"subscribe", &RPCParser::parseEvented, -1, -1}, + {"unsubscribe", &RPCParser::parseEvented, -1, -1}, }; auto const count = jvParams.size(); @@ -1574,8 +1412,8 @@ struct RPCCallImp // Parse reply JLOG(j.debug()) << "RPC reply: " << strData << std::endl; - if (strData.starts_with("Unable to parse request") || - strData.starts_with(jss::invalid_API_version.c_str())) + if (strData.find("Unable to parse request") == 0 || + strData.find(jss::invalid_API_version.c_str()) == 0) Throw(strData); Json::Reader reader; Json::Value jvReply; @@ -1652,7 +1490,6 @@ rpcCmdToJson( } else if (jvRequest.isArray()) { - // NOLINTNEXTLINE(modernize-use-ranges) std::for_each(jvRequest.begin(), jvRequest.end(), insert_api_version); } @@ -1795,7 +1632,7 @@ rpcClient( // YYY We could have a command line flag for single line output for // scripts. YYY We would intercept output here and simplify it. } - catch (RequestNotParsable const& e) + catch (RequestNotParsable& e) { jvOutput = rpcError(rpcINVALID_PARAMS); jvOutput["error_what"] = e.what(); diff --git a/src/xrpld/rpc/detail/RPCHandler.cpp b/src/xrpld/rpc/detail/RPCHandler.cpp index cbd08a2677..1d8e1168b4 100644 --- a/src/xrpld/rpc/detail/RPCHandler.cpp +++ b/src/xrpld/rpc/detail/RPCHandler.cpp @@ -1,29 +1,29 @@ -#include - +#include +#include +#include #include #include #include +#include #include -#include #include #include #include -#include #include #include -#include // IWYU pragma: keep +#include #include #include #include +#include +#include #include #include -#include -#include -#include -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { namespace { @@ -234,4 +234,5 @@ roleRequired(unsigned int version, bool betaEnabled, std::string const& method) return handler->role_; } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/RPCHelpers.cpp b/src/xrpld/rpc/detail/RPCHelpers.cpp index 1bf6d32bf9..e7b56feac4 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCHelpers.cpp @@ -1,49 +1,23 @@ -#include - +#include #include #include -#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { std::uint64_t getStartHint(std::shared_ptr const& sle, AccountID const& accountID) @@ -470,4 +444,5 @@ parseSubUnsubJson( return rpcSUCCESS; } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp index 0934289226..955533c776 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.cpp @@ -1,32 +1,15 @@ -#include - -#include #include #include +#include #include -#include -#include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include +#include -#include -#include - -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { namespace { @@ -492,4 +475,5 @@ getOrAcquireLedger(RPC::JsonContext const& context) RPC::make_error(rpcNOT_READY, "findCreate failed to return an inbound ledger")); } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/RPCSub.cpp b/src/xrpld/rpc/detail/RPCSub.cpp index f9cd860908..3b5b56d937 100644 --- a/src/xrpld/rpc/detail/RPCSub.cpp +++ b/src/xrpld/rpc/detail/RPCSub.cpp @@ -1,28 +1,12 @@ -#include - #include +#include #include #include #include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include +#include -#include - -#include #include -#include -#include -#include -#include -#include -#include -#include namespace xrpl { @@ -35,15 +19,15 @@ public: boost::asio::io_context& io_context, JobQueue& jobQueue, std::string const& strUrl, - std::string strUsername, - std::string strPassword, + std::string const& strUsername, + std::string const& strPassword, ServiceRegistry& registry) : RPCSub(source) , m_io_context(io_context) , m_jobQueue(jobQueue) , mUrl(strUrl) - , mUsername(std::move(strUsername)) - , mPassword(std::move(strPassword)) + , mUsername(strUsername) + , mPassword(strPassword) , j_(registry.getJournal("RPCSub")) , logs_(registry.getLogs()) { @@ -79,7 +63,7 @@ public: << " ssl= " << (mSSL ? "yes" : "no") << " path='" << mPath << "'"; } - ~RPCSubImp() override = default; + ~RPCSubImp() = default; void send(Json::Value const& jvObj, bool broadcast) override @@ -89,7 +73,7 @@ public: auto jm = broadcast ? j_.debug() : j_.info(); JLOG(jm) << "RPCCall::fromNetwork push: " << jvObj; - mDeque.emplace_back(mSeq++, jvObj); + mDeque.push_back(std::make_pair(mSeq++, jvObj)); if (!mSending) { diff --git a/src/xrpld/rpc/detail/Role.cpp b/src/xrpld/rpc/detail/Role.cpp index 325b7eb3c6..f832e43119 100644 --- a/src/xrpld/rpc/detail/Role.cpp +++ b/src/xrpld/rpc/detail/Role.cpp @@ -1,25 +1,9 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include #include +#include #include -#include -#include -#include -#include namespace xrpl { @@ -209,7 +193,7 @@ extractIpAddrFromField(std::string_view field) // We may have an IPv6 address in square brackets. Scan up to the // closing square bracket. - auto const closeBracket = std::ranges::find_if_not(ret, [](unsigned char c) { + auto const closeBracket = std::find_if_not(ret.begin(), ret.end(), [](unsigned char c) { return std::isxdigit(c) || c == ':' || c == '.' || c == ' '; }); @@ -229,8 +213,8 @@ extractIpAddrFromField(std::string_view field) // then there cannot be an appended port. In that case we're done. { // Skip any leading hex digits. - auto const colon = std::ranges::find_if_not( - ret, [](unsigned char c) { return std::isxdigit(c) || c == ' '; }); + auto const colon = std::find_if_not( + ret.begin(), ret.end(), [](unsigned char c) { return std::isxdigit(c) || c == ' '; }); // If the string starts with optional hex digits followed by a colon // it's an IVv6 address. We're done. diff --git a/src/xrpld/rpc/detail/ServerHandler.cpp b/src/xrpld/rpc/detail/ServerHandler.cpp index db6dad2f1c..e5cc7a83bf 100644 --- a/src/xrpld/rpc/detail/ServerHandler.cpp +++ b/src/xrpld/rpc/detail/ServerHandler.cpp @@ -1,74 +1,38 @@ -#include - #include #include #include #include #include +#include #include #include +#include -#include #include #include #include -#include #include #include -#include -#include #include -#include -#include #include -#include -#include #include #include -#include #include #include -#include -#include -#include -#include #include #include -#include -#include #include -#include #include -#include #include -#include #include -#include -#include -#include -#include -#include +#include #include -#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -110,7 +74,7 @@ authorized(Port const& port, std::map const& h) return true; auto const it = h.find("authorization"); - if ((it == h.end()) || (!it->second.starts_with("Basic "))) + if ((it == h.end()) || (it->second.substr(0, 6) != "Basic ")) return false; std::string strUserPass64 = it->second.substr(6); boost::trim(strUserPass64); @@ -277,8 +241,9 @@ build_map(boost::beast::http::fields const& h) // key cannot be a std::string_view because it needs to be used in // map and along with iterators std::string key(e.name_string()); - std::ranges::transform( - key, key.begin(), [](auto kc) { return std::tolower(static_cast(kc)); }); + std::transform(key.begin(), key.end(), key.begin(), [](auto kc) { + return std::tolower(static_cast(kc)); + }); c[key] = e.value(); } return c; @@ -474,18 +439,18 @@ ServerHandler::processSession( else { RPC::JsonContext context{ - {.j = app_.getJournal("RPCHandler"), - .app = app_, - .loadType = loadType, - .netOps = app_.getOPs(), - .ledgerMaster = app_.getLedgerMaster(), - .consumer = is->getConsumer(), - .role = role, - .coro = coro, - .infoSub = is, - .apiVersion = apiVersion}, + {app_.getJournal("RPCHandler"), + app_, + loadType, + app_.getOPs(), + app_.getLedgerMaster(), + is->getConsumer(), + role, + coro, + is, + apiVersion}, jv, - {.user = is->user(), .forwardedFor = is->forwarded_for()}}; + {is->user(), is->forwarded_for()}}; auto start = std::chrono::system_clock::now(); RPC::doCommand(context, jr[jss::result]); @@ -857,18 +822,18 @@ ServerHandler::processRequest( Resource::Charge loadType = Resource::feeReferenceRPC; RPC::JsonContext context{ - {.j = m_journal, - .app = app_, - .loadType = loadType, - .netOps = m_networkOPs, - .ledgerMaster = app_.getLedgerMaster(), - .consumer = usage, - .role = role, - .coro = coro, - .infoSub = InfoSub::pointer(), - .apiVersion = apiVersion}, + {m_journal, + app_, + loadType, + m_networkOPs, + app_.getLedgerMaster(), + usage, + role, + coro, + InfoSub::pointer(), + apiVersion}, params, - {.user = user, .forwardedFor = forwardedFor}}; + {user, forwardedFor}}; Json::Value result; auto start = std::chrono::system_clock::now(); @@ -1231,8 +1196,9 @@ setup_Client(ServerHandler::Setup& setup) static void setup_Overlay(ServerHandler::Setup& setup) { - auto const iter = std::ranges::find_if( - setup.ports, [](Port const& port) { return port.protocol.count("peer") != 0; }); + auto const iter = std::find_if(setup.ports.cbegin(), setup.ports.cend(), [](Port const& port) { + return port.protocol.count("peer") != 0; + }); if (iter == setup.ports.cend()) { setup.overlay = {}; diff --git a/src/xrpld/rpc/detail/Status.cpp b/src/xrpld/rpc/detail/Status.cpp index c622b9a7e2..ce3082f0fa 100644 --- a/src/xrpld/rpc/detail/Status.cpp +++ b/src/xrpld/rpc/detail/Status.cpp @@ -1,15 +1,9 @@ #include -#include -#include -#include -#include -#include - #include -#include -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { std::string Status::codeString() const @@ -85,4 +79,5 @@ Status::toString() const return ""; } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/TransactionSign.cpp b/src/xrpld/rpc/detail/TransactionSign.cpp index 92b6d73050..d6909d555b 100644 --- a/src/xrpld/rpc/detail/TransactionSign.cpp +++ b/src/xrpld/rpc/detail/TransactionSign.cpp @@ -1,68 +1,31 @@ -#include - #include #include #include #include #include -#include -#include #include #include #include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include -#include -#include #include -#include -#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include +#include #include // Validity::Valid #include #include -#include -#include -#include -#include +#include #include -#include -#include -#include -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { namespace detail { // Used to pass extra parameters used when returning a @@ -656,7 +619,7 @@ transactionPreProcessImpl( stTx = std::make_shared(std::move(parsed.object.value())); } - catch (STObject::FieldErr const& err) + catch (STObject::FieldErr& err) { return RPC::make_error(rpcINVALID_PARAMS, err.what()); } @@ -1105,14 +1068,15 @@ sortAndValidateSigners(STArray& signers, AccountID const& signingForID) return RPC::make_param_error("Signers array may not be empty."); // Signers must be sorted by Account. - std::ranges::sort(signers, [](STObject const& a, STObject const& b) { + std::sort(signers.begin(), signers.end(), [](STObject const& a, STObject const& b) { return (a[sfAccount] < b[sfAccount]); }); // Signers may not contain any duplicates. - auto const dupIter = std::ranges::adjacent_find( - signers, - [](STObject const& a, STObject const& b) { return (a[sfAccount] == b[sfAccount]); }); + auto const dupIter = std::adjacent_find( + signers.begin(), signers.end(), [](STObject const& a, STObject const& b) { + return (a[sfAccount] == b[sfAccount]); + }); if (dupIter != signers.end()) { @@ -1123,7 +1087,8 @@ sortAndValidateSigners(STArray& signers, AccountID const& signingForID) } // An account may not sign for itself. - if (signers.end() != std::ranges::find_if(signers, [&signingForID](STObject const& elem) { + if (signers.end() != + std::find_if(signers.begin(), signers.end(), [&signingForID](STObject const& elem) { return elem[sfAccount] == signingForID; })) { @@ -1326,7 +1291,7 @@ transactionSubmitMultiSigned( { stTx = std::make_shared(std::move(parsedTx_json.object.value())); } - catch (STObject::FieldErr const& err) + catch (STObject::FieldErr& err) { return RPC::make_error(rpcINVALID_PARAMS, err.what()); } @@ -1388,7 +1353,7 @@ transactionSubmitMultiSigned( return RPC::make_param_error("tx_json.Signers array may not be empty."); // The Signers array may only contain Signer objects. - if (std::ranges::find_if_not(signers, [](STObject const& obj) { + if (std::find_if_not(signers.begin(), signers.end(), [](STObject const& obj) { return ( // A Signer object always contains these fields and no // others. @@ -1425,4 +1390,5 @@ transactionSubmitMultiSigned( return transactionFormatResultImpl(txn.second, apiVersion); } -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/detail/TransactionSign.h b/src/xrpld/rpc/detail/TransactionSign.h index 8ffcb44a84..62a34d931e 100644 --- a/src/xrpld/rpc/detail/TransactionSign.h +++ b/src/xrpld/rpc/detail/TransactionSign.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include diff --git a/src/xrpld/rpc/detail/TrustLine.cpp b/src/xrpld/rpc/detail/TrustLine.cpp index 5b7b555eca..c2bc152448 100644 --- a/src/xrpld/rpc/detail/TrustLine.cpp +++ b/src/xrpld/rpc/detail/TrustLine.cpp @@ -1,17 +1,9 @@ #include -#include -#include #include -#include -#include -#include #include -#include #include -#include -#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/TrustLine.h b/src/xrpld/rpc/detail/TrustLine.h index 59fa2e73f3..a0fce8847a 100644 --- a/src/xrpld/rpc/detail/TrustLine.h +++ b/src/xrpld/rpc/detail/TrustLine.h @@ -32,10 +32,6 @@ enum class LineDirection : bool { incoming = false, outgoing = true }; */ class TrustLineBase { -public: - TrustLineBase& - operator=(TrustLineBase const&) = delete; - protected: // This class should not be instantiated directly. Use one of the derived // classes. @@ -43,6 +39,8 @@ protected: ~TrustLineBase() = default; TrustLineBase(TrustLineBase const&) = default; + TrustLineBase& + operator=(TrustLineBase const&) = delete; TrustLineBase(TrustLineBase&&) = default; public: @@ -71,25 +69,25 @@ public: bool getAuth() const { - return (mFlags & (mViewLowest ? lsfLowAuth : lsfHighAuth)) != 0u; + return mFlags & (mViewLowest ? lsfLowAuth : lsfHighAuth); } bool getAuthPeer() const { - return (mFlags & (!mViewLowest ? lsfLowAuth : lsfHighAuth)) != 0u; + return mFlags & (!mViewLowest ? lsfLowAuth : lsfHighAuth); } bool getNoRipple() const { - return (mFlags & (mViewLowest ? lsfLowNoRipple : lsfHighNoRipple)) != 0u; + return mFlags & (mViewLowest ? lsfLowNoRipple : lsfHighNoRipple); } bool getNoRipplePeer() const { - return (mFlags & (!mViewLowest ? lsfLowNoRipple : lsfHighNoRipple)) != 0u; + return mFlags & (!mViewLowest ? lsfLowNoRipple : lsfHighNoRipple); } LineDirection @@ -108,28 +106,28 @@ public: bool getFreeze() const { - return (mFlags & (mViewLowest ? lsfLowFreeze : lsfHighFreeze)) != 0u; + return mFlags & (mViewLowest ? lsfLowFreeze : lsfHighFreeze); } /** Have we set the deep freeze flag on our peer */ bool getDeepFreeze() const { - return (mFlags & (mViewLowest ? lsfLowDeepFreeze : lsfHighDeepFreeze)) != 0u; + return mFlags & (mViewLowest ? lsfLowDeepFreeze : lsfHighDeepFreeze); } /** Has the peer set the freeze flag on us */ bool getFreezePeer() const { - return (mFlags & (!mViewLowest ? lsfLowFreeze : lsfHighFreeze)) != 0u; + return mFlags & (!mViewLowest ? lsfLowFreeze : lsfHighFreeze); } /** Has the peer set the deep freeze flag on us */ bool getDeepFreezePeer() const { - return (mFlags & (!mViewLowest ? lsfLowDeepFreeze : lsfHighDeepFreeze)) != 0u; + return mFlags & (!mViewLowest ? lsfLowDeepFreeze : lsfHighDeepFreeze); } STAmount const& diff --git a/src/xrpld/rpc/detail/Tuning.h b/src/xrpld/rpc/detail/Tuning.h index eb3cfa0ebf..e9dd2c37d7 100644 --- a/src/xrpld/rpc/detail/Tuning.h +++ b/src/xrpld/rpc/detail/Tuning.h @@ -1,8 +1,11 @@ #pragma once +namespace xrpl { +namespace RPC { + /** Tuned constants. */ /** @{ */ -namespace xrpl::RPC::Tuning { +namespace Tuning { /** Represents RPC limit parameter values that have a min, default and max. */ struct LimitRange @@ -11,31 +14,31 @@ struct LimitRange }; /** Limits for the account_lines command. */ -static LimitRange constexpr accountLines = {.rmin = 10, .rDefault = 200, .rmax = 400}; +static LimitRange constexpr accountLines = {10, 200, 400}; /** Limits for the account_channels command. */ -static LimitRange constexpr accountChannels = {.rmin = 10, .rDefault = 200, .rmax = 400}; +static LimitRange constexpr accountChannels = {10, 200, 400}; /** Limits for the account_objects command. */ -static LimitRange constexpr accountObjects = {.rmin = 10, .rDefault = 200, .rmax = 400}; +static LimitRange constexpr accountObjects = {10, 200, 400}; /** Limits for the account_offers command. */ -static LimitRange constexpr accountOffers = {.rmin = 10, .rDefault = 200, .rmax = 400}; +static LimitRange constexpr accountOffers = {10, 200, 400}; /** Limits for the account_tx command. */ -static LimitRange constexpr accountTx = {.rmin = 10, .rDefault = 200, .rmax = 400}; +static LimitRange constexpr accountTx = {10, 200, 400}; /** Limits for the book_offers command. */ -static LimitRange constexpr bookOffers = {.rmin = 1, .rDefault = 60, .rmax = 100}; +static LimitRange constexpr bookOffers = {0, 60, 100}; /** Limits for the no_ripple_check command. */ -static LimitRange constexpr noRippleCheck = {.rmin = 10, .rDefault = 300, .rmax = 400}; +static LimitRange constexpr noRippleCheck = {10, 300, 400}; /** Limits for the account_nftokens command, in pages. */ -static LimitRange constexpr accountNFTokens = {.rmin = 20, .rDefault = 100, .rmax = 400}; +static LimitRange constexpr accountNFTokens = {20, 100, 400}; /** Limits for the nft_buy_offers & nft_sell_offers commands. */ -static LimitRange constexpr nftOffers = {.rmin = 50, .rDefault = 250, .rmax = 500}; +static LimitRange constexpr nftOffers = {50, 250, 500}; static int constexpr defaultAutoFillFeeMultiplier = 10; static int constexpr defaultAutoFillFeeDivisor = 1; @@ -52,7 +55,7 @@ static int constexpr binaryPageLength = 2048; static int constexpr jsonPageLength = 256; /** Maximum number of pages in a LedgerData response. */ -int constexpr pageLength(bool isBinary) +inline int constexpr pageLength(bool isBinary) { return isBinary ? binaryPageLength : jsonPageLength; } @@ -63,5 +66,8 @@ static int constexpr max_src_cur = 18; /** Maximum number of auto source currencies in a path find request. */ static int constexpr max_auto_src_cur = 88; -} // namespace xrpl::RPC::Tuning +} // namespace Tuning /** @} */ + +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ChannelVerify.cpp b/src/xrpld/rpc/handlers/ChannelVerify.cpp index c1c7ab750b..91b23db4e6 100644 --- a/src/xrpld/rpc/handlers/ChannelVerify.cpp +++ b/src/xrpld/rpc/handlers/ChannelVerify.cpp @@ -1,22 +1,13 @@ #include #include -#include #include -#include -#include #include #include -#include #include -#include -#include #include -#include -#include #include -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/VaultInfo.cpp b/src/xrpld/rpc/handlers/VaultInfo.cpp index 711478658a..4a704e0b0b 100644 --- a/src/xrpld/rpc/handlers/VaultInfo.cpp +++ b/src/xrpld/rpc/handlers/VaultInfo.cpp @@ -1,17 +1,12 @@ #include #include -#include #include #include -#include #include #include -#include #include - -#include -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/account/AccountChannels.cpp b/src/xrpld/rpc/handlers/account/AccountChannels.cpp index 1fa492a3c0..7bf8a03f21 100644 --- a/src/xrpld/rpc/handlers/account/AccountChannels.cpp +++ b/src/xrpld/rpc/handlers/account/AccountChannels.cpp @@ -3,36 +3,15 @@ #include #include -#include -#include -#include -#include -#include -#include #include +#include #include -#include #include -#include -#include #include #include -#include #include -#include #include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { void @@ -114,7 +93,7 @@ doAccountChannels(RPC::JsonContext& context) AccountID const& accountID; std::optional const& raDstAccount; }; - VisitData visitData = {.items = {}, .accountID = accountID, .raDstAccount = raDstAccount}; + VisitData visitData = {{}, accountID, raDstAccount}; visitData.items.reserve(limit); uint256 startAfter = beast::zero; std::uint64_t startHint = 0; diff --git a/src/xrpld/rpc/handlers/account/AccountCurrencies.cpp b/src/xrpld/rpc/handlers/account/AccountCurrencies.cpp index dfcfffbf27..3713823934 100644 --- a/src/xrpld/rpc/handlers/account/AccountCurrencies.cpp +++ b/src/xrpld/rpc/handlers/account/AccountCurrencies.cpp @@ -2,20 +2,11 @@ #include #include -#include #include -#include #include -#include #include -#include -#include #include -#include -#include -#include - namespace xrpl { Json::Value diff --git a/src/xrpld/rpc/handlers/account/AccountInfo.cpp b/src/xrpld/rpc/handlers/account/AccountInfo.cpp index 019ff83def..becaea8a51 100644 --- a/src/xrpld/rpc/handlers/account/AccountInfo.cpp +++ b/src/xrpld/rpc/handlers/account/AccountInfo.cpp @@ -1,36 +1,18 @@ #include #include #include +#include #include -#include -#include -#include -#include -#include #include #include #include -#include #include -#include #include -#include -#include -#include -#include +#include #include #include -#include - -#include -#include -#include -#include -#include -#include -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/account/AccountLines.cpp b/src/xrpld/rpc/handlers/account/AccountLines.cpp index 5a879f0cbe..7985417b50 100644 --- a/src/xrpld/rpc/handlers/account/AccountLines.cpp +++ b/src/xrpld/rpc/handlers/account/AccountLines.cpp @@ -4,34 +4,13 @@ #include #include -#include -#include -#include -#include -#include #include #include -#include #include -#include -#include #include -#include -#include -#include #include #include -#include -#include - -#include -#include -#include -#include -#include -#include - namespace xrpl { void @@ -138,12 +117,7 @@ doAccountLines(RPC::JsonContext& context) bool ignoreDefault; uint32_t foundCount; }; - VisitData visitData = { - .items = {}, - .accountID = accountID, - .raPeerAccount = raPeerAccount, - .ignoreDefault = ignoreDefault, - .foundCount = 0}; + VisitData visitData = {{}, accountID, raPeerAccount, ignoreDefault, 0}; uint256 startAfter = beast::zero; std::uint64_t startHint = 0; diff --git a/src/xrpld/rpc/handlers/account/AccountNFTs.cpp b/src/xrpld/rpc/handlers/account/AccountNFTs.cpp index 605dd3b07c..e1ead76e85 100644 --- a/src/xrpld/rpc/handlers/account/AccountNFTs.cpp +++ b/src/xrpld/rpc/handlers/account/AccountNFTs.cpp @@ -3,23 +3,15 @@ #include #include -#include -#include #include -#include +#include #include #include -#include #include -#include #include -#include #include #include -#include -#include - namespace xrpl { /** General RPC command that can retrieve objects in the account root. diff --git a/src/xrpld/rpc/handlers/account/AccountObjects.cpp b/src/xrpld/rpc/handlers/account/AccountObjects.cpp index 5b172cd4c3..2e8462de2d 100644 --- a/src/xrpld/rpc/handlers/account/AccountObjects.cpp +++ b/src/xrpld/rpc/handlers/account/AccountObjects.cpp @@ -3,26 +3,17 @@ #include #include -#include -#include -#include #include -#include +#include #include #include #include #include -#include #include #include #include -#include -#include -#include -#include #include -#include namespace xrpl { @@ -51,7 +42,7 @@ getAccountObjects( auto typeMatchesFilter = [](std::vector const& typeFilter, LedgerEntryType ledgerType) { - auto it = std::ranges::find(typeFilter, ledgerType); + auto it = std::find(typeFilter.begin(), typeFilter.end(), ledgerType); return it != typeFilter.end(); }; @@ -262,19 +253,18 @@ doAccountObjects(RPC::JsonContext& context) Json::StaticString name; LedgerEntryType type; } static constexpr deletionBlockers[] = { - {.name = jss::check, .type = ltCHECK}, - {.name = jss::escrow, .type = ltESCROW}, - {.name = jss::nft_page, .type = ltNFTOKEN_PAGE}, - {.name = jss::payment_channel, .type = ltPAYCHAN}, - {.name = jss::state, .type = ltRIPPLE_STATE}, - {.name = jss::xchain_owned_claim_id, .type = ltXCHAIN_OWNED_CLAIM_ID}, - {.name = jss::xchain_owned_create_account_claim_id, - .type = ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID}, - {.name = jss::bridge, .type = ltBRIDGE}, - {.name = jss::mpt_issuance, .type = ltMPTOKEN_ISSUANCE}, - {.name = jss::mptoken, .type = ltMPTOKEN}, - {.name = jss::permissioned_domain, .type = ltPERMISSIONED_DOMAIN}, - {.name = jss::vault, .type = ltVAULT}, + {jss::check, ltCHECK}, + {jss::escrow, ltESCROW}, + {jss::nft_page, ltNFTOKEN_PAGE}, + {jss::payment_channel, ltPAYCHAN}, + {jss::state, ltRIPPLE_STATE}, + {jss::xchain_owned_claim_id, ltXCHAIN_OWNED_CLAIM_ID}, + {jss::xchain_owned_create_account_claim_id, ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID}, + {jss::bridge, ltBRIDGE}, + {jss::mpt_issuance, ltMPTOKEN_ISSUANCE}, + {jss::mptoken, ltMPTOKEN}, + {jss::permissioned_domain, ltPERMISSIONED_DOMAIN}, + {jss::vault, ltVAULT}, }; typeFilter.emplace(); diff --git a/src/xrpld/rpc/handlers/account/AccountOffers.cpp b/src/xrpld/rpc/handlers/account/AccountOffers.cpp index 19b88e7499..38cc7c1dc5 100644 --- a/src/xrpld/rpc/handlers/account/AccountOffers.cpp +++ b/src/xrpld/rpc/handlers/account/AccountOffers.cpp @@ -3,33 +3,15 @@ #include #include -#include -#include -#include -#include #include #include +#include #include -#include #include -#include -#include #include -#include -#include #include #include -#include -#include - -#include -#include -#include -#include -#include -#include - namespace xrpl { void diff --git a/src/xrpld/rpc/handlers/account/AccountTx.cpp b/src/xrpld/rpc/handlers/account/AccountTx.cpp index c01fc044e7..acd5912ee0 100644 --- a/src/xrpld/rpc/handlers/account/AccountTx.cpp +++ b/src/xrpld/rpc/handlers/account/AccountTx.cpp @@ -7,35 +7,19 @@ #include #include #include -#include #include #include #include -#include -#include -#include -#include -#include #include #include -#include #include -#include #include #include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include - namespace xrpl { using TxnsData = RelationalDatabase::AccountTxs; @@ -73,7 +57,7 @@ parseLedgerArgs(RPC::Context& context, Json::Value const& params) ? params[jss::ledger_index_max].asUInt() : UINT32_MAX; - return LedgerRange{.min = min, .max = max}; + return LedgerRange{min, max}; } if (params.isMember(jss::ledger_hash)) { @@ -205,7 +189,7 @@ getLedgerRange(RPC::Context& context, std::optional const& ledg if (status) return status; } - return LedgerRange{.min = uLedgerMin, .max = uLedgerMax}; + return LedgerRange{uLedgerMin, uLedgerMax}; } std::pair @@ -227,11 +211,7 @@ doAccountTxHelp(RPC::Context& context, AccountTxArgs const& args) result.marker = args.marker; RelationalDatabase::AccountTxPageOptions const options = { - .account = args.account, - .ledgerRange = result.ledgerRange, - .marker = result.marker, - .limit = args.limit, - .bAdmin = isUnlimited(context.role)}; + args.account, result.ledgerRange, result.marker, args.limit, isUnlimited(context.role)}; auto& db = context.app.getRelationalDatabase(); @@ -446,8 +426,7 @@ doAccountTx(RPC::JsonContext& context) status.inject(response); return response; } - args.marker = { - .ledgerSeq = token[jss::ledger].asUInt(), .txnSeq = token[jss::seq].asUInt()}; + args.marker = {token[jss::ledger].asUInt(), token[jss::seq].asUInt()}; } auto res = doAccountTxHelp(context, args); diff --git a/src/xrpld/rpc/handlers/account/GatewayBalances.cpp b/src/xrpld/rpc/handlers/account/GatewayBalances.cpp index 81e464ba87..4dd169d5b5 100644 --- a/src/xrpld/rpc/handlers/account/GatewayBalances.cpp +++ b/src/xrpld/rpc/handlers/account/GatewayBalances.cpp @@ -3,30 +3,14 @@ #include #include -#include -#include #include #include #include #include -#include -#include -#include #include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { // Query: diff --git a/src/xrpld/rpc/handlers/account/NoRippleCheck.cpp b/src/xrpld/rpc/handlers/account/NoRippleCheck.cpp index 54964be8da..31662b63a5 100644 --- a/src/xrpld/rpc/handlers/account/NoRippleCheck.cpp +++ b/src/xrpld/rpc/handlers/account/NoRippleCheck.cpp @@ -2,26 +2,17 @@ #include #include #include +#include #include -#include -#include #include #include -#include #include -#include -#include #include -#include #include -#include #include #include -#include -#include - namespace xrpl { static void diff --git a/src/xrpld/rpc/handlers/account/OwnerInfo.cpp b/src/xrpld/rpc/handlers/account/OwnerInfo.cpp index d287d2fd25..659a149e20 100644 --- a/src/xrpld/rpc/handlers/account/OwnerInfo.cpp +++ b/src/xrpld/rpc/handlers/account/OwnerInfo.cpp @@ -2,15 +2,11 @@ #include #include -#include #include #include #include #include -#include -#include - namespace xrpl { // { diff --git a/src/xrpld/rpc/handlers/admin/BlackList.cpp b/src/xrpld/rpc/handlers/admin/BlackList.cpp index dfcb1aaa3a..86abe53686 100644 --- a/src/xrpld/rpc/handlers/admin/BlackList.cpp +++ b/src/xrpld/rpc/handlers/admin/BlackList.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include diff --git a/src/xrpld/rpc/handlers/admin/UnlList.cpp b/src/xrpld/rpc/handlers/admin/UnlList.cpp index 79eb2acf29..31f41b4a33 100644 --- a/src/xrpld/rpc/handlers/admin/UnlList.cpp +++ b/src/xrpld/rpc/handlers/admin/UnlList.cpp @@ -2,12 +2,8 @@ #include #include -#include -#include +#include #include -#include - -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/admin/data/CanDelete.cpp b/src/xrpld/rpc/handlers/admin/data/CanDelete.cpp index 59d4b3a75c..7d881e7d2e 100644 --- a/src/xrpld/rpc/handlers/admin/data/CanDelete.cpp +++ b/src/xrpld/rpc/handlers/admin/data/CanDelete.cpp @@ -3,18 +3,12 @@ #include #include -#include #include -#include #include #include #include -#include -#include -#include - namespace xrpl { // can_delete [||now|always|never] diff --git a/src/xrpld/rpc/handlers/admin/data/LedgerCleaner.cpp b/src/xrpld/rpc/handlers/admin/data/LedgerCleaner.cpp index 71dcb6d62f..408cd16023 100644 --- a/src/xrpld/rpc/handlers/admin/data/LedgerCleaner.cpp +++ b/src/xrpld/rpc/handlers/admin/data/LedgerCleaner.cpp @@ -1,5 +1,4 @@ #include - #include #include #include diff --git a/src/xrpld/rpc/handlers/admin/data/LedgerRequest.cpp b/src/xrpld/rpc/handlers/admin/data/LedgerRequest.cpp index ec31529226..da29addd2d 100644 --- a/src/xrpld/rpc/handlers/admin/data/LedgerRequest.cpp +++ b/src/xrpld/rpc/handlers/admin/data/LedgerRequest.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include diff --git a/src/xrpld/rpc/handlers/admin/keygen/ValidationCreate.cpp b/src/xrpld/rpc/handlers/admin/keygen/ValidationCreate.cpp index 27ae21d393..c82ddffea5 100644 --- a/src/xrpld/rpc/handlers/admin/keygen/ValidationCreate.cpp +++ b/src/xrpld/rpc/handlers/admin/keygen/ValidationCreate.cpp @@ -1,16 +1,9 @@ #include -#include #include -#include -#include #include -#include #include #include -#include - -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp b/src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp index bbd8f622be..428dfb5380 100644 --- a/src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp +++ b/src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp @@ -1,11 +1,8 @@ -#include - #include #include +#include #include -#include -#include #include #include #include @@ -13,12 +10,9 @@ #include #include #include -#include #include #include -#include -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/admin/log/LogLevel.cpp b/src/xrpld/rpc/handlers/admin/log/LogLevel.cpp index 9cfa321654..e1e637435c 100644 --- a/src/xrpld/rpc/handlers/admin/log/LogLevel.cpp +++ b/src/xrpld/rpc/handlers/admin/log/LogLevel.cpp @@ -9,10 +9,6 @@ #include -#include -#include -#include - namespace xrpl { Json::Value diff --git a/src/xrpld/rpc/handlers/admin/log/LogRotate.cpp b/src/xrpld/rpc/handlers/admin/log/LogRotate.cpp index c1fdd58c23..3cc7f35381 100644 --- a/src/xrpld/rpc/handlers/admin/log/LogRotate.cpp +++ b/src/xrpld/rpc/handlers/admin/log/LogRotate.cpp @@ -1,10 +1,8 @@ #include -#include #include #include #include -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/admin/peer/Connect.cpp b/src/xrpld/rpc/handlers/admin/peer/Connect.cpp index 4d9667e4a9..fe3183484e 100644 --- a/src/xrpld/rpc/handlers/admin/peer/Connect.cpp +++ b/src/xrpld/rpc/handlers/admin/peer/Connect.cpp @@ -4,15 +4,11 @@ #include #include -#include -#include #include #include #include #include -#include - namespace xrpl { // { diff --git a/src/xrpld/rpc/handlers/admin/peer/PeerReservationsAdd.cpp b/src/xrpld/rpc/handlers/admin/peer/PeerReservationsAdd.cpp index 6aaa5cc78a..dcd97bb2e4 100644 --- a/src/xrpld/rpc/handlers/admin/peer/PeerReservationsAdd.cpp +++ b/src/xrpld/rpc/handlers/admin/peer/PeerReservationsAdd.cpp @@ -1,13 +1,11 @@ #include #include -#include #include #include #include #include #include -#include #include #include @@ -56,8 +54,8 @@ doPeerReservationsAdd(RPC::JsonContext& context) return rpcError(rpcPUBLIC_MALFORMED); PublicKey const& nodeId = *optPk; - auto const previous = context.app.getPeerReservations().insert_or_assign( - PeerReservation{.nodeId = nodeId, .description = desc}); + auto const previous = + context.app.getPeerReservations().insert_or_assign(PeerReservation{nodeId, desc}); Json::Value result{Json::objectValue}; if (previous) diff --git a/src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp b/src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp index d60979aab3..14d017779d 100644 --- a/src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp +++ b/src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include diff --git a/src/xrpld/rpc/handlers/admin/peer/Peers.cpp b/src/xrpld/rpc/handlers/admin/peer/Peers.cpp index 9164089e83..646aae7bc8 100644 --- a/src/xrpld/rpc/handlers/admin/peer/Peers.cpp +++ b/src/xrpld/rpc/handlers/admin/peer/Peers.cpp @@ -1,19 +1,13 @@ #include #include #include -#include #include #include -#include -#include -#include +#include #include -#include #include -#include - namespace xrpl { Json::Value diff --git a/src/xrpld/rpc/handlers/admin/server_control/LedgerAccept.cpp b/src/xrpld/rpc/handlers/admin/server_control/LedgerAccept.cpp index 7119b5235e..91e88b707f 100644 --- a/src/xrpld/rpc/handlers/admin/server_control/LedgerAccept.cpp +++ b/src/xrpld/rpc/handlers/admin/server_control/LedgerAccept.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include diff --git a/src/xrpld/rpc/handlers/admin/server_control/Stop.cpp b/src/xrpld/rpc/handlers/admin/server_control/Stop.cpp index e3e0f29fa2..b47c35e21d 100644 --- a/src/xrpld/rpc/handlers/admin/server_control/Stop.cpp +++ b/src/xrpld/rpc/handlers/admin/server_control/Stop.cpp @@ -2,7 +2,6 @@ #include #include -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/admin/signing/ChannelAuthorize.cpp b/src/xrpld/rpc/handlers/admin/signing/ChannelAuthorize.cpp index d93e1efadc..73d185be44 100644 --- a/src/xrpld/rpc/handlers/admin/signing/ChannelAuthorize.cpp +++ b/src/xrpld/rpc/handlers/admin/signing/ChannelAuthorize.cpp @@ -1,25 +1,14 @@ #include #include -#include #include #include -#include -#include -#include -#include #include #include #include -#include -#include -#include #include -#include -#include #include -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/admin/signing/Sign.cpp b/src/xrpld/rpc/handlers/admin/signing/Sign.cpp index d92506c672..e7150c5e2f 100644 --- a/src/xrpld/rpc/handlers/admin/signing/Sign.cpp +++ b/src/xrpld/rpc/handlers/admin/signing/Sign.cpp @@ -1,11 +1,8 @@ #include #include -#include #include -#include #include -#include #include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/admin/signing/SignFor.cpp b/src/xrpld/rpc/handlers/admin/signing/SignFor.cpp index 572093856f..54f23c9d81 100644 --- a/src/xrpld/rpc/handlers/admin/signing/SignFor.cpp +++ b/src/xrpld/rpc/handlers/admin/signing/SignFor.cpp @@ -1,11 +1,8 @@ #include #include -#include #include -#include #include -#include #include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/admin/status/ConsensusInfo.cpp b/src/xrpld/rpc/handlers/admin/status/ConsensusInfo.cpp index 5ccbda2a16..f9c5a97785 100644 --- a/src/xrpld/rpc/handlers/admin/status/ConsensusInfo.cpp +++ b/src/xrpld/rpc/handlers/admin/status/ConsensusInfo.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include diff --git a/src/xrpld/rpc/handlers/admin/status/FetchInfo.cpp b/src/xrpld/rpc/handlers/admin/status/FetchInfo.cpp index fd916ef53e..f25f18acf7 100644 --- a/src/xrpld/rpc/handlers/admin/status/FetchInfo.cpp +++ b/src/xrpld/rpc/handlers/admin/status/FetchInfo.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include diff --git a/src/xrpld/rpc/handlers/admin/status/GetCounts.cpp b/src/xrpld/rpc/handlers/admin/status/GetCounts.cpp index 8cc687fec2..648d29a5fd 100644 --- a/src/xrpld/rpc/handlers/admin/status/GetCounts.cpp +++ b/src/xrpld/rpc/handlers/admin/status/GetCounts.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -5,16 +6,12 @@ #include #include -#include #include #include +#include #include #include -#include -#include -#include - namespace xrpl { static void diff --git a/src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp b/src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp index c8ec6a2c15..aec9dba4b4 100644 --- a/src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp +++ b/src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp @@ -1,14 +1,13 @@ // Copyright (c) 2019 Dev Null Productions #include +#include #include #include #include #include -#include #include -#include namespace xrpl { Json::Value diff --git a/src/xrpld/rpc/handlers/admin/status/ValidatorListSites.cpp b/src/xrpld/rpc/handlers/admin/status/ValidatorListSites.cpp index 80823a8936..36e2064387 100644 --- a/src/xrpld/rpc/handlers/admin/status/ValidatorListSites.cpp +++ b/src/xrpld/rpc/handlers/admin/status/ValidatorListSites.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/admin/status/Validators.cpp b/src/xrpld/rpc/handlers/admin/status/Validators.cpp index cf9cab6b84..95e6de9e68 100644 --- a/src/xrpld/rpc/handlers/admin/status/Validators.cpp +++ b/src/xrpld/rpc/handlers/admin/status/Validators.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/ledger/Ledger.cpp b/src/xrpld/rpc/handlers/ledger/Ledger.cpp index dd2280b51c..6bf627d29c 100644 --- a/src/xrpld/rpc/handlers/ledger/Ledger.cpp +++ b/src/xrpld/rpc/handlers/ledger/Ledger.cpp @@ -1,35 +1,14 @@ -#include - #include #include -#include #include #include -#include #include +#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include #include #include -#include - -#include -#include - -#include -#include -#include -#include -#include namespace xrpl { namespace RPC { diff --git a/src/xrpld/rpc/handlers/ledger/Ledger.h b/src/xrpld/rpc/handlers/ledger/Ledger.h index db70f35904..f024241546 100644 --- a/src/xrpld/rpc/handlers/ledger/Ledger.h +++ b/src/xrpld/rpc/handlers/ledger/Ledger.h @@ -16,7 +16,8 @@ namespace Json { class Object; } // namespace Json -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { struct JsonContext; @@ -55,4 +56,5 @@ private: int options_ = 0; }; -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ledger/LedgerClosed.cpp b/src/xrpld/rpc/handlers/ledger/LedgerClosed.cpp index 43e6fa686e..e26019cca6 100644 --- a/src/xrpld/rpc/handlers/ledger/LedgerClosed.cpp +++ b/src/xrpld/rpc/handlers/ledger/LedgerClosed.cpp @@ -1,8 +1,6 @@ #include #include -#include -#include #include #include #include diff --git a/src/xrpld/rpc/handlers/ledger/LedgerData.cpp b/src/xrpld/rpc/handlers/ledger/LedgerData.cpp index f0a361d951..059c844e6e 100644 --- a/src/xrpld/rpc/handlers/ledger/LedgerData.cpp +++ b/src/xrpld/rpc/handlers/ledger/LedgerData.cpp @@ -6,21 +6,10 @@ #include #include -#include -#include #include #include -#include #include -#include #include -#include - -#include -#include - -#include -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp b/src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp index f1a9253de2..97c4efcc7a 100644 --- a/src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp +++ b/src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp @@ -1,18 +1,6 @@ -#include #include #include -#include -#include -#include - -#include -#include - -#include -#include -#include - namespace xrpl { std::pair doLedgerDiffGrpc(RPC::GRPCContext& context) diff --git a/src/xrpld/rpc/handlers/ledger/LedgerEntry.cpp b/src/xrpld/rpc/handlers/ledger/LedgerEntry.cpp index 4de75da1b0..1fa88ac34d 100644 --- a/src/xrpld/rpc/handlers/ledger/LedgerEntry.cpp +++ b/src/xrpld/rpc/handlers/ledger/LedgerEntry.cpp @@ -3,35 +3,19 @@ #include #include -#include -#include +#include #include +#include #include -#include #include #include -#include #include #include -#include #include -#include -#include -#include +#include #include -#include #include -#include -#include - -#include -#include -#include -#include -#include -#include - namespace xrpl { using FunctionType = std::function( @@ -843,14 +827,10 @@ doLedgerEntry(RPC::JsonContext& context) #undef LEDGER_ENTRY #pragma pop_macro("LEDGER_ENTRY") - {.fieldName = jss::index, .parseFunction = parseIndex, .expectedType = ltANY}, + {jss::index, parseIndex, ltANY}, // aliases - {.fieldName = jss::account_root, - .parseFunction = parseAccountRoot, - .expectedType = ltACCOUNT_ROOT}, - {.fieldName = jss::ripple_state, - .parseFunction = parseRippleState, - .expectedType = ltRIPPLE_STATE}, + {jss::account_root, parseAccountRoot, ltACCOUNT_ROOT}, + {jss::ripple_state, parseRippleState, ltRIPPLE_STATE}, }); auto const hasMoreThanOneMember = [&]() { @@ -917,7 +897,7 @@ doLedgerEntry(RPC::JsonContext& context) return RPC::make_param_error("No ledger_entry params provided."); } } - catch (Json::error const& e) + catch (Json::error& e) { if (context.apiVersion > 1u) { diff --git a/src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h b/src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h index d0d643661d..4a4366556d 100644 --- a/src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h +++ b/src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h @@ -12,7 +12,9 @@ #include -namespace xrpl::LedgerEntryHelpers { +namespace xrpl { + +namespace LedgerEntryHelpers { inline Unexpected missingFieldError(Json::StaticString const field, std::optional err = std::nullopt) @@ -281,4 +283,6 @@ parseBridgeFields(Json::Value const& params) *lockingChainDoor, lockingChainIssue, *issuingChainDoor, issuingChainIssue); } -} // namespace xrpl::LedgerEntryHelpers +} // namespace LedgerEntryHelpers + +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/ledger/LedgerHeader.cpp b/src/xrpld/rpc/handlers/ledger/LedgerHeader.cpp index 6f01889b59..6b93594020 100644 --- a/src/xrpld/rpc/handlers/ledger/LedgerHeader.cpp +++ b/src/xrpld/rpc/handlers/ledger/LedgerHeader.cpp @@ -1,16 +1,10 @@ -#include - #include #include #include -#include #include -#include #include -#include - namespace xrpl { // { diff --git a/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp b/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp index c093c5fcf5..272e66018c 100644 --- a/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp +++ b/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp @@ -2,35 +2,14 @@ #include #include -#include -#include -#include -#include #include -#include -#include -#include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include +#include -#include - -#include -#include -#include -#include -#include -#include +#include namespace xrpl { @@ -160,8 +139,7 @@ doAMMInfo(RPC::JsonContext& context) asset2 = (*amm)[sfAsset2]; } - return ValuesFromContextParams{ - .accountID = accountID, .asset1 = *asset1, .asset2 = *asset2, .amm = amm}; + return ValuesFromContextParams{accountID, *asset1, *asset2, amm}; }; auto const r = getValuesFromContextParams(); diff --git a/src/xrpld/rpc/handlers/orderbook/BookChanges.cpp b/src/xrpld/rpc/handlers/orderbook/BookChanges.cpp index 502895e734..83b26729a1 100644 --- a/src/xrpld/rpc/handlers/orderbook/BookChanges.cpp +++ b/src/xrpld/rpc/handlers/orderbook/BookChanges.cpp @@ -1,12 +1,9 @@ #include - #include #include #include -#include - namespace xrpl { Json::Value diff --git a/src/xrpld/rpc/handlers/orderbook/BookOffers.cpp b/src/xrpld/rpc/handlers/orderbook/BookOffers.cpp index 04fceac268..3b4f76dc96 100644 --- a/src/xrpld/rpc/handlers/orderbook/BookOffers.cpp +++ b/src/xrpld/rpc/handlers/orderbook/BookOffers.cpp @@ -2,28 +2,17 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include #include #include #include #include #include -#include -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/orderbook/DepositAuthorized.cpp b/src/xrpld/rpc/handlers/orderbook/DepositAuthorized.cpp index 95c7238d20..fb1c0db884 100644 --- a/src/xrpld/rpc/handlers/orderbook/DepositAuthorized.cpp +++ b/src/xrpld/rpc/handlers/orderbook/DepositAuthorized.cpp @@ -1,26 +1,13 @@ #include #include -#include -#include -#include -#include #include #include -#include #include #include -#include -#include #include -#include #include -#include -#include -#include -#include - namespace xrpl { // { diff --git a/src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp b/src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp index 10359c810e..281f2d63a7 100644 --- a/src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp +++ b/src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp @@ -3,38 +3,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - namespace xrpl { using namespace boost::bimaps; @@ -271,8 +248,9 @@ doGetAggregatePrice(RPC::JsonContext& context) iteratePriceData(context, sle, [&](STObject const& node) { auto const& series = node.getFieldArray(sfPriceDataSeries); // find the token pair entry with the price - if (auto iter = std::ranges::find_if( - series, + if (auto iter = std::find_if( + series.begin(), + series.end(), [&](STObject const& o) -> bool { return o.getFieldCurrency(sfBaseAsset).getText() == std::get(baseAsset) && diff --git a/src/xrpld/rpc/handlers/orderbook/NFTBuyOffers.cpp b/src/xrpld/rpc/handlers/orderbook/NFTBuyOffers.cpp index 98c4a73784..3ee8935f3a 100644 --- a/src/xrpld/rpc/handlers/orderbook/NFTBuyOffers.cpp +++ b/src/xrpld/rpc/handlers/orderbook/NFTBuyOffers.cpp @@ -1,10 +1,8 @@ #include #include -#include -#include #include -#include +#include #include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/orderbook/NFTSellOffers.cpp b/src/xrpld/rpc/handlers/orderbook/NFTSellOffers.cpp index 8612fdf587..9dbd9ef49f 100644 --- a/src/xrpld/rpc/handlers/orderbook/NFTSellOffers.cpp +++ b/src/xrpld/rpc/handlers/orderbook/NFTSellOffers.cpp @@ -1,10 +1,8 @@ #include #include -#include -#include #include -#include +#include #include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/orderbook/PathFind.cpp b/src/xrpld/rpc/handlers/orderbook/PathFind.cpp index ffe00f54a8..ced3625b4c 100644 --- a/src/xrpld/rpc/handlers/orderbook/PathFind.cpp +++ b/src/xrpld/rpc/handlers/orderbook/PathFind.cpp @@ -3,12 +3,10 @@ #include #include -#include #include #include #include #include -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp b/src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp index c0a2a17a49..1b19061b9d 100644 --- a/src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp +++ b/src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp @@ -1,22 +1,12 @@ #include #include -#include #include -#include #include #include -#include -#include -#include -#include #include -#include #include -#include -#include - namespace xrpl { // This interface is deprecated. diff --git a/src/xrpld/rpc/handlers/server_info/Feature.cpp b/src/xrpld/rpc/handlers/server_info/Feature.cpp index f6f5316a55..24ff0d62b8 100644 --- a/src/xrpld/rpc/handlers/server_info/Feature.cpp +++ b/src/xrpld/rpc/handlers/server_info/Feature.cpp @@ -1,12 +1,8 @@ #include #include #include -#include -#include -#include #include -#include #include #include #include diff --git a/src/xrpld/rpc/handlers/server_info/Fee.cpp b/src/xrpld/rpc/handlers/server_info/Fee.cpp index d943d02f77..49a36261f4 100644 --- a/src/xrpld/rpc/handlers/server_info/Fee.cpp +++ b/src/xrpld/rpc/handlers/server_info/Fee.cpp @@ -1,9 +1,9 @@ +#include #include #include #include +#include -#include -#include #include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/server_info/Manifest.cpp b/src/xrpld/rpc/handlers/server_info/Manifest.cpp index 75533f0e78..ba3461033f 100644 --- a/src/xrpld/rpc/handlers/server_info/Manifest.cpp +++ b/src/xrpld/rpc/handlers/server_info/Manifest.cpp @@ -6,9 +6,7 @@ #include #include #include -#include #include -#include namespace xrpl { Json::Value diff --git a/src/xrpld/rpc/handlers/server_info/ServerDefinitions.cpp b/src/xrpld/rpc/handlers/server_info/ServerDefinitions.cpp index d3db8cf56d..f99f427ca8 100644 --- a/src/xrpld/rpc/handlers/server_info/ServerDefinitions.cpp +++ b/src/xrpld/rpc/handlers/server_info/ServerDefinitions.cpp @@ -1,9 +1,8 @@ #include +#include -#include #include #include -#include #include #include #include @@ -12,14 +11,9 @@ #include #include -#include -#include +#include -#include -#include -#include #include -#include #include #include diff --git a/src/xrpld/rpc/handlers/server_info/Version.h b/src/xrpld/rpc/handlers/server_info/Version.h index 233ae3e4d8..a03212e906 100644 --- a/src/xrpld/rpc/handlers/server_info/Version.h +++ b/src/xrpld/rpc/handlers/server_info/Version.h @@ -2,7 +2,8 @@ #include -namespace xrpl::RPC { +namespace xrpl { +namespace RPC { class VersionHandler { @@ -12,14 +13,14 @@ public: { } - static Status + Status check() { return Status::OK; } void - writeResult(Json::Value& obj) const + writeResult(Json::Value& obj) { setVersion(obj, apiVersion_, betaEnabled_); } @@ -39,4 +40,5 @@ private: bool betaEnabled_; }; -} // namespace xrpl::RPC +} // namespace RPC +} // namespace xrpl diff --git a/src/xrpld/rpc/handlers/subscribe/Subscribe.cpp b/src/xrpld/rpc/handlers/subscribe/Subscribe.cpp index 9be273587d..8b3e5a5e1f 100644 --- a/src/xrpld/rpc/handlers/subscribe/Subscribe.cpp +++ b/src/xrpld/rpc/handlers/subscribe/Subscribe.cpp @@ -4,26 +4,14 @@ #include #include #include -#include -#include -#include -#include #include -#include -#include #include #include #include #include -#include #include -#include -#include -#include -#include - namespace xrpl { Json::Value @@ -77,7 +65,7 @@ doSubscribe(RPC::JsonContext& context) ispSub = context.netOps.addRpcSub(strUrl, std::dynamic_pointer_cast(rspSub)); } - catch (std::runtime_error const& ex) + catch (std::runtime_error& ex) { return RPC::make_param_error(ex.what()); } diff --git a/src/xrpld/rpc/handlers/subscribe/Unsubscribe.cpp b/src/xrpld/rpc/handlers/subscribe/Unsubscribe.cpp index 258774d12a..6846d9baf3 100644 --- a/src/xrpld/rpc/handlers/subscribe/Unsubscribe.cpp +++ b/src/xrpld/rpc/handlers/subscribe/Unsubscribe.cpp @@ -3,18 +3,11 @@ #include #include -#include -#include -#include -#include #include #include #include -#include #include -#include - namespace xrpl { Json::Value diff --git a/src/xrpld/rpc/handlers/transaction/Simulate.cpp b/src/xrpld/rpc/handlers/transaction/Simulate.cpp index f5004bab13..433603338d 100644 --- a/src/xrpld/rpc/handlers/transaction/Simulate.cpp +++ b/src/xrpld/rpc/handlers/transaction/Simulate.cpp @@ -4,41 +4,18 @@ #include #include #include +#include #include #include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include #include #include -#include #include -#include -#include -#include -#include #include - -#include -#include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/transaction/Submit.cpp b/src/xrpld/rpc/handlers/transaction/Submit.cpp index 73260c0661..cac7259a00 100644 --- a/src/xrpld/rpc/handlers/transaction/Submit.cpp +++ b/src/xrpld/rpc/handlers/transaction/Submit.cpp @@ -1,27 +1,13 @@ #include #include #include -#include #include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include #include #include -#include -#include -#include - namespace xrpl { static NetworkOPs::FailHard diff --git a/src/xrpld/rpc/handlers/transaction/SubmitMultiSigned.cpp b/src/xrpld/rpc/handlers/transaction/SubmitMultiSigned.cpp index d121e9a850..52213e174a 100644 --- a/src/xrpld/rpc/handlers/transaction/SubmitMultiSigned.cpp +++ b/src/xrpld/rpc/handlers/transaction/SubmitMultiSigned.cpp @@ -2,8 +2,7 @@ #include #include -#include -#include +#include #include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/transaction/TransactionEntry.cpp b/src/xrpld/rpc/handlers/transaction/TransactionEntry.cpp index 67fd2504fe..36f53130fa 100644 --- a/src/xrpld/rpc/handlers/transaction/TransactionEntry.cpp +++ b/src/xrpld/rpc/handlers/transaction/TransactionEntry.cpp @@ -3,14 +3,9 @@ #include #include -#include -#include -#include #include #include -#include - namespace xrpl { // { diff --git a/src/xrpld/rpc/handlers/transaction/Tx.cpp b/src/xrpld/rpc/handlers/transaction/Tx.cpp index 530b45e225..a3ed788060 100644 --- a/src/xrpld/rpc/handlers/transaction/Tx.cpp +++ b/src/xrpld/rpc/handlers/transaction/Tx.cpp @@ -5,35 +5,20 @@ #include #include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include #include #include #include -#include -#include -#include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/transaction/TxHistory.cpp b/src/xrpld/rpc/handlers/transaction/TxHistory.cpp index 1669d289b4..3467b1c990 100644 --- a/src/xrpld/rpc/handlers/transaction/TxHistory.cpp +++ b/src/xrpld/rpc/handlers/transaction/TxHistory.cpp @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/src/xrpld/rpc/handlers/utility/Random.cpp b/src/xrpld/rpc/handlers/utility/Random.cpp index e17a8928bb..5ed4426940 100644 --- a/src/xrpld/rpc/handlers/utility/Random.cpp +++ b/src/xrpld/rpc/handlers/utility/Random.cpp @@ -6,8 +6,6 @@ #include #include -#include - namespace xrpl { namespace RPC { diff --git a/src/xrpld/rpc/json_body.h b/src/xrpld/rpc/json_body.h index 2e9e774992..d70fafb2d4 100644 --- a/src/xrpld/rpc/json_body.h +++ b/src/xrpld/rpc/json_body.h @@ -69,7 +69,7 @@ struct json_body { } - static void + void init(boost::beast::error_code& ec) { ec.assign(0, ec.category()); diff --git a/src/xrpld/shamap/NodeFamily.cpp b/src/xrpld/shamap/NodeFamily.cpp index 2c47515498..3460c68608 100644 --- a/src/xrpld/shamap/NodeFamily.cpp +++ b/src/xrpld/shamap/NodeFamily.cpp @@ -1,22 +1,8 @@ -#include - -#include #include #include #include #include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include namespace xrpl { diff --git a/src/xrpld/shamap/NodeFamily.h b/src/xrpld/shamap/NodeFamily.h index 3985a8bdf8..ab555919ac 100644 --- a/src/xrpld/shamap/NodeFamily.h +++ b/src/xrpld/shamap/NodeFamily.h @@ -1,8 +1,5 @@ #pragma once -#include - -#include #include namespace xrpl {